Hi all, mostly I need some inspiration.
I have a packman game about 90% done.
The biggest issue is emulating PacMan’s movement.
For now, movement works with collision detection via box trace:
The pawn has a collision set to barely fit between labyrinth walls, it can thus move along the pathway, but never move towards a wall (except for intersections).
on tick, I’m running 4 box traces. One in each cardinal direction.
Those are used to determine if a change of direction is possible.
Player input simply changes the desired direction of travel when possible.
This emulates the behavior rather well, but falls into some LOC driven pitfalls.
Basically whenever the pawn is traveling the direction change/box trace detection of a corridor can fail due to the position the pawn has. X505.431, y800 for instance.
To eliminate that I tried moving in %5 increments which works better, but still occasionally fails, and also prevents speeds greater than the value of the modulus.
So, Here’s the question:
is there a way to get the trace to happen at different frequency? Something like substep for physics or similar?
I tried changing tick group, but that hasn’t really changed anything.
Is there any other way to achieve the “buffer” effect of a turn happening only when possible except for traces?
I’m using a box trace for commodity really. The corridors don’t have a path or anything that I could align with if I used a linentrace, and they rely on the size of the box trace to allow for the turn to happen at the perfect moment when the pawn is aligned perfectly with the corridor.
again, 90% this works fine. 10% or so you get stuck or can’t make a turn.
you’ll know how important making that turn is when Blinky is behind ya…