SakeTami
TRY FOR FREE
relativisticgame
relativisticgame

patreon


Week 56: collision avoidance: itโ€™s done!

his week I finished the relativistic implementation of the new collision avoidance algorithm. The new code is much better than the old one. Well, this is what I expected after working on the classical proof of concept a couple of weeks back. Here is the commit message:

Author: Matteo Franchin <matteo.franchin@relativisticgame.net>
AuthorDate: Mon Nov 20 18:34:06 2023 +0000
Commit: Matteo Franchin <matteo.franchin@relativisticgame.net>
CommitDate: Wed Nov 22 09:51:56 2023 +0000

engine: new collision avoidance algorithm
    
Implement a more refined version of the collision avoidance algorithm.
The new algorithm has the following advantages over the older one:
    
- objects are not bouncing back when hitting walls. Objects should now
   accurately slow down close to walls.
- they can now go faster, especially closer to walls. Objects can
   move fast and parallel to walls.
- a maximum velocity can be set for objects, independently on whether
   they are colliding with walls
- the algorithm is much better at preventing objects from traversing
   walls. It takes care of time-discretisation to achieve that.
- friction is introduced to spare the player from continuously braking
   and correcting the direction of travel.

I attach a video that tries to show some of these claims (note how the robot goes fast parallel to walls, without bouncing), although a video isnโ€™t the best way of assessing these sorts of changes. An intermediate game demo (say 1.1) would work better. Ideally, itโ€™d be nice to allow people to try different parameters. For example, I can make the robot go faster, but then navigation becomes less smooth inside narrow corridors. It is a bit of a trade-off. In the end, the parameters should be set in a way that improve user-experience. Here is where feedback could help. The problem is that my resources are limited. I have to carefully decide where to invest my time.

On that note, while thinking about levels for the game I came out with a super cool paradox on time-dilation. I really want to make a YouTube video out of it, but - at the same time - I donโ€™t want to delay demo 2.0 too much.

Also, this week I finally could go back to working on game mechanics. I am introducing new types of keys and keyholes. I hope to make significant progress in the next weeks and design room 2 and room 3. I also plan to work on save/load functionality (as it could be handy for development.) After that, the next thing in my TO-DO list is working on sound-effects.

Conclusion: implementing the collision avoidance algorithm took much longer than I expected. Not great. There is a positive side to it, though. The new algorithm solves one problem that I noticed previously and would have taken time to fix. The door was dragging the player when moving. I expected the new algorithm to behave better, but I wasnโ€™t sure that the problem would completely go away. It seems that is the case. Hooray!



More Creators