The International Simutrans Forum

 

Author Topic: Devolpment of Pak256.America-Ex  (Read 505 times)

0 Members and 1 Guest are viewing this topic.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Devolpment of Pak256.America-Ex
« on: June 30, 2020, 03:23:13 PM »
Hello everyone. I thought I might give you an update on how my progress of developing Pak256.America-Ex is going.

Here is what I have so far:

A wooden bridge
A stone bridge
A brick bridge
A box truss bridge
A bow truss bridge
A modern concrete bridge

An unpaved road
A cobblestone street
A macadam road
A city road (with two spanning yellow orangy road lines)
A suburban city road with no lines
A rural road
A highway
The Interstate

A town hall

So far I have finished the roads and the bridges. Currently I am working on going through the source files and changing the metric units to our system of units before I start on road vehicles.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19823
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #1 on: June 30, 2020, 06:47:56 PM »
Currently I am working on going through the source files and changing the metric units to our system of units before I start on road vehicles.

May I ask how you are implementing this - are you having a customisable setting for people to be able to switch between metric and US units?

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #2 on: July 01, 2020, 05:26:26 PM »
Honestly I don't know how to do that so I was just going to create it's own software file. If you could tell me how, I will do that.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19823
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #3 on: July 01, 2020, 05:36:11 PM »
Honestly I don't know how to do that so I was just going to create it's own software file. If you could tell me how, I will do that.

I can tell you in general terms, but giving detailed instructions would take as much work as actually coding it myself, which would not be trivial.

In general terms, you need to add code to read an additional simuconf.tab entry. The best way to do this is simply find the code for reading an existing simuconf.tab entry (look for the simuconf.tab setting text in the code) and copy it exactly in every place that it appears just with the modified text and such other modifications as may be suitable (you will want a boolean, I expect, for "us_units" or similar, so copy another boolean version). You will then need to find a place in the code that reads/writes a saved setting value and also copy this substituting your new name. For loading/saving, you will also need to increment the save game version number in simversion.h, and then amend the version checks before you read/write your new data to make sure that only games saved with your new version try to read this additional datum, or else you will break backwards compatibility with all saved games.

Then you need to check for whether this value is enabled whenever a unit of measurement be displayed, and, if it is, call an algorithm to convert the unit to the U. S. style unit, and then display this unit, together with unit descriptive text, such as "MPH" in the interface.

You will also need to make sure that you update the translatable texts for all the US style units.

I hope that this helps.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #4 on: July 01, 2020, 10:54:01 PM »
That...that sounds like a tall order. Maybe I'll just leave as is, I don't think anyone will mind.

Offline freddyhayward

  • Devotee
  • *
  • Posts: 224
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #5 on: July 02, 2020, 03:22:46 AM »
In all honesty, and perhaps a result of a lack of sympathy from my exclusively metric usage as an Australian, I would be very reluctant to see any accomodation in the code for imperial units. It would create additional complexity to all distance and speed code which is already very complex due to conversions between km/h and the various internal units.

However, if it were implemented in a way that simplified the unit code and isolated both km/h and mph from each other and the internal units, it would be worthwhile.

Online KneeOn

  • Devotee
  • *
  • Posts: 203
  • Pak64.GB
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #6 on: July 02, 2020, 09:22:57 AM »
The UK uses imperial units for speed, a mixture for almost everything else, Celsius for temperature.

On here I don't think it matters.

A really nice way around it would be to make your icons have both MPH and KPH on them.

That would let users have a feel in terms they know and also let them select the right way for the right vehicle in metric terms.

Carl did this quite successfully in his track set.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19823
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #7 on: July 02, 2020, 09:48:05 AM »
In all honesty, and perhaps a result of a lack of sympathy from my exclusively metric usage as an Australian, I would be very reluctant to see any accomodation in the code for imperial units. It would create additional complexity to all distance and speed code which is already very complex due to conversions between km/h and the various internal units.

It would be insane actually to modify the simulation code in any way to achieve this; the only sensible way of doing this is to convert the metric units to the US units* at the point of display in the UI.

* Note: US units are not identical to UK Imperial units; although some units are the same (e.g. miles, feet, pounds), others are not (e.g. tons, gallons).

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #8 on: July 02, 2020, 03:15:02 PM »
Actually what I have found difficult isn't figuring out feet or yards, it's kilonewtons and kilowatts to horsepower and pounds force for power and tractive effort. I ended up having to do some research and I think I've figured it out. Now it's just trial and error. I'll create everything and make sure it works and if there's anything I don't like I'll go back through and change it. I've found a neat tutorial about compiling Simutrans Extended on this site that I'll use. It seems simple enough once I've checked everything.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #9 on: July 02, 2020, 03:19:25 PM »
For Kneeon's comment, here in the States, we do actually use both MPH and KPH on our speedometers. The Imperial Units are always on top while underneath it displays your speed in Kilometers per hour. I don't know how I will be able to add both to the game however.

Online KneeOn

  • Devotee
  • *
  • Posts: 203
  • Pak64.GB
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #10 on: July 02, 2020, 10:40:51 PM »
We have the same but all road signs are miles (and miles per hour).


I'm not sure if the GUI supports larger (i.e. 256x256) or if it is still 64x64.


If it does support larger sizes you could have ways with MPH and then KPH written as part of the icon.


For my stations pack I've got two platform types, classic and modern. I also have two building types, normal and island. To mark each there is a scaled down graphic of the building with a red M or C, and a red I so users can see.


Carls tracks have the speed in MPH. Luckily, I know a bit about rolling stock so third rail is a maximum of 90mph, diesel is 125 and overheads are 225.


That means I know the maximum usable speed for that type of unit, then it's trial and error.


For you, I'd suggest MPH written on the icon above KPH.


That'll mean players can draw the right tracks for the KPH displayed in the depot, but will know in US terms the speed in MPH so they can relate.


It's just whether the icon feels cluttered and that depends on the size.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #11 on: Yesterday at 12:03:39 AM »
Road signs here are also in MPH. Some states did experiment with posting signs in KPH and MPH together and you can still find some of these signs here and there.

Offline Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Devolpment of Pak256.America-Ex
« Reply #12 on: Yesterday at 07:08:59 AM »
How about just using miles in the graphics (toolbar icon) and names (translation) and leaving km/h in tooltip. Just like in pak Britain using lb/yd for rail weights in the name (translation).

BTW I think pak128.britain is not consistent in miles to km conversion. Some vehicles and ways are rated at 175 km/h, some at 177 km/h while the real world specs are 110 mph.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #13 on: Yesterday at 03:57:38 PM »
Sorry, I already finished changing everything :P. Something that would have taken me months to do, I found a way to do it in a few minutes. We are going camping this weekend over in California so I won't have internet access until Monday. On Monday, I will compile everything to complete it.

Online KneeOn

  • Devotee
  • *
  • Posts: 203
  • Pak64.GB
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #14 on: Yesterday at 10:29:33 PM »
You tease!

I'd be curious if this was an actual figure change if it could become an option in the display settings - I'm not a programmer but that way perhaps we would see players use the units they're most used too, mitigating any issues for European players using your work.

Well done on finding a solution. Pakset development gives lots of freedom and decisions seem (to me) overwhelming.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #15 on: Today at 01:22:18 AM »
Oh no. I used a software that allowed me to tell it to look for a keyword in all of the folders and files of the Simutrans source code. So if I wanted to find the word Meter, it will look through ALL of the files (more than a thousand of them) and I was able to change said keyword to feet with a press of a mouse key without having to go through every file myself. It saved me a lot of time.

Offline Ves

  • Devotee
  • *
  • Posts: 1793
  • Languages: EN, SV, DK
Re: Devolpment of Pak256.America-Ex
« Reply #16 on: Today at 08:18:21 AM »
Did you only change the word meters to feet? You did not do any length conversion (ie 1 meter = 3,28 feet)?

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19823
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Devolpment of Pak256.America-Ex
« Reply #17 on: Today at 10:32:01 AM »
Did you only change the word meters to feet? You did not do any length conversion (ie 1 meter = 3,28 feet)?

If this is the technique adopted (i.e. only changing the text), then I am afraid that this will produce serious problems, as everything is calibrated precisely for the metric units, so the relationships between different measurements (including time) will be all wrong.

Offline TheRoadmaster1996

  • *
  • Posts: 53
  • Languages: EN, some ES
Re: Devolpment of Pak256.America-Ex
« Reply #18 on: Today at 02:37:29 PM »
No I did not. I was really only testing to see if it would work. If everything was fine, I was going to go back and make it right.