View Issue Details

IDProjectCategoryLast Update
0021178AI War 2Bug - GameplayMay 8, 2019 7:12 pm
ReporterDEMOCRACY_DEMOCRACY Assigned To 
Status resolvedResolutionfixed 
Product VersionBETA 0.855 Galactic Markings 
Fixed in VersionBETA 0.857 The AI Strikes Back... Hard 
Summary0021178: Units that cost metal to claim are actually are free to claim
DescriptionSo it turns out you can claim units with a metal cost for free. on planet Zanovar, at the very top there is a neutral spire frigate. build a command station on the planet, and watch as you instantly claim it, despite not having 2 million metal.
TagsNo tags attached.

Activities

DEMOCRACY_DEMOCRACY

May 3, 2019 1:34 am

reporter  

free spire frigate.save (579,084 bytes)

Bummeri

May 5, 2019 6:21 pm

reporter   ~0051524

I confirm. Maybe lift the severity to major?

BadgerBadger

May 5, 2019 10:14 pm

manager   ~0051525

Why? It's not particularly affecting gameplay negatively

Bummeri

May 6, 2019 6:37 am

reporter   ~0051527

Because it is relevant for balancing and pacing of the game?

vinco

May 7, 2019 6:09 pm

reporter   ~0051540

Honestly, I think the cost to build the fleet units/turrets provide enough of a balance/pacing bump on claiming a new centerpiece.

DEMOCRACY_DEMOCRACY

May 8, 2019 3:03 am

reporter   ~0051543

If unit should have a metal cost to claim, add it in, if not, remove the text indicating they do cost metal to claim.

wm46

May 8, 2019 6:44 am

reporter   ~0051544

Well, if the people demand it, I know what the issue is but I don't know the best way to fix.

GameEntity_Squad.cs - line 414:

            if ( TypeData.RevertsToNeutralOnDeath && PFaction.Faction.Type == FactionType.NaturalObject )
            {
                result.HullPointsLost = result.DataForMark.HullPoints - 1;
                result.ShieldPointsLost = result.DataForMark.ShieldPoints;
                result.HasNotYetBeenFullyClaimed = true;
            }

Arks, Golems, etc don't revert to neutral on death anymore, so their HP doesn't properly get set to 1 HP. I can't really think of a good OR statement that captures everything though, best I could come up with is ( TypeData.RevertsToNeutralOnDeath || TypeData.Tags.Contains("Capturable") ) && PFaction.Faction.Type == FactionType.NaturalObject, but I don't know if there will ever be capturable stuff that doesn't contain Capturable, and there's also probably a better way to check for this that I don't see.

wm46

May 8, 2019 6:53 am

reporter   ~0051545

There's also some weirdness with the way the healing done by claiming is calculated. Right now in MetalFlowPlanning, neutral claiming always heals maxFlowRate HP/s, with a cost of maxFlowRate Metal/s, always 1:1 metal to hp cost. This means that you're almost always paying less metal than you should be, because metal costs are almost always larger than the HP of the ship.

BadgerBadger

May 8, 2019 10:24 am

manager   ~0051546

Does that explain why the first time you claim a flagship it's free?

wm46

May 8, 2019 2:47 pm

reporter   ~0051547

This first bit of code is what runs when running the reclaim flow planning in the core, OnClaim sets the ships so its no longer disabled. Faction.cs - Line 1357

                                        if ( claimable.HullPointsLost <= 0 && claimable.HasNotYetBeenFullyClaimed )
                                            claimable.OnClaim( Context );

So when the HP reaches 100%, and the ships receives a ClaimingNeutrals flow, it immediately gets claimed and can build things.

You end up only paying 1 metal to claim things with 100% hp. If the metal cost (or really HP since the code is bugged) is less than 1, but yet it's still claimable, the cost gets set to 1. So the way to fix things is to fix what's not properly setting the ship's HP to 0 when it gets created.

wm46

May 8, 2019 3:11 pm

reporter   ~0051548

Actually, looking through the code again, the ships don't even need to have 1 metal paid. The flag HasNotYetBeenFullyClaimed never gets set to true, so really all of the ships just automatically become yours when you capture the planet.

wm46

May 8, 2019 3:37 pm

reporter   ~0051549

Fixed the bug with the metal cost to claim, now the only issue left is the HP not properly being set to 1.

wm46

May 8, 2019 5:59 pm

reporter   ~0051550

I decided on having the script check if there's a defined metal cost to claim, TypeData.MetalCostToClaim > 0.

I can't test it since I get errors about something Unity related when building, but it should work.

This can be marked fixed.

Issue History

Date Modified Username Field Change
May 3, 2019 1:34 am DEMOCRACY_DEMOCRACY New Issue
May 3, 2019 1:34 am DEMOCRACY_DEMOCRACY File Added: free spire frigate.save
May 3, 2019 1:34 am DEMOCRACY_DEMOCRACY File Added: free spire frigate.savemet
May 5, 2019 6:21 pm Bummeri Note Added: 0051524
May 5, 2019 10:14 pm BadgerBadger Note Added: 0051525
May 6, 2019 6:37 am Bummeri Note Added: 0051527
May 7, 2019 6:09 pm vinco Note Added: 0051540
May 8, 2019 3:03 am DEMOCRACY_DEMOCRACY Note Added: 0051543
May 8, 2019 6:44 am wm46 Note Added: 0051544
May 8, 2019 6:53 am wm46 Note Added: 0051545
May 8, 2019 10:24 am BadgerBadger Note Added: 0051546
May 8, 2019 2:47 pm wm46 Note Added: 0051547
May 8, 2019 3:11 pm wm46 Note Added: 0051548
May 8, 2019 3:37 pm wm46 Note Added: 0051549
May 8, 2019 5:59 pm wm46 Note Added: 0051550
May 8, 2019 7:12 pm RocketAssistedPuffin Status new => resolved
May 8, 2019 7:12 pm RocketAssistedPuffin Resolution open => fixed
May 8, 2019 7:12 pm RocketAssistedPuffin Fixed in Version => BETA 0.857 The AI Strikes Back... Hard