UnitRepair=yes + Factory=AircraftType = IE

Bug #895384 reported by Marshall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Confirmed
Low
Unassigned

Bug Description

Apparently this causes internal errors so Ares pre-empts this by crashing during startup.

How does this cause IEs? I've had the combination in my mod for ages and never had a problem. I'm using NADEPT as a place to produce a non-AirportBound aircraft, which may be why I don't get errors (although it's certainly possible through capturing other sides' tech that AirportBound aircraft could be produced here).

If this really is such a fatal thing, is it possible we can have a work-around?
E.g. if the problem is due to AirportBound aircraft, then can you make it so that AirportBound aircraft are not produced here and/or that they are automatically ordered to move next to the building on completion, so that they will either land or crash when they can't return?

***Alternatively, can VehicleType factories be used to build AircraftTypes that are not AirportBound? This would be a better solution.***

Revision history for this message
Marshall (m-edward) wrote :
Revision history for this message
DCoder DCoder (dcoder1337) wrote :

This is one specific IE that drove me mad for ages - Westwood's GAAIRC has UnitRepair=yes commented out, and a lot of people have itchy fingers and uncomment it. When AI needs to find a valid repair bay (damaged vehicle), it tries to communicate with the repair bays it has to see which one is empty. Westwood's code at that point goes more weetawded that usual, and gets stuck in an infinite loop -> stack overflow at a random EIP -> pain in the ass to debug. I'm not sure if it's the fact that the GAAIRC has multiple docks, or simply that it produces/contains aircraft at the time. And when I tested it myself, my own aircraft would jump right off of it after getting repaired, which kind of cockblocked their attempts to reload.

I can see how in some circumstances this combination is actually useful, but I obviously didn't think of them when I added that preemptive Fatal Error. I'll look into lifting it if someone can give me more conclusive results of what causes the crash or if the consensus is that I should...

Revision history for this message
Marshall (m-edward) wrote :

I have replicated an Internal Error and attached an except.txt

Using:
My custom carryall unit (AirportBound=no)
Unmodified Harrier
GAAIRC with UnitRepair=yes
NADEPT with Factory=AircraftType

First, I built my carryall unit at NADEPT. I tried various things. If a unit is being repaired before about 45% construction complete then construction will pause at 45%. If a unit is (instead) being repaired when construction is 100% complete then the aircraft will fly in from the edge of the map.
Built a Harrier at NADEPT. Damaged with a tank, then ordered away and it returned automatically and got repaired by NADEPT as if it were a vehicle. Then it would fly around in circles. Strangely, I got the enter cursor on GAAIRC (there is another Issue open for that functionality to be restored). Ordering the Harrier to GAAIRC, it would land but then immediately take off, fly in a circle and then land before taking off again.
Built a new Harrier, this time at GAAIRC. This immediately took off and flew around in a circle before landing and taking off again.
Built a third Harrier at GAAIRC. Boom - IE. Not sure if the Harrier had completed or was still under construction. Pretty sure one of the earlier Harriers had just that moment landed on GAAIRC.

There clearly is a problem here but whether it is due to AirportBound aircraft, number of docks, or some other aircraft/aircraft-factory logic I have no idea.
Based on DCoder's comments, it sounds like the problem could be units trying to find a repair bay and either there's an issue with multiple docks or because it doesn't have a place they can reach. However it looks like the problem does not occur with NADEPT.

Assuming that is the case then we could allow UnitRepair+Factory=AircraftType. It would be better to find the exact cause though (e.g: if it is due to number of docks then Ares can still pre-empt if it checks Docks as well)

However, following on from this, there's still the problem of Airport-bound aircraft being produced at such a building. This, however, could be dealt with by following up on the Issue that has been raised for limiting factories to producing specific units. Then I could have NADEPT only produce my carryall.

Finally there is the issue of construction halting. Would it be possible to have vehicles refuse to move on to a repair depot if it were producing something? You may want this to be logged as a separate issue.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Thanks for the tests... I'll have to think about a good solution for a while :)

Revision history for this message
MRMIdAS (mrmidas) wrote :

just thinking outside the box, is it possible to give the airpads a heal weapon, make it only work against custom armours, give said custom armours to the aircraft, and give the heal weapon AffectsEnemies=no and AffectsAllies=yes?

somewhat of a long winded workaround I know.

Revision history for this message
Untrue (untrue) wrote :

SelfHealing on aircraft is enough for me. I can't reproduce on MRMIdAS' workaround though.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Self healing aircraft have problems when it's time to die, IIRC.

Revision history for this message
AlliedG (alliedg) wrote :

Possible solutions to this issue.

- Healing particle systems on aircraft.

- Aircraft can move onto service depot for normal repair (without alt move)

- Machine Shop heals aircraft. (needs new code)

- Repair units can heal docked aircraft. (needs new code)

Finally as a general note AI should never build service depots or any UnitRepair structures, it really screws up AI attack forces etc.

Revision history for this message
RandomNutjob (randomnutjob) wrote :

Think moving to depot be #1
As for Machine Shop and Repair units that'd be useful too
On sidenote why do UnitRepair structures screw up attack forces?

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Because they decide it's time to get healed after getting hurt, instead of doing their jobs, probably.

Renegade (renegade)
Changed in ares:
status: New → Confirmed
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.