The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom armor rating calculation
Author Message
Murmur
Apprentice
*

Posts: 33
Likes Given: 3
Likes Received: 2 in 2 posts
Joined: Feb 2013
Reputation: 0



Post: #1
Custom armor rating calculation
First, I'd like to thank everyone for helping me get to this point. I have wanted to create my own custom combat system for literally 15+ years and it's finally becoming a reality, so thank you very much.

I have successfully created my custom @HitTry and @Hit, and I'm very satisfied with them.

Logically, next is doing my @GetHit for calculating armor.

Since my server would be considered a customized T2A or pre-T2a, all I need to do is calculate how much damage is done in melee and spells in regards to one value, the AR value (or I guess in modern terms, physical AR).

I have my pseudocode completely fleshed out, and I have tested all the calculations on a dynamic spreadsheet. There is only one snag I've hit.

My core calculation in my pseudocode is
Code:
damage * (100 - ARMOR) / 100

I've tried my absolute best to do my homework at each step, and I'm 100% convinced all my code works with this base formula, but of course, there is a snag in the 'Vision'.

With this formula, any AR value greater than or equal to 100 technically negates any value of damage dealt. That's easy to fix by using percentages to guarantee damage at the end of the calculation, but I'm wanting a little more flexibility in my custom armors that I'm planning on making, so I'd like to use AR values up to 200.

I've messed around with this formula for like 4 hours straight on a spreadsheet and never found one that works. Let me paint 2 scenarios:

Scenario 1:
Armor Calculation is currently 'damage * (100 - ARMOR) / 100'.
20damage * (100 - 50AR) / 100
So that would be:
20 * (50) / 100 = 10 damage

Does anyone have any good ideas on how to implement a similar equation, but with 200AR as the 'max'?

Obviously, this doesn't work:
Scenario 2:
Armor Calculation is currently 'damage * (200 - ARMOR) / 100'.
20damage * (200 - 50AR) / 100
So that would be:
20 * (150) / 100 = 30 damage

It was immediately clear to me this is no good. But I tried for 4 hours to find another algorithm that worked and I just don't think I'm creative enough to figure it out. Has anyone else seen/heard/used a good algorithm for my server idea?

I'd appreciate any input, and thanks again for all the help. I really appreciate it.
-Murmur

*you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
05-10-2017 05:00 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Custom armor rating calculation - Murmur - 05-10-2017 05:00 PM

Forum Jump:


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