News:

SimuTranslator
Make Simutrans speak your language.

Recent posts

#61
This is not a compiler bug - I got this:
/home/ceeac/code/simu/simusvn/src/simutrans/descriptor/bridge_desc.cc:105:9: runtime error: load of value 4294967295, which is not a valid value for type 'img_t'
and
...
#6 0x0000559905e7862d in __ubsan_handle_load_invalid_value_abort ()
#7 0x00005599061a4d75 in bridge_desc_t::get_end (this=0x7c50e1a3d100, test_slope=0 '\000', ground_slope=0 '\000', way_slope=0 '\000') at /home/ceeac/code/simu/simusvn/src/simutrans/descriptor/bridge_desc.cc:107
#8 0x0000559906f0fb99 in tool_build_bridge_t::mark_tiles (this=0x7ca0e161e730, player=0x7d30e168b040, start=..., end=...) at /home/ceeac/code/simu/simusvn/src/simutrans/tool/simtool.cc:3074
#9 0x0000559906e9b58c in two_click_tool_t::move (this=0x7ca0e161e730, player=0x7d30e168b040, buttonstate=1, pos=...) at /home/ceeac/code/simu/simusvn/src/simutrans/tool/simmenu.cc:1459
#10 0x0000559907122d55 in karte_t::interactive (this=0x7e30e17ee100, quit_month=2147483647) at /home/ceeac/code/simu/simusvn/src/simutrans/world/simworld.cc:6189
#11 0x0000559906e5f99a in simu_main (argc=1, argv=0x7c10e15e0030) at /home/ceeac/code/simu/simusvn/src/simutrans/simmain.cc:1691
#12 0x0000559906e83bd9 in sysmain (argc=1, argv=0x7ffd179f4e08) at /home/ceeac/code/simu/simusvn/src/simutrans/sys/simsys.cc:1541
#13 0x000055990733fe72 in main (argc=1, argv=0x7ffd179f4e08) at /home/ceeac/code/simu/simusvn/src/simutrans/sys/simsys_s2.cc:1196

Seems like bridge_builder_t::can_build_bridge, which is called from tool_build_bridge_t::mark_tiles, returns a bridge height that is at terrain level, and bridge_desc_t::get_end does not handle this.

To reproduce, just build the pak64 brick viaduct on flat terrain.
#62
Technical Documentation / Re: Clarification needed on co...
Last post by Nazalassa - April 09, 2026, 04:07:35 PM
Quote from: poppo on April 08, 2026, 11:47:59 PMA Vehicle's position is determined by its front position. So, the last car's end position can be "stick out" for the rear from reserved tiles.
When reversing, we put vehicles spacing out by the length of vehicles. However, as mentioned above, the length of the last car was not taken into account before reversing. So, vehicles cannot advance a distance equal to the last car's length.

From what I understood, a vehicle's position represents its south/east end (which is not necessarily the front one). So I only see one possibility for the vehicle to stick out: when it is going south/eastwards and its last vehicle is longer than its first vehicle, in this fashion:

<- ###### ###### ###### ###### ############
S |+------+------+|-----+------+--|---------------| N
                         ||
                         \/
   ############ ###### ###### ###### ######  ->
S |+------------+-|----+------+---|--+------------| N

where |-----| is a tile, ###### are the convoy's vehicles, and + denotes the position of each vehicle.

Is that correct?
#63
Bug Reports / Re: If the value of factory's ...
Last post by poppo - April 09, 2026, 02:33:53 PM
OK, I understand.
In factory_edit_frame_t, they use this value as prod_per_month, but when call build_factory, they call inverse_scale_width_with_month_length(), so this value treated as prod_per_unit-time.
#64
Bug Reports / Re: Free road utopia created o...
Last post by prissi - April 09, 2026, 01:09:25 PM
I have created quite a few maps an never got this so far. Are there any addons, like multitile buildings in your pak128?
#65
Bug Reports / Re: If the value of factory's ...
Last post by prissi - April 09, 2026, 01:07:44 PM
The limit is due to the 32 bit arithmetic before scaling. Honestly, asking for 1 million workers/customer per month is not a factory ...

The production is per fixed time interval. If a month is longer, then there are more of those intervals => nothing needs to be scaled. So some values have to scaled (like how many passengers per month to display) while the things per production intervall do not need scaling.

But of course, errors are always possible, that code had become quite complex with all the just_in_time stuff.
#66
Bug Reports / Re: If the value of factory's ...
Last post by poppo - April 09, 2026, 10:18:19 AM
Thank you! I check the fix of overflow!

But I have some questions:
The default production_pre_month value in factory_edit_t is already scaled with month length.
Why is pax_demand of factory also scaled with month length in fabrik_t::update_scaled_pax_demand() again?
And why the limit range of the production value in factory_edit_t is not dependent on the month length?
#67
Bug Reports / Re: If the value of factory's ...
Last post by poppo - April 09, 2026, 02:51:46 AM
my test factory pax_level is 65535 and city population is about 99999.
I will check with latest version later.
#68
Bug Reports / Re: If the value of factory's ...
Last post by prissi - April 09, 2026, 01:00:36 AM
Since such a big number are not really practical, I will cap the demand at 932,067 (2^23-1)/9. However, I fail to create these numbers in a test game. So please test the latest revision.
#69
Bug Reports / Re: Free road utopia created o...
Last post by Isaac Eiland-Hall - April 09, 2026, 12:20:51 AM
Ah, geez, the way I play is with -freeplay on with a goal of serving every house/factory/etc. This would be an *adventure* of a map. lol. Little busses all over! :)
#70
Bug Reports / Re: Free road utopia created o...
Last post by prissi - April 09, 2026, 12:19:29 AM
The houses would be spread over the map, although in principle limited to a suitable location (near a road or next to a hosue).