Porting of Field of Vision MRPAS + LoS + A*Star

Showcase your libraries, tools and other projects that help your fellow love users.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by osuf oboys »

Yes, I also noticed this. Also, walking into any obstacle will consume several seconds of processing as A* covers the entire map. I'm sorry but the map is not that huge, it should work fine with a good implementation of A*. Your new one is much better than the old one but I think you can improve it a lot more. The new one is definitely nicer in terms of programming style but it pays for it in performance. Something specialized might be necessary for you. One simple trick I would suggest though, is to botch the heuristics by multiplying it with a small constant above 1. This will help break ties for diagonal movement and leads to significant speed-up in some situations (although not walking behind those walls).

There's also a number of hierarchical and dynamic variants of pathfinding algorithms that makes ample use of the particular structure of PF in games. Frankly, if the monsters always walk from their location to the player, you could do a single efficient BFS from the player and send the monsters according to that. It will beat separate A*'s when you got a bunch of monsters in a maze-y structure.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by Lap »

osuf,

I sure don't see you talk much, but I'm glad when you do.
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartoleo »

is to botch the heuristics by multiplying it with a small constant above 1. This will help break ties for diagonal movement and leads to significant speed-up in some situations (although not walking behind those walls).
I dont' understand why?
I look into astar code... the algorithm I took is very 'abstract' and very nice.
I think is possible optimize it
This is a 'technical demo' ... in a real game I think that A*Pathfinding should not used every frame...

thank you for info & replies
Bartoleo
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartoleo »

I need a 'favor'
If you have a Mac
can you make a .app of my project (mrpas.love)?
I need to test it on a Mac

The steps are described here:
Making an executable file out of a .love-file
http://love2d.org/wiki/Game_Distribution

thank you in advance
Bartoleo
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by thelinx »

You don't need a Mac to create an app file. Download the UB zip from the LÖVE front page and you can do it yourself. Follow the instructions you yourself linked to :P
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartoleo »

ok
I was unsure that it could work
I'll try
Bartoleo
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartoleo »

changed A*Star algorithm
taken T-Engine4 one
from
http://te4.org/
thanks to :
Nicolas Casalini "DarkGod"
darkgod@te4.org

now it uses it as A*Star standard pathfinding
new keys:
c : 'old' a*star, good paths, but slow (I have not yet understood why)
C: 'old' a*star with 'closerpath', less beatiful paths, but slow (I have not yet understood why)
left cntrl + c : new A*Star, less beatiful paths but it's faster
Bartoleo
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by thelinx »

I get this error with the latest version:
Image
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartoleo »

sorry...
try now (file updated)
I was playing with profiler (it needed profiler.dll)

^^
Bartoleo
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Porting of Field of Vision MRPAS + LoS + A*Star

Post by bartbes »

thelinx wrote:I get this error with the latest version:
[screenshot]
You know there is a text error dumped in the terminal right?
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests