Author Topic: pathfinding  (Read 2067 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
pathfinding
« on: 16 September 2011, 09:21:52 »
better pathfinding algorythmns:

initial link from willvarfar:
http://harablog.wordpress.com/2011/08/26/fast-pathfinding-via-symmetry-breaking/

http://grastien.net/ban/articles/hg-aaai11.pdf

Please post/add good articles/links here regarding this!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: pathfinding
« Reply #1 on: 26 September 2011, 06:47:19 »
I'm taking a quick look to see if i can get JPS added onto the pathfinding.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: pathfinding
« Reply #2 on: 26 September 2011, 08:32:19 »
"quick look"  ;D
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Mr War

  • Guest
Re: pathfinding
« Reply #3 on: 26 September 2011, 09:16:59 »
I encourage any enhancements to pathfinding, from an optimisation perspective. Like other's feedback, when I do experience latency and low FPS it's now more linked to pathfinding than, say, bad models. the slowdowns occur when many units are moving to same place at same time.

Maybe a 'dumb' optimization to try is to vary the destination on AI mass attacks so that they are more likely to take different routes?  I don't know the code so just guessing. Like offset the target destination by 10 cells with slight rules like no tile set objects or something.

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: pathfinding
« Reply #4 on: 10 November 2011, 20:08:41 »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: pathfinding
« Reply #5 on: 11 November 2011, 00:23:45 »
oh man, too sad, this ***** has written his own license ...
I think like this we are not allowed/willing to use it :(

Willvarfar can you contact him and ask him for permission? I think you need a github account to contact him right?
« Last Edit: 11 November 2011, 00:30:31 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: pathfinding
« Reply #6 on: 11 November 2011, 01:01:21 »
Its README contains a simplified (a.k.a. 2-clause, a.k.a. Free-) BSD license which is GPL compatible. If we could have a GPL licensed copy of the code it would be better. I guess the author would not loose anything by dual licensing it.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: pathfinding
« Reply #7 on: 11 November 2011, 01:14:07 »
oh thats very good!
Sorry that i missed it, so I was the ****  :P
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: pathfinding
« Reply #8 on: 11 November 2011, 06:33:13 »
I will create github issues so we can all see what I've asked for :)

I played with it for http://aichallenge.org.  Even I understood the API.  That's why I'd like 4-way movement and wrapping issues - not directly for glest.  I've gone made my own astar-jps just for my contest anyway now, so not much to lose.

JPS is so enticing, and I could imagine retro-fitting to our existing pathfinder might be more profitable.  We have a lot of features, some of which I've captured in the github issues; we are also interested in solutions to coordinated movement http://www.gamasutra.com/view/feature/3313/coordinated_unit_movement.php
« Last Edit: 11 November 2011, 06:43:25 by will »

Ari Rahikkala

  • Guest
Re: pathfinding
« Reply #9 on: 11 November 2011, 08:56:01 »
JPS is so enticing, and I could imagine retro-fitting to our existing pathfinder might be more profitable.

I had a look at your svn and saw you wasted no time in getting to this :). I'll look at the issues and respond on github in more depth later, but for now: Different map topologies (i.e. map wrap) should be reasonably straightforward to implement in themselves though the API will get a bit more complicated. Four-way connectivity might be easy to do, or it might be impossible, since I'm not sure if the JPS optimisation is specific to 8-way-connected maps. Will have to work through that one on paper (and through testing it in code, I suppose). If it doesn't work on 4-way-connected maps, there's always unoptimised A* or this other method (though, being offline, it'd complicate the API a bit further).

As for units bigger than one tile - with units of, say, 3x1 tiles, do you mean ones that will always have the exact 3x1 shape, or ones that can turn? Because the latter is somewhat considered gnarly. If multi-tile units are small and have constant shapes, though, I think it should only be a matter of either testing each tile in the unit's shape for clearance when adding neighbouring nodes to the open list, or simply constructing a clearance map for that unit offline first.

Mr War

  • Guest
Re: pathfinding
« Reply #10 on: 11 November 2011, 18:12:32 »
Hi ari, I don't think I know you but from what you've just said I'm very pleased to have you joining glest community.

Re multicell units, currently in MG all unis are square, eg. 2x2, 3x3

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: pathfinding
« Reply #11 on: 23 November 2011, 11:09:10 »
yes, I think you only have to care about sqare units
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: pathfinding
« Reply #12 on: 23 November 2011, 22:17:29 »
Hi ari, I don't think I know you but from what you've just said I'm very pleased to have you joining glest community.

Re multicell units, currently in MG all unis are square, eg. 2x2, 3x3
Hmm, I somehow missed this one, but it's not true. While the defined size itself (which will influence the selection circle as well) is always a perfect square, cell maps can define a unit as being, well, not-square. For example, the cellmap:
Code: [Select]
01
01
01
Would effectively be a 3x1 unit. Units can walk through the one side, and it should be able to walk through a 1 cell "hole" as well. Last time I checked, though (a long, long time ago - but I see no reason why it would have changed), units with cellmaps were unable to move if there was a unit already standing in the cellmap area, though they could move past existing units that weren't in their cellmap when the command was issued. Of course, no mods use moving units with cellmaps, I don't think...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: pathfinding
« Reply #13 on: 24 November 2011, 00:48:34 »
Would effectively be a 3x1 unit. Units can walk through the one side, and it should be able to walk through a 1 cell "hole" as well. Last time I checked, though (a long, long time ago - but I see no reason why it would have changed), units with cellmaps were unable to move if there was a unit already standing in the cellmap area, though they could move past existing units that weren't in their cellmap when the command was issued. Of course, no mods use moving units with cellmaps, I don't think...

I tought about fixing cellmap stuff some time ago. The big problem of units with cellmaps is that gelst only uses its square grid and so you can't rotate units with cell map properly.



Unit
Code: [Select]
010
010
010



can not pass something like that (even when it would fit with correct rotation)

Code: [Select]
00111
00011
10001
11000





Green and Red icons are from WikiMedia Commons Released under CC-BY-SA.
For credits see:

Red icon: http://commons.wikimedia.org/wiki/File:Rotes_Quadrat.svg
Green icon http://commons.wikimedia.org/wiki/File:Gruenes_Quadrat.svg

Edit by Omega: Removed spoiler tag as it caused code boxes to crunch into less than one line tall.
« Last Edit: 25 November 2011, 04:01:27 by Omega »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: pathfinding
« Reply #14 on: 24 November 2011, 12:20:42 »
of course its not true, but as you said no mods use it and the engine itself already behaves wrong if you use moving units with cellmaps. So I say, there is really no need to handle this very complicated fact in a pathfinder!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios