Defense Calculation (technical question)

This is the place where you can chat about anything related to OriginsRO and Ragnarok Online. This is NOT for technical support or requests to GMs.
Forum rules
This section is NOT meant for technical support or GM assistance requests and may be not monitored by GMs everyday. The appropriate places for that kind of requests are the Technical Support forum and the Questions and Support tracker.

Re: Defense Calculation (technical question)

Postby Mathy » April 24th, 2018, 12:23 am

The value per refinement point is 66, and then we add a constant 50, and divide by 100.

This means
Code: Select all
(refinement_level * 66 + 50) / 100

This is effectively performing 5/4 (aka nearest) rounding.

This means what it says.
Image
User avatar
Mathy
Developer
Developer
Metaling
Metaling
 
Posts: 679
Joined: July 30th, 2013, 10:37 pm
Location: SP - Brazil
Gender: Male
GitLab User ID: @Mathy
Discord Username: Mathy#4278
IRC nickname: Mathy

Re: Defense Calculation (technical question)

Postby Akazu » April 24th, 2018, 1:37 am

Mathy wrote:
The value per refinement point is 66, and then we add a constant 50, and divide by 100.

This means
Code: Select all
(refinement_level * 66 + 50) / 100

This is effectively performing 5/4 (aka nearest) rounding.

This means what it says.


Hello Mathy,

Thank you for your contribution,

I have tested this and concluded that the game uses this:
Which is your statement but it does have a Floor/Round Down to Whole numbers.
FLOOR((refinement_level * 66 + 50) / 100)

I have tested this on OriginsRO upgrading a lot

Thank you for helping me get the right information.

In the end I and Jake was wrong, but we both achieve correct knowledge as a result.
User avatar
Akazu
Player
Player
Drops
Drops
 
Posts: 11
Joined: March 11th, 2018, 12:16 am
Gender: Not Telling

Re: Defense Calculation (technical question)

Postby Mathy » April 24th, 2018, 3:01 am

Akazu wrote:
Mathy wrote:
The value per refinement point is 66, and then we add a constant 50, and divide by 100.

This means
Code: Select all
(refinement_level * 66 + 50) / 100

This is effectively performing 5/4 (aka nearest) rounding.

This means what it says.


Hello Mathy,

Thank you for your contribution,

I have tested this and concluded that the game uses this:
Which is your statement but it does have a Floor/Round Down to Whole numbers.
FLOOR((refinement_level * 66 + 50) / 100)

I have tested this on OriginsRO upgrading a lot

Thank you for helping me get the right information.

In the end I and Jake was wrong, but we both achieve correct knowledge as a result.

Yeah, these variables are all integers, so we ignore all the decimal digits. RO does this almost everywhere. You rarely ever see a float.
Just lookup how divisions happen in the C language and you'll understand.
I wouldn't call it floor because of what happens if you have a negative number.
Image
User avatar
Mathy
Developer
Developer
Metaling
Metaling
 
Posts: 679
Joined: July 30th, 2013, 10:37 pm
Location: SP - Brazil
Gender: Male
GitLab User ID: @Mathy
Discord Username: Mathy#4278
IRC nickname: Mathy

Re: Defense Calculation (technical question)

Postby Akazu » April 24th, 2018, 3:39 am

Ahh thank you again

I'm just glad someone was able to share data to prove another data wrong.
User avatar
Akazu
Player
Player
Drops
Drops
 
Posts: 11
Joined: March 11th, 2018, 12:16 am
Gender: Not Telling

Re: Defense Calculation (technical question)

Postby Jake » April 24th, 2018, 5:01 pm

Thank you all.
User avatar
Jake
Player
Player
Poporing
Poporing
 
Posts: 70
Joined: August 29th, 2014, 11:07 pm
Gender: Male

Re: Defense Calculation (technical question)

Postby Perq » April 25th, 2018, 7:29 am

I gotta admit that I'm confus a lil bit. :V I always thought that you get 2 defense per 3 refine rate. I don't quite understand how does the (66*x+50)/100 works D:

Would this mean that if you have only one item with one refine rate on it, you will get +1 def from it?
Attachments
refine.gif
refine.gif (8.37 KiB) Viewed 126 times
User avatar
Perq
Player
Player
Drops
Drops
 
Posts: 9
Joined: February 17th, 2018, 8:06 pm
Gender: Male
Discord Username: Perq

Re: Defense Calculation (technical question)

Postby Akazu » April 25th, 2018, 8:46 am

Perq wrote:I gotta admit that I'm confus a lil bit. :V I always thought that you get 2 defense per 3 refine rate. I don't quite understand how does the (66*x+50)/100 works D:

Would this mean that if you have only one item with one refine rate on it, you will get +1 def from it?


Just note that the game will round down 9.99 is 9

Correct I've tested all the upgrade variables up to 0-36 out of 50

Mathy Math Formula matches what he stated.

Im surprised of seeing that formula, as if no one shares it and knows about it.
User avatar
Akazu
Player
Player
Drops
Drops
 
Posts: 11
Joined: March 11th, 2018, 12:16 am
Gender: Not Telling

Re: Defense Calculation (technical question)

Postby Mathy » April 25th, 2018, 12:45 pm

Perq wrote:I gotta admit that I'm confus a lil bit. :V I always thought that you get 2 defense per 3 refine rate. I don't quite understand how does the (66*x+50)/100 works D:

Would this mean that if you have only one item with one refine rate on it, you will get +1 def from it?

If refine_rate is 1, as in your example, then you get:
def = (66 * 1 + 50) / 100
def = 116 / 100
def = 1
Image
User avatar
Mathy
Developer
Developer
Metaling
Metaling
 
Posts: 679
Joined: July 30th, 2013, 10:37 pm
Location: SP - Brazil
Gender: Male
GitLab User ID: @Mathy
Discord Username: Mathy#4278
IRC nickname: Mathy

Previous

Return to General Chat



Who is online

Users browsing this forum: Rooster and 3 guests

cron