Jump to content

Battle mechanic


Grillick
 Share

Recommended Posts

I've been searching and searching, and I can't for the life of me find the post where Sheepy explained the numbers used for the battle mechanic.

 

I know that battles (that's what I'm calling the 3 mini-contests built into the resolution of a war action) compare a random number that is based on the strength of each side's military. What I don't remember is the range for that random number. It caps at 100% of the military strength, but what's the base? I know it was 0 at one point, but it was changed because people were annoyed that they weren't getting immense triumphs against 0 ships, but I can't remember (or find) what it was changed to.

 

Can someone be so kind as to give me a link to the relevant post, or an answer to my question?

"It's hard to be a team player when you're omnipotent." - Q

Link to comment
Share on other sites

  • Administrators

Tonight when I get home and have all the source code handy, I'll see if I can get this for you. I'd also like to make a battle simulator at some point where players can enter in their own custom numbers and get a generated possible result.

  • Upvote 6

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

Tonight when I get home and have all the source code handy, I'll see if I can get this for you. I'd also like to make a battle simulator at some point where players can enter in their own custom numbers and get a generated possible result.

God yes. Please do.

q8nfyvc.gif

Link to comment
Share on other sites

  • Administrators

Here's how a ground battle works:

 

Attacker's Army Value = Armed Soldiers * 1.75 + Unarmed Soldiers * 1 + Tanks  * 40

Defender's Army Value = Armed Soldiers * 1.75 + Unarmed Soldiers * 1 + Tanks  * 40

 

A simulation occurs:

AttSolCasRand = MAX(RANDBETWEEN((Armed Soldiers * 1.75 + Unarmed Soldiers)*.4,(Armed Soldiers * 1.75 + Unarmed Soldiers)),1)
DefSolCasRand = MAX(RANDBETWEEN((Armed Soldiers * 1.75 + Unarmed Soldiers)*.4,(Armed Soldiers * 1.75 + Unarmed Soldiers)),1)

AttTankCasRand = MAX(RANDBETWEEN((Tanks * 40 * .4),(Tanks * 40)),1)
DefTankCasRand = MAX(RANDBETWEEN((Tanks * 40 * .4),(Tanks * 40)),1)

AttRand = AttSolCasRand + AttTankCasRand
DefRand = DefSolCasRand + DefTankCasRand

If(AttRand > DefRand) {
Victory = Victory + 1

AttTankCasualties += ((DefTankCasRand+1)/550) + ((DefSolCasRand+1)/6600)
DefTankCasualties += ((AttTankCasRand+1)/530) + ((AttSolCasRand+1)/6600)

} else {

AttTankCasualties += ((DefTankCasRand+1)/530) + ((DefSolCasRand+1)/6600)
DefTankCasualties += ((AttTankCasRand+1)/550) + ((AttSolCasRand+1)/6600)

}

That simulation is ran 3 times, and casualties are added up and the victory type decided from the three rolls. Then damage and cash stolen is calculated.

  • Upvote 1

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

That's the top two variables calculated.

 

You mean this?:

 

 

 

AttSolCasRand = MAX(RANDBETWEEN((Armed Soldiers * 1.75 + Unarmed Soldiers)*.4,(Armed Soldiers * 1.75 + Unarmed Soldiers)),1)

DefSolCasRand = MAX(RANDBETWEEN((Armed Soldiers * 1.75 + Unarmed Soldiers)*.4,(Armed Soldiers * 1.75 + Unarmed Soldiers)),1)

 

 

So how does that work? I see it takes the soldier power and then computes a random number between 40% and 100% of its power, but I don't see how that is then applied to determining soldier casualties? Surely 40-100% aren't killed in a skirmish.

 

I thought this part was just to calculate strength values and then randomize it a bit to determine who wins the skirmish, but not to calculate casualties. 

 

There should be variables called AttSolCasualties and DefSolCasualties, shouldn't there?

Edited by Princess Bubblegum
Link to comment
Share on other sites

  • Administrators

No, I just forgot to throw in soldier casualties. That's my bad. When I get home I'll update it.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.