Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Wall detection (https://forums.graalonline.com/forums/showthread.php?t=86290)

DustyPorViva 06-11-2009 09:21 PM

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.

Gambet 06-12-2009 12:33 AM

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.

fowlplay4 06-12-2009 12:56 AM

Just check for walls where the players actually heading, no sense checking for walls behind yourself when you're walking forward.

DustyPorViva 06-12-2009 12:58 AM

Quote:

Originally Posted by fowlplay4 (Post 1498755)
Just check for walls where the players actually heading, no sense checking for walls behind yourself when you're walking forward.

Possibly... though in reality I make use of three sides -- the direction the player is heading, and the sides. One extra unchecked side isn't really going to hurt anything when it saves a bunch of math and checks.

fowlplay4 06-12-2009 01:07 AM

I'm not quite sure why you need to check the sides as well though either.

DustyPorViva 06-12-2009 01:24 AM

Quote:

Originally Posted by fowlplay4 (Post 1498761)
I'm not quite sure why you need to check the sides as well though either.

When the player is sliding around a tile I have to check and make sure they're not sliding over a wall.

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.

Chompy 06-27-2009 12:57 AM

You would actually only need to check max 2 sides at once :)

Robin 06-27-2009 03:18 AM

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

DustyPorViva 06-27-2009 05:19 AM

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.