The International Simutrans Forum

Development => Bug Reports => Topic started by: Franck70 on November 23, 2013, 11:50:46 PM

Title: Missing tools in menu bar
Post by: Franck70 on November 23, 2013, 11:50:46 PM
Hello everyone.
I come to you because I have a big worry since yesterday my tools menu buttons rail, road tools AIR tools etc. have disappeared from the menu bar.
I simutrans 112.3 comic Pack 96th 0.4.10
When I raise the game they are but I load my current game they disappear.

(http://www.heberger-image.fr/data/images/99999_simutranspbbout.png)
Title: Re: Missing tools in menu bar
Post by: Lmallet on November 24, 2013, 01:13:29 AM
To clarify the bug report, it seems the toolbar disappears once you hit January 1st 2999.  (from http://forum.simutrans.com/index.php?topic=12865.msg127741#msg127741 (http://forum.simutrans.com/index.php?topic=12865.msg127741#msg127741))
Title: Re: Missing tools in menu bar
Post by: Fabio on November 24, 2013, 09:40:00 AM
The most logical reason might be that all pakset infrastructure (ways, stations, depots) retire on 2999.
Title: Re: Missing tools in menu bar
Post by: Ters on November 24, 2013, 10:21:00 AM
2999 is the default retire date if the pak set doesn't specify one, either because the pak set is very old or because the pak set author simply didn't consider it to be any problem. (I think many pak sets deteriorate sometime after 2000-2013 in the game as they don't fully predict the future.)
Title: Re: Missing tools in menu bar
Post by: Lmallet on November 25, 2013, 01:56:08 AM
2999 is the default retire date if the pak set doesn't specify one, either because the pak set is very old or because the pak set author simply didn't consider it to be any problem. (I think many pak sets deteriorate sometime after 2000-2013 in the game as they don't fully predict the future.)

Is this something that can be set via a config file, or is this set when the pakset is compiled?
Title: Re: Missing tools in menu bar
Post by: Ters on November 25, 2013, 07:46:58 AM
Is this something that can be set via a config file, or is this set when the pakset is compiled?

Each individual object type's introduction and retirement dates are set in the dat files making up the "source code" for the pak files. The default dates used when the pak set doesn't specify one, are hardcoded into the game.
Title: Re: Missing tools in menu bar
Post by: gauthier on November 26, 2013, 08:31:17 PM
Each individual object type's introduction and retirement dates are set in the dat files making up the "source code" for the pak files. The default dates used when the pak set doesn't specify one, are hardcoded into the game.
So the only thing to do is to change the default retire date which is coded in the game ?
Although I have other questions in mind :
_ Why did coders choose a date which is so near from the player ? (Well yes ... I can't really say "near", anyway 2999 is in player's reach, hence this bug report, integer type allow much higher values).
_ What about using a special value, let's say 0, to mean "no retire date" to the game ?
Title: Re: Missing tools in menu bar
Post by: Ters on November 26, 2013, 08:47:31 PM
I wouldn't call 2999 near. I'm almost at 2040 in my current game, and I feel like I have played it for ages (since 1850 or so). It's hardly any fun anymore, as there are no new vehicles, except a few that are so badly balanced that they won't generate a profit no matter what. Cities are so huge, covering them with local transportation, let alone coming up with names for the stops, is tiresome. I mostly just sit and watch the trains run. Sometimes I try to reduce the losses that set it on my rail network due to a skyrocketing speed bonus base speed around 2030, but almost nothing works.

Generally speaking, changing the default could potentially cause compatibility issues. Perhaps not so much for the default retire date as for the default introduction date, but still. If a pak set is ready for a longer timeline, it should go for it itself.
Title: Re: Missing tools in menu bar
Post by: prissi on November 27, 2013, 05:10:15 PM
This date was choose from old age. Before simutrans crashed at 2240 ...
Title: Re: Missing tools in menu bar
Post by: Ters on November 27, 2013, 06:01:27 PM
2999 times 12 isn't too far away from the upper limit of a signed 16-bit integer, which might have been used at some point, if it isn't still somewhere.
Title: Re: Missing tools in menu bar
Post by: Fabio on November 27, 2013, 06:32:00 PM
Considering that no serious game can run until 1400, paksets could have a display_year_offset e.g. 1400 which might allow to play until 4399.
Title: Re: Missing tools in menu bar
Post by: Ters on November 27, 2013, 06:58:12 PM
If pak sets want to play until 4399 and beyond, they can (unless there is some lingering limitation somewhere that hasn't been dealt with). They just have to opt in by telling the game their retirement dates. 2999 is just for loading/compiling old pak sets. One could perhaps make it possible for makeobj to use a different default date if the author is too lazy (I can understand them) to put dates on everything.
Title: Re: Missing tools in menu bar
Post by: Dwachs on November 27, 2013, 07:01:51 PM
Dates are saved as 32bit signed integers in 12*year + month format. There is plenty of room to lift the default retirement date.

The problem is what happens with paks that have the default retirement date set at 2999? Should this be similarly increased? I doubt that any pak-file uses this retirement date intentionally. This would be an easy fix: apply new retirement date to all old pak files and change makeobj to set it for fresh compiled files.
Title: Re: Missing tools in menu bar
Post by: gauthier on November 29, 2013, 09:10:05 PM
Dates are saved as 32bit signed integers in 12*year + month format. There is plenty of room to lift the default retirement date.

The problem is what happens with paks that have the default retirement date set at 2999? Should this be similarly increased? I doubt that any pak-file uses this retirement date intentionally. This would be an easy fix: apply new retirement date to all old pak files and change makeobj to set it for fresh compiled files.
I thought we were dealing with a hardcoded limit...
Quote
2999 is the default retire date if the pak set doesn't specify one

Anyway, if "2999" is set in all pak files, it will be easy to replace this in official paksets, but much more difficult to make every addon maker remake his addons.
I don't know how retire dates are dealt with in the game. Should it be possible to just disable retirement for pak files having 2999 as retire date ?
Title: Re: Missing tools in menu bar
Post by: Fabio on November 29, 2013, 09:16:50 PM
I would suggest that after 2999 timeline gets disabled.
Title: Re: Missing tools in menu bar
Post by: prissi on November 29, 2013, 10:44:09 PM
One could just set "no timeline" in the starting dialogue and then save the game. This should bring everything back (if not, then there is an error to report.)
Title: Re: Missing tools in menu bar
Post by: Ters on November 30, 2013, 09:17:13 AM
I thought we were dealing with a hardcoded limit...
Anyway, if "2999" is set in all pak files, it will be easy to replace this in official paksets, but much more difficult to make every addon maker remake his addons.
I don't know how retire dates are dealt with in the game. Should it be possible to just disable retirement for pak files having 2999 as retire date ?

My worry is that this may break those paks. A default of 2999 is/was part of the contract between developers and pak set makers. Retireing at 2999 might be intentional by the pak set maker, although that may be rare. It's the same with the introduction date. If the default retirement date is ignored, the default introduction date should also be ignored. There have been problems with that as well. But ignoring the introduction date may easily look very odd.
Title: Re: Missing tools in menu bar
Post by: prissi on November 30, 2013, 10:51:48 PM
If you play to 2999 just disable the timeline. Because no development will happen after 2050 is almost any pak.
Title: Re: Missing tools in menu bar
Post by: Ters on December 01, 2013, 09:09:48 AM
Disabling the timeline has the unfortunate side effect of enabling everything. A possible feature could be to allow the game to stop advancing the years. This could be useful also for stopping the timeline before the end, for those pak sets that enter an unfortunate state at some point, or if you just want to keep playing in a certain era.