Jump to content

Air Patrols Crashing, Unable to DeleteAit Patrols


eeustice
 Share

Recommended Posts

  • 3 weeks later...

Hint to TonyE and donaldseadog:

1. formedit.c FormationDlg() says that air units with CombatFlag <= 0 will show up in the formation editor.

2.  formedit.c AddFormRec() looks for an AirPatrolEvent associated with the unit via FindAirPatrolEvent() to determine if the unit is a formation air patrol or just part of the formation.  If it is a formation air patrol, form->state is set to AIR_FORM.

3. formedit.c FindAirPatrolEvent() finds the first AirPatrolEvent based on the group matching (not the group id, the group structure in memory) and the unit's id matching.

4. formedit.c MakeFormationList() builds the list box of items in the formation.  It looks at the FormRecs already created and shows them as formation air patrols if form-> STATE == AIR_FORM || form->state == PATROL_FORM.  

 

In short, I expect that somewhere along the line, the affected formation air patrols are losing their associated AirPatrolEvent or the association (via somehow changed UnitIds) is broken.

Link to comment
Share on other sites

Tracked down the file just before the first air patrol in Guam becomes corrupt.

It doesn't repeat every time, but the event does happen.

Launch GE

Locate Guam on the map.

Run the GE for 1 second.

While GE is doing what the GE does change time to 0

When you get the message below open the formation editor on Guam and look for a Fighter Drone patrol

unknown.png

unknown.png

This is the first corrupted patrol.

You will not be able to delete the patrol in the Formation Editor, but you can still split from the base at this time.

If you have any questions please let me know.

 

Unit ID Test 1-41.0001.zip

Link to comment
Share on other sites

On 9/8/2022 at 10:37 PM, TonyE said:

Hint to TonyE and donaldseadog:

1. formedit.c FormationDlg() says that air units with CombatFlag <= 0 will show up in the formation editor.

2.  formedit.c AddFormRec() looks for an AirPatrolEvent associated with the unit via FindAirPatrolEvent() to determine if the unit is a formation air patrol or just part of the formation.  If it is a formation air patrol, form->state is set to AIR_FORM.

3. formedit.c FindAirPatrolEvent() finds the first AirPatrolEvent based on the group matching (not the group id, the group structure in memory) and the unit's id matching.

4. formedit.c MakeFormationList() builds the list box of items in the formation.  It looks at the FormRecs already created and shows them as formation air patrols if form-> STATE == AIR_FORM || form->state == PATROL_FORM.  

 

In short, I expect that somewhere along the line, the affected formation air patrols are losing their associated AirPatrolEvent or the association (via somehow changed UnitIds) is broken.

I'm a bit slow and just read this. I'll put in a separate comment below that seems to give another clue that is beyond my knowledge but might help.

Meanwhile I'll look at this bit too.

Link to comment
Share on other sites

I've looked at three of erics save games and used lazgui.dll to pause game and look at "structure" in the game second following each save. The second event listed for game time 100303 refers to the (supposedly) patroling unit ac21.

At game time 100289 (the second after erics save game 1-40.0071) the data looks good, and the unit is patroling and behaving.

Next second (I used erics next second game save, 1-40.0001) the data for the event has changed and the unit applies to is now a nonexistant unit. The unit now appears not to be patrolling and is listed incorrectly in the formation editor.

I don't understand how the data in the event is changed, but maybe its another hint.

On my laptop it takes 5 minutes for that 1 sec game time to run.

image.thumb.png.f7aa08c6175361beb9943b7ae495b9cf.png

image.thumb.png.547561973e55b818cb179b2580dcf61e.png

Link to comment
Share on other sites

On 9/8/2022 at 10:37 PM, TonyE said:

2.  formedit.c AddFormRec() looks for an AirPatrolEvent associated with the unit via FindAirPatrolEvent() to determine if the unit is a formation air patrol or just part of the formation.  If it is a formation air patrol, form->state is set to AIR_FORM.

Where do FormRecs reside?

Link to comment
Share on other sites

1 hour ago, donaldseadog said:

Where do FormRecs reside?

They are temporary structures created when needed, primarily when the formation editor is opened.  The structures are freed when the formation editor is closed.

  • Like 1
Link to comment
Share on other sites

On 9/8/2022 at 10:37 PM, TonyE said:

I expect that somewhere along the line, the affected formation air patrols are losing their associated AirPatrolEvent or the association (via somehow changed UnitIds) is broken

That, in my limited understanding, seems to tie in with the change over one sec in the ac21 event where the applied to unit changes from the correct unit (ac21) to a non existing unit.? Is this warm?

Link to comment
Share on other sites

Got there in the debugger by setting a breakpoint on change in memory contents of the AIR_PATROL_EVENT for ACb unit 21.  It took a long time to run those 14 game seconds.  I was expecting it to be one game second from 1-40.0071.  So slowly getting closer to the moment things go awry.

image.png

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...