Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 0 users and 205 guests online.

Languages

  • English English
  • French French

Browse archives

« Novembre 2008  
Lu Ma Me Je Ve Sa Di
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Curve math

Submitted by Gideon on Tue, 2006-12-19 13:00. SE:V MODs

Similar to my linear math post, but with damage reduction according to an exponential decay curve.

WARNING: If math angers/frustrates you, then this will REALLY piss you off...

This is the math for a weapon to reduce damage according to an exponential decay curve.

Definitions:

f(m) is damage modifier from levels.

f(p) is percentage of m which applies, as expressed by a number from 0.00 (for 0%) to 1.00 (for 100%).

f(r) is the percentage of the range of the weapon as it relates to its maximum possible range, as expressed by a number from 0.00 (for 0%)
to 1.00 (for 100%). Example: If the max range is 60, then 30 is 50% of 60 (or one half), so r = 0.5.

f(m) = damage by level * (p)

f(p) = a + b * (Power(c, (-1 * (r))))

f(r) = range formula

Notes:

a + b = 1 = 100% damage

b is the ammount of damage lost. b = 0.45 = 45% damage lost.

So, if you want the damage lost to be at 25%, b = 0.25. a + b = 1. a + 0.25 = 1. a = 1 - 0.25. Therefore, a = 0.75.

c is the steepness of the curve. c = 1 = totally flat curve at a + b. As c increases, curve becomes more steep (more like a 90 degree angle).
c = 100 seems to be just about right.

Script function definitions:

Power is the formula command for exponents. Power (A, B) means A to the power of B. Squareing something would be Power (A, 2).
Cubing would be Power (A, 3). Another text notation for this would be A^B.

iif is an if - then - else command. iif(A, B, C) = if A is true, do B, otherwise do C.

Min is take the minimum of two values. Min(A, B) = take the minimum of A or B, whichever is lower.

So, iif([%Range%] Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)
(23 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 1.67) - iif([%Range%] > Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)

Simplified formulas:

iif([%Range%] <= Min(90, (([%Level%] - 1) * 10) + 30), (20 + (([%Level%] - 1) * 15)) - (([%Range%] / 10) * 1.67), 0)
iif([%Range%] <= Min(90, (([%Level%] - 1) * 10) + 30), (23 + (([%Level%] - 1) * 15)) - (([%Range%] / 10) * 1.67), 0)

Work:

iif([%Range%] <= Min(100, (([%Level%] - 1) * 10) + 30), (20 + (m)) , 0)

f(m) = (([%Level%] - 1) * 15) * (p)

f(p) = 0.5 + 0.5 * (Power(100, (-1 * (r))))

f(r) = [%Range%] / Min(100, (([%Level%] - 1) * 10) + 30)

Result:

iif([%Range%] <= Min(90, (([%Level%] - 1) * 10) + 30), (20 + (([%Level%] - 1) * 5) * (0.5 + 0.5 * (Power(100, (-1 * ([%Range%] / Min(90, (([%Level%] - 1) * 10) + 30))))))) , 0)
iif([%Range%] <= Min(90, (([%Level%] - 1) * 10) + 30), (23 + (([%Level%] - 1) * 5) * (0.5 + 0.5 * (Power(100, (-1 * ([%Range%] / Min(90, (([%Level%] - 1) * 10) + 30))))))) , 0)

This allows for a more organic and consistant damage dropoff accross all levels, but requires additional testing.

‹ map creation and balance mod GidMod 4.8.0b ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Curve math

Submitted by seeker on Fri, 2007-11-02 23:59.

This is really good, you must like math! Its's good for people to like math

» login or register to post comments
Mod Designer

Re: Curve math

Submitted by Gideon on Sat, 2007-11-03 10:55.

Whoa...back from the dead...

Yeah, I like math. Seem to have a knack for it. Spelling, not so much.

At any rate, I'll have to republish this information in the blogs area, so it can't be buried quite so easily. Thanks for the reminder!

"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • Jraenar_Final.jpg
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • (1.08) Remote mining resources counted twice
  • Modding How to?
  • Eee-concept.jpg

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • Spice up combat: Toss physics injection into the pot.
  • SEV demo crash, creating new ship design
  • Evilhamburger's EvilMod 1.0.0-Main Release
  • Having two versions installed
  • Nichtangriffspakt / Nonaggression treaty
(c) Strategy First, Inc. All rights reserved.