Taming the box
One big issue when playing with time in a game is physics, especially with a non-deterministic engine like the current default in Unity.
A 'simple' solution to playback would be to record the rigid body position and rotation data for all objects and just play them back. We can't do that in this game as the actions of each characters loop is allowed to change the environment from that experience by characters in earlier loops.
Take the video above as an example - in the first loop the player controls the Barbarian and moves the box to the right.
In the second loop the player controls the Rogue and stands them in the way - now the Barbarians actions, when played back, don't cause the box to move all the way, this is because we playback the Barbarians 'input' not their positions.
For the third loop the player waits with the wizard and moves the box again with both of the other characters out of the way 4 seconds later.
Just playing back input however was resulting in cases where the same actions playing out - with not change in the environment - would not always result in the same outcome, which breaks the expectations of the player.
For now our solution is to simplify the interactions with the box - moveables now live in their own Unity layer and a much simpler collider 'guide' geometry lives in another. The box then only interacts with the player, other boxes and the guides - ignoring all other level geometry.
I've also made the angular drag so high the box basically won't rotate anymore. The current setup is far more stable than the old setup.
There are still glitches to be worked out - observe the wizard at the end of his loop fly off the map!
To fix that I think I need to switch from a simple character controller to something like the wonderful KCC instead - that's a job for another day though.
For now - please try breaking level 2 and letting me know in the comments.
#gamedev, #indiedev, #madewithunity
Files
Get Loop Dungeon
Loop Dungeon
Control 4 characters through a 15 second time loop to collaboratively solve puzzles and explore the dungeon.
Status | In development |
Author | so-op games |
Genre | Puzzle, Action, Adventure, Role Playing |
Tags | Action RPG, Puzzle-Platformer, Singleplayer, Top-Down, Top Down Adventure |
Accessibility | Textless |
More posts
- Giving the UI some care and attention.Sep 19, 2021
- Chart ToppersSep 18, 2021
- QoL improvement - hero selectorSep 12, 2021
- Cables and PulleysSep 09, 2021
- Blocking out "The Sewer"Aug 18, 2021
- Animations, Sparkles, Pops and GruntsAug 17, 2021
- New level added "The Wall"Aug 12, 2021
- Loot the LoopAug 09, 2021
- Loop playback finally solid.Aug 04, 2021
Leave a comment
Log in with itch.io to leave a comment.