Battle Simulator and Tests

Wonderful! This looks like a very clean, well designed rewrite.

A couple questions.
Can we please keep the randomness for bombers (10%) for laser kills, but drop the randomness for lasers killing transports/bombers?

How are the 15% and 30% loss limits going to be reinstated? Test results now show extremely large losses on both sides. Yes, the defender losses are higher than the attacker’s, but the attacker’s losses are still way higher than expected. If the only change is going to be a flat cap on losses, then a very common result will just be max losses on both sides and attacker wins the planet. I was hoping for a less drastic change from before, but maybe you are going to change formula stuff when you put the cap in and this won’t be an issue.
Example - everything equal, all units are destroyed:

What do you mean by bomber, laser, and transport stats? I don’t know how this would matter since they went off of flat percentages. Are you saying transports are going to start shooting down lasers?

One bug I see in the simulator is that defender ground units from portal are not counted unless there are also stationed ground units.

1 Like

I just had a little tinkle and from just doing a couple of attempts, I think far too many transporters are being shot down by defending fighters.

Same fleet sizes attacking and defending.
Attacker: FA, NF, 50% race. - Droids
Defender: -30% Race - Soldiers

Old code has 85% transports/ground landing

New code has only 45% of transports/ground landing.

1 Like

testing now i get some strange results.

Before testing this is what i have in my head:
i have the general idea that max kill on fighters is 30% still…

Seems max kill si 100% ?
Even attacking empire loose 60% ?

here i try to counter the attack race bonus by lowering the amount of fighters by 50% vs the defending empire.

i expected close to simular looses, but 100% (500) lost on attacker and 75% (750) lost on defender.

both tests seems strange.

testing tips from the AW :stuck_out_tongue:
Keep it simple. lock down 1 of part of prosess first.

1 Like

Awesome stuff everybody!

Absolutely. I’m planning to build in a random multiplier into the config options. I’ll start with the laser losses. :+1:

Another config option, but the behavior should be the same as it was before. I’ll have this back for v4.

We’re switching away from flat percentages here. The problem with that is that the existing air to ground phase does not actually factor in unit stats, making the units themselves fairly meaningless.

Interestingly, IC used to be this way, but changed to the flat percentages somewhere over its years. This upcoming change is actually reverting this part to early battle behavior.

Not for #milky-way-76, as transports have a ground attack of 0. However, this will now be supported if we wanted to modify unit stats either through their default values or via galaxy settings, spells/ops, galactic events, and/or other means (research?).

Great catch, thanks!

Thanks for testing this, I’ll keep this in mind when working the loss cap back in. :+1:

Testing tips from pie: read the updates. :stuck_out_tongue:

I’ll move caveats to the top of the post in the next one so they’re easier to see.

Definitely. :+1: That’s actually what we’ve done here; the 1 part of the process that’s changed first is the base loss calculations.

The next update will add some things back in so that fewer variables are changing overall.

Thanks again, everybody!

with the max 30% loss are you planning on a true cap of 30% or the current version where you can basically lose everything?

By “current version” do you mean the current in-game code, or the current simulator? Can you describe or show a test example?


by current i mean the way it has been in game for a long time, the guide says you can only lose 30% but say you hit a laser trap, you can still lose all your transports and all the ground you sent, making the guide a liar :smiley:

i’m lazy, but i’m sure @DustyAladdin or @Airwing can elaborate better than I :stuck_out_tongue:

1 Like

Be nice to add a variable on fleet fatigue per tick. Sending a fighter to attack 25 planets in one tick should bring on huge fatigue and lower the effectiveness on the later attacks :wink:


@Dukey that’s an interesting idea. I’m going to put that onto our list to brainstorm on after this initial rewrite gets buttoned up and released. There are some other features too I’d like to explore once the main changes settle.

@Random, gotcha. :+1: We’re moving to a cap in all phases by default. Losing all transports will no longer be possible in the default setup.

On that note, v3 has been updated to re-introduce that cap, amongst other things:

v3 updates; no v4 (for now)

From here on out I’m making updates to v3 instead of adding new versions for each change. v3 will be what gets tested in real battles on dev, and what we’re aiming to release for next round.

v3 bug fixes

v3 bug fixes

  • The defender’s portalled ground was not using the correct stats.
  • Units with 0 defending stats were not being correctly factored.

These are now fixed.

@DustyAladdin, these were both related to the bug you reported, which should now behave correctly.

The 30% loss cap has been re-added

The 30% loss cap has been re-added

This is active by default for all unit types. Previously, this did not apply to lasers, transports, and bombers.

@DustyAladdin, @Airwing, and @Luker8969, this should resolve the large losses you were seeing. Please let me know if you still think things don’t feel right.

Random loss multiplier

Random loss multiplier

This has been re-added only for lasers for the time being, but is now supported everywhere. For lasers, we have it set to shift 10% in either direction. This is the same behavior as before, although the base calculations have changed.

Some questions

A few questions for all of us:

  1. What should determine whether or not a given unit has a random loss multiplier baked in? Why limit it to just lasers, trans/bombers, or anything?

  2. If a unit does have a random loss multiplier, what should determine what that value is? The old code had laser losses shift between 90% and 110% of the base loss value, but trans/bomber losses shifted between 100% and 150% of the base loss value. What do we want these values to look like going forward?

  3. Similar to above: the 30% loss cap feels arbitrary. Should it stay at 30, or change to something else?

Keep in mind: even if we keep these things the same, the results will still be very different due to the change/fix on the base loss calculation. This isn’t a bad thing: it’s the entire point.

So, when thinking about all of this, try to avoid wanting results that feel familiar just for the sake of familiarity. Familiarity in this case was largely flawed; we should be thinking about what makes sense independently of past behavior.

I’m going to start moving this work into the game code so we can run real in-game test battles. In the meantime, more testing and input is still very welcome.


1 Like

So there’s a really long way to go before this is better than the current game code. First of all, please re-implement the 15% cap for ground units lost through portal. I really do think the game’s 15% and 30% unit loss limits were very good for balance. Secondly, unit losses now are massively higher than in the current game code. See below - equal fighters, 50% attack bonus gives 8% losses evenly on both sides currently but in new code it has max 30% loss on both sides.

I would really recommend trying to get total losses somewhere between what the current game code has for attacker or defender (with the mystery bonus). Are you not using the same formulas from the current code? My guess would be that you just use the ratios up to 100% losses like V2 and then put a hard cap at 30%, where I would bet the current game code uses the ratios to scale between 0-30%.


V3 proposed

Last point, the ratios don’t seem to be right. Attacker can outnumber defender 5:1 with 50% bonus and still lose twice as much ground. Currently, if you have way more ground you will always lose less than the defender.

1 Like

Is there any rationale behind these numbers? I can definitely add 15% back in, but I worry that we’re just sticking with arbitrary values for no other reason than familiarity.

What makes a given cap “better” than another?

I am definitely not. Everything has been reduced to a single base calculation that now requires specific (and well reasoned) modifiers to be added on top of each phase.

The current code/logic/formula is directionless and arbitrary, and we’re throwing it out. We can re-approximate its results if we really want to, but we should understand why. Otherwise we’re just rebuilding the same mess.

Not quite. The current code is a bit odd. Both versions have a hard cap at 30%, but the current code has a loss modifier in place before the cap. So you effectively see a ratio-based cap, but it is a byproduct.

That’s what I mean by deconstructing this stuff and rebuilding it with more direction. The results you describe are effectively by accident, or at least not clearly designed.

We can make it feel similar though. We need to know the following for each unit type involved in the battle:

  1. random loss multiplier. atm v3 has it only on lasers (10%)

  2. ratio-based loss modifier. atm v3 has none

  3. percentage loss cap. atm v3 has 30% default for each phase

Another important question worth restating: why should these vary per unit? What is the specific reasoning?

Speaking of reasoning: why did you want the random modifier back on laser losses, but dropped for bomber/trans losses? I’m curious as to what determined that split request, and what significance it may have to the wider assessment.

Once we figure out per-unit answers, we can potentially randomize these values as well to make battles less predictable overall. We would need to know the parameters there as well.

The ratio-based loss modifier will fix this. I can add some defaults to get things feeling similar, but we shouldn’t ignore the questions above.

This was great feedback, thanks!

Alright, I’ve got some familiar looking results, but before we go forward let’s take a step away from the abstract math for a second, and into the rationale.

Using fighters for an example, we have:

Fighters engage in combat with the opponent’s air units; fighters, bombers, and transports.

  • Air attack: 10
  • Air defence: 10

With no bonuses, at current unit stats, their offensive and defensive power are exactly matched.

Ignoring the 30% loss cap, why wouldn’t they completely kill each other?

@MTG_Dad made the comparison to Magic, and I think it’s apt here. If we want to reduce losses, for each side, why don’t we modify the unit stats to reflect this inherently? We can either bump unit defense or drop unit attack to achieve the same result.

Either way, that would move the complexity out of the formula and put it into the unit stats themselves, which seems far more intuitive.

100% kill would make the battle very short. Imo the fig running part is a very fun feature… AS an idea could also lower the Max kill to 20% ish to prolog the battle also…would make winning harder

1 Like

There are very good game design reasons for both the 15% and the 30% loss limits and for having losses between even fleets being significantly lower. Currently I believe if everything is completely even it is about 3-4% ground loss and 8-10% fighter loss, which I think are very good baselines. The attacker wins the planet and both sides have small losses, but nothing that is too noticeable in comparison to the main fleet.

To start with the Magic comparison, in MTG you have a constant stream of resources. You draw a card every turn and you get to untap your lands each turn, providing a constant supply of mana, with the major caveat that mana cannot be stockpiled. You have to use it that turn or else it disappears. This is not how IC works. In IC you do not pay mana for fleet, you pay in resources, which can and are stockpiled. Families will save for days to jump as large a fleet as possible at the start of the war, but these savings are not regenerated every turn like lands being untapped. Family income drastically drops due to fleet upkeep and lost infra, not to mention the other costs of winning a war (sending fleets, building lasers/portals, etc.). Frequently income can even go negative in war. Rebuilding a crashed fleet after a jump is not nearly as easy as replacing creatures in MTG.

The better comparison to MTG would be with drawing cards and hand size. You can stockpile cards like you save for jumps in IC, albeit for different reasons. If you go all in with an aggressive deck and play all the cards in your hand to flood the board, you are taking a risk. If your board is swept then you have no remaining cards and very little chance to catch up. This is very similar to crashing your fleet in IC, but fleet crashes come from avoidable mistakes, not as an unavoidable cost of battle. Additionally, there are no board sweeping spells in IC, or really any catch-up mechanics of any kind. There is no reason to hold back on a fleet jump for war and keep savings on hand (old morale was a reason for this, but I’m going to ignore that ridiculous mechanic).

I think the major difference between the two games and why we should not drastically increase unit losses in battles for IC is that a game of Magic lasts maybe 20 minutes, whereas an IC round is supposed to last for 6 weeks. If evenly matched fleets started max killing each other then wars would no longer go on for a few days. They would be much shorter and the downtime between wars would be much longer and I don’t think people want more of that.

I’m not against tweaking the 15% and 30% limits, but I do think they are very close to what they should be and have the benefit of being nice round numbers which are easy to remember. The 15% loss limit for defending units from a portal exists to make raids more challenging. With a 30% limit, there really wouldn’t be any need for coordination to raid a banker. For example, 10 battles with max kill reduces the defender fleet by 80% at the current 15% loss limit, but would kill 97% with a 30% limit. We are already taking away a large defender advantage with this code rewrite, so I don’t see a reason to make it even more difficult for bankers to stop raids since we will be making it easier for attackers to get max kills with the current inherent defender bonus removed. If we really want to change it for the sake of trying something new, I would recommend setting it to 16% or 17% and seeing if you like that better.

For the 30% limit, I agree with Airwing and definitely don’t think it should go higher, since there is already enough risk in triggering a large fleet when it is unknown whether the defender has his main fleet in or when you aren’t sure of how large the fleet is. The 30% loss due to taking a risk that didn’t pan out or being hit by a fleet much larger than yours is already very significant. Again, it only takes 6 hits at 30% loss before 88% of the fleet is destroyed. This can happen all very quickly already. I would be more open to tweaking the 30% limit than the 15% limit since I think the effects would be less severe. I think 25% would be too low and would lower the risk of all the things I mentioned above. There would be fewer consequences for mistakes or poor decisions. I would be totally fine if you wanted to try out a limit of 27-28%, the big downsides being that it is harder for people to remember an odd number and it would throw people off who are used to being able to calculate backwards quickly in their heads what defender fleet is from 30%.

1 Like

Awesome analysis @DustyAladdin!

I believe there’s a consensus that capping losses is a good thing. I’m not suggesting we throw that out, but I do question the mechanism that expresses it.

A static cap feels like a shortcut to force balance on a result, because the underlying logic isn’t designed well enough.

Take the 10k figs vs 10k figs example. In the new logic, without the cap, everybody loses everything. However, that doesn’t mean that we need to bring back a forced 30% cap to retain balance. We can achieve the same results in that specific battle by doing this:

Fighters engage in combat with the opponent’s air units; fighters, bombers, and transports.

  • Air attack: 3
  • Air defence: 10

That’s literally the same results for that specific battle.

This doesn’t stay the same for all battles, but that’s kind of the point. If you have 100 fighters, and I send 1 million, from a power comparison perspective what sense does it make that you can lose no more than 30?

I’m all for restricting the ability to destroy each other in a single battle, but if that’s what we want, we should achieve that effect independently of the power comparison. The game’s current code modifies and distorts that comparison to the point that it loses its meaning. The math has become too abstract.

You, @Airwing, and others are right to think that losses shouldn’t be so high, and that we should still allow for fighter runs, etc.

However, re-adding a hard 30% cap is a crutch, and although it is mathematically simple it is conceptually confusing. We know how it works because we’ve been here forever, but if a new player asked any of us “why 30%?” and we can’t answer it simply and without having to give a crash course in IC strategy, then we’re doing it wrong.

This really does feel like something that should be solved via unit attributes, not in the formula itself.

As a side note, @Rivan made an interesting point in Hangout #7 that in a real life conflict, 10k soldiers vs 10k soldiers wouldn’t mean 100% unit loss all around.

Imo, that could be very simply expressed by dropping soldier’s attack attributes relative to other soldiers. We could even consider “attack” to infer a measure of accuracy. That is, if a soldier’s atk/def is 3/10, then they effectively miss 70% of the time against other soldiers.

It might seem like it’s being overthought, especially if the end result feels similar, but it makes a huge difference in how we can improve upon the battle experience in the long term. We don’t have to settle for just rebuilding the same outcome; we can instead build a system that supports the same outcome as one of many variants.

I’m a bit confused about what you’re suggesting. I haven’t seen the underlying code, so I actually don’t care how you go about implementing the changes so long as they match what we are targeting. The current code may be abstract and meaningless to you since you can see it, but nobody else can see how the engine works, just the results. I know how much you like pristine code :wink: so I’m not going to tell you to just do it the easy way, but that’s what I would do.

If I was somehow controlling 100 fighters and saw 1 million coming to attack me, I would for sure turn around and retreat through the portal, destroying the portal on my way out and leaving the planet to the attackers, which would leave me with zero unit losses. I think the whole idea of battles/losses are that they mirror real life. The battle ends well before all units are destroyed. It ends when one side has inflicted noticeable damage on the other side to break their ranks and have the remaining fleet scatter in retreat. I don’t think having specific caps is a crutch or difficult to explain without IC strategy. It’s there for game balance reasons and there has to be a limit somewhere.

So basically, go ahead and implement the changes however you want as long as the we get the major results we want, and then we can go and test and see if there are unintended consequences we want to redesign around.

1 Like

Yeah, it’s a bit tricky to discuss the underlying stuff given the one-sided view.

For now though, I’m focusing on getting a replacement out that doesn’t change too many variables up front. So the 30% and 15% caps will stay for now, even if I don’t like how they’re implemented.

As for what I’m suggesting, it’s a more intuitive and configurable setup that makes clear sense and doesn’t have so much “magic” happening underneath the hood. It’s de-mystifying the factors so that more players can understand exactly what’s happening.

The reason I’m leaning so hard on that is, that once this battle stuff is wrapped up, a million other things are going to take priority and we likely won’t revisit the code again for a very long time.

So, I want to make it extensible so we don’t have to go years between adjustments again. The real goal is to remove me from the picture entirely, giving more control to the players to experiment, without having to know how to code.

Alright, so we’re near completion here. Bear with the noise, this post is more for for future reference in case we need to look back at the decisions here.

More info than you care about

I went back over the old code again to better understand this:

removing the loss reduction multiplier

This “loss modifier” mentioned above is really a loss reduction multiplier, and it is not applied consistently. Atm, defending units have a higher value here, which is part of the reason the battle favors defenders so strongly.

What’s worse is, it even differs amongst stationed/portalled in the air battle. Strangely, however, this discrepancy doesn’t exist in the ground battle.

This part of the code is being removed, with the “ratio-based cap” being expressed more directly as a unit-based loss cap. All that means is that we can achieve the same results by defining the value higher up in the logic. This doesn’t matter right now, but it will when we expose this for players to tinker with.

configurable unit attributes

The tricky part now is, that reduction multiplier differed across unit types as well, and across phases too. That means that we’ve been used to a sense of relative power that is now going to be significantly disrupted.

For example, compare the following battles, with no bonuses:

20k figs vs 20k figs

  • 3333 fighters lost dogfights against the defending stat fighters.
    those poor passengers didn’t stand a chance.
  • 1042 fighters stationed as defense on the planet were shot down by the attacking air forces.

20k droids vs 20k droids

  • 1458 attacking droids malfunctioned.
  • 993 stationed droids failed in their program to defend the planet.

The air battle is deadlier, but it has nothing to do with the unit attributes, which is ridiculous.

Unfortunately, fixing this is going to throw things out of whack for us. The good news is, the new code more accurately expresses unit attributes, and unit attributes are now going to be configurable as a galaxy/round setting.

What it all comes down to is that we are removing the arbitrary math and overall mystery/weirdness out of the formula itself and putting more weight on the significance of unit attributes.

So, “the battle formula” will finally be fairly simple and less prone to bugs, and the complex parts that we do enjoy will be expressed through changes to the unit types themselves.

I am wrapping up the final touches. I’ll post again here when it’s ready to test.

We’re all wrapped up here, and ready for in-game test on dev. More info below: