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.
  • I may be able to just run the game loop for everything in a custom fixed update like this http://wiki.unity3d.com/index.php/CustomFixedUpdate
  • I'm a bit confused on how to edit the code for ORK would I have to use the API to change how updates work in AI scripts?
  • Maybe I could use ORK.Game to increase time speed and simulate it that way.
  • The turn based battle's progress is mainly relying on the actions that are used. I.e. there isn't really a tick going on increasing the turns, etc. - it's start turn > combatant selects action > use action > next combatant, ... (naturally, depending on the used setup there are differences here).

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • If I'm only doing realtime combat battles, is there a way to base the entire ORK framework off of my custom LogicUpdate method that can be called once per frame or as many times per frame as I like to fastforward things? I would just need to make it based off a custom Update method rather than the Unity default Update Method. I wouldn't be using physics for anything other than maybe collisions? And my own A* pathfinding for movement.
  • Theoretically.

    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();
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • How do I go about changing ORK from firing every update as it currently is, to firing only when ORK.Core.FireTick() is called?
  • You'd have to disable the ORKHandler component on the _ORK game object that's created when ORK is initialized. I'd not recommend that, though, as that'd also impact many other things.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Instead of disabling it, could I duplicate it and modify it somehow? Or just modify it and have to original backed up in git in case I need it.
  • There's no way to modify when ORK.Core.FireTick() is called with the API?
  • You can replace it with a custom component by just disabling it and adding your custom component to the _ORK game object (or any other game object, but make sure it's not destroyed on scene changes, i.e. DontDestroyOnLoad called for it).

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.