Author Topic: Pathfinder problems  (Read 1761 times)

uncle

  • Guest
Pathfinder problems
« on: 11 March 2012, 22:30:37 »
OK, you all probably know about it, but I was told to write it here in case you swept this problem under the carpet.

The thing is, that the pathfinder sucks.

In every game I played (Starcraft, Age of Empires, Stronghold etc*) I have never had a problem with the pathfinder. Even on complicated maps. Why is it such a problem here?

For example, people complain about the pathfinder when they play my map The Hunters (link to it is in my signature). I know, maybe I should make it more pathfinder-friendly, but why? Why do we have here the pathfinder for? :)

*In a game, uuu was telling me something about grouping units in these games. So maybe you should consider implementing it in MG to make it work here too.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Pathfinder problems
« Reply #1 on: 11 March 2012, 22:47:31 »
Well... GAE has a far more accurate pathfinder, but it suffers from other issues...
I think we really need to crack down on building a whole new pathfinder. One that is accurate, and always gets where you told it to go. Oh.. AND DOESN'T LAG.

I have a hard time wondering how calculating 2d routes(that are inaccurate, and very dumb), brings my computer to low frame-rates:
CPU: Phenom II 6 Core 3GHz
GPU: Radeon HD 5870 1GB GDDR5
RAM: 8GB DDR3 1333Mhz
Egypt Remastered!

Proof: Owner of glest@mail.com

uuu

  • Guest
pathfinder cannot find the way
« Reply #2 on: 11 March 2012, 23:02:37 »
Hi.
Pathfinder has problem on certain maps, when there is no possible straight path to the destination. Units get stuck in a dead-end.
Example:

I discussed with Uncle different solutions in different games - one of them is to use formations for units, which concerns pathfinder, too.
Current pathfinder just wants to go the straight way, and if something gets in the way, it tries to go around, also changing directions after some time. It works good during battle, when units that blocked the way, are already moved someplace else. That is why it concerns formations - without formations, and with precise pathfinder, units would behave dumb during battle (e.g. cannot go through now, so unit goes all the way around the whole map...).
Maybe all we need for now, is to have precise pathfinder for map (it cannot change), but it "waits" for units that are blocking the way (no point in moving around behind the rock, is it?).

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Pathfinder problems
« Reply #3 on: 11 March 2012, 23:13:08 »
Well the pathfinder decides how to do things based on what the unit sees and doesn't wait for things. I agree wait for things.
Your picture is perfect.
Instead of operating based on what the user sees, operate based on the map. If it drew the quickest route on a map, it would be simple and fast. Also there need to be things like units not trying to move if they obviously can't. Units need to wait, until the preferred path is clear, if it is blocked by a moving unit, wait. If it is blacked by a static, or simply 'stopped' unit, recalculate path. If no solution is available, tell the blocking unit to move for a second and let the other unit by, then move back. This would help with the issue when you tell a group of units to move somewhere, they explode, all going in separate directions. Instead each unit would wait, then go right behind the other unit, and you would get the effect of a formation. So I disagree with needing formations, we just need a better pathfinder. :)
(don't have time to go over this post, I'm late)
Egypt Remastered!

Proof: Owner of glest@mail.com

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Pathfinder problems
« Reply #4 on: 12 March 2012, 05:29:30 »
Of course the same old discussions come up and the same old no-help results. Its easy to complain and point out problems, not so easy to help. IF anyone had time and experience to contribute, maybe we could actually do something about these problems.

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Re: Pathfinder problems
« Reply #5 on: 12 March 2012, 15:17:12 »
Personally i dont like this kind of comments. There are various ways to say thigs. Saying "the pathfinder sucks" imo it's just a slap in the face of programmers that work hard and for free to megaglest! An acceptable comment is "the pathfinder needs improvements or the pathfinder has problems how can we improve it?" imo saying "it's sucks" it's not acceptable, softcoder seems to be a very gentle person, if (but i suppose many of you too) would be a mg developer i would have answered "the pathfinder sucks? Change game", i know it may sound a little rude but i think saying comments like "the pathfinder sucks" is rude too. Softcoder i thank you again for the hard work you did and you continue to do on megaglest! (thanks to titi too eh! :) )
I translated Megaglest in italian and i keep the translation updated.

uncle

  • Guest
Re: Pathfinder problems
« Reply #6 on: 12 March 2012, 18:06:19 »
Pizza90: Right, I probably should not use such inappropriate words, sorry about that. :)
But the truth is, that it really needs to be fixed, because it is one of the most important things in the game which affects the user experience.

Users new to MG are probably not very happy about it. They are used to use a working pathfinder (which can be found especially in paid games).

TotalNoob

  • Guest
Re: Pathfinder problems
« Reply #7 on: 12 March 2012, 20:19:30 »
If anyone ever entered the topic of pathfinders, knows that there is no best solution in this matter, everything depends on situation. Just for example: http://gamedev.stackexchange.com/questions/5013/how-does-pathfinding-in-rts-games-work AND research about pathfinding is still in progress, new ideas come every year, designed for a specific situation.

To devs: Sorry that I don't lookup into the MG code and try to find that myself but is there an exact description of Regular pathfinder which is used now in MG? Or maybe on wiki? Did not find it so far.

I suppose creating own pathfinder can be fun. If anyone has some coding experience can try to look for best solution for MG by himself. I would like to do it myself, but I did not find time for that yet. Perhaps I should play MG less, and start to work on it more :)

If anyone would like to start work on pathfinder let me know. We can start together and motivate each other :) And think about the references in your CV if we succeed ^^ :D

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Re: Pathfinder problems
« Reply #8 on: 13 March 2012, 17:31:35 »
Uncle dont worry :) My words were for you in this case but are valid also for others people, i didnt want to be rude eh :) i just wanted to make understand that if everyone helps making a small thing megaglest will get better and better very fast :)
I translated Megaglest in italian and i keep the translation updated.