Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Units don't make way for other units #3346

Open
wzdev-ci opened this issue Mar 19, 2012 · 18 comments
Open

Units don't make way for other units #3346

wzdev-ci opened this issue Mar 19, 2012 · 18 comments

Comments

@wzdev-ci
Copy link
Contributor

keyword_pathfinding type_bug | by JDW


  1. Select say 15 trucks and give them a destination. They will reach it and bunch up into a blob.
  2. Now select one unit which is right in the center of the blob.
  3. Give it a destination outside the blob.
  4. The truck keeps spinning around trying to get out as the other trucks do not make any way for it to get out.

Issue migrated from trac:3346 at 2022-04-16 09:39:52 -0700

@wzdev-ci
Copy link
Contributor Author

scorgi uploaded file two_savegames.zip (214.8 KiB)

I faced the same problem, here are two saved situations.

@wzdev-ci
Copy link
Contributor Author

scorgi uploaded file wz2100-20120320_082325-CAM_1C.jpg (204.1 KiB)

Screenshot of a truck (no1), dancing but unfortunately not finding way to work destination.
wz2100-20120320_082325-CAM_1C.jpg

@wzdev-ci
Copy link
Contributor Author

scorgi uploaded file wz2100-20120320_082450-Sk-Pyramidal-T1.jpg (258.8 KiB)

Screenshot of how a unit (no. 2) is blocking a cyborg builder from his destinations.
wz2100-20120320_082450-Sk-Pyramidal-T1.jpg

@wzdev-ci
Copy link
Contributor Author

Terminator commented


I think when setting destanation for group, every unit should be a little futher or else where close to origin dest. point.

@wzdev-ci
Copy link
Contributor Author

camellia0x++ commented


Another issue (related) is that the units must be in an "exact" spot for them to be happy and switch to guard mode.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 4, 2012

Giani commented


Replying to Warzone2100/old-trac-import#3346 (comment:1):

I think when setting destanation for group, every unit should be a little futher or else where close to origin dest. point.

The bug was fixed in beta5 and beta6, but it needs to be fixed again.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented May 3, 2012

Giani commented


AND needs to be fixed in Beta 8 :(

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented May 9, 2012

am.test.mail.noreply@... commented


I have the same problem. Just played campaign in v2.3 and all went well. Now I started campaign in v3.1b9 and see that units are completely stupid! Sometimes even two units on flat land cannot move in their directions after they meet each other - they just keep rotating by 90 deg and nothing. Same situation in groups and at any building or terrain corner. In 2.3 all was ok. And now fun is starting when some units are moving forward and some going back the same way for repair...

@wzdev-ci
Copy link
Contributor Author

Lord Apocalypse commented


still there for beta 10 though haven't run into it as much as I did while on cam 1 (cam 1 with beta 9, cam 2 with beta 10)

@wzdev-ci
Copy link
Contributor Author

Giani commented


It does't happen only on campaing, it happens in MP and skirmish too.

@wzdev-ci
Copy link
Contributor Author

Cyp changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

am.test.mail.noreply@... commented


Well I fixed it a little, but I guess that is very stupid fix...
In beta9, move.cpp, moveGetObstacleVector function, I added some strings:

/* Original code */
 // scan the neighbours for obstacles
 	gridStartIterate(psDroid->pos.x, psDroid->pos.y, AVOID_DIST);
 	for (BASE_OBJECT *psObj # gridIterate(); psObj != NULL; psObj gridIterate())
 	{
 		if (psObj == psDroid)
 		{ continue;  // Don't try to avoid ourselves. }
 		DROID *psObstacle = castDroid(psObj);
 		if (psObstacle == NULL)
 		{ // Object wrong type to worry about.
 			continue; }
/* Inserted this: */
+		if(psObstacle->sMove.Status == MOVEINACTIVE ||
+			psObstacle->sMove.Status == MOVETURN)
+		{ continue; }
/* End of insert*/

Yeah, this may be completely stupid, BUT: 1) This works for me, units at least moving, not just stand and dance. 2) I can't understand the super smart and complex (but non-working) logic of that function. So, maybe this will help someone until better fix arrives.

@wzdev-ci
Copy link
Contributor Author

Trifler commented


This bug is rearing its ugly head in 3.1.0. If my units are stopped, they will not move out of the way for my Commander. Likewise my Repairers often get stuck in the middle of a blob and cannot get to vehicles that are out of range. I can hear the Repairer's engine going full bore trying to push the vehicle next to it out of the way, to no avail. Retreating vehicles often die due to this problem as well.

@wzdev-ci
Copy link
Contributor Author

Pangaea commented


This is still a problem in 3.1.1.

Looks like units are going arrow-straight to a target (trucks to build/repair something for example) and if there is something in the way, well, then they keep 'dancing'. Units retreating for repairs is an issue too, and one group of units crossing paths with another. At one point in the Alpha mission where you are to intercept the commander with an artefact, I had one mortar/bombard trying to get north, and a tank trying to get south from the channel in the east (on the way to the scavenger base in the very NE), and they kept bumping into each other ever so long. When this happens with trucks I tend to try to micromanage them when I notice these issues, like putting in waypoints around the cluster of units/structures.

Pathfinding is a big beast to tackle, but I wish it was possible to find a better solution in this otherwise excellent game.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jun 5, 2014

raf2486 changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jun 5, 2014

raf2486 commented


I have the same issue. What broke the pathfinding to begin with?

@wzdev-ci
Copy link
Contributor Author

shoeib commented


The problem is still there in 3.1.5 :(

@wzdev-ci
Copy link
Contributor Author

klasskill commented


it is still in master and 3.2 as well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant