realbasic-games
[Top] [All Lists]

Re: Fuel Consumption Algorithm

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Fuel Consumption Algorithm
From: Robert Steely <robsteely at nc dot rr dot com>
Date: Sat, 23 Oct 2004 22:33:46 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <093E822C-2509-11D9-AF54-0003934A9366 at nc dot rr dot com> <BC833D86-250A-11D9-8C85-00039369B326 at kellerfarm dot com>

On Oct 23, 2004, at 11:46 AM, Andrew Keller wrote:

So, what you're looking for is a way to calculate fuel used based on speed, and you want fuel used to skyrocket in a high range of speed. A very simple way of doing this is to use the function, y=x^2, where the y axis is fuel used and the x axis is speed. This function creates a parabola, which opens upward, and as the x values go up the y values go up faster and faster.

You can also modify the equation with coefficients to make it more or less potent. For this I would suggest using y=a*x^2 (don't forget the order of operations), and make "a" a property or constant. Making "a" bigger will cause the graph to reach higher faster, and making "a" smaller would cause the graph to do the opposite. You could pull out a graphing calculator and start playing with other graphs, if you want.

Thanks to everyone who responded.

 y = x^2 * coefficient

is the approach I'm going with. Seems to work well so far. My game is a PT boat simulation that focuses more on combat than precise physics so I'm not too concerned with calculating friction, drag, mass, etc. Besides, there's so little data available for WWII-era PT boats that I'm having to make up most of it anyway.

Thanks again,

Bob

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>