News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Simutrans Experimental [Original thread]

Started by jamespetts, January 21, 2009, 12:20:03 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jamespetts

Archive thread - no further information will be added here. See other threads in the Simutrans-Experimental forum for more information

Introduction

As many forum regulars may be aware, I have recently developed a number of patches that are designed to have a substantial impact on gameplay. These patches have not yet been included into the trunk, quite probably because that impact has not yet been fully tested. I thought that it might be helpful if I produce a single experimental version, containing all of the various alterations that I have made to the code, for people to be able to test the gameplay impact of my modifications for themselves. I will release both the source code and a Windows binary so that people can see the modified source code all in one place, and also so that people without the wherewithal or inclination to compile from source can test (and even, if it is found to be stable enough, play with) my modified version. The experimental version is based on the latest nightly at the time of release - partly for that reason, and partly because my new features are not fully tested - it should be considered beta software and used accordingly.

I will keep this original post updated with the latest information on the progress of this experimental version as matters progress. I am also currently working with the PakBritain team, and hope for there to be a release (possibly an interim release) of a version of PakBritain that takes advantage of the extra features in this experimental version (but is also compatible with the default version) fairly soon.

Getting the necessary files

1. Source code

Simutrans-Experimental now uses a version control system ("VCS") called "Git" (as written by Linus Torvolds, no less), and no longer uses patch files (which can be hard to apply). The Simutrans-Experimental Git repository is here. For a tutorial on how to use Git, see here. The standard Simutrans SVN is also mirrored on Git here. Git is compatible with Linux and Windows (and possibly also MacOS X, although I have not verified that).

It is recommended that those who wish to get the source code for Simutrans-Experimental setup a separate directory for doing so than that used for the normal source code. Anyone wishing to contribute to coding for the Experimental version is welcome to do so, using Git's very flexible branching system (which makes it far easier to merge a branch back into the trunk than is possible with SVN). So, unlike with standard Simutrans, to make an alteration to the code of Simutrans-Experimental, do not upload a patch file - fork the code in the standard Git way. Any modification that is included in Simutrans-Experimental will be included by way of re-merging the code, rather than applying a patch. Please let me know if you have forked the code so that I can merge back in any desirable new features!

2. Modified configuration files

The attached file Simutrans-experimental-config.zip contains all of the modified configuration files required for the experimental version, including:

(a) simuconf.tab:

This is my configuration file sample, needed because many of my modifications need their own configuration settings. This is an example from PakBritain-Experimental, but should be able to be modified for other paksets easily. The new features are, I hope clearly, documented.

(b) privatecar.tab:

This is a special configuration file, needed for one of the new features incorporated into this version: competition with private cars.

(c) en.tab:

These are slightly revised translation texts for the English language, as there is no specific Simutranslator entry for some of the new texts that have to be translated for the additional features. If anyone wants to produce a non-English version, please reply to this thread with the amended file attached.

(d) speedbonus.tab:

This is a modified speed bonus file for Pak128, taking into account the modified speed bonus system used in this experimental release. This may change again when the new revenue system is implemented.

3. Program files (binaries)

These are the files that will be needed if you cannot or do not want to compile Simutrans-Experimental from source. Simutrans-Experimental may well be added to the official nightly builds (albeit not as often as nightly) in the near future, but, for the time being, a Windows executable version of Simutrans-Experimental can be downloaded here, and a Windows executable version of Makeobj-Experimental (for making assets that take advantage of Simutrans-Experimental's new features) can be downloaded here. (Note: new version)

List of modifications

Note: This list of modifications is only updated with every binary release of Simutrans-Experimental. Binary releases of Simutrans-Experimental will be less frequent than code updates on Git. For modifications to the source code on Git, see the commit comments.

I have included all of my recent patches, plus one or two patches produced recently by other regular contributors, but not included in the trunk. I have assumed that those patches have been released under the Artistic licence, and that the authors will, therefore, have no complaint about their code being included. If I am mistaken in that view, please contact me via PM and ask to have your patch removed from the experimental version.

1. Modification of speed bonus for local transport*; and

2. increase of running costs for obsolete vehicles, both explained further here.

3. Modified passenger generation, including local weighting and alternative destinations, explained further here.

4. Competition with private cars, as discussed further here.

5. Cornering, weight limits and tilting trains, as discussed here.

6. Way constraints (new in this version - fully implemented in the code and UI) as also discussed here.

7. Catering level (implemented in .dat files and UI only - currently has no effect on gameplay. Also, mail vehicles with a catering level above 1 are treated as "travelling post office" vehicles, but no effect on gameplay is yet coded), as also discussed  here.

8. Enhanced physics for steam locomotives.

9. Industries close down at a random point between 0 and 30 years after their retirement date. A message is displayed in the ticker when an industry closes down. Any other industries in the same chain either re-link to another supplier/consumer, or, if they cannot find one, close down themselves.

10. The origins of goods/passengers/mail are displayed with vehicles and stops (New in this version: origin data now saves).

11. Automated replacement of vehicles, by Isidoro, (updated to be compatible with way constraints) discussed here. (New in this version): data on replacing vehicles now saves: replacing will occur as planned when reloading from a saved game when convoys are saved as being set to be replaced.

12. More sophisticated handling of debt (including: customisable interest on debt, an option to turn off bankruptcy, and a credit limit, beyond which no further capital purchases can be made (which can be disabled)). More details on this feature here.

13. (New in this version) Accurate reversing for trains, including different types of trains taking longer to reverse: see here for more details. (Note: this will only work with customised pakset data, made using a recent version of Makeobj-Experimental)

14. (New in this version) Variable loading time for all vehicles: see here for more details. (Note: this will only work with customised pakset data, made using a recent version of Makeobj-Experimental)

15. (New in this version) Upgrading (rather than buying and selling) of vehicles, fully integrated with the vehicle replacing system;  see here for more details. (Note: this will only work with customised pakset data, made using a recent version of Makeobj-Experimental)

* This will become obsolete when item no. 1 on the to do list is completed.

Please note also that the experimental version excludes a feature of some of the more recent nightlies, the revenue being based on the straight line distance between the start and end point of the whole journey, rather than for each transfer. It has been omitted because it would be difficult to integrate with the existing code, is not entirely realistic, and will be redundant once the new revenue system is in place.

Note: (New - 15th of March 2009) The save game files produced by Simutrans-Experimental are no longer compatible with save game files produced by standard Simutrans. Simutrans-Experimental can load save games from standard Simutrans, but standard Simutrans cannot load files saved by Simutrans-Experimental. This new version, however, enables data, such as the weight limits of tracks/roads, etc., the origins of goods, which vehicles are being replaced and so forth, to be saved.

To do

There are a number of further plans that I have in relation to work on this experimental version. In approximate order of priority so far:

(1) revised revenue system, with revenues based on journey times and accommodation level, not the maximum speed of vehicles;

(2) full implementation of catering and travelling post offices;

(3) a system in which labour costs (and possibly other costs) vary depending on the year;

(4) an implementation of overcrowding for passenger services;

(5) a more sophisticated means of passengers/goods choosing which route to take to travel, or whether to take their private cars as opposed to public transport, based on the new revenue model described at (1) and (possibly) the quality of services metrics being developed by Isidoro; and

(6) merge in the underground view and underground slopes patches if this has not already been included in the trunk.

Known issues

1. The sort ordering for goods in transit or at stations does not work - this is associated with origins tracking, although the reason is not entirely clear.

2. When goods from different origins have the same destination, they are not combined together in the GUI for convoys or stations, even when the mode is not set to sort by origin.

3. Interest payments are not shown in the finance history window. Fixing this requires reversioning the save game files.

Fixed bugs

15th of February 2009

1. Cornering speeds would often be incorrect when more than one vehicle was moving at once.

2. Detection of overweight vehicles became erratic when more than one vehicle was moving at once.

3. (Fixing items 1 and 2 might also have resolved occasional crashes that had not hitherto been traced or reproduced effectively).

4. Crash (assertion failure) when loading a saved game.

5. Crash (uninitialised variable) sometimes when loading saved games.

22nd of February 2009

6. Occasionally, vehicles set to be replaced automatically will not go to the depot automatically as they should.

7. Instability and unexpected behaviour when vehicles unload in a game that has been loaded from a saved game.

26th of February 2009

8. Crash (access violation) on some occasions relating to the code for detecting when vehicles are climbing hills.

15th of March 2009

10. Origin data are not saved.

11. Maximum weights on track are not set correctly when loading a saved game.

Feedback

The whole point of this experimental version is to enable people to experiment. I should be very grateful for any feedback that people have from using this experimental version, particularly as regards: (1) bugs; and (2) gameplay/balancing issues. Please, however, do not post about bugs or gameplay issues until you have verified that the bugs/issues are present only in the experimental version, and cannot be reproduced in the standard nightly (if they can, please make a stand-alone bug report in the usual way). I should also be grateful for any suggestions for improvement, although please be aware that, because I am busy with work, I may not have the time to implement even good suggestions.

Happy experimenting!
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.

isidoro

My code (and my body) is free for testers...  Go ahead.

jamespetts

Quote from: isidoro on January 21, 2009, 12:55:32 AM
My code (and my body) is free for testers...  Go ahead.


Thank you :-)
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.

jamespetts

#3
Update: Both source and binary versions are now updated for official Nightly 2259 (21 Jan. 2009), and the configuration files are consolidated into a single .zip file for convenience and speed.

Further update: Experimental 0.2 contained a bug which would cause the game to crash whenever a vehicle reached a stop. An updated version is now available that fixes that.
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.

jamespetts

#4
New: Windows binary for Makjeobj-Experimental now available, to allow asset authors to make assets compatible with the new features in Simutrans-Experimental. See the original post for the link. Also, reference has been added in the future features list to changing labour costs, etc., over time, as well as a reference to overcrowding.
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.

z9999

Is it possible to rewrite the code for GCC safety ?
I can't compile your code on MinGW + MSYS because of too many errors, and I gave up.

jamespetts

Z9999,

ahh, I wasn't aware that there were errors that would be produced on some compilers but not others with this code. Can you give me an idea of what those errors are and where in the code they are to be found?
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.

Frank

Quote from: jamespetts on January 21, 2009, 12:20:03 AM
...
Edit: Binary version for Windows now available here.
Edit 2: Binary version of Makeobj-Experimental (for compiling assets compatible with the extended features in Simutrans-Experimental) available here.

pleace delete the www. from links

jamespetts

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.

sojo

Quote5. Cornering, weight limits and tilting trains, as discussed here
I have tested the cornering. I think it looks good for trains but not so good for road-vehicles.

And i had the feeling sometimes some vehicles drive to fast. (It were citycars).
"English is a easy language. But not for me." ;) sojo

follow simutrans_de on Twitter
- A home for Simutrans (in german)

jamespetts

Sojo,

interesting comments about road vehicles - have you tried adjusting the values in simuconf.tab? All the various cornering settings are adjustable by waytype in simuconf.tab, so you can reduce the impact of corners just for road vehicles. If you find some values that you think are better than the default, let me know, and I'll try them out, and, if they work, include them as the default in a subsequent release. Thank you for your work!
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.

sojo

I have done no changes. I have used my normal simuconf.tab without any of this settings.
"English is a easy language. But not for me." ;) sojo

follow simutrans_de on Twitter
- A home for Simutrans (in german)

jamespetts

Ahh - to make Simutrans-Experimental work properly, you need to use a specially adapted simuconf.tab: a copy is included in Simutrans-experimental-config.zip. The reason for this is that there are a number of Simutrans-Experimental specific settings that need to be set in simuconf.tab.
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.

Fabio

and is experimental simuconf.tab back compatible with standard simutrans?

z9999

You don't have MinGW, then it's okay. Don't mind, thank you.  :)

jamespetts

Fabio,

yes, it should be, since additional parameters in the file not supported are simply ignored.

Z9999,

what OS were you trying to compile it in? I use MSVC++ Express Edition, as recommended in the thread explaining how to compile the code. MinGW is a Windows compiler, so, if you are using Windows, you can just use MSVC++ Express Edition (free). If you are using Linux and cannot compile there, that is something that I'd need to fix.
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.

Fabio

Quote from: jamespetts on January 26, 2009, 05:07:11 PM
yes, it should be, since additional parameters in the file not supported are simply ignored.

good to know! ;)

jamespetts

Update: Simutrans-Experimental source code is now available on Git: see the original post for details. The source code has also been updated since the original release, and now includes the latest rivers code as well as other recent enhancements.
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.

wernieman

#18
.....

for git you need a git-Client?
(Have you an example for the acess?)

Or can I use svn???
I hope you understand my English

jamespetts

Yes, indeed one needs a Git client for Git (which was recommended to me over and above SVN). The process of downloading and installing the Git client for Windows is explained in this tutorial.
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.

wernieman

Installing no Problem (Linux) but using .....

I say to you, that I make a spezial run for you experienze ... so the Server need the sources ..
I hope you understand my English

jamespetts

Here's some information on how to use Git - but I'm not sure that I really understand your second sentence.
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.

DirrrtyDirk

I read it that way, that's he's going to make a special nightly version - and for that his server needs the sources.
  
***** PAK128 Dev Team - semi-retired*****

wernieman

Dirk .. you are good.....

I need the sources of the simutrans-experimental for compiling.

Have your git an anonymous access?? (Read Only)
I hope you understand my English

jamespetts

Dirk - thank you for the translation! Yes, I hope that I've got it setup to allow anonymous access. Try here:

http://github.com/jamespetts/simutrans-experimental/tree/master
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.

jamespetts

Update - new binary and features

A new release of Simutrans-Experimental is now available (updated binaries linked from the original post; updated source code on Github), with all of the revisions of the trunk up to and including r2287 (incorporating the removal of the vehicle noise at fast-forward: that has now been removed from the list of Simutrans-Experimental specific features, as well as the ever popular rivers), and a new experimental feature: enhanced steam locomotive physics.

Steam locomotive physics - in detail

In standard Simutrans, steam locomotives are treated in exactly the same way as any other locomotive, but, in reality, their performance characteristics are different (as this article explains: http://www.railway-technical.com/st-vs-de.shtml). The main noticable effect of these differences are that steam locomotives are slower to accelerate and give poorer performance on gradients than diesel or electric locomotives of the same overall power. Those differences between steam and diesel/electric traction had a marked impact on the development of railways. Firstly, it lead to early railways being constructed to avoid gradients as much as possible, even if it involved relatively tight corners, since the reduction in speed necessary to take corners was far less than the reduction in speed that a gradient would bring about; secondly, it was part of what was responsible for a strong preference on the part of railway operators to replace steam with diesel and electric traction, when the technology became mature, especially for suburban services (involving regular starting/stopping) or services in areas with steep gradients.

Simutrans-Experimental now incorporates these physical characteristics in a somewhat simplified form. The precise mechanism is largely invisible to the player, who will only notice that steam trains perform worse at low speeds than diesel/electric trains of the same overall power. This should make network design choices more interesting, as well as giving players more incentive than they currently have to use electric trains early in the game, when their maximum speed and power is low. I have tested the new physics carefully with Pak128 and Pak64, and it seems to balance about right (with the exception of the RVg 0-4-0-T in Pak128, which is now underpowered, and cannot haul more than 3 coaches without being restricted to 3kph: the problem, I suspect, is a combination of the gear being set at 0.8 and the contemporary carriages being too heavy: making the settings more favourable to low powered locomotives than they are made other locomotives perform too well). PakBritain, unfortunately, is not currently balanced well in respect of steam locomotive power, so the effect of this feature is largely unnoticeable there (some steam locomotives have a gear factor of over 3 - the Princess Coronation class accelerates like a Ferarri with or without this feature). No doubt, rebalancing will come in time.

One thing for both players and asset authors to bear in mind is that this feature works by reducing the effective power of the locomotive at lower speeds. To take account of the fact that some steam locomotives are designed to run at low speeds and others at high speeds, without having to add a tractive effort factor to all the assets in the game (which would require a great deal of work to be re-done), the system that I have implemented assumes that a locomotive with a lower maximum speed per unit of power has more of its available power at the lower end of its speed, whereas a locomotive with a higher top speed has a greater proportion of its power available at higher speeds. The practical effect of this is that more powerful steam locomotives with lower top speeds (such as, for instance, the LMS 8F and BR 9F - indeed, most locomotives with a larger number of smaller driving wheels) have better acceleration and gradient climbing abilities than their faster cousins. This is balanced against the fact, of course, that they have a lower top speed. Thus, there is, with this feature, a greater differentiation between locomotives designed for freight work and locomotives designed for passenger/mail work than there is in default Simutrans.

I should be very interested for people to test this new feature (using the binary provided; or you can compile from the sources if you prefer) and give views as to whether I have balanced it correctly. I should also be interested in thoughts on whether there are any other (relatively simple to code) ways of improving locomotive physics, preferably that (1) have a substantial, balanced and realistic economic impact on the game; and (2) do not require changes to all existing vehicle assets to make work properly. Please reply to this thread with any thoughts.
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.

prissi

Simutrans has no meaningful physics, if you look into the acceleration formulars. Those would bring any Newtonian to cry in despair. Trust me, I teach them every year. I tried the "correct" formulars too, but on the Simutrans scale those simply did not look neither realistic nor nice.

Moreover the power of any engine rail is in reality not the only constrait, there is also the tracktive effort (see TTD Patch for elaborate discussion) which ultimately give the max. accelleration at low speeds, where power is in excess. Also steam engines perform worse at high spoeed, when the steam consumption rate exceeds the boiler area. A steam engine has a certain power only at a certain speed. (Also electric engines has different posers ratios. Usually electric engines can give much more power, up to 100% for short time scales than their 1h nominal power. For instanc ethe 103 can give 10300 kW peak power but is rated for 7400kW.) The only meaningful power is for diesel engines; even more since they ran more or less at constant revolutions (compared to car engines at least).

By the way, how does the japanese engines work then? THose are very weak, same for old age engines.

And Simutrans has all modes of transport and thus the formula has to fit them all and (since we are a game) must be good looking too. It even worked somehow on planes, even though it was introduced before. Since there is only a few steam trucks and apart from that only steam ships, it might be still ok.

(On a side note, However, it would be easier to discuss you changes if you showed the relevant section of the code without requiring to install git to get all code and then look in simconvoi.cc for the changes.)

jamespetts

Prissi,

thank you for your thoughts - it is always useful to know about the physics end of things from a physicist. I am aware that the physics in Simutrans do not try to be exactly accurate because of the nature of the game - it would be a different matter if it were a train driving simulator, of course. My intention with this change is not to have Simutrans simulate accurate physics for the sake of it, but to increase the accuracy of the physics only in so far as it has a substantial economic impact on gameplay, and steam engines accelerating from a slow speed more slowly, and having more trouble on gradients seems to be a good start.

You mention one or two other interesting facets of physics that I am wondering whether to attempt to incorporate. Firstly, the reduced efficiency of a steam engine at very high speeds; so far, I have taken the speed limit given in the vehicle file as the expression of that loss of efficiency, but do you think that the effect is significant enough that I ought also make them slower to accelerate when they are nearing their top speed by reducing the effective power when a locomotive is within, say, 10% of its maximum speed? If the reduction in power was subtle enough, and slowly phased in, that might give a good effect (and look more realistic, too, than a vehicle accelerating at a near linear rate then suddenly stopping accelerating) without having too drastic an impact on things.

I am interested also in what you have written about electrics, but I am not sure that I fully understand. Is the electric engine's ability to deliver higher power output for short periods something that might usefully have an economic impact on the game, or is it too rarely used to make a real difference?

I am also aware of the different modes of transport (although there is nothing to stop there being code to give different physics models to different modes of transport, of course, with a simple switch case on the wtype), although altering steam physics in this way ought not have an impact on other modes of transport, since (1) steam road vehicles would largely be subject to the same effect (they did not usually have gearboxes); and (2) if there was ever a problem with anomalous effects for non-trains, it would be easy to add a test in the code to see whether the vehicle is a train before applying the new formulae.

As to the code, if you set up a Git repository for Simuntrans-Experimental, you can see the new code for each individual revision by using the "visualise history" setting in Git-GUI. Did you want me to paste the relevant code into this thread for further discussion?
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.

Spike

I like the idea of having different engine characteristics for the steam engines. The "power" value is often discussed, and together with the "gear" value Simutrans already is pretty detached from real world engine powers (still people want to see those numbers in the vehicle specs, otherwise they complain).

While in general I think that special cases are bad for maintainability of a program, Simutrans-Experimental seems to be the proper playground for testing such ideas, and if you get along with the maintenance of Simutrans-Experimental, despite the added complexity, it's even better.

Summary: Variation is good, realism not necessary on this level IMO.

prissi

SInce GIT is only available for a very limited number of platforms and the discussion can surface in half a year or so again, pasting the relevant changes ensures we are talking about the same.

jamespetts

Update: New version of the binary available, which now includes a system of industries retiring between 0 and 30 years (the upper number can be set in simuconf.tab) after their in-built retirement date has passed, if the player is playing with the timeline enabled. This enables pakset authors to simulate a changing world/economy, and gives players with established industry connexions later in the game a greater challenge in having to adapt to changing circumstances. Industries in the same chain as those that close down either relink to other suitable industries, or close down themselves if there are no suitable other industries.
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.

The Hood

That sounds awesome.  The only problem is that I said I would draw more industries when you had done this.  Why did you have to do it so fast? :p

jamespetts

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.

VS

Oh, wow. I hope the industry changes are one day ported back, because this is one of the things I was always hoping for...

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!

jamespetts

VS,

I'm glad that you like it. You could always just play Simutrans-Experimental, of course ;-)
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.