Sequences

The column on the left is the original sequence. The column on the right is a sequence for the differences in-between numbers. How can I find the constant in-between the numbers? Both columns should have the same result.

I know something simple like
2, 4, 6, 8 would be +2.
and that
3, 5, 9, 17, 33, would be *2-1.

However this is beyond me, other than I know it is *2-x and that x seems to double each time as well.

Other urls found in this thread:

en.wikipedia.org/wiki/Integer_(computer_science)
en.wikipedia.org/wiki/Floating_point
twitter.com/AnonBabble

What generated the sequence? Or what is the sequence supposed to be?

what was the original question?

you can always try to fit a polynomial and see what happens

It's the experience points needed to level up in a game. Each entry in the left column is the number of total points needed for the next level. The column on the right in the number of points needed within that level to get to the next.

Just a personal project as I deconstruct the game.

oh i see, it's a recurrence. never mind about the polynomial. it would help to see the original question though

No real original question. This is just data I've complied from various level up screens as I've hacked into the code to allow instant leveling up in order to see how much experience is needed for future levels.

Each next lvl seems to require about 92% more experience than the last one is the only pattern i see so far

Looking at it yes the pattern seems to be 1.92x increaments in exp for next lvl always rounding down (rounding down on perfect whole numbers too it seems).

That's pretty much what I'm looking for. 91.9197% is what I have so far for that first level. I'm trying to get it as accurate as possible as if you round with this sort of equation your result becomes further off further down the sequence.

So far the only other thing I can think to try is for the first example is.

3000*2=6000-5759=241 First example is *2+241.
Then
5759*2=11518-11057=461 so *2+461
etc.

I figured there was a fixed percentage. Could you show how you arrived at 92%? I know it's not exactly 92% and would like to narrow that down.

it might help to make a table of all [math]\frac{x_i}{x_{i-1}}[/math]

if this doesn't work just try normal rounding

The new column is *2-x with x being the cell to the left.

Compute the differences of the differences until you get all 0s, if you do, it's a polynomial.

It's a recurrence.

it seems to be pretty close to 92%, not sure if we need finite differences, but good idea anyway.

Between each term, there's essentially a floor() function, which rounds things down so you'll never get a perfect ratio since there is no infinite sample.

that's not what i meant.

the person who got 1.92 did so by taking 5759/3000, so if you take that for every pair of values, you might get a better idea of what your coefficient is, or if it's even a linear function at all

OP here, I am attempting to find the finite differences. It doesn't appear that is a simple as 92% rounded down to the nearest integer as the second number would be 5760 instead of 5759. While other numbers are exactly the number (not including the decimal), some further in the sequence are not.

Attempting the final number in the sequence gets me:

377082133*1.92=723997695.36 instead of 723999079.xx

Is there a better way the find this than reverse-rounding?

first please do this:

...

meaning for the right column in your first picture, compute 5759/3000, 11057/5759, etc.

sorry, i meant for the right column in your first picture

...

I understand now. I didn't take calculus so I didn't recognize your formula.

so it's 1.92

are those all the samples you have? if you want to calculate it more accurately, only round it after you've calculated up to the level you need. (or do just the opposite, and round it every recurrence, to see whether this is what the game does)

It might be helpful to note that in the game you rank down as you level up. You start at rank 12 and go down until you hit rank 1. You can continue to level up, but you cannot do better then rank 1. I believe that the developers were not expecting for players to go past row 12 in this table.

After row 20 in the table, when you level up to 21 the experience counter raps around to the negative range. Eventually it gets back positive. This is the data from that range, but it doesn't fit with the sequence due to the wrap around.

You can approximate a working function by taking the ratios between the differences and using a bisection method in which you multiply each difference by a fraction of the next one to the current one.

Naturally, just by looking at the problem, you can come up with the iterative function:

f(x+1) = floor( f(x) + ( f(x)-f(x-1) )^( 723999079/377082133 ) )

Where f(0) is 0 and f(1) is 3000.

When I brute-forced a method through a bisection method for the ratios, it yielded the same function but with the exponent being 754974703/393216000, or 1.9199999567667643.

I'd just assume that the exponent is 1.92 but that there are floating points in the background that create noise in the calculation. It's fairly common to use floats in game design, especially when they're used to calculate other things and when the game engine is built to accommodate large projects.

I prefer not to round up to 1.92 as that throws the numbers off a bit more than I would like once we get into the hundred-millions. The only consistent thing is about 1.9199 except in the first where it is about 1.9196 and the last where it is about 1.92. However, the exact multiplier is not a hard percentage for every single level as you can see, there are slight variations in the multiplier per level.

what in the fuck....

so the game de-levels you? i'm not sure what you're saying.

>exponentiating by the fraction instead of just multiplying by it
Eh, close enough.

Disregard the mention of the exponentiation and use multiplication instead.

>I'd just assume that the exponent is 1.92 but that there are floating points in the background that create noise in the calculation.

agreed. this does bring up an interesting question: how would you model noise from floating point inaccuracies? is it gaussian? uniform? i'm sure some engineer can chime in.

No, the games EXP wraps around. The far left column is the total experience needed to level up. I think there is a hard limit once you hit 3 billion EXP. It wraps around to negative something billion. You can continue to gain positive EXP via normal means, however it is VERY unlikely a player will legitimately come close to level 21. If you got 1 million EXP per day, (which is very tough to do) it would take 4 years and 4.5 months playing every single day.

I'm working on editing one of the EXP scripts that give you 250 EXP into a MUCH higher amount in order to see where that wrap around point is. I've already seen that it isn't 2 billion, so my guess is that it is 3 billion and then it wraps around into the negative range. Level 21 requires -1393943319 EXP, once you hit the wrap around point, you will be at an EXP amount that is lower than the required negative EXP amount to level up. It's still all forward progress, other than the wrap around point at (I'm guessing) 3 billion.

they probably exceeded the maximum value for whatever variable type they use to store your total exp.

this is a bug in the game, or rather they did not account for your cheating

I'm not good with explaining floating points, but a computer engineer should be able to using pic related.

The wrap-around limit for your common 32-bit int value is 2^31-1, or about 2.1 billion (2147483647). The last bit is reserved for the number 0, so when it wraps down, it goes to -2147483648.

kind of makes you wonder why they'd use a signed variable for your level.

op if the game is open source just change the variable type and recompile, or let the devs know or whatever

No doubt that it's a bug. The same result would happen if you actually spent long enough to get up to that point. It's not a result of me going into the files. It's somewhat like how with many games from the 80s had a level limit of 255 and when you rolled over into 256 it caused wrap around bugs like this, which in most cases were game breaking.

Very nicely explained. I'll modify the first gain EXP file so that I will hit 249 EXP below 2147483647 and then trigger an event which will get me 250 EXP to confirm.

The game is from the year 2000. Nobody really cares anymore. I'm just messing around. The original point of this was to create an EXP chart for myself and find out how long it would take to max out all of your skills Once you hit level 27 you will have the maximum of 9 in all 9 skills at 3 skill points awarded per level up. I was not expecting to encounter this wrap around bug though. Although, if it wasn't for the wrap around bug it would take 240 years to max out your skill points. The wrap around going into the negative range and then the lower positive million range makes leveling up for levels 25 and 26 take only 1 year each at 1 million EXP per day as opposed to being humanly impossible if it wasn't for the wrap around bug.

i wonder if there's any way to change the variable type after compilation? if you can locate where it is in the binary, you could widen that space, but I don't really know what else you'd need to do so that it behaves properly. i hardly ever program in c, much less edit binary files.

disregard my ramblings, it might not be a static variable

I ended up going with a slightly different method then I was originally going to do. I made it so that I had 2147483647 EXP exactly and then modified a gain EXP script so that I gained 1 EXP. It did exactly as you said and wrapped down to -2147483648. Thank you for that information, it would've taken me much longer to find without your help. I can now use this information to calculate the rest of the sequence in EXP needed for each level from levels 21 to 27. I'll post back with results. Although I'm sure that after level 20 the EXP will not be going with the sequence on the left chart, the EXP needed per level still might match up with the 1.92.

I was just about to respond to said ramblings to if you're talking about .

Are you referring to the 1.92 (1.9199) variable which is slightly off the further down the decimal range you get? Based on the variation I don't think it is a static variable, although it could be and if there are floating points, they very well could be creating noise. I'm not sure what a floating points are exactly, I'll have to look it up later. With floating points interfering, would the EXP amount be match up perfectly on every load of the game? Because when I change the level to get to these EXP amounts, they are always the same for the same level. If I load up the game with setting myself to level 20 or even 21 (or any other level for that matter) the EXP that I have and the EXP needed to level up will always be the same. (If I load the PC at level 20 on five different occasions, the PC will always be at 786950786 EXP.

it looks like your total experience wraps around because the variable can't hold such a large value. if you had the source, this would be as easy as changing the variable type.

what i was wondering is whether it would be possible to change a variable type after compilation by modifying the binary file directly. i don't do much low-level programming, or work on compilers, so this is beyond my knowledge.

weren't you a mechanical engineer? you're not supposed to know things about computers

why do you need to calculate this? what event triggers a level-up?

I'm just starting out as you might've guessed. I've been using a mix of the dev released in-game editor along with some player made external tools for most things. There are a few things I can hardcode in notepad like dialog nodes and I'm just starting to understand action scripting. (Although that requires a tool to decrypt it.)

The point of this thread was so that I could eventually estimate out how long each level would take to level up when using legitimate means. I was originally attempting to find this by figuring out the percentage of increase which was as we found out was roughly a multiplier of 1.92.

I never suspected and figured I would have to brute force the EXP gain script until I stumbled across where the wrap around point was. saved me so much time. Thanks again!

The result of knowing that, granted me the ability to calculate the attached pic. The times given are rounded estimates once you get outside of the day range.

At 1 million EXP per day (difficult to do, but possible with a few hours of constant grinding.) you can make it to level 10 in the first day. level 11 would take 2 days, level 12 would take 3. It roughly doubles from there due to the 1.92 multiplier, until the wrap-around point. The 1.92 multiplier stays in effect when back in the positive range but thanks to the wrap-around limit. It takes less time for those higher levels, as shown. All that's left to do now is come up with the total time in a separate column and this project will be complete.

I'd still be interested on the background of the 1.919 (1.92) multiplier and why there are variations once you get a few decimal places in, if anyone can figure that out.

To answer your first question, see
The event which triggers a level up is surpassing the required EXP amount at which point you will be told by the game what the next EXP amount you need to reach.

The game gives you 3 skill points per level. There are 9 skills in total which max out at 9 skill points. You need to make it to level 27 in order to max out all skills. I was attempting to find out how long that would take. The answer is roughly 27 years and 4.5 months, if the player obtained 1 million EXP per day every day. This is actually possible, but not easy and would require some serious dedication every day, but would still allow time for work and sleep.

>I'd still be interested on the background of the 1.919 (1.92) multiplier and why there are variations once you get a few decimal places in, if anyone can figure that out.

when you multiply something by 1.92 you may get a real number that exceeds the precision limits of your cpu, or cannot be stored in whatever variable that it holds the result. you should read up on this though, both of your issues are related.
en.wikipedia.org/wiki/Integer_(computer_science)
en.wikipedia.org/wiki/Floating_point

As for this 27 years and 4.5 months at 1 million EXP every day, this is much better than my previous estimate of 240 years to go from level 26 to level 27 if it wasn't for the wrap-around bug.

Wow, thanks for the links. I'm not sure if I'm quite to that level of understanding. It seems like enrolling in a calculus class would be a good idea.

it doesn't have much to do with calculus, although knowing more calc is always good.

pick up a book on C and read the first couple of chapters, you'll understand. whoever wrote the game did kind of a sloppy job desu.

Bethesda Softworks

You're welcome, my brother.

To get some quick understanding of the floating point problem, try looking for explanations on YouTube. A quick search gave me this:

www.youtube.com/watch?v=PZRI1IfStY0