Player getting stuck in corners?

Blitz3D Forums/Blitz3D Programming/Player getting stuck in corners?

Cubed Inc.(Posted 2012) [#1]
The player in my game keeps on getting stuck in corners when he jumps into them. If you are moving, he gets stuck in the corner, and when you stop he very awkwardly slide back down to land.

Does anyone have any suggestions on what I should do about this situation? I'm honestly stumped:\


Kryzon(Posted 2012) [#2]
Few suggestions:

• Post thorough screenshots so we can have a better look at your environment's structure.

• Increase the player's collision radius\box-size.

• Utilize invisible, low-polygon, "white-box" like geometry to serve as a collision layer. This is very used in games so the level designer can precisely control where the player is able to go.
Have you ever noticed invisible walls at specific parts of levels etc.? this is it.
In your case, you could have collision geometry in the form of angled planes at the corner of walls (kinda like chamfering the corners), so the character slides along the corner instead of getting stuck at it.
What I mean by invisible is that in order for this auxiliary geometry to be considered for collisions you can't use HideEntity - you need to make them transparent with EntityAlpha.
Read more here (post #1): http://blitzbasic.com/Community/posts.php?topic=88742#1083861

EDIT: Giving your post a second read... if this only happens when you're 'jumping' into corners or other structures then it's most likely you have faulty gravity\physics logic. Make sure the code's working as it should.

Last edited 2012


Zethrax(Posted 2012) [#3]
Does your game have inertia in it? If so then you need to cancel the player's built up inertia/energy when a wall collision occurs.

You've really provided no useful information about how you're handling character movement though, so it's virtually impossible for anyone to give you any useful advice until you do provide that info. If you want people to take the time to help you then you need to take the time to provide detailed info about the problem you're having.


Cubed Inc.(Posted 2012) [#4]
Kryzon
I tried out your third suggestion and it worked perfectly!
I applied an "invisible box" with a slightly curved top to the geometry, gave it a completely translucent texture and it did the trick.

Here's a screenshot of my game btw. I think it'll give you a better grasp on what kind of game it is.

http://imageshack.us/photo/my-images/9/blitzcc2012071301074776.png/


Kryzon(Posted 2012) [#5]
Wow, you got some cool atmosphere going on in there. Kinda like an afternoon sun.
Reminds me of N64 titles.

I'm glad it's working, but make sure that this auxiliary collision geometry is as optimized as possible (i.e: no presence of triangles that don't influence anything - or triangles that the player can never touch), as the more redundant triangles you remove from this the faster it'll be to process collisions.


Yasha(Posted 2012) [#6]
'Nother tip for improving collision performance: only use polygon collisions when you actually need them. For walking about on a flat surface, box collisions will be more efficient than a flat mesh, because a box is mathematically very simple and uses a different collision function. Depending on your level layout, you might want to consider using some combination of techniques for best optimisation. (Do experiment rather than taking my word for it, of course.)