Author Topic: Special Forces attack (now with added desync!)  (Read 2183 times)

Offline Vinraith

  • Hero Member Mark II
  • *****
  • Posts: 806
Special Forces attack (now with added desync!)
« on: March 31, 2014, 11:17:20 pm »
So twice in our current game (7.010) we've had the special forces patrol assault us outright, each time in a different location. Since there's a special forces commander in the game, that means 25000 ships pouring into our systems with no warning and minimal threat on the board. This isn't supposed to happen, surely?

In addition to making this game almost unplayable it's caused at least one desync. This is, I'll admit, one of the more diabolically clever ways for the AI to win the game (which it was on the verge of losing), but it's not exactly my idea of fun. :) I'm attaching a pre and post desync save for inspection...
« Last Edit: March 31, 2014, 11:24:40 pm by Vinraith »

Offline Master Cylinder Pants

  • Newbie
  • *
  • Posts: 3
Re: Special Forces attack (now with added desync!)
« Reply #1 on: March 31, 2014, 11:42:03 pm »
And here's a host side save with advanced logs...
Note this is from an attempt to reproduce the special forces fun + desync from Vinraith with advanced logs on.
No special forces invasion though - just the desync (but the special forces were nearby, they like to watch).
« Last Edit: March 31, 2014, 11:45:09 pm by Master Cylinder Pants »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #2 on: April 01, 2014, 09:30:50 am »
Wow, the AI was really going for the gold in this one, eh?  Will take a look, thanks for the saves.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #3 on: April 01, 2014, 09:32:58 am »
Ohhh, 7.010.  There were some potential desync things I fixed since then.  I'll still take a look when I get a chance, but it's possible that was fixed in the interim.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Vinraith

  • Hero Member Mark II
  • *****
  • Posts: 806
Re: Special Forces attack (now with added desync!)
« Reply #4 on: April 01, 2014, 11:25:05 am »
Thanks Keith. The desync is the biggest problem, but is this normal SF behavior?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #5 on: April 01, 2014, 11:27:26 am »
The SF should never intentionally enter a human-controlled planet.  I think if you provoke them to come after your attack fleet, then quickly take the planet that you might seem them pop in to admire the new command station, but only because they haven't realized it's time to cancel the path yet.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Vinraith

  • Hero Member Mark II
  • *****
  • Posts: 806
Re: Special Forces attack (now with added desync!)
« Reply #6 on: April 01, 2014, 12:03:11 pm »
The SF should never intentionally enter a human-controlled planet.  I think if you provoke them to come after your attack fleet, then quickly take the planet that you might seem them pop in to admire the new command station, but only because they haven't realized it's time to cancel the path yet.

That wouldn't apply here, since we'd held that system for some time, so I wonder why it decided to attack? As mentioned, we've had this happen twice now, in two different systems, both of which had been under our control for quite a long time prior to the attack in question.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #7 on: April 01, 2014, 12:04:44 pm »
Yea, it's a bug, for sure.  What exactly happened I can't guess yet.

"Computation Complete: Players Having Too Much Fun.  Launch Special Forces."
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Vinraith

  • Hero Member Mark II
  • *****
  • Posts: 806
Re: Special Forces attack (now with added desync!)
« Reply #8 on: April 01, 2014, 12:06:36 pm »
Yea, it's a bug, for sure.  What exactly happened I can't guess yet.

"Computation Complete: Players Having Too Much Fun.  Launch Special Forces."

25000 ships do have a way of raining on your parade, that's for sure. :)

If earlier saves or any other materials would be helpful just let us know.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #9 on: April 01, 2014, 06:10:20 pm »
Findings so far:


1) Shortly after the SF carriers execute the Naos command station, a carrier deploys about 108 ships to replenish losses.  On the same frame or nearly so a general AI reinforcement triggers.  I had reinforcement logging on at the time and this led to an OutOfMemoryException from the sheer weight of the logs.  Why the text got that big is a mystery to me, as even 1 Megabyte of text is a loooooooot of text, and it would probably need at least 100MB or 200MB to really challenge it.  But perhaps something else is going on there.  I have it using a memory-efficient custom buffer for such thing (as opposed to serial string concatenation which is murder on efficiency when there's thousands of concats).

Anyway, if either of you have reinforcement logging on, turn it off and try again :)  Advanced logging should be fine, as the sheer volume is much lower there.  That's why the toggles are separate and the reinforcement has (iirc) warnings in the tooltip, incidentally.  I suppose I could just make the logging less detailed at the guard-post level, but I think I'm going to change the overall concept soon anyway.

That out-of-mem thing didn't stop the game from running (the garbage collector presumably got a shot at it and it took another go on the next frame) but this definitely would have caused a desync.


2) Doing a retest without the out-of-mem problem, there were no crashes.  This was in SP so doesn't test the desync thing.  But from the SF logs it's not actually trying to attack Naos.  But Naos was in the way to Struve, and Struve is where they wanted to be.  Apparently they stopped for tourist recreation when the oppportunity presented itself.  I'm currently investigating giving the SF a bit sterner orders about what to do when in a human system.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Chthon

  • Sr. Member Mark II
  • ****
  • Posts: 398
Re: Special Forces attack (now with added desync!)
« Reply #10 on: April 01, 2014, 08:33:23 pm »
Translation of the reinforcement log:  "Won't this eventually be sent to Keith to be fixed again?"  "Not if he turns on reinforcement logging today, heh heh heh..." *What follows is 4 gigabytes worth of data amounting to PTHBBBBT!*

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #11 on: April 01, 2014, 08:37:22 pm »
Translation of the reinforcement log:  "Won't this eventually be sent to Keith to be fixed again?"  "Not if he turns on reinforcement logging today, heh heh heh..." *What follows is 4 gigabytes worth of data amounting to PTHBBBBT!*
Yes, sometimes it does that.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Special Forces attack (now with added desync!)
« Reply #12 on: April 01, 2014, 09:40:59 pm »
Ok, a bit more progress:

1) It wasn't trying to get on the road to the target staging area because it didn't have a path to that target that didn't involve going through player territory (even not counting the player planet it was already on).  I told it to path through whatever if there was no purely non-player path.

But it bears mentioning that you've apparently split the AI's overall territory into a disjoint pieces, and entrapped the special forces blob in one of those pieces (that's in a long string of 2-wormhole planets, even).

2) It pathed through whatever, including player planets (but not engaging them much, just wormhole-to-wormhole)

3) Then it got stuck on your massive chokepoint and I spent a lot of time putting in more logging to figure out why the commands that were being sent from the AI thread weren't actually getting added to the unit command lists.

There was a black hole machine.


Are you guys sure you didn't want the SF to try to bust through?  I'm not sure what choice it was left ;)

Even when I scrap the black hole machine they're dragging their feet a lot on the way to the wormhole, trying to figure that out now.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Chthon

  • Sr. Member Mark II
  • ****
  • Posts: 398
Re: Special Forces attack (now with added desync!)
« Reply #13 on: April 01, 2014, 09:52:50 pm »
Ok, a bit more progress:

1) It wasn't trying to get on the road to the target staging area because it didn't have a path to that target that didn't involve going through player territory (even not counting the player planet it was already on).  I told it to path through whatever if there was no purely non-player path.

But it bears mentioning that you've apparently split the AI's overall territory into a disjoint pieces, and entrapped the special forces blob in one of those pieces (that's in a long string of 2-wormhole planets, even).

2) It pathed through whatever, including player planets (but not engaging them much, just wormhole-to-wormhole)

3) Then it got stuck on your massive chokepoint and I spent a lot of time putting in more logging to figure out why the commands that were being sent from the AI thread weren't actually getting added to the unit command lists.

There was a black hole machine.


Are you guys sure you didn't want the SF to try to bust through?  I'm not sure what choice it was left ;)

Even when I scrap the black hole machine they're dragging their feet a lot on the way to the wormhole, trying to figure that out now.
Sounds to me like they sent invitations to party, and punch was served.

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Special Forces attack (now with added desync!)
« Reply #14 on: April 01, 2014, 09:53:50 pm »
Wait, did you just describe 25k ships wreaking havoc on a human planet settlement a "vacation"*?


*Well, the exact wording was tourist recreation, but that is basically means vacation.