News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Miles per hour

Started by jamespetts, December 16, 2008, 12:52:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sarrus

I played many games, which has only the imperial metrics. For example, the speed was displayed as mph and I didn't know exactly how fast I drive. I'm used to this, and I still like these games.

Casteele

Personally, I do not think converting to "MPH" alone is such a good idea.. What I think would be a good idea is to simply internationalize the UI the same way it's done for languages. Internally, the game/code/cpu/whatever does not care if 1+1 is in miles or kilometres or martian zilwiks. All the game codes cares about is that 1+1 equals 2, whatever the type of units.

In truth, when I write software that I know is bound for an international market, I follow a few simple rules:

1) All input is converted into "standard units". That is, regardless of the input units, be it imperial or metric, I convert it on input into whatever unit makes the _code_ easier to write and maintain. For example, in financial software, I convert dollars, pounds, yen, etc., into FU's ("financial units"), which are roughly USD$1.00 to 10000000FU (which is large enough that converting back to almost any other world currency won't cause significant rounding errors.)

2) All internal calculations are done in the internal standard units. There are few, if any, conversions done in calculations, IF the internal/standard units are well chosen. Using FU's for example, since FU's are accurate to several decimal places no matter which currency is used for input or output, I generally do not have to worry about any conversions, rounding errors, etc. (For a game like this, though, scaling things like the maps may be a good idea. However, that really is not a "conversion" so much as a "scaling factor", which is not much different to calculate for drawing than it is to calculate the zoom level.)

3) All output is sent to functions which convert the internal standard units into whatever units are specified by the system locale, or a user defined locale, which are then output to the UI.

Doing it this way allows the software to run regardless of locale settings, and if done right, can even allow the user to set up custom conversions.. Image SimuTrans with the Mars pak using [hypothetical] Martian units, or a space pak version where the playing field is many light years of space between star systems.. Much like people have modding other games to their favorite genres. Such a game would have far more appeal to more people!

Of course, this would not be a trivial or minor project as far as code is concerned. It would require a lot of codework, and therefore would need to be an ongoing project. But I think it would be worth it in the long run: Once the input/output routines are in place, and the UI updated, the game becomes infinitely flexible. It might also make maintaining the code much easier, since the I/O conversions free the game engine from needing to worry about many different units--all code can be written using simple internal units that best fit the needs of the code.

Fabio

this sounds interesting...

VS

Then you're welcome to take a shot at it :P

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Casteele

I might just do that.. But like the developers, I'd like to know if there's even enough real _interest_ in such a patch before committing my time and effort to it.. or even a better way to go about doing it..

jamespetts

I suspect that the interest, if there is any, is likely to come from people who don't currently play Simutrans partly because the units of measurement are unfamiliar - so there's no easy way of assessing the demand, I'm afraid.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.