A hover unit abducted, a bridge, and a crash

Bug #912894 reported by mevitar on 2012-01-06
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Medium
AlexB

Bug Description

So, there we 3 enemy hover units coming to my base, over a bridge. I had a jumpjet with and abductor weapon, so i picked up 2 of them so i have less to worry about. Later, when i unloaded them in my base, i picked up one of those again, and noticed that the 2nd one is going in some weird direction. It was going back to the location from which i abducted it... On the bridge.

But it was going there over cliffs... Flying over cliffs...

Once it got close, it started do slowly fall down (it was in air...), and waited there for a brief moment until it was back on the ground (under the bridge), when it decided to carry on its orders from before i abducted it. This time, however, it used a normal path to get to my base.

But that's not all, because once i destroyed that unit, i got a crash. The dump, debug and except are in the archive.

Ares version: fatman

mevitar (mevitar) wrote :
Graion Dilach (graiondilach) wrote :
  • pdb.7z Edit (1.5 MiB, application/x-7z-compressed)

Since FatMan is compiled by me a while ago, one pdb coming in.

Crash is in gamemd range.

AlexB (alexander-b) wrote :

Crash seems to happen while an infantry unit checks whether a cell is occupied (related to pathfinding). It seems the cell still has a pointer to another infantry unit that has already been destroyed (EIP is FEEEFEEE, so the memory has been freed already).

Mevitar, did you abduct infantry units?

mevitar (mevitar) wrote :

I tried some more testing and got another crash. Also, my findings:

The unit doesn't try to get back to its abduction destination (by flying over cliffs and ignoring bridges) if it isn't moving when abducted. Also, when i abducted one that was moving, but not over a bridge, i encountered no crashes at all (it still ignored cliffs on its way back to the abduction spot). I did this multiple times during 1 game, destroying each abducted unit after, but nothing happened. I tried another game a bit later, and this time abducted the unit when it was on a bridge. There was no crash when i destroyed it, but a few minutes later the game crashed anyway.

And regarding your question: at the 1st time it crashed, i did abduct infantry early in the game, and killed it soon after in my base. And in case you need it for the 2nd crash, i abducted no infantry at all, only the tested enemy hover unit.

Graion Dilach (graiondilach) wrote :

Wait. So it tries to go back to it's abduction spot ALWAYS?

mevitar (mevitar) wrote :

Always if it was on the move while i abducted it.

Hm.... And it actually happens for any UnitType, hover or not. I just had a unit with mech locomotor and MovementZone=Infantry walk on on the water, up the cliffs, and through trees to the cell where it was abducted, after which it started moving back to the area where the abductor unloaded it. It doesn't seem to happen to infantry. Didn't test flying units yet.

I also missed one important thing - the abducting unit is a jumpjet. Will do more testing later to see if this thing happens for non-jumpjet abductors.

mevitar (mevitar) wrote :

Is there an option to edit comments here? I didn't write it clearly enough - when i abducted an infantry unit that was on the move, and unloaded it somewhere away, it didn't try to get back to the cell it was abducted from. It stayed right next to the abducting unit where it was unloaded. That was unlike the ground UnitTypes i tested, which tried to get back to the cell from which i abducted them (by making short-cuts), and then returned next to the transport (this time the normal way).

Changed in ares:
assignee: nobody → Graion Dilach (graiondilach)
importance: Undecided → Medium
status: New → In Progress
mevitar (mevitar) wrote :

The code of the abductor, its weapon and warhead.

Graion Dilach (graiondilach) wrote :

While I really want this to get done, and I think I know where the issue lies... I can't find the pointer to the waypoints. One DWORD must be a pointer to a WaypointListClass, if that one gets flushed, the issue should go away.

I just can't find that one. -_-

Changed in ares:
assignee: Graion Dilach (graiondilach) → nobody
status: In Progress → Confirmed
mevitar (mevitar) wrote :

And after more extensive testing, a summary:

1. The 'walk over all terrain to the abduction spot' issue occurs only for UnitTypes that were abducted while they were on the move, and were abducted by a jumpjet abductor. It always occurs for a moving UnitType with a hover locomotor, even if it was abducted by a ground abductor.

2. Ground based abductors don't have this issue for non-hover units. However, something different will happen - the abducted unit will try to recreate the path of its abductor from where it fired its weapon to where it was ordered to unload (meaning: if after the attack you order it to move 8 cells down, and 6 cells left, the abducted unit will do exactly the same after unloading). If its movement will get interrupted by anything during that process (a building, water, anything that the unit cannot go through), or once its movement finishes, it will try to get back near the unloading unit.
There are 2 conditions for this to happen, though:
* abductor has to be on the move when it abducts the target
* abductor cannot stop until ordered to deploy (and it has to be stopped by exactly that command, or nothing will happen; if it stops at any point, the unit inside will behave normally after unloading)
If any of those 2 conditions are broken, the unit will behave normally after unload.
I also noticed that sometimes a unit will move a few cells away and then back after unloading, even if it was the only unit inside the transport, and both the abductor and the abducted were stationary when the abducting weapon was fired. I wasn't able to determine what causes this.

3. Any unit abducted from a bridge will still occupy the cell it was abducted from. Units won't be able to move over it, only around.

4. The game crashes if the above unit is destroyed, and something tries to move over that blocked cell. If the unit will get back on the bridge after unloading, the blocked cell will seem to be removed, and anything will be able to move through it normally. However, once the unit gets destroyed (doesn't matter how far from the bridge that happens), anything trying to pass through that cell will cause a crash (again...).
Destroying the bridge on that cell also causes a crash.

Graion Dilach (graiondilach) wrote :

Hm. I might be the lazy guy, but what if we ignore all these bugs from abducting side and instead hook up to the passengerdropping logic to not go to various places?

Renegade (renegade) wrote :

*looks at report* *looks at comments*

Where were those people crying Ares was stable and release-ready, again?

Anyway, Graion, would you prefer if I took this one? I have no idea of everything you said so far, but since I originally coded this, I can hardly escape the blame. ;)
It's up to you, just no Westwood-fixes, please. ^^

Graion Dilach (graiondilach) wrote :

Yeah, I would. I terribly ran out of ideas on my own about this bug.

MRMIdAS (mrmidas) wrote :

Get the feeling this is why the chrono prison was removed?

Renegade (renegade) on 2012-01-11
Changed in ares:
assignee: nobody → Renegade (renegade)
milestone: none → 0.2-rc1
AlexB (alexander-b) wrote :

The latest v02 binary has a fix for this problem.

Changed in ares:
status: Confirmed → Fix Committed
mevitar (mevitar) wrote :

Tested with 12.98.1119 build, the bridge cell from which a unit has been abducted can be traversed normally. Destroying the bridge on that cell (or the whole bridge) doesn't cause a crash anymore. Destroying the unit after it leaving the abductor doesn't cause a crash either. So this seems to be fixed.

However, a moving unit abducted by a jumpjet still does the All-Terrain-Walk after leaving the abductor. I'll also test if the ground abductors had their issue fixed, but that will be later.

mevitar (mevitar) wrote :

The issue with ground abductors didn't really go away (although it seems that the abducted unit doesn't recreate the path that the abductor went anymore - it just goes back to the abduction spot, and then to deploy spot).

But i noticed that abductors with hover locomotor also have the same problem as jumpjet abductors (no, this wasn't introduced with the fix, i just missed it before).

DCoder DCoder (dcoder1337) wrote :

Alex: you missed one part of the fix I mentioned, seems like jumpjet loco will require similar hacking (and what about other locos, have *all* of them been tested?):

<DCoder1337> now that I think about it, simply onbridge won't be enough
<DCoder1337> after all, that was just a fix for the "link to the unit persists" crash, not the "idiot unit goes back to abduction point" glitch
<DCoder1337> if it keeps doing that stupid movement thing, you'll need to do the nasty stuff and shove zeroes into its memory
<DCoder1337> this is what I did for that:
<DCoder1337> auto pdwLoco = reinterpret_cast<DWORD *>(Target->Locomotor);
<DCoder1337> Debug::Log("Locomotor ptr is %p\n", *pdwLoco);
<DCoder1337> if(*pdwLoco == 0x7EACFC) { // fuck you hoverbob
<DCoder1337> pdwLoco += 0x5;
<DCoder1337> pdwLoco[0] = pdwLoco[1] = pdwLoco[2] = pdwLoco[3] = pdwLoco[4] = pdwLoco[5] = 0;
<DCoder1337> }

Renegade (renegade) on 2012-04-09
Changed in ares:
assignee: Renegade (renegade) → AlexB (alexander-b)
AlexB (alexander-b) wrote :

Thanks, D! This will be fixed in the next release.

@Testers: Which locomotors show this behavior? Hovers are known to do this, DCoder suspects JumpJets do this also, what about rocket, fly, whatever, ..., others and some more?

mevitar (mevitar) wrote :

As of now, i can say that walker locomotor is no different than regular wheel locomotor, and the one used by fighter-like AircraftTypes seems to not suffer from any problems at all. More details will come as i find the time to do the testing.

AlexB (alexander-b) wrote :

New various-fixes and v02 binaries contain a fix for the "unloading hover unit moving through the map like a ghost" bug.

mevitar (mevitar) wrote :

I will test it later today.

mevitar (mevitar) wrote :
Download full text (3.6 KiB)

Tested with 12.108.1388.
Unless i write 'ghostwalking', the unit travels normally, and goes back to the cell once it reaches something that blocks its way, or some cell unindentified (probably trying to recreate the path of the abductor since the abduction, but sometimes it is hard to tell...).

** JUMPJET ABDUCTOR **

Ground locomotor:
 * abducted when on the move: no problems
 ! abducted when still: goes somewhere (um, wtf?; btw, it behaves like Subt and Tele locos, but is fixed when they aren't, and bugged when they are fixed... may be related, or not...)
Hover locomotor:
 * abducted when on the move: no problems (so, it is fixed)
 * abducted when is still: no problems
Subterraenan locomotor:
 ! abducted when on the move: goes somewhere
 * abducted when still: no problems
Infantry locomotor (InfantryType):
 * abducted when on the move: normal unload behavior
 * abducted when still: no problems
Droppod locomotor:
 * didn't test, but i think it's safe to assume that no unit with this locomotor should be abductable?
Aircraft locomotor (AircraftType):
 * abducted when on the move: no problems
 * abducted when still: no problems
Teleport locomotor (UnitType):
 ! abducted when on the move: goes somewhere if was abducted while walking out of the War Factory (teleporting UnitTypes don't teleport out of the factory), no problems otherwise
 * abducted when still: no problems
Walker locomotor:
 ! abducted when on the move: ghostwalking
 * abducted when still: no problems
Jumpjet locomotor (UnitType):
 ! abducted when on the move: normal unload behavior; BUT: when unloaded, the unit will forever occupy the cell it was unloaded into, even though it goes into the air almost immediately! this will make the cell (or cells!) inaccesible forever, and if die unit dies, the game crashes (dump attached)
 * abducted when still: no problems
Ship locomotor (UnitType):
 * untested, i don't use those in my mod, and adding them would break everything; will try another time (unless someone else tests this)
Missile locomotor (AircraftType):
 * abducted when on the move: no problems (explodes on the unload cell)
 * abducted when still: untested

** HOVER ABDUCTOR **

Ground locomotor:
 ! abducted when on the move: goes somewhere
 * abducted when still: no problems
Hover locomotor:
 * same as jumpjet abductor
Subterraenan locomotor:
 * same as jumpjet abductor
Infantry locomotor (InfantryType):
 * same as jumpjet abductor
Droppod locomotor:
 * same as jumpjet abductor
Aircraft locomotor (AircraftType):
 * same as jumpjet abductor
Teleport locomotor (UnitType):
 * same as jumpjet abductor
Walker locomotor:
 * same as jumpjet abductor
Jumpjet locomotor (UnitType):
 * same as jumpjet abductor
Ship locomotor (UnitType):
 * same as jumpjet abductor
Missile locomotor (AircraftType):
 * same as jumpjet abductor

** GROUND ABDUCTOR **

Ground locomotor:
 * abducted when on the move: no problems
 * abducted when still: no problems
Hover locomotor:
 * same as jumpjet abductor
Subterraenan locomotor:
 * same as jumpjet abductor
Infantry locomotor (InfantryType):
 * same as jumpjet abductor
Droppod locomotor:
 * same as jumpjet abductor
Aircraft locomotor (AircraftType):
 * sam...

Read more...

mevitar (mevitar) wrote :

I really wish there was an edit button :)

DCoder DCoder (dcoder1337) wrote :

Thank you for the thorough test!

AlexB (alexander-b) wrote :

I implemented a overly complicated solution for this in various-fixes and v02. The locomotor is thrown out of the window and a new one is created.
Please check if you see something strange like a memory leak other weird behavior.

Also fixed: Abducting a unit that is currently attacked by a Magnetron.

mevitar (mevitar) wrote :

Tested with 12.115.1265. I noticed that a unit with a chrono locomotor, when abducted while on the move from the War Factory, now teleports out of the abductor like it always should.
This "overly complicated solution" seems to have fixed all issues with abductors. :P

Well, almost, as i got a crash to desktop when trying to abduct a unit attacked by a Magnetron... Didn't get any except.txt, and no option to make a crashdump. The only thing that i have is the debug.log...

AlexB (alexander-b) wrote :

Thanks for all the test data and the confirmation! Do you remember which unit the Magnetron attacked and in what state it was (like exiting war factory, repariring on service depot, harvesting, unloading, ...). If it an be reproduced, I'll add some logging.

mevitar (mevitar) wrote :

It was a miner with chrono locomotor. It was busy harvesting. Then i lifted it, and the abductor attacked it while it was still not far from the round (something like 1-2 cells away from the ground level). And then...

AlexB (alexander-b) wrote :

I can reproduce this crash. It's the chrono locomotor. I'll try to find a way to fix it.

AlexB (alexander-b) wrote :

Another v02 binary uploaded. This should fix the issue... i hope.

mevitar (mevitar) wrote :

Seems fixed. I guess that's all issues with Abductor logic, so closing this. :)

Changed in ares:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers