Thread: Sorting out the maths in some game code.

1. Sorting out the maths in some game code.

I completely edit my last post in this should be more simple to understand and maybe figure out. I found out that "x" decreases as "a" increase. But the "x" value in both equations should equal each other.

ax = b

65x = 134
77x = 157

2. Originally Posted by JonnyMe
I completely edit my last post in this should be more simple to understand and maybe figure out. I found out that "x" decreases as "a" increase. But the "x" value in both equations should equal each other.

ax = b

65x = 134
77x = 157
What you have posted is meaningless. If you hope to get help, post the whole question.

3. Originally Posted by mr fantastic
What you have posted is meaningless. If you hope to get help, post the whole question.
Don't call someone else work meaning less, if it is unsolvable then say so.

I read your rules nothing about post bumping.

x needs to equal something, this is not homework a problem this is part of a game code that I would like to figure out. I would have figured it out myself but I am not exactly fresh on my freshman algebra or whatever this falls under.

65 = 134
77 = 157

65 x (something) = 134
77 x (something = 157
A x (something) = C

4. Originally Posted by JonnyMe
Don't call someone else work meaning less, if it is unsolvable then say so. Mr F says: It is in your own interests, not mine, that you make what you post meaningful. Otherwise, you will simply find that no-one bothers to reply and you will be left wondering why.

I read your rules nothing about post bumping. Mr F says: Rule #10. Read it.

x needs to equal something, this is not homework a problem this is part of a game code that I would like to figure out. I would have figured it out myself but I am not exactly fresh on my freshman algebra or whatever this falls under.

65 = 134
77 = 157

65 x (something) = 134 Mr F says: (something) = 134/65.
77 x (something = 157 Mr F says: (something) = 157/77.
A x (something) = C Mr F says: (something) = C/A.
..

5. Originally Posted by mr fantastic
..
" 10) Do not beg for answers. If your question is unanswered do not make a post begging for someone to reply back, it is totally useless. Other members can see the question."
Very very vague interpretation of bumping.

No one bothers to reply because no one knows the answer you got is wrong also.

It has to be solvable its part of the game's code so there must be very complex.

Here is it is to the simplest level I can put it:

A x B = C
D x B = E

B = B

A = 65
B = unknowable
C = 134
D = 77
E = 157

6. Originally Posted by JonnyMe
" 10) Do not beg for answers. If your question is unanswered do not make a post begging for someone to reply back, it is totally useless. Other members can see the question."
Very very vague interpretation of bumping.

No one bothers to reply because no one knows the answer you got is wrong also.

It has to be solvable its part of the game's code so there must be very complex.

Here is it is to the simplest level I can put it:

A x B = C
D x B = E

B = B

A = 65
B = unknowable
C = 134
D = 77
E = 157
mr fantastic is giving you valid feedback, and your questions really don't make sense.

If what you say is true, then

$\frac{134}{65} = \frac{157}{77}$

which we know is not true, so you're looking for a B that does not exist.

There must be something wrong with the way you're coding the game, or the way you are conceptualizing.

7. Originally Posted by undefined
mr fantastic is giving you valid feedback, and your questions really don't make sense.

If what you say is true, then

$\frac{134}{65} = \frac{157}{77}$

which we know is not true, so you're looking for a B that does not exist.

There must be something wrong with the way you're coding the game, or the way you are conceptualizing.
mr fantastic's math is correct but does not work with the equation, the game is completed already and been working its not mine, I really got to show you guys what I am trying to get out of this.

8. Originally Posted by JonnyMe
mr fantastic's math is correct but does not work with the equation, the game is completed already and been working its not mine, I really got to show you guys what I am trying to get out of this.
Care to share any lines of code? I can read most languages... I assume it's not assembler.

9. Originally Posted by undefined
Care to share any lines of code? I can read most languages... I assume it's not assembler.
Great I can't find my 77-77 carbine. So I got to do different numbers now.

Here is where its from and I don't have access to the game's code, but as far as I know this feature in it is working correctly.

Uploaded with ImageShack.us

So shooting with a 65-65 carbine (damage will always be the same since the damage range on the carbine is the same number) your spray shot will always do 134 damage no mater what. Same thing with the 153 carbine.

So now.

A x B = C
D x B = E

B = B

A = 65
B = unknowable
C = 134
D = 153
E = 313

10. Originally Posted by JonnyMe
Great I can't find my 77-77 carbine. So I got to do different numbers now.

Here is where its from and I don't have access to the game's code, but as far as I know this feature in it is working correctly.

Uploaded with ImageShack.us

So shooting with a 65-65 carbine (damage will always be the same since the damage range on the carbine is the same number) your spray shot will always do 134 damage no mater what. Same thing with the 153 carbine.

So now.

A x B = C
D x B = E

B = B

A = 65
B = unknowable
C = 134
D = 153
E = 313
Okay this is what I gather.

You have a function f(x) that maps the carbine number (whatever it's called) to the damage it does.

So f(65) = 134
f(77) = 157
f(153) = 313

You are looking for an expression for f(x) that allows you to calculate damage given arbitrary carbine number x.

This is a problem of curve fitting. The more data points you have, the better.

As we already discussed, f(x) cannot be of the form f(x) = kx for some constant real k.

A quick inspection also reveals that f(x) cannot be linear, of the form f(x) = ax + b.

We can find a quadratic polynomial to fit the data, but it would be better if you could provide more data points. That way, if we fit three points using a quadratic curve and any additional points happen to be on the curve, we will have some confidence we found the right curve.

So far these are the data points.

(65, 134)
(77, 157)
(153, 313)

We don't even know if the program uses a polynomial f(x). For all we know, it could based on an arbitrary table of values. But curve fitting seems to be the best solution for what you want, unless you can get access to the game's source code.

11. Originally Posted by undefined
Okay this is what I gather.

You have a function f(x) that maps the carbine number (whatever it's called) to the damage it does.

So f(65) = 134
f(77) = 157
f(153) = 313

You are looking for an expression for f(x) that allows you to calculate damage given arbitrary carbine number x.

This is a problem of curve fitting. The more data points you have, the better.

As we already discussed, f(x) cannot be of the form f(x) = kx for some constant real k.

A quick inspection also reveals that f(x) cannot be linear, of the form f(x) = ax + b.

We can find a quadratic polynomial to fit the data, but it would be better if you could provide more data points. That way, if we fit three points using a quadratic curve and any additional points happen to be on the curve, we will have some confidence we found the right curve.

So far these are the data points.

(65, 134)
(77, 157)
(153, 313)

We don't even know if the program uses a polynomial f(x). For all we know, it could based on an arbitrary table of values. But curve fitting seems to be the best solution for what you want, unless you can get access to the game's source code.
Appreciate the help but finding a weapon (carbine) with the min=max damage is very very hard and a rare thing, I was only able to get a hold of 3 if more appear I can add them in to, but you gave me a start to work on this myself, from what I see the higher the damage carbine the less the damage multiplier spray shot is doing, so the multiplier of spray shot is a formula based on how much damage the carbine has.