Hi,
I'm trying to build an RPG game with ORK where you can leave the game and come back a day or more later and the game will simulate the time that has passed and AI behaviors that happened while you were gone. When you log back into the game, I want it to load and simulate the time that has passed based on the amount of time since your last log in. Is there a way to do a turn/tick-based system for ORK so that I can simulate speeding through a bunch of ticks to simulate time passing rapidly? I don't know that I can use Unity's timeScale variable as it seems to only go up to 100x. I don't have any physics in the game simulation so if I can do it with ORK would be ideal. The tick rate can also be very low like 2 ticks per second where the game only checks characters' move or attack 2x per second as it's a slow paced asynchronous game design. I'm new to ORK and I know there's a turn-based battle system so I'm wondering if I can do something similar for everything in ORK where essentially the game update is real-time tick-based and I can fast forward through a bunch of ticks in a short loading screen.
I have a playback system so you can scrub back through a replay of the game states in the past, but I'm struggling with actually simulating a massive passage of time like a few days.
So, to fast forward this, you'd have to make the battle actions (via their battle events) faster. The easiest way is increasing the Unity time scale. An alternative would be using the Requirements of the battle animation setup (e.g. in an ability) to determine if a battle event is played or not. E.g. if you want to fast forward, you could set a bool game variable and use that as a requirement to play or not play certain battle events.
This way you could skip animating events and only do calculations/movement - it's very setup-heavy, though, as you'll often have to do battle events/animations for actions twice, once for the normal and once for the speed up versions.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
ORK itself updates things via the ORK handler component's update function, i.e. you can actually manually update all in ORK with a single call to:
ORK.Core.FireTick();
Or manually update a combatant or other things by calling their individual Tick functions. You can also update all combatants via:
ORK.Game.Combatants.Tick();
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The ORKHandler does 3 things:
- fire ORK's update routine (component's Update function calls ORKCore.Instance.FireTick())
- fire ORK's GUI update routine (component's OnGUI function calls ORKCore.Instance.FireGUITick())
- fire ORK's application quit when the app is closed (component's OnApplicationQuit function calls ORKCore.Instance.FireApplicationQuit())
ORK's FireTick is only called from the ORKHandler, so if you disable it, you have full control over it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!