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

Connexion utilisateur

  • Créer un nouveau compte
  • Demander un nouveau mot de passe

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • agrégateur de nouvelles

Rechercher

Qui est en ligne

Il y a actuellement 2 utilisateurs et 160 invités en ligne.

Utilisateurs en ligne

  • Randallw
  • crazydog

Languages

  • English English
  • French French

Parcourir les archives

« Octobre 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 31    
Accueil » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Linear Math...

Soumis par Gideon le Mar, 2006-12-19 12:48 SE:V MODs

I am going to attempt to post two examples of the math I have used in my personal mod to do weapon damage with. If this posts successfully (it errored out last time) feel free to use this information however you want.

WARNING: What follows is math. If math angers/frustrates you, then this will probably piss you off.

This is the math for a weapon to reduce damage according to linear dropoff.

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) = 1 - (a * r)

f(r) = range formula

Notes:

a is the ammount of damage lost. a = 0.4 = 40% damage damage lost.

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) = 1 - (0.5 * (r))

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

Result:

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

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

‹ Using Troops to defend against boarding actions Modelling ships.... ›
» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.
Mod Designer

linear pt 1

Soumis par Gideon le Mar, 2006-12-19 12:57

deleted

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Ahhh...to heck

Soumis par Gideon le Mar, 2006-12-19 12:57

deleted

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Image de Rilbur

Problems

Soumis par Rilbur le Mar, 2006-12-19 13:06

You may be having issues with the < and > signs. Either use "escape HTML" format under Input Format, or replace all such symbols with &l t; and &g t; (remove the spaces to make them format correctly into < and >)
_______________________
There are 10 types of people in the world:

Those that understand binary, and those that don't.

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Got it working

Soumis par Gideon le Mar, 2006-12-19 13:09

I got it working. I can make the post, and then edit the subject. When editing the subject, I can put in the text I want and it seems to take it.

The whole text is too long to post at one go, even using the break command, so I had to split it up between two subjects. This one covers linear decay, the other one covers an exponential decay curve.

» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Perhaps this would be better

Soumis par Mylon le Mer, 2007-01-17 23:24

Perhaps this would be better illustrated with a few graphs. Mind explaining what this formula does in simpler terms? It's difficult to make out what the formula does, given all of the parenthesis.

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

breakdown

Soumis par Phoenix-D le Jeu, 2007-01-18 01:02
Note before anyone uses ANY of this: SE5 math can be VERY ODD. Test your formulas! 100 - 5 + 5 + 100 does NOT equal 0 in SE5 terms, for example. iif([%Range%] <= Min(100, (([%Level%] - 1) * 10) + 30), (20 + ((([%Level%] - 1) * 15) * (1 - (0.5 * ([%Range%] / Min(100, (([%Level%] - 1) * 10) + 30)))))) , 0) The If statement just means the range is set 100 or 30 + ten per level, whichever is lower. 20 + ((([%Level%] - 1) * 15) * (1 - (0.5 * ([%Range%] / Min(100, (([%Level%] - 1) * 10) + 30))))) That's what's left. Base damage is 20. That's modified twice. First by the weapon's tech level. ([%Level%] - 1) * 15 means it gains 15 damage per level. That's multiplied by the range modifier. 1-(0.5 * ([%Range%] / Min(100, (([%Level%] - 1) * 10) + 30) Ok. What this says is as the range increases, damage drops. AND the better your tech level, the less it drops. At level 1, your damage is cut in half once you get past range 30. At level 2, that its cuts cut in half past 40, at level 3 50, etc until you reach 100. No matter your tech level, your damage will be cut in half at range 100. It isn't a sharp cut off; the formula gradually decreases the damage with range. That's just the easy spot to explain how the formula runs. So at level 1 and range 30 it works out like so: 20 base damage. Range modified works out to: 1-(0.5 * ([30] / Min(100, (([1] - 1) * 10) + 30) or 1-(0.5*([30]/30) = 0.5 20 * 0.5 = 10. So the weapon has 20 damage at Range 0, decreasing smoothly until Range 30, where it has 10 damage. Note: this is a ridiculously short range. Most ships in stock SEV are almost 20 units WIDE..
» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Math Error?

Soumis par Riptokus le Jeu, 2007-01-18 01:27

Phoenix-D wrote:
Note before anyone uses ANY of this: SE5 math can be VERY ODD. Test your formulas! 100 - 5 + 5 + 100 does NOT equal 0 in SE5 terms, for example.

You meant -100 - 5 + 5 + 100, Right? If not, then that's probably your error. You start at 100, Subtract 5 for 95, plus 5 for 100 again, then add another 100 and it defenatly doesn't equal zero Eye-wink

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Yeah

Soumis par Phoenix-D le Jeu, 2007-01-18 22:59

Yep. Typo. Smiling

» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.

Now on STEAM

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

Contenu populaire

Aujourd'hui :

  • Star Wars SEV ship set available
  • No Point Defence in Technology in Balance mod
  • New Engine System
  • Research By Percentage SUCKS
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List

Depuis toujours :

  • 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

Dernier accès :

  • A new way to texture your shipsets!
  • SE5_20060929-58.jpg
  • Removing engine limit on hulls - Ramifications?
  • Possible Space Yard Rate Modifier Bug
  • ? on effect with 2 scopes
(c) Strategy First, Inc. All rights reserved.