anti-stuck methods after c_move?

Posted By: Loopix

anti-stuck methods after c_move? - 03/25/08 10:09

Hello friends!

I'm looking for snippets and methods to un-stuck my chars when they 're caught in narrow canyons an the like. The code should check if move distance could be performed (when using c_move). If the move distance (over a certain time) was less than a certain amount of quants (while the move force remained...), there should be some kind of un-stuck function called.

Note: It should work with model-levels!

I'm sure some of you have experance in this issue I'd be happy about suggestions and help...thx!
Posted By: PHeMoX

Re: anti-stuck methods after c_move? - 03/25/08 13:03

What would you like the 'unstuck code' to do? Resetting the moving model to a different position will look weird I think, so instead you'd be looking for code that prevents getting stuck in the first place, right?

Perhaps you should try to add a certain amount of upward force when moving forward, while still tracing the ground distance and so on to keep the model on the ground. It's probably a bit of an ugly solution, but it seems to work for me,

Cheers
Posted By: PadMalcom

Re: anti-stuck methods after c_move? - 03/25/08 13:12

I think I know exactly what he means.

@Loopix: Did you use GLIDE as parameter in c_move? This could be an easy solution!

Otherwise you have to look for a pathfinding solution where you place nodes aroud the player that you can trace. The nodes leading to your target and being hit without a barrier form the right path to your final target
Posted By: Loopix

Re: anti-stuck methods after c_move? - 03/25/08 13:41

Thanks guys! I use glide and also c_rotate and c_move all the time, including object avoidance trough c_trace...still the chars can get cought in narrow corners. Thats why I'm looking for examples from people who have dealt with this issue...i'm just too stupid to find a well working general unstuck solution myself.
Again: The unstuck code should only be executed after some time elapsed with no movement distance but movement force applied....maybe the entity should c_rotate 180'...decrease it's gravity a little and increase its x_speed for a short a while before it targets it's given waypoint again....dunno
Posted By: PadMalcom

Re: anti-stuck methods after c_move? - 03/25/08 14:04

Do you want to display a message "You got stuck, game will place player in a free position"? This is no adequate solution I think.

When this happens rarely you could easily place invisible blocks in tricky corners so that the player can't even get there.

I will try to find a solution tonight and post it tomorrow if possible.

EDIT:
My try would be store the last 3 positions of the player and set it back until I can trace again in all directions.
Posted By: Nidhogg

Re: anti-stuck methods after c_move? - 03/25/08 15:59

Have you tried my.polygon = on...
If so what about the the c_minmax i think it is..
© 2024 lite-C Forums