huh?Originally Posted by bigsofty
huh?Originally Posted by bigsofty
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Currently...
Should be...Code:SX PXPPPPE PX
X= WALLCode:SX PX PPE PXP P
S=START
E=END
P=PATH
The path should go around the lower X, instead is squeezes between the lower and middle X.
there's a boolean parameter switch to turn this behavor on and off in code, tell the pathfinder not to use diagonals if that's bothering you, if it is something else, then you can specify the pathfinder it can't go there in the callback procedure.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Ah, cool, nice workOriginally Posted by Delfi
hey, i know this is not really meant to be here, because you guys r doin som great work thinkin (!).
I jst wanted to ask how you guys make the download link thing. If it's a PGD thing, then how do you upload? If it's from a blog that lets u upload, what blog is it?
Cheers
[quote="IlovePascal"]I jst wanted to ask how you guys make the download ]
you need a server to host the file.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Damn! Isn't there another way :cry:
Hey folks,
right now I found some times to test my pathfinding based on this sample and source.
I just realized it is not doing what it should do.
I have my own blocktester:
Level=0 means there is nothing, 255 means it is a road, 51..55 is grass.Code:function TForm1.blocktester(X, Y, Fx, Fy: integer): integer; begin result:= -1; // if it isnt anything else - it is wall if (level[x,y]=255) then result:=round(((ABS(FX-X) + ABS(FY - Y)) * 3)) else if (level[x,y]=0) or (level[x,y] in [51..55]) then result:= ((ABS(FX-X) + ABS(FY - Y)) * 3)*32; end;
For my villagers I call it like this:
I tried to debug it and realized each time I get an patherror!Code:StartPoint := Point(round(x),round(z)); EndPoint := Point(round(ntargetx),round(ntargetz)); setlength(Astack, 0); patherror:=false; Astar.findpath(StartPoint, EndPoint, point(levelb-1,levelh-1),true, true, @blocktester); setlength(waypath,0); setlength(path,0); setlength(WayPath,length(path)); nway:=0; if not patherror then begin boolstand:=false; for i:=0 to length(path)-1 do waypath[i]:=path[i]; end else form1.exceptionmsg('Kein Path gefunden');
Levelb is the width and Levelh the height of my level (256x256).
It starts to step and no idea what causes the patherror, any idea?
PS: Merry XMas.
Thanks,
Firle *depressedonxmas*
Sorry, but without more info i can't really help you anything unless you tell us where the code ends up in an error.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Bookmarks