Marisa-Chan / UA_source

Mod for UrbanAssault (Replace original game engine)
GNU General Public License v2.0
120 stars 16 forks source link

Possible zombie unit bug? #22

Open KynikossDragonn opened 3 years ago

KynikossDragonn commented 3 years ago

I'm not fully sure how to describe the situation that just happened but:

While I was streaming the Taerkasten campaign I came across this situation: https://www.twitch.tv/videos/823464137

All I can think of what happened was, somehow while rapidly adding more Serps into that squad, somehow I guess one got fully created at nearly the same exact time one of them fired upon the power station and somehow made one of the newly created ones get stuck in a "zombified" state where I can't move or order it, it doesn't show up in the Squadron Manager, and destroying it permanently leaves a wreck that isn't affected by physics nor collides with anything.

The game didn't crash after this and I was able to complete the mission successfully and return to the shell after beaming out.

Marisa-Chan commented 3 years ago

Very strange bug. And I really can't reproduce it even with fresh version or with old one from november. If you more lucky in it - it would be great to catch it one more time or find conditions when it appear.

KynikossDragonn commented 3 years ago

I'm not sure how I could reproduce it, if I ever decide to replay this campaign again and get to this mission and start using Serp's to snipe powerstations with, I can give it another shot.

Hopefully it's not the compiler producing weird code.

Marisa-Chan commented 3 years ago

Seems I reproduce it on debug map with "2 level" aggr and placing new units in same squad while they attacking something But still no idea why it's happening and why it's not in squad manager, but on map.

пт, 22 янв. 2021 г. в 17:07, KynikossDragonn notifications@github.com:

I'm not sure how I could reproduce it, if I ever decide to replay this campaign again and get to this mission and start using Serp's to snipe powerstations with, I can give it another shot.

Hopefully it's not the compiler producing weird code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Marisa-Chan/UA_source/issues/22#issuecomment-765294381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJLFL75SKP2JNOTIPF6STS3FE6ZANCNFSM4ULBDDDQ .

Marisa-Chan commented 3 years ago

Oh, seems I found why it's rendered and does not function. Seems it's only in sector units list and somehow lost from units list.

пт, 22 янв. 2021 г. в 17:44, Zidane Sama llancelot7@gmail.com:

Seems I reproduce it on debug map with "2 level" aggr and placing new units in same squad while they attacking something But still no idea why it's happening and why it's not in squad manager, but on map.

пт, 22 янв. 2021 г. в 17:07, KynikossDragonn notifications@github.com:

I'm not sure how I could reproduce it, if I ever decide to replay this campaign again and get to this mission and start using Serp's to snipe powerstations with, I can give it another shot.

Hopefully it's not the compiler producing weird code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Marisa-Chan/UA_source/issues/22#issuecomment-765294381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJLFL75SKP2JNOTIPF6STS3FE6ZANCNFSM4ULBDDDQ .

Marisa-Chan commented 3 years ago

Finally I catch what's going wrong. And seems it's vanilla bug too. Well, steps what's going on:

  1. Game engine iterate through your first-level units (commanders) and store it into array and sort by CommandID
  2. After this it's handle input and place msg for your HS for creating new unit and place it under control of currently selected Unit.
  3. Next will be update-iterate through HS and their units
  4. Enemy HS unit/gun/missile iterated prior to your selected commander(and your HS) destroy him.
  5. Your commander on destroy transfer his kids to new commander
  6. Update-iterate reaches your HS and it's create new unit and place it into previously destroyed Commander kids list.
  7. After that, destroyed commander excluded from update list and placed into cache list. At this point it's completely detach new created unit and it's stays only in sector list.
Marisa-Chan commented 3 years ago

I hope it was fixed with this commit https://github.com/Marisa-Chan/UA_source/commit/5995fab88cca85051de60f4e4e9279d70e49e2d9 User's unit management things was moved before update loop.

And hope it will not generate new bugs.