View Issue Details

IDProjectCategoryLast Update
0021396AI War 2Gameplay IssueJul 16, 2019 1:14 pm
ReporterBadgerBadger Assigned ToChris_McElligottPark  
Severitymajor 
Status resolvedResolutionfixed 
Product Version0.875 Counterattacks You Can Taste 
Fixed in Version0.876 Counterattacks Ate My Waves 
Summary0021396: No waves are generated
DescriptionThe commit

* When waves are created, they now have a specific planet that they use from which to launch their wave.

prevents conventional waves from being spawned.

In PlanWave() the assignment:

                int tempBudget = 0;
                Options.approxWaveStrength = this.approximatePotentialStrengthOfWave( faction, Context, budget, out tempBudget, numUnitTypes, ShipGroupCat, maxGuardianTypes, Options, null );

was moved below
                     ArcenSparseLookupPair<Planet, Planet> pair = this.ChooseWaveTarget( faction, Context, budget, Options );

The AI needs to know the approximate strength of the wave when deciding which planet to target. The AI needs to know the approximate strength of the wave so it can avoid attacking particularly strong planets with weak waves, or how it makes sure reconquest waves hit a target they think they can beat.
TagsNo tags attached.

Relationships

related to 0021405 resolvedChris_McElligottPark No waves for diff 10 

Activities

Chris_McElligottPark

Jul 13, 2019 11:42 am

administrator   ~0052223

Whoops! That's going to be challenging, because the strength of the wave is now based on where it's coming from. So we'll have to make it calculate that for all the potential targets.

BadgerBadger

Jul 15, 2019 9:38 am

manager   ~0052228

Not just the composition of the wave is determined by. the source planet, but the strength as well?!

Keep in mind that it doesn't need to be the exact strength, just an approximation.

Chris_McElligottPark

Jul 15, 2019 10:54 am

administrator   ~0052230

It's implicitly the strength as well, yes -- since the costs don't directly determine the strength, if the xml diverges it will potentially be very off if balance is adjusted various ways. The budget isn't determined based on where it comes from, but if you recall the budget!= the strength now. And especially with multiple ais, it could get pretty funky since things like royal ais use way more strength for the same budget. And based on how I have it set up, if a different AI recaptures a planet that was royal, they'll use the royal ships from that planet at the moment.

So... I am just trying to avoid having the code make assumptions like "the modders and developers will balance costs and strength consistently." That's demonstrably not the case, heh. And even as we get into more extreme AI types I imagine it might intentionally diverge further.

Really what we should be doing, and I can work on it, is that we build more than an estimate for the potential waves. Build the wave compositions and hold onto those, and so that way when we choose one to use later on, it's definitely what was advertised.

I'll have to do some refactoring, but nothing too major to my knowledge.

BadgerBadger

Jul 15, 2019 10:57 am

manager   ~0052231

I think a refactor is appropriate; once strength was decoupled from AI budget the old paradigm didn't make as much sense.

Chris_McElligottPark

Jul 16, 2019 1:14 pm

administrator   ~0052268

Thanks!

* Really major refactor of how waves are generated, since it needs to know what is in the wave before it can decide what to do with it... and it also needs to know where the wave would be coming from now before it knows how strong it is and what is in it... so basically a lot of things had to be reorganized in order to make it so that it can tell which end is up.
** The overall logic should be the same, but it's just more accurate now in terms of actually using real numbers for strength calculations rather than trying to use estimates or approximations. The waves can vary a lot more than we can accurately estimate now, so that was definitely needed.
** The two major downsides of this revision are firstly that this does a lot more calculations on a background core of your CPU, but frankly it still should be pretty trivial; and secondly that there's a good chance we introduced some major new bugs with waves in all this.
** We have tested this and basic waves function as well as apparently reconquest waves, but we haven't checked hacking waves, waves in response to alarm posts, etc. Knock on wood that those should work. This is at least a step up over last version, where it was sending no waves at all because the approximation code got moved around without a full refactor (oops).

Issue History

Date Modified Username Field Change
Jul 13, 2019 12:50 am BadgerBadger New Issue
Jul 13, 2019 11:42 am Chris_McElligottPark Note Added: 0052223
Jul 15, 2019 9:38 am BadgerBadger Note Added: 0052228
Jul 15, 2019 10:54 am Chris_McElligottPark Note Added: 0052230
Jul 15, 2019 10:54 am Chris_McElligottPark Assigned To => Chris_McElligottPark
Jul 15, 2019 10:54 am Chris_McElligottPark Status new => assigned
Jul 15, 2019 10:57 am BadgerBadger Note Added: 0052231
Jul 16, 2019 12:11 pm BadgerBadger Relationship added related to 0021405
Jul 16, 2019 1:14 pm Chris_McElligottPark Status assigned => resolved
Jul 16, 2019 1:14 pm Chris_McElligottPark Resolution open => fixed
Jul 16, 2019 1:14 pm Chris_McElligottPark Fixed in Version => 0.876 Counterattacks Ate My Waves
Jul 16, 2019 1:14 pm Chris_McElligottPark Note Added: 0052268