![]() |
Wall detection
I've been screwing around with a new method of wall-detection lately... and I've stumped myself. What I'm doing is checking the walls surrounding all directions of the player, to make all the data easily-accessible. This saves me from having to do extra, conditional steps later.
Problem is... http://i39.tinypic.com/2epnk01.png Yellow blocks are where I'm doing 1x1 onwall2 checks. The two tile layouts are very different, but as far as my script can tell they are identical. I definitely don't want the player to be able to slide through the first layout, but it cripples basic walking functionality when the player can't slide through the second. Any suggestions? I'm trying to keep this method as simple as possible, and want to avoid making huge changes to the basic idea. |
You could look into implementing some of the A* wall-detection methods (where it assigns a high cost value to objects and terrain that are unpassable), but that wouldn't exactly fall under keeping it simple.
|
Just check for walls where the players actually heading, no sense checking for walls behind yourself when you're walking forward.
|
Quote:
|
I'm not quite sure why you need to check the sides as well though either.
|
Quote:
Regardless, that wasn't really the point of this topic, however it doesn't matter. I've got another idea I'm gonna work with. |
You would actually only need to check max 2 sides at once :)
|
I forget what onwall2 does, but i'm guessing your script is only checking for walls here, based on your description of the behaviour of your results:
http://i40.tinypic.com/jgtcmc.jpg |
onwall2 is checking for walls in the area given, so it's actually checking for a wall in all of the yellow areas. Doesn't matter now though... I've got bigger problems: http://forums.graalonline.com/forums...ad.php?t=86498 :P
|
| All times are GMT +2. The time now is 07:26 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.