Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Re: Help Me ! » Grand Theft Auto: Maths Edition?? » 2006-03-21 08:29:03

George, Y wrote:

<snip>

for simple linear air resistance

v'= k/v -p - av ( backward acceleration due to air)

Who can solve that? big_smile

<snip>

Perhaps we can use a software to solve it, i think you are good at it, sam tongue

Um, well I might be good at Excel, but I'm not quite sure how to apply this formula to the data that I have... any suggestions?

[Edited so I'm not credited. big_smile]

#2 Re: Help Me ! » Grand Theft Auto: Maths Edition?? » 2006-03-20 12:49:03

mathsyperson wrote:

Well, from my mechanics course, I know that power = force x velocity.

So that means that if an engine has a constant power then it has less driving force as its speed increases.

If we factor in the resistive forces or air resistance, friction, etc., then there will eventually be a point where even at full power, the resultant force only manages to break even and so that would be the car's maximum speed.

<snip>

See my other notes above.  With no 0 values for Inertia & Drag there doesn't seem to be any top speed.  I got a car to 1000km/hr last night before I ran out of road (& that was a short bit!)  It was so funny because I then hit something and launched the car half way across the map (and if you know San Andreas, the map is LARGE!). roflol

#3 Re: Help Me ! » Grand Theft Auto: Maths Edition?? » 2006-03-20 12:40:47

MathsIsFun wrote:

I managed to get a good fit with the 200km/hr figure using (160/EA)[sup]0.9[/sup] but it doesn't work well for 400 km/hr.

I think we may need a formula that includes air friction and possibly some limiting factor to do with engines (ie the engine does not have unlimited RPM), so as the speed increases the acceleratioin decreases.

Anyone?

Well, I will tell you a little more about the game engine and the other parameters that I can adjust.

Basically there are 4 parameters which you can adjust in the game engine per car:

Weight
Engine Acceleration (Which is apparently in meters/sec^2 btw)
Inertia
Drag

Each of these can be adjusted independently and the game engine allows you to have 0 Drag and 0 Inertia (I have used 0 settings for Drag and Inertia to get cleaner results for EA).  Weight has no bearing on acceleration.

So we don't really have a real-world situation here.  It's a virtual world with it's own physics rules smile

I was expecting EA to be completely linear as you can use Drag and Inertia to modify the acceleration curve, however it obviously isn't, hence my issue neutral

I realised last night that I probably need to do more tests using the same EA and record times to different speeds, not just 2 (200 & 400) like doing 25/50km/hr steps, as looking at the graphs I have now, it seems that there is also a curve when using the same EA to accelerate to different speeds.

So, I'm not sure if that helps the situation or not, but hey tongue

#4 Re: Help Me ! » Grand Theft Auto: Maths Edition?? » 2006-03-20 12:15:44

George,Y wrote:

v= k log(1+t)  <v velocity t time elapsed> , ideally.

Thanks for your reply.

Could you please explain this formula a little more?  Is 'k' the Engine Acceleration (EA)?  Also how can I calculate the log value? (sorry, I'm not used to these kinds of maths functions)

Another thing, I want to be able to calculate the time it takes to get to a given speed based on the EA.  Will your formula allow me to do this?  If so, how can I re-arrange it so that it does?

Thanks,

Sam.

#5 Help Me ! » Grand Theft Auto: Maths Edition?? » 2006-03-19 16:15:27

sam.f
Replies: 11

Hi,

I have a problem I am keen to get some advice on.

Basically I'm tweaking the handling parameters for some cars in a computer game (Grand Theft Auto: San Andreas) in an attempt to make them as true to real life as possible.   (See, maths IS fun!!) smile

I've got some 'real world' data based on my manual tests of different settings and their affect on the vehicles in the game, and I'm trying to derive a formula to help me calculate the expected results rather than manually testing every possible setting (of which there are thousands) hmm

The sample data I have collected is listed below.  Note that 'EA' is the game parameter that I am working with at the moment.  It stands for Engine Acceleration and the higher the setting, the higher the car's acceleration rate is.  I have done slightly more tests to 200km/hr than to 400, because it's hard to find enough straight road in the game world to get to 400 with an EA less than 30.  I might be able to do it if anyone needs the figures, but it's a hard ask smile

EA    Seconds to 200km/hr
10    12.5
20    6.25
30    4.25
40    3.50
50    2.75
60    2.50
70    2.25
80    2.00
90    2.00
100    2.00
   
EA    Seconds to 400km/hr
30    14.00
40    10.75
50    8.50
60    7.50
70    6.50
80    6.00
90    5.50
100    5.25

Unfortunately, the only method of timing that I have at my disposal is a manual stopwatch, which isn't very accurate, but I've generally done a number of runs and compensated for my reaction times etc.  In any case, the times I list below need to be viewed with a certain amount of flexibility and I would say that you could adjust them by at least 0.25 seconds either way if you see that they would fit a pattern / formula by doing so.

I have spent a number of days using Excel to work with these numbers and while I have been sucessful in determining a pattern and deriving formulas for other game parameters, I have been unable to do so with EA.  The best I've been able to do so far is to graph the numbers, the result being that and they show up as a relatively smooth, non-linear curve.  This confirms in my mind that there must be some pattern or formula somewhere in the bowels of the game engine, however working with the numbers, I can't determine what this could be.  I have tried variations on simple ratios, differences and combinations of, but when it comes down to it, I don't really have any idea on how to approach this problem hmm

I can use the graph to (approximately) predict an outcome, for example, looking at the results on the 400km/hr graph and using them to estimate what the time would be for an EA of 55 showed up as 8 seconds on the graph, and was confirmed as being accurate after in game testing.

If anyone can give me some idea of how best to approach this problem I would be MOST appreciative!  And of course if you just happen to be a GTA:SA player, then you are more than welcome to a copy of my realistic car setups once they are completed smile

And in case you're wondering, yes, I MUST be a nerd as I seem to spend more time working on a spreadsheet with game data than I do actually playing the game (at least for the moment anyway) big_smile


Teach me oh wizened ones! tongue

Thanks in advance,


Sam.

Board footer

Powered by FluxBB