New pathfinding

New pathfinding

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

New pathfinding

Post by imbaczek »

since people seem to have a love/hate relationship with it, read this:

http://github.com/spring/spring/commit/ ... c4bed2d551
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: New pathfinding

Post by JohannesH »

http://github.com/spring/spring/commit/ ... 1a19f05acb

Is this worth mentioning also? Cause even with just a single unit moving alone, it twitches stupidly instead of driving straight. With BA tanks that is at least.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: New pathfinding

Post by imbaczek »

this should not twitch; it only modifies the path slightly. maybe post a replay or a demo? also, to find out if it's the pathfinder, try /cheat and then the debug view (the B key).
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: New pathfinding

Post by smoth »

so this heat stuff makes units space out? sorry I am not sure what I am looking at.
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: New pathfinding

Post by JohannesH »

Heres a replay of a single flash failing to follow a direct line on perfectly flat ground, but making curves to the sides all the time.
Attachments
local_20090823_182714_Comet Catcher Redux_0.80.2.sdf
Flash cruising
(41.69 KiB) Downloaded 35 times
Hacked
Posts: 116
Joined: 15 Aug 2008, 18:06

Re: New pathfinding

Post by Hacked »

thats wierd
after a few runs, the flash goes straight down the line with no problems
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: New pathfinding

Post by imbaczek »

hum, i see. we'll see how easy it is to fix...
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: New pathfinding

Post by Dragon45 »

You've effectively implemented a form of message passing in your agent-based system. There's going to be some cool emergent behavior...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: New pathfinding

Post by imbaczek »

there already are other forms of message passing between agents in the engine, but the messages usually carry explosive payloads 8)
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: New pathfinding

Post by Dragon45 »

8) Well done. 8)
Hacked
Posts: 116
Joined: 15 Aug 2008, 18:06

Re: New pathfinding

Post by Hacked »

after playing a few games on comet catcher with mass flash spam
i realize that i dont frown as much at unit behavior as i did before the new pathfinding. the units seem more intelligent (not walking into each other)

sometimes, the straight line problem is a minor annoyance though when, for example, i ask them to plow through an enemy base and they decide to take a detour around it
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: New pathfinding

Post by Dragon45 »

How're cool-off times being handled ATM?
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: New pathfinding

Post by momfreeek »

The meandering is especially noticable with nota ships (they're long and thin and precise positioning of a single ship can have a big effect on a game). It can be quite handy for avoiding torpedoes :-), but sometimes they just head off in a random direction and get killed :(.

in a recent game:
<player1> Why are my ships wobbling about like retards?
<player2> currents
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: New pathfinding

Post by Licho »

Yes units seem to be drunk :)
I dont like it much..

It look sunnatural especially for big units that turn slowly
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New pathfinding

Post by Argh »

Shouldn't all of that be pretty easy to deal with, though?

I mean, let's look at use cases, and ways to solve the problems:

1. Huge Units that don't move very fast:

Code: Select all

heatMapping=1;
heatProduced=300; //pretty much block anything from trying to move in its path and bump into it
heatMod=0.0001; //Pretty much ignore other heat sources, bumping and clumping is rarely an issue.
2. Fast swarmers:

Code: Select all

heatMapping=0; //Easiest solution, just disable it and let them bump into one another like they always did.
Or:

Code: Select all

heatMapping=1;
heatProduced=5;//Produce little heat, to make them less wobbly in packs.
heatMod=0.15;//Avoid strong heat sources.
The emergent behavior created, in that case, should spread them out.

3. Typical medium-speed, medium-footprint Unit:

Code: Select all

heatMapping=1;
heatProduced=60;//Produce more heat than little guys.
heatMod=0.01;//Avoid very strong heat sources, try not bunch up so much, but otherwise ignore a lot of heat.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: New pathfinding

Post by momfreeek »

a nota ship doesn't move in a straight line even if its on its own in the middle of an ocean.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: New pathfinding

Post by Argh »

Really? Are we talking about after imbazcek's fix for self-heat? Or just stock 0.8.2?

More to the point, NOTA probably needs to change the Unit parameters to use the system more effectively.

I haven't tested with NOTA, so I'm curious. I really haven't seen much in the way of bad behavior over here.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: New pathfinding

Post by momfreeek »

I was speccing, someone complained that their ship wouldn't move in a straight line.. and yes it was meandering all over the place.. no other units anywhere near it. I've experienced it too and had a ship wander off quite a way, 30 degrees from its destination. I didn't know why it was happening till I read this thread.

The fact that nota ships are long and thin makes direction changes all the more noticeable and turning off course can really screw up their movement. Also facing can be critical, the ship needs to be perpendicular to the target to fire a full broadside and armour is weaker on the sides and rear.

I pointed nota devs at this thread.. all I can tell you is what I saw.
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: New pathfinding

Post by JohannesH »

Argh wrote:Really? Are we talking about after imbazcek's fix for self-heat?
Most apparently no.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: New pathfinding

Post by SpliFF »

I haven't checked the code carefully but at a guess it may be taking the contours of the seabed into consideration for ships.

Another possibility is the heatmap travels along the entire estimated path to the goal so even if a unit is traveling alone it will be affected by any paths that will cross its own, even if the paths are perpendicular (crossroads).

Final possibility, the heatmaps do not decay quickly enough, causing a unit to avoid paths that have already been passed by another unit (don't walk on my footprints). This could even happen if a unit changes it's own path but attempts to avoid its previous one.

A very useful thing here would be a visual heatmap overlay for debugging.
Post Reply

Return to “Game Development”