The new layout is in beta testing and we're inviting you to help us try it out! Click here to read the announcement post for details.

Community Forum

The new layout is in beta testing and we're inviting you to help us try it out! Click here to read the announcement post for details.

Aging Question

Southerngal
Posts: 306
Joined: Sat Nov 03, 2018 7:19 pm
Visit My Farm

Aging Question

Post by Southerngal »

I wasn't sure exactly where to post this, so I figured this was the safest place. I just have a question about aging- Why does after, like 5 years old does the aging time change? It's usually a month, then a half, then a month, but then they go to things like 17 yrs, 3.7 months. What's up with that? If you have an answer, that would be helpful.
BlackOak2
Premium
Premium
Posts: 10573
Joined: Sat Jan 30, 2016 12:41 am
Visit My Farm

Re: Aging Question

Post by BlackOak2 »

Southerngal wrote:I wasn't sure exactly where to post this, so I figured this was the safest place. I just have a question about aging- Why does after, like 5 years old does the aging time change? It's usually a month, then a half, then a month, but then they go to things like 17 yrs, 3.7 months. What's up with that? If you have an answer, that would be helpful.
Any questions about HWO can (and really should) go into the questions forum. Just an FYI.

So awhile ago, we actually had our horse ages listed in the following format:
2 years, 3 months, 2 weeks

There was a time as some of the horses aged that the format would eventually read:
15 years, 7 months, 3 weeks

Then they would climb to:
23 years, 5 months, 5 weeks

Which doesn't exist in the real world. It was a glitch in the aging system, rather a count-up, not an actual glitch at all, just the mathematical formula used. The new format we see today, is the correction. Each turn, it's not an exact number, there are apparently decimals that are also added into it. This is why we have the 3.7... in the older format, you would likely have read it as '3 weeks'.
Don't forget to check it out!
Quick Start Guide For Newbies
Link to additional information.
BlackOak2's Quick-Links
Southerngal
Posts: 306
Joined: Sat Nov 03, 2018 7:19 pm
Visit My Farm

Re: Aging Question

Post by Southerngal »

BlackOak2 wrote:Any questions about HWO can (and really should) go into the questions forum. Just an FYI.

So awhile ago, we actually had our horse ages listed in the following format:
2 years, 3 months, 2 weeks

There was a time as some of the horses aged that the format would eventually read:
15 years, 7 months, 3 weeks

Then they would climb to:
23 years, 5 months, 5 weeks

Which doesn't exist in the real world. It was a glitch in the aging system, rather a count-up, not an actual glitch at all, just the mathematical formula used. The new format we see today, is the correction. Each turn, it's not an exact number, there are apparently decimals that are also added into it. This is why we have the 3.7... in the older format, you would likely have read it as '3 weeks'.
Oh, ok. I wasn't sure if that was just for, like, glitches and stuff. And thatnks for telling me this!
BlackOak2
Premium
Premium
Posts: 10573
Joined: Sat Jan 30, 2016 12:41 am
Visit My Farm

Re: Aging Question

Post by BlackOak2 »

Southerngal wrote:
BlackOak2 wrote:Any questions about HWO can (and really should) go into the questions forum. Just an FYI.

So awhile ago, we actually had our horse ages listed in the following format:
2 years, 3 months, 2 weeks

There was a time as some of the horses aged that the format would eventually read:
15 years, 7 months, 3 weeks

Then they would climb to:
23 years, 5 months, 5 weeks

Which doesn't exist in the real world. It was a glitch in the aging system, rather a count-up, not an actual glitch at all, just the mathematical formula used. The new format we see today, is the correction. Each turn, it's not an exact number, there are apparently decimals that are also added into it. This is why we have the 3.7... in the older format, you would likely have read it as '3 weeks'.
Oh, ok. I wasn't sure if that was just for, like, glitches and stuff. And thatnks for telling me this!
To understand, first the question must be asked! :D

Don't worry about asking questions, if you don't understand, then please do. We'll work it out if we can (the HWO community).
Don't forget to check it out!
Quick Start Guide For Newbies
Link to additional information.
BlackOak2's Quick-Links
Raikit
Posts: 431
Joined: Wed Dec 23, 2015 2:49 am
Visit My Farm

Re: Aging Question

Post by Raikit »

BlackOak2 wrote:
Southerngal wrote:
Just some fun trivia for you guys - this is actually a computational issue. You would think that as you add .5 to itself again and again forever you'll always end up with a multiple of .5. Unfortunately in computers it doesn't work that way. Because of how the numbers are stored in memory there's always some sort of trailing bit - so every .5 you see is actually more like .500000000...(a bunch more zeroes)...000001. During the course of everyday life this doesn't cause much if any issue - most of the time when you add .5 it'll still look like you've only added .5. But eventually, when you add .5 to itself enough times, that last 01 makes itself known and so it looks like you added .6. It just so happens that whatever way HWO stores its horse ages, the extra 01 ends up showing up about once every five years - or about every 120 turns.

A cool way to test this is to use an excel spreadsheet. You can have a column where each row takes the previous column and adds something to it. Eventually you'll get a number different than you would expect.

Also, this wouldn't happen if every time the horse aged we added raw numbers together. Right now what happens is that the horse's age is stored in a database. Every time the horse ages its age is retrieved from the database, incremented, and then stored back in the database including all of the trailing stuff that may get added during the calculation. If, instead of that, we simply added .5 to 60 (the number of months in five years) we wouldn't have to worry about the trailing decimals brought around by the saved number.

Unfortunately there's no easy way to do that. The "simplest" solution I can personally think of off the top of my head would be to store the horse's age as a string rather than a decimal. So each horse's stored age would show "X years, Y months" - then, based on that string, you would calculate how many months the horse had been alive and then add .5 to it for aging. This way you would generate a new number each time to be added to rather than keeping any trailing decimals added by previous computation. However, doing this requires a lot more processing time than simply retrieving a number and incrementing it.

Sorry for the long post. I do these sort of things for a living. :lol:
Southerngal
Posts: 306
Joined: Sat Nov 03, 2018 7:19 pm
Visit My Farm

Re: Aging Question

Post by Southerngal »

Raikit wrote:...
Lol, that's pretty interesting! Not sure I understood half of it tho... :lol:
BlackOak2
Premium
Premium
Posts: 10573
Joined: Sat Jan 30, 2016 12:41 am
Visit My Farm

Re: Aging Question

Post by BlackOak2 »

Raikit wrote:
BlackOak2 wrote:
:lol:
Indeed! I agree with Southerngal, it is interesting!
And everything I didn't want to say. Also... couldn't exactly remember. :|

Thank you for the in-depth. :D
Don't forget to check it out!
Quick Start Guide For Newbies
Link to additional information.
BlackOak2's Quick-Links
Become a Patron!
Last visit was: Wed Apr 24, 2024 10:23 am

It is currently Wed Apr 24, 2024 10:23 am