Move range searching
Move range searching
I am thinking how to search the range a character can move now. I made a sample program, so I expose.
Look at pictures. "S" is a start point, brown squares are walls and cyan ones are floors, and each number signifies move power left for shift -- the search process stops when the move power is exhausted. Green ones are the woods, and two move powers are used there. Pink is a route.
Those pictures were drawn by Irrlicht.
Binary
http://www.mediafire.com/download.php?jxyzjtyttkh
Look at pictures. "S" is a start point, brown squares are walls and cyan ones are floors, and each number signifies move power left for shift -- the search process stops when the move power is exhausted. Green ones are the woods, and two move powers are used there. Pink is a route.
Those pictures were drawn by Irrlicht.
Binary
http://www.mediafire.com/download.php?jxyzjtyttkh
Last edited by Vandal on Tue Feb 16, 2010 10:19 am, edited 2 times in total.
i'm not a tech guy here but normally if let say I am S and I'm going after F, wouldn't I go straight to him rather than walking along the sideway? Since there isn't any obstacle in the middle. just my 2 cents though.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Same distance, but like you say; i think most games will try to zig-zag.Virion wrote:i'm not a tech guy here but normally if let say I am S and I'm going after F, wouldn't I go straight to him rather than walking along the sideway? Since there isn't any obstacle in the middle. just my 2 cents though.
This could be done by keeping a record of last move direction, then if you have an equal cost of moving in 2 directions try not to move in the same one as the last time.
no, if you look at this picture:Virion wrote:i'm not a tech guy here but normally if let say I am S and I'm going after F, wouldn't I go straight to him rather than walking along the sideway? Since there isn't any obstacle in the middle. just my 2 cents though.
you'll see that each square has a moving range value...
and if you count the values you'll see the (long) path has a lesser value than the streight path...
(at least this how I understand this )
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
..., that's what I meant with "moving range value" !!!Ulf wrote:Each node has it's own weight.
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Virion, your point that it seems more natural that a character trads zigazag is correct, but zigzag will increase useless actions --waste time for turn-- in the project I am imaging. I let a man walk as straight as possible.
The first, second, and third pictures are not A*. They are calculated only by a move value each square has without A*. All a* programs have window-titles "A*".
The first, second, and third pictures are not A*. They are calculated only by a move value each square has without A*. All a* programs have window-titles "A*".
This is a sample that I extended my A* program to 3D. It is so easy to apply a complete program on Irrlicht to 3D.
Demo
http://www.mediafire.com/download.php?mzzojwgkuo2
[/url]
Demo
http://www.mediafire.com/download.php?mzzojwgkuo2
[/url]
Last edited by Vandal on Fri Feb 19, 2010 10:13 pm, edited 1 time in total.
looks good! hope to see a 3d model running on the path soon!Vandal wrote:This is a sample that I extended my A* program to 3D. It is so easy to apply a complete program on Irrlicht to 3D.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info