News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Devolpment of Pak256.America-Ex

Started by RealAmerican1776, June 30, 2020, 03:23:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RealAmerican1776

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.

jamespetts

Quote from: TheRoadmaster1996 on June 30, 2020, 03:23:13 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?
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.

RealAmerican1776

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.

jamespetts

Quote from: TheRoadmaster1996 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.

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.
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.

RealAmerican1776

That...that sounds like a tall order. Maybe I'll just leave as is, I don't think anyone will mind.

freddyhayward

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.

KneeOn

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.

jamespetts

Quote from: freddyhayward 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.

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).
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.

RealAmerican1776

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.

RealAmerican1776

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.

KneeOn

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.

RealAmerican1776

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.

Vladki

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.

RealAmerican1776

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.

KneeOn

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.

RealAmerican1776

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.

Ves

Did you only change the word meters to feet? You did not do any length conversion (ie 1 meter = 3,28 feet)?

jamespetts

Quote from: Ves on July 04, 2020, 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)?

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.
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.

RealAmerican1776

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.

RealAmerican1776

Working on my first vehicle. It's an old Ford Model TT which will be introduced in 1917 and end production in 1928. This is the pickup truck version of the iconic Ford Model T. It will be able to carry bulk goods, piece goods, bulk fluids, long goods, and livestock. I have attached a picture of it carrying coal.

KneeOn

I viewed this on my phone, the preview looked like a pak64, and opening it looked pak256 - that's quite impressive it holds its scale so well!


Very nice, will these have special colours for night lighting?

RealAmerican1776

Yes, I'm hoping to have the headlights glow in the dark and I also want to add player color to the doors.

RealAmerican1776

My second vehicle will be a Narragansett Pacer Horse. You will be using it to pull carriages and such and not freight. It was first bred in my home state of Rhode Island back when it was the Colony of Rhode Island and Providence Plantations and several famous people during colonial times owned the horse including George Washington himself who raced one when he was younger and we now believe this is same horse Paul Revere rode on that fateful night in 1775. Unfortunately because the breed is now extinct, we don't know much about it except that it was fast and was mostly chestnut in color. It will appear from 1690 to 1880 (when the last Narragansett Pacer dies.)

RealAmerican1776

For the Grumman LLV Mail Truck, I have noticed that a new feature allows public service to operate vehicles so I recommend having public service operate the LLV as it would be in real life.

jamespetts

That looks interesting. I wonder whether this thread should be moved to the Extended pakset forum; was there any particular reason for it being in the Simutrans-Extended development forum in the first place?
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.

RealAmerican1776

Not really, I just figured since I'm informing you guys about development of an extended pakset that it should be here.

jamespetts

Quote from: TheRoadmaster1996 on July 24, 2020, 12:46:54 AM
Not really, I just figured since I'm informing you guys about development of an extended pakset that it should be here.

Splendid, thank you for clarifying. I have moved this to the paksets forum as it fits better here.
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.

RealAmerican1776

Thank you. I look forward to releasing my first version of the pakset.

RealAmerican1776

For my next road vehicle, I want opinions on the player color on the Peterbilt 387. I ended up doing it by hand so I don't know what you guys think about it.

RealAmerican1776

Hi everyone. I need help scaling vehicles. Does anyone have a guide or a template for scales for 256?