Author Topic: AI War 2 v0.522 Released! "Variations On A Theme"  (Read 5986 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
AI War 2 v0.522 Released! "Variations On A Theme"
« on: October 03, 2017, 02:05:47 pm »
Release notes here!

Lots of crazy going on lately, hence it being two weeks since the last release (sorry!)

This time I focused on articulating some key "joints" in the skeleton of how the game comes together:
- Wormhole placement now has much more variety, while maintaining the rule that you can tell which direction the other planet is in based on where the wormhole position.
- The AI's main defensive position is also no longer always in the center of each planet.
- Finally, under the hood, much of the info tracking how strong the AI is and the humans are is now no longer specific to those two "main" factions but is now fully available for all special factions as well. The changed symbols impact existing mods, of course, but now you can do a lot more with them.

There's also a variety of other changes; major postprocessing stack switch by Chris, more Nanocaust updates from Badger, and some key bugfixes that will make the AI not just bumrush every force that attacks that planet.

Enjoy!
Keith
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 FalseMyrmidon

  • Newbie Mark II
  • *
  • Posts: 24
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #1 on: October 03, 2017, 04:38:59 pm »
Any UI updates in this one?  I still find the UI to be pretty painful.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #2 on: October 03, 2017, 05:11:13 pm »
Any UI updates in this one?  I still find the UI to be pretty painful.
No, was working on other things for this one. But plenty more to come on the UI side.
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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #3 on: October 03, 2017, 11:39:16 pm »
I think there's a lot of good progress in .522. I look forward to once the rest of the defence placers (TwoStrongPoints, ThreeStrongPoints, etc) are uncommented.

I really like the variable wormhole placement.

I do have some remarks about the visuals. I like that it feels less like a Mardi Gras parade. I do think some of the models could stand a bit more massaging from a lighting point of view. For example, when I zoom in on the sniper guardian it always looks creepy and insectoid. At every LOD I try there's always some new menacing detail to observe. I particularly like the sense of veining you get that adds to the insectoid sense. However, Some of the other guardians (like the missile guardian in particular) feel like they are missing that level of detail at some of the higher LOD. Consider the missile guardian in the attached picture. I can tell from a variety of other LODs that I've examined that there's a ton of cool detail, but I don't feel like I see that here.

Also, I think sometimes things are just a bit too bright and reflective.

Now, keep in mind that I did just critique "too much blackness" and "too much brightness" simultaneously. This is why I'm a systems programmer, and not a graphics person. Give me a nice easy kernel panic any day!


Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #4 on: October 04, 2017, 09:16:57 pm »
Hey Keith, from a more pragmatic stance, I'm trying to figure out how to use the new Strength code. What I'd like to do is figure out for each nanocaust planet whether there are human forces on it. I see in the Nanocaust.cs code like
Code: [Select]
                CombatSide otherCombatSide = planet.Combat.Sides[i];
                FInt sideStrength = otherCombatSide.DataByStance[SideStance.Me].TotalStrength;
                switch ( otherCombatSide.WorldSide.Type )
                {
                    case WorldSideType.AI:
                        aiStrength += sideStrength;
                        break;
                    case WorldSideType.Player:
                        humanStrength += sideStrength;
                        break;
                }

which makes some sense (you're iterating over all the CombatSides, then updating the humanStrength and aiStrength when we are iterating on the Human and AI CombatSide respectively).

I am a bit confused about the fact that you are looking at the SideStance.Me array entry. What exactly does that mean? I would welcome a bit more description of how this all works so I make sure I'm using it correctly.

Code: [Select]
                FInt sideStrength = otherCombatSide.DataByStance[SideStance.Me].TotalStrength;

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #5 on: October 05, 2017, 09:19:40 am »
I am a bit confused about the fact that you are looking at the SideStance.Me array entry. What exactly does that mean?
"otherCombatSide.DataByStance[SideStance.Me].TotalStrength" means "otherCombatSide's total strength on the planet". So "Me" just means "Self" or "UnitsOwnedByThisSide".

The other possible values are:

SideStance.Friendly : units not owned by otherCombatSide, but owned by another side that is friendly to otherCombatSide.
SideStance.Hostile : units owned by a side that is hostile to otherCombatSide
SideStance.Neutral : any unit not in any of the other three categories

Would it be clearer if I renamed SideStance.Me to SideStance.Self or SideStance.OwnUnits, or something like 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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #6 on: October 05, 2017, 09:34:12 am »
Ahh, now I see. I do think SideStance.Self makes more sense, so if I could prevail upon you to change it I think it would be helpful.

So in general, if I want to find the strength from a given side (human/AI/particular faction) on a planet, I iterate over all the combat Sides and check the Type/Name for the value I'm interested in?
« Last Edit: October 05, 2017, 09:36:19 am by BadgerBadger »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #7 on: October 05, 2017, 09:52:03 am »
So in general, if I want to find the strength from a given side (human/AI/particular faction) on a planet, I iterate over all the combat Sides and check the Type/Name for the value I'm interested in?
Not exactly. There are three general cases:

1) What you described is what you do if you want the strength for a given side TYPE, specifically WorldSideType, which can be one of four values:

NaturalObject
Player
AI
SpecialFaction

And realistically you'd only care about Player or AI, since NaturalObject is just wormholes and stuff like that, and SpecialFaction doesn't care which faction it is (presumably you always care about which faction it is, or at least whether that faction is hostile, friendly, or neutral).


2) If what you want is the strength for a given side, like Nanocaust or Nanocaust-Zombies or Player-Zombies or Dyson-Sphere or a specific human player (multiplayer can have more than one) or a specific AI (the design is for there to be different AI sides controlling different regions, though there'll probably also be a "master" AI that controls the MC itself and generally calls the broader shots), then you can use that side's CombatSide object to get to the DataByStance[SideStance.Me] data. Though in long-term-planning you get the data from a different place, but it's similar.

So no iterating over all sides in that case.


3) The more robust, and I think in the future more common, case is when you want to get the strength of all forces of a particular alignment, or stance, relative to some side. For instance, in your Nanocaust planning code it probably often doesn't need to care about who owns the other units there, it just needs to know "how much strength here is under my control", "how much strength here is friendly to me", and "how much strength here is hostile to me". That way you don't have to check for the various zombie factions (you would in methods #1 or #2) or other factions that may or may not be friendly or hostile depending on the circumstances. It's already added up for you.

And to do that you look at things like mySide.DataByStance[SideStance.Hostile].TotalStrength
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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #8 on: October 05, 2017, 12:35:34 pm »
So for me, I want to check "Is someone attacking a Nanocaust planet" so I can send troops to ward them off. But I want to have different behaviour if a Human is attacking me vs another faction (the Dyson sphere? The devourer?) or the AI. For example, lets say that if a human attacks me, I want to attack them back.

So my code might be

Code: [Select]
foreach(nanocaust planet)
{
    CombatSide myCombatSide = planet.Combat.GetSideForWorldSide( side );
    if(mySide.DataByStance[SideStance.Hostile].TotalStrength > minEnemyStrengthForDefenseFleet)
     {
          //this planet is under attack
          //Now, how do I figure out who is attacking, keeping in mind there might be multiple forces (2 humans? a human fleet following the devourer in?)
          for ( int i = 0; i < planet.Combat.Sides.Count; i++ )
           {
                CombatSide otherCombatSide = planet.Combat.Sides[i];
                FInt sideStrength = otherCombatSide.DataByStance[SideStance.Me].TotalStrength;
                if(otherCombatSide.WorldSide.Type == WorldSideType.Player && sideStrength > retaliationMin)
                {
                       //queue up an attack against this player later
                 }
            }
            //send troops to this planet to defeat the enemy forces
      } 
}

Does that look like a solid idiom?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #9 on: October 05, 2017, 02:53:11 pm »
Does that look like a solid idiom?
Yes, that looks reasonable. You may want to do
Code: [Select]
mySide.DoForRelatedSides(SideRelationship.SidesThatAreHostileTowardsMe, <delegate containing your logic>)instead of looping over the sides directly, or at least check for whether otherCombatSide is in fact hostile, but it's up to you.
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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #10 on: October 06, 2017, 10:27:00 am »
Yeah, I'm bad at spotting where the DoForRelated/delegate pattern would be optimal. It's not one I'm used to.

A few quick UI related thoughts.

It occurs to me that one of the real UI annoyances I think people are having is how poorly Metal data is reported. At the moment it's pretty unusable (and it tends to overlap onto the Incoming Waves text). I fixed this for myself a while ago so I forget (though I think my solution is a bit hacky) that everyone else has to deal with it.

Do we really need a "Planet" menu at all? There are two things you can do with it right now, "Capture Planet" and "Do Not Path Through Planet". DoNotPathThrough seems like it could be limited to the Galaxy map (what if mouseing over a planet in the Galaxy Map gave you a "do not path through" toggle that was then represented by an additional UI element, say putting a red circle around the planet on the map, or placing a red line across the planet UI element). And "Capture Planet" could just be done by directing your forces to attack the planet controller.

The "Galaxy" Menu also should only be available in the Galaxy Map screen. In fact, why not make the elements of the Galaxy Map always-available buttons in the Galaxy Map screen. At the moment the Galaxy Map seems dreadfully underutilized. Recall that in AIWC a player would spend a ton of their time in the galaxy map screen planning what to do next, and I expect that will be about the same in AIW2. What about a display mode that showed the Strength of ships on each planet? What about adding a glow to the planet to show ownership (or actually changing the colour of the planet name, instead of just making the name Murdoch (Gold) or Murdoch (Unowned)? Also having the lines between planets change colour would be nice (recall in AIWC that those lines would change colour based on who owned the planets at either end); that feature would also allow you to show the paths units would take in the galaxy map.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #11 on: October 06, 2017, 02:23:23 pm »
Yeah, I'm bad at spotting where the DoForRelated/delegate pattern would be optimal. It's not one I'm used to.
It's not optimal performance-wise but it's ok. I find that it makes it easier to write correct code if I'm not manually checking for is-hostile, etc. In other areas it's more important because there's various filters that should always be applied and may not be obvious. Looping over the raw entity lists would give you ships, wormholes, and shots, for example.

Quote
It occurs to me that one of the real UI annoyances I think people are having is how poorly Metal data is reported. At the moment it's pretty unusable (and it tends to overlap onto the Incoming Waves text). I fixed this for myself a while ago so I forget (though I think my solution is a bit hacky) that everyone else has to deal with it.
I tried to dig up the code for that, but the post I found from you on the topic didn't have code attached. Can you point me at it?

It wouldn't be a permanent solution, of course, but it would be a good point to start the discussion from.

What do people want from a metal display? Do they want fire that can be fitted nasally?

The main things I want to see in it are:
- The stockpile amount. If it's some huge number it doesn't need to be precise, just a number of thousands or millions or whatever.
- The current change per second/step/whatever.
- If I'm bottomed out, I want to see the percent of current demand that is being met by the current production.
- If I'm bottomed out, I want to see the estimated time until my net metal production will be positive again.
- Not currently implemented, but in general I'd like to be able to see the estimated time until all my queued construction is complete (so turrets and whatnot are simple cases; looping build queues would just look at how long it would take to fill in the cap, and that gets tricky with multiple producers)
- Not currently implemented, but something relatively eye-catching when storage is full and I'm "wasting" metal income.

Then there's the question of what should show on the main display itself, whether any of that is conditional (on being bottomed out, or maxed out, or whatever), what should show in a tooltip, and whether there should be some alternate display mode you can toggle to show more info up there, etc.

Quote
Do we really need a "Planet" menu at all? There are two things you can do with it right now
I'm intending to move the resource-focus controls there, instead of having you build those aux structures to accomplish it. There are other potential "standing order" or "policy" decisions that would be per-planet and that's the logical place for them.

Quote
DoNotPathThrough seems like it could be limited to the Galaxy map (what if mouseing over a planet in the Galaxy Map gave you a "do not path through" toggle that was then represented by an additional UI element, say putting a red circle around the planet on the map, or placing a red line across the planet UI element)
It's logical to limit it to the galaxy map, but having it be a dedicated toggle would make it harder to add other such decisions.

Quote
And "Capture Planet" could just be done by directing your forces to attack the planet controller.
The point of the Capture planet toggle is to tell your forces which planets to capture without waiting until you're on the planet. So if you have an overwhelming force with a flagship you could just FRD it to the target planet and it will capture the planet without you needing to intervene further.

Quote
The "Galaxy" Menu also should only be available in the Galaxy Map screen.
My only concern with that is I don't want to have a different mapping of numbers to buttons-across-the-bottom based on whether you are on the galaxy map or not.

Quote
In fact, why not make the elements of the Galaxy Map always-available buttons in the Galaxy Map screen.
That would make the prior point workable, but there are other functions outside that menu that need to be accessible when you're on the galaxy map. For one, you need to be able to give the normal set of orders to your current selection.

Quote
At the moment the Galaxy Map seems dreadfully underutilized. Recall that in AIWC a player would spend a ton of their time in the galaxy map screen planning what to do next, and I expect that will be about the same in AIW2.
Certainly, and the main point of the Planet menu is to have not just "passive" decision making (where you look at data and think), but "active" decision making where you tell the game which planets to capture, which to avoid pathing through, which to focus on which resources, etc.

Quote
What about a display mode that showed the Strength of ships on each planet?
Sure, that would be a good idea.

Quote
What about adding a glow to the planet to show ownership
Adding support for that would be a Chris thing, I don't know what's involved.

Quote
(or actually changing the colour of the planet name, instead of just making the name Murdoch (Gold) or Murdoch (Unowned)?
That would be good, and probably more tenable.

Quote
Also having the lines between planets change colour would be nice (recall in AIWC that those lines would change colour based on who owned the planets at either end);
That would be great, I haven't investigated how easily those line colors can be changed at runtime.

One thing I'd like is to just go ahead and say that overlapping planet connections are not supported (it wouldn't crash, but it wouldn't be guaranteed to be pleasant), and draw polygons from the midpoints of all the border planets owned by one side, and fill those polygons with the controlling side color so that there's a real visualization of "owned territory". That might be beyond what Chris has time to add support for, though :)
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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #12 on: October 06, 2017, 02:42:20 pm »
These two files contain the changes that I'd made locally to make my metal flow vaguely useful.

I would say first, make the metal settings usable "enough", then worry about fine-tuning it. I think the list of things you were interested in are already mostly accomplished by my code, and nothing else seemed exceptionally hard (except the queued construction stuff, which I think would have components that aren't in External Code.

I think it would be much easier for people to give feedback on what other features they need (or whether they don't need things) if they have something usable enough to get started.
« Last Edit: October 06, 2017, 02:47:33 pm by BadgerBadger »

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #13 on: October 06, 2017, 03:05:58 pm »
Ahh, now I see. I do think SideStance.Self makes more sense, so if I could prevail upon you to change it I think it would be helpful.

Seconding the refactor to SideStance.Self

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.522 Released! "Variations On A Theme"
« Reply #14 on: October 06, 2017, 04:08:15 pm »
Sorry, forgot to change .Me to .Self for 0.523, but I've just made the change for 0.524.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!