Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Major update on combat engine (damage/armor calculations)
Author Message
Coruja
Sphere Developer
*****

Posts: 815
Likes Given: 4
Likes Received: 190 in 156 posts
Joined: Jul 2012
Reputation: 6

Dimension Shard

Post: #1
Major update on combat engine (damage/armor calculations)
As promised, I'm bringing good news to everyone Smile
With some users feedback, I made a huge optimization on sphere internal damage/armor calculations. This means: the code is now lightweight, faster, and support some new features.

If someone want use new features, just enable it and they will be ready to use.
And if someone want keep using old calculations, they still avaible and fully working too.

Changes:
  • COMBAT_SPECIALDAMAGE and COMBAT_USE_RESISTANCE settings on sphere.ini are now a single COMBAT_ELEMENTAL_ENGINE which does the same thing (but now unified)
  • COMBAT_ELEMENTAL_ENGINE now totally overrides old AR calculations with new AOS damage/resist types instead use both at the same time. If you want the new AOS engine just enable this, otherwise keep it disabled to use the old pre-AOS engine (AR)
  • The old AR was doing a wrong calculation for years and now it's fixed (calculation details explained below)
  • Char damage is now calculated using correct formulas. If unarmed (wrestling) the base damage will be the char DAM (default is 1-4 for all players, but it can be customizable, just make sure that your c_man/c_woman/c_elf_male/etc chardefs has proper DAM set), and using weapons the base damage will be the weapon damage. This base damage can be increased with some bonuses (if COMBAT_OSIDAMAGEMOD it will use OSI bonus calculation, otherwise it will use sphere default bonus [STR/10]).
  • On AOS+ clients, the char status menu now will show exactly the damage range that the char can deal (including all bonuses)
  • New blood effects

Removed features (as discussed here):
  • COMBAT_TARGETTEDHIT setting on sphere.ini. Previously it was used to set a hit prefference and make the char hit this body location. The internal code got removed to make the general code more lightweight, and if someone still using this feature, it can be softcoded on scripts without problems.
  • All "hit location" messages on sphere_msgs.scp. They are just tons of random messages without any real functionality.
  • Old [Physical/Fire/Cold/Poison/Energy]Damage properties got removed and replaced with the new DAM[Physical/Fire/Cold/Poison/Energy], which is compatible with COMBAT_ELEMENTAL_ENGINE and works using correct calculations.

These changes will be live on next nightly (30/01/15), I recommend everyone make some tests before use it on live servers, and also update your sphere.ini (CombatFlags list) and sphere_msgs.scp (just remove all combat_hit_* messages)

Feel free to test it and make any suggestion

More info about elemental engine (AOS) x old AR engine (pre-AOS):
(This post was last modified: 01-30-2015 02:51 PM by Coruja.)
01-29-2015 11:55 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 4 users Like Coruja's post
Jim
Apprentice
*

Posts: 28
Likes Given: 0
Likes Received: 12 in 4 posts
Joined: Jan 2015
Reputation: 0



Post: #2
RE: Major update on combat engine (damage/armor calculations)
Great!
Thanks Coruja! :_)
01-29-2015 01:47 PM
Find all posts by this user Like Post Quote this message in a reply
dagger4k
Journeyman
*

Posts: 194
Likes Given: 1
Likes Received: 12 in 12 posts
Joined: Mar 2012
Reputation: 0



Post: #3
RE: Major update on combat engine (damage/armor calculations)
good work Coruja
01-29-2015 06:58 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 855
Likes Given: 102
Likes Received: 161 in 121 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Major update on combat engine (damage/armor calculations)
Good work, I have to request you to update sphere_combat.scp to keep reflected there the current base formulas and damages so anyone can have access to everything and make use of an updated and fast rework of the hardcoded engine.

Also for me and Ben to keep the removed code in somewhere (targetted code is now in the current sphere_combat.scp) but if it's going to be removed it's not a big deal for us to give out one script with the code instead of making people to try formulas and code they possibly cannot figure out.

And, again, nice work Big Grin
01-29-2015 07:53 PM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #5
RE: Major update on combat engine (damage/armor calculations)
This is amazing. Thanks!

[Image: 2hy9q0y.png]
02-10-2015 05:22 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Sharlenwar
Journeyman
*

Posts: 52
Likes Given: 0
Likes Received: 3 in 3 posts
Joined: May 2012
Reputation: 0



Post: #6
RE: Major update on combat engine (damage/armor calculations)
Hey Coruja! Thanks for the amazing update!

*Yes, I still watch these every so often*
03-04-2015 05:42 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Sharlenwar's post
DerParagorn
Apprentice
*

Posts: 3
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2015
Reputation: 0



Post: #7
RE: Major update on combat engine (damage/armor calculations)
Hallo i'am a new and i want to make my first shard.
The New blood effects is this the blood spam on a combat? Can i disable this?
03-05-2015 08:15 AM
Find all posts by this user Like Post Quote this message in a reply
advikahluwalia
Apprentice
*

Posts: 1
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: May 2015
Reputation: 0



Post: #8
RE: Major update on combat engine (damage/armor calculations)
Excellent.. Nice Work You Had Done Coruja :-)

packers and movers faridabad
packers and movers ghaziabad
packers and movers noida

packers and movers Noida
05-11-2015 07:36 PM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #9
RE: Major update on combat engine (damage/armor calculations)
(01-29-2015 11:55 AM)Coruja Wrote:  AR resist calculation:
It's the old pre-AOS combat engine. It uses only 1 damage type and 1 resist (AR).

Sphere always used a wrong AR formula, where the AR is always a random value between 0~AR (example: if you have 50 AR, you will resist a random 0~50 damage).
Now the AR calculation is fixed and it uses the correct AR formula:

max resist = AR * rand(7, 35) / 100
min resist = max / 2

total resist = rand( min, (max-min)+1 )
final damage = total damage - total resist

There is something weird about this formula.
For example:
Code:
DAMAGE=50
ARMOR=50
Max resist = 50 * 15 / 10 == 7,5
Min Resist = 7,5 /2 == 4
Total resist = Random between (4, (7,5-4)+1) //(this last formula will be min +1 everytime!
Total resist = Random between (4,4)
final damage = 50-4

The unique "RANDOM" PART OF THE CODE will be the 7,35
is this right?

[Image: 2hy9q0y.png]
09-10-2015 11:01 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.