Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pathfinding in platform game in C++

I want to find path in 2d platform game, teeworlds. The player there can move left/right, jump, and use hook, that lets you move upward the wall or move under ceiling. Well, its hard becouse normal pathfinds like a* or bfs cant exist here, cuz you cant just move up. I need to find path btw 2 players so 1 can go to the second one. There are 3 types of tiles, collide, nohook (you cant hook it) and nothing (air). I have the map in format int map[w][h] where 0=air, 1=collide, 2=nohook. map isnt modified for whole game time.

I have completly no idea how to do that. If you can help me, I'd be pleased.

PS. The question is general about platform games, teeworlds is only one of them...

like image 646
noisy cat Avatar asked Mar 18 '26 21:03

noisy cat


1 Answers

From the pathfinding algorithm's standpoint you could treat the climbable walls as if they were normal walkways, so the algorithm does not stop there.

like image 92
Attila Avatar answered Mar 21 '26 09:03

Attila



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!