Author Topic: AI War 2 v0.524 Released! "Improvement Variety Pack #1"  (Read 2680 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« on: October 07, 2017, 08:43:19 pm »
Release notes here!

No one theme here, other than "make the game more fun to play" :)

Opening with some UI improvements from community member BadgerBadger, and moving on to some behavior changes from me to make waves behave in a more familiar fashion and to make your ships not fan out in a counter-productive fashion when you give them an attack order.

Modders can now make different galaxy display modes change the text (and its color) around planets on the galaxy map, which really helps show the info you want.

And some various bugfixes in the middle of it all.

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 BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #1 on: October 08, 2017, 11:49:23 pm »
Hey Keith, got a quick one for you. This will show the Strength of the AI defenses on planets when you use the "AI Defenses" galaxy view. It's quite handy.

First, in GalaxyMapDisplayMode_Normal.cs, change GetTextAndColorForLowDownText() to be a virtual function
Code: [Select]
        public virtual void GetTextAndColorForLowDownText( Planet planet, out string text, out Color color )
        {
            CombatSide localSide = planet.Combat.GetLocalSide();
            int threatStrengthInt = localSide.DataByStance[SideStance.Hostile].ThreatStrength.IntValue;
.....

Then add the following to GalaxyMapDisplayMode_Badger.cs
Code: [Select]
    public class GalaxyMapDisplayMode_AIDefenses : BaseGalaxyMapDisplayMode
    {
        public override void PickOtherThingsToShow( Planet planet, GameEntity EntityToSkip, GameEntity[] ArrayToFill )
        {
            UtilityMethodsFor_GalaxyMapDisplayMode.BasePickGalaxyMapOtherThingsToShow( planet, EntityToSkip, ArrayToFill,
                delegate ( GameEntity entity )
                {
                    if ( ArcenStrings.ListContains( entity.TypeData.Tags, "NormalPlanetNastyPick" ) )
                        return true;
                    if ( ArcenStrings.ListContains( entity.TypeData.Tags, "MasterControler" ) )
                        return true;
                    return false;
                } );
        }
       //the below function is new
      public override void GetTextAndColorForLowDownText( Planet planet, out string text, out Color color )
      {
            CombatSide localSide = planet.Combat.GetLocalSide();
            int totalStrengthInt = localSide.DataByStance[SideStance.Hostile].TotalStrength.IntValue;

            if ( totalStrengthInt <= 0 )
            {
              text = string.Empty;
              color = ColorMath.White;
            }
            else
            {
                text = totalStrengthInt.ToString();
                color = ColorMath.White;
            }
        }
    }

It seems like a useful addition to things to get us started.

Also, why does SideStance.Hostile give me what I'm looking for? I would have expected the GetLocalSide() function to return the owner of the planet, so one would use SideStance.Friendly to check the strength of whoever owns the planet on that planet.
« Last Edit: October 09, 2017, 12:00:53 am by BadgerBadger »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #2 on: October 09, 2017, 10:10:45 am »
First, in GalaxyMapDisplayMode_Normal.cs, change GetTextAndColorForLowDownText() to be a virtual function
Whoops, I'd meant all the functions in that class to be virtual/abstract. Have made them so.

Good idea on showing the defense strength. I'll take that and raise you color-coding, based on how strong your current selection is:

Code: [Select]
        public override void GetTextAndColorForLowDownText( Planet planet, out string text, out Color color )
        {
            CombatSide localSide = planet.Combat.GetLocalSide();
            int totalStrengthInt = localSide.DataByStance[SideStance.Hostile].TotalStrength.IntValue;

            if ( Math.Abs( World.Instance.CampaignRealSecondsPlayed_NonSim - LastSelectionStrengthUpdateSecondsPlayed_NonSim ) > 0 )
            {
                LastSelectionStrengthUpdateSecondsPlayed_NonSim = World.Instance.CampaignRealSecondsPlayed_NonSim;
                FInt localSelectionStrength = FInt.Zero;

                Engine_AIW2.Instance.DoForSelected( SelectionCommandScope.AllPlanets, delegate( GameEntity selected )
                 {
                     localSelectionStrength += selected.TypeData.BalanceStats.StrengthPerSquad;
                     localSelectionStrength += selected.GetStrengthOfContentsIfAny();
                     return DelReturn.Continue;
                 } );
                LastSelectionStrength = localSelectionStrength;
            }

            if ( totalStrengthInt <= 0 )
            {
                text = string.Empty;
                color = ColorMath.White;
            }
            else
            {
                text = totalStrengthInt.ToString();
                if ( totalStrengthInt > LastSelectionStrength * 2 )
                    color = ColorMath.OrangeRed;
                else if ( totalStrengthInt > LastSelectionStrength )
                    color = ColorMath.Orange;
                else if ( totalStrengthInt < ( LastSelectionStrength / 2 ) )
                    color = ColorMath.DeepSkyBlue;
                else
                    color = ColorMath.White;
            }
        }

The line with checking LastSelectionStrengthUpdateSecondsPlayed_NonSim is just so that the player's selected strength is only recomputed at most once per real-time second, rather than recomputed every frame and for every planet; a similar technique could be used if you have other stuff to compute that's potentially expensive.

The "SelectionCommandScope.AllPlanets" thing is new for next version; I realized that DoForSelected needs to sometimes only apply to what you have selected on your current planet, and sometimes needs to apply to everything, and sometimes needs to choose based on whether you're on the galaxy map. Previously it was always current-planet-only, so if you selected a control group, went to the galaxy map and told it to change planets, your "selected strength" would drop as the units left their origin planet. Now it won't change just from them moving around. Also makes it easier to give them follow-up orders after they make transit.

Quote
Also, why does SideStance.Hostile give me what I'm looking for? I would have expected the GetLocalSide() function to return the owner of the planet, so one would use SideStance.Friendly to check the strength of whoever owns the planet on that planet.
planet.GetControllingSide() returns the owner of the planet. planet.GetLocalSide() returns the side which corresponds to the local player account. Would GetLocalPlayerSide() be clearer? GetPlayerSide() would be ambiguous in MP.
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.524 Released! "Improvement Variety Pack #1"
« Reply #3 on: October 09, 2017, 10:13:25 am »
Yeah, LocalPlayerSide() is way clearer to me. I think that would be a useful change.


Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #4 on: October 09, 2017, 11:04:57 am »
I'm just going to start doing this:

#HireBadger

:P

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #5 on: October 09, 2017, 11:34:53 pm »
Yo, so great idea. In the pre-game lobby when you are choosing your ship, lets actually show the image of the ship and have it rotate and stuff.

Also, we should have some sort of in-game screen where we show the model of a ship (fleetship, starship, etc) and then give the stats from the XML.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #6 on: October 11, 2017, 05:46:47 pm »
Hey Keith, a proposed update to the descriptions. I copied what you wrote in the wiki when the starships/fleetships were released into the description fields, and in a few places I wrote something vaguely accurate when there wasn't a description. I assume you could extend on these if desired, but this is something at least! This is one of those things that a first pass is kinda necessary before handing out more game keys, so hopefully this will save you some time.

The release notes in the wiki say "Armor ships should do engine damage", so I updated the EntitySystem for ArmorShip_Gun to do engine damage (it was previously just using regular shells).

I also think "Armor Ship" is a really weird name. I feel like the names "Space Tank" and "Armor Ship" conjure up the same basic  "Strong but pretty slow, does lots of damage". The only actual difference is Armor Ships are more tanky than Space Tanks and destroy engines. I propose a name change for Armor Ships to something that has a "Strong but very slow" feel that doesn't remind one of "Tank". What about "Tercio Ships" (https://en.wikipedia.org/wiki/Tercio) or "Tortoise Ships" or something like that.
« Last Edit: October 11, 2017, 11:44:46 pm by BadgerBadger »

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.524 Released! "Improvement Variety Pack #1"
« Reply #7 on: October 12, 2017, 11:21:31 am »
Also, I do think the original wave behaviour in AIW2 (wave starts at a nearby AI planet then travels to one of your planets) is a worthwhile behaviour to hold onto as a different playstyle. I'd actually kinda like the ability to choose between AIWC wave behaviour, original AIW2 behaviour and cross planet waves from AIWC.

Also, is there a way to check which planet is going to be hit by the wave? I looked briefly into incorporating the Wave's target into the "Wave incoming" warning message, but I couldn't figure out how.