Hi,
I made a Love2d-lua porting of Field of Vision MRPAS
original code: http://umbrarumregnum.110mb.com/download/mrpas
it is not 100% finished (I must rewrite map as object and not n-arrays)
but it works
you can toggle walls with mouse click
you can move @ character with arrows
key 1 : calculate FOV after move (as rogulikes do)
key 2 : calculate FOV every update (for benchmark)
key 3 : decativate LOS (line of sight)
key 4 : activate LOS
key 5 : deactivate A*Star pathfinding
key 6 : activate A*Star pathfinding
key 7 : move enemies (G characters) on A*Star path
key c : 'old' a*star, good paths, but slow (I have not yet understood why)
key C: 'old' a*star with 'closerpath', less beatiful paths, but slow (I have not yet understood why)
key left cntrl + c : new A*Star, less beatiful paths but it's faster (default now)
A*Star now OK!
A*Star T-Engine Version
file updated (17 aug 2010, corrected profiler)
Porting of Field of Vision MRPAS + LoS + A*Star
Porting of Field of Vision MRPAS + LoS + A*Star
- Attachments
-
- mrpas.love
- (13.42 KiB) Downloaded 426 times
Last edited by bartoleo on Tue Aug 17, 2010 2:32 pm, edited 8 times in total.
Bartoleo
Re: Porting of Field of Vision MRPAS
Very interesting, it's like an inverse shadow function
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Porting of Field of Vision MRPAS
Isn't it exactly like a shadow function - if you see the player as the light source?ljdp wrote:Very interesting, it's like an inverse shadow function
I've actually been toying with the same thing, but not in a tiled world.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Porting of Field of Vision MRPAS
I'm very impressed with this. Thanks for sharing!
When I write def I mean function.
Re: Porting of Field of Vision MRPAS
I've updated .love
cleaner version
with map cells as objects and mrpas functions as separate module
coming soon Line of Sight function and A*Star Pathfinding
cleaner version
with map cells as objects and mrpas functions as separate module
coming soon Line of Sight function and A*Star Pathfinding
Bartoleo
Re: Porting of Field of Vision MRPAS
i've updated .love
added LOS = Line of Sight
activate with key 4 (deactivate with 3)
added A*Star (taken from http://github.com/philnelson/A-Star-Pathfinding-For-Lua
activate with key 6 (deactivate with 5)
added monster movement (character G) on A*Star path
I'm rewriting A*Star , the implementation I took is too "rectangular", anyway thanks philnelson
sorry for my english
added LOS = Line of Sight
activate with key 4 (deactivate with 3)
added A*Star (taken from http://github.com/philnelson/A-Star-Pathfinding-For-Lua
activate with key 6 (deactivate with 5)
added monster movement (character G) on A*Star path
I'm rewriting A*Star , the implementation I took is too "rectangular", anyway thanks philnelson
sorry for my english
Bartoleo
Re: Porting of Field of Vision MRPAS
Very nice, I like it!
The path found by A* seems a bit ... rectangular though.
The path found by A* seems a bit ... rectangular though.
Re: Porting of Field of Vision MRPAS
yes it's too rectangular...
i'm porting another a*star code
i'm porting another a*star code
Bartoleo
Re: Porting of Field of Vision MRPAS
ok, i'm using another A* pathfinding algorithm
i took it here
http://wiki.garrysmod.com/?title=A-Star ... ing_Module
by Deco Da Man
it's dynamic and customizable
i've updated .love
now I have the elements for my game
i took it here
http://wiki.garrysmod.com/?title=A-Star ... ing_Module
by Deco Da Man
it's dynamic and customizable
i've updated .love
now I have the elements for my game
Bartoleo
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Porting of Field of Vision MRPAS + LoS + A*Star
I like it very much.
One thing though: when A* is activated, my FPS drops dramatically ( from ~50 to ~3 ) when I "hide" behind the left wall.
One thing though: when A* is activated, my FPS drops dramatically ( from ~50 to ~3 ) when I "hide" behind the left wall.
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 4 guests