News:

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

Simutrans 32-bit graphics — work in progress and open for review

Started by victor_18993, September 05, 2026, 06:37:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

victor_18993

I have been working on a new 32-bit graphics renderer for Simutrans Standard.

The goal is to modernize the graphics pipeline while keeping compatibility with the existing game and current paksets. Existing 16-bit graphics still work as they do today, but the new renderer can use full 32-bit colour internally, giving us much more room for better shading, transparency, lighting and future higher-quality graphics.

The project is still under development and has NOT been integrated into SVN.

The current version already runs with GDI, SDL2 and SDL3 and has been tested with pak64, pak128 and pak192.comic. The classic 16-bit renderer is still preserved as well.

I have published the current development version here so that anyone interested can review the code, screenshots, documentation and validation results:


https://github.com/Dkijas/simutrans-true32-renderer

The repository also contains the patch against the current development base, build instructions and technical notes.

At this stage I would especially appreciate feedback from maintainers, developers and anyone interested in the graphics side of Simutrans.

There is still work to do before any possible integration into the official trunk, so for now this should be considered a public work-in-progress and review project.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

I've now been able to reproduce and isolate this properly.
There were actually two separate Windows GDI issues involved: one in resize-event delivery, and another where
WindowSize mixed logical and physical pixels when Windows scaling was above 100%.
Both now have tested candidate fixes. I've verified them at 150% scaling with resize, maximize and restore, and the original corruption no longer appears.
I've published the fixes and the test evidence in the public lab repository for review:
https://github.com/Dkijas/simutrans-true32-renderer
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Great,
that's what I've been waiting for—I'm I am scraping with my feet.

Is there a version of makeobj yet that handles 32-bit graphics?

victor_18993

Hi Makie, for now we first need to agree that this renderer is what is wanted—a 32-bit renderer that is backwards-compatible with 16-bit so we don't break existing add-ons (this is essential). The architecture is already designed and I'm still testing, looking for potential bugs.

Then there would be the community discussion to see if the proposal is suitable for Standard.

Don't worry, Makeobj will definitely have to be updated to a version that supports both the future and current formats. As soon as the scope is finalized, I will present the Makeobj proposal.

I know you're very eager for this leap to 32-bit without image compression, but it's important that it's finalized properly. The Japanese community is also waiting for this to be settled, from what I've talked with them, since they would likely handle the port to OTRP and I would do the port adapted for Extended so James can review it.

My idea is for this project to be cross-cutting, just like SDL3 was, which has been quickly incorporated into OTRP and Extended.

Thank you very much for the comment, and I would really appreciate hearing what you artists expect from a real leap to 32-bit without image compression.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on September 06, 2026, 08:16:29 AMand I would really appreciate hearing what you artists expect from a real leap to 32-bit without image compression.
It s not a image compression it is a lost of color information. Color gradients become stepwise. That can be mask with dithering, but then there is a lost of resolution and sharpness. The graphics are becoming crumbly.

In pak128.german all graphics are available as 32/24-bit graphics.
All i have to do is use a 32bit capable makeobj and run over the thousands of graphics and the map should be softer and the colors more nuanced.
Just how clearly visible that becomes—and whether the effort is worth it—can only be seen in a real test.

pak192.comic will not benefit, i think.
But pak128 and pak128.german should look much more better.
pak64 has too few pixels, so no significant differences are to be expected.

victor_18993

That's great if you have all the images because you can migrate quickly; I framed it as a system that will allow coexistence.

Yes, exactly, I misspoke—it's not image compression, it's how it's processed in Makeobj and then displayed by the renderer in Simutrans. This project is indeed about that: not losing detail, being able to implement shadows and depth, and adding more detail to the graphics.

Ultimately, for me it's not just about improving the graphics and giving Simutrans a bit of a visual refresh for the user, but also about providing a better tool for everyone making add-ons—so what you're already creating in 32-bit is displayed in Simutrans with depth, shadows, and details that we can't offer today with the current renderer.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

poppo

In my opinion, we need to decide how to treat special colors for 24bit colors.

Player color has only 8 variations of brightness, and we can only set the player color from about 28 colors.
The number of special colors are too less, with the 24bit well-resolution graphic.
(And more, we also need to check the variation and how to define light colors in the night)

24bits (32bits) is not hard task for pak makers because most image editing software supports 24(32) bits PNG file.

victor_18993

Poppo, I think that's one of the issues to address. I'd like to have the input of Prissi and the rest of the maintainers to get a broader view.


Thank you very much for your contribution.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: poppo on September 06, 2026, 09:19:28 AMIn my opinion, we need to decide how to treat special colors for 24bit colors.
Look at this discussion:
https://forum.simutrans.com/index.php/topic,23978.msg213136.html
More special colors lead to many lighting pixel in old graphics.
Who has fought against glowing ghost pixels knows, this is a real nuisance.
All the old PNG files would then have to be reworked.

A good solution is a mask graphic specified separately.
Then at least 24 bits are available for all all kinds of special colors.
And if a mask graphic is specified then the old special colors should be ignored.


victor_18993

QuoteLook at this discussion:
https://forum.simutrans.com/index.php/topic,23978.msg213136.html
More special colors lead to many lighting pixel in old graphics.
Who has fought against glowing ghost pixels knows, this is a real nuisance.
All the old PNG files would then have to be reworked.

A good solution is a mask graphic specified separately.
Then at least 24 bits are available for all all kinds of special colors.
And if a mask graphic is specified then the old special colors should be ignored.



I'm already looking into evolving MakeObj so the prototype can be used for testing; this might help serve as a testing platform to unblock agreement on the special color specifications, for example, or test how the graphics look.

I'll let you know as soon as I update the repository.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

A small update on the RGBA32 / true32 work.

The project has moved forward quite a lot since the last update. The experimental runtime can now load the new XR32 image data while keeping the normal IMG data as a fallback, so old content and older Simutrans versions remain compatible.

The main pieces are now working together:
  • true RGBA32 rendering
  • legacy IMG fallback
  • player colours and special colour semantics
  • day/night changes
  • transparency and antialiased semantic edges
  • native zoom for XR32 images
  • substantially reduced memory usage and first-draw/zoom costs

The native zoom was probably the hardest part. Player colours cannot simply be averaged when an image is scaled, so this needed a new runtime representation that keeps the different colour contributions separate. That design is now implemented and has passed the current pixel-level validation without mismatches.

We have now consolidated the work into a single candidate and are cleaning the remaining laboratory code. It is still experimental and not yet an SVN candidate: there is one runtime path that still needs explicit test coverage, and broader compiler/platform testing is still pending. Makeobj production integration will also come later.

Once the current cleanup is complete, I think we have accumulated enough progress to publish a new laboratory GitHub pre-release, so people can start testing it with real saves, paksets and hardware while we continue preparing the eventual Standard candidate.

So the project has moved from "can true 32-bit graphics work in Simutrans?" to mainly "is the implementation clean, sufficiently covered and portable enough for upstream review?"
I'll keep posting updates as those last stages are completed.



En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

[Experimental] True 32-bit (ARGB8888) renderer - Windows test build, feedback wanted

An experimental prototype of a true 32-bit ARGB8888 screen renderer for Simutrans
Standard is available for testing. It is NOT integrated into Standard, it is not an
official release, and it is not a stable version.

Download (Windows x86_64, SDL2):
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-4-r12261-testing-1

What it does: the screen framebuffer and the per-player image caches become ARGB8888
instead of RGB565, so day/night shading, transparency, blending, player colours,
outlines and zoom filtering work with 8 bits per channel instead of 5/6/5. Pakset
image data, savegames and the network protocol are unchanged.

The archive contains two executables built from the same source tree:

    simutrans-rgba32.exe  the 32-bit renderer - the one to test
    simutrans-16bit.exe    the ordinary 16-bit renderer - for comparison

Comparing the two on the same world is the most useful thing you can do.

How to run it:

    1. Extract into a folder of its own, NOT over your normal installation.
    2. Copy in a pakset (pak64, pak128, ...). None is bundled - please use your own.
    3. Use COPIES of any savegames you try.
    4. Run:  simutrans-rgba32.exe -singleuser
      -singleuser keeps settings, saves and screenshots inside that folder
      instead of your Documents\Simutrans.

What would help most:

    - zoom: scroll over a large map at every zoom level, watching tile edges
    - info windows: tile, station, convoy, depot, line - especially at zoom
      levels other than the default one
    - transparency: underground view, cursors, transparent building mode
    - player colours with more than one player, and day/night transitions
    - long sessions, an hour or more on a busy map
    - save and reload, compared against simutrans-16bit.exe on the same save

A note on XR32: the build can read an optional extra node in a pak file, but no
public pakset contains one and the makeobj that would write them is not part of
this candidate. Your usual paksets bring no new XR32 content, so there is no XR32
visual improvement to look for here. Testing the 32-bit renderer with ordinary
paksets is the useful test.

Reporting: https://github.com/Dkijas/simutrans-true32-renderer/issues
There is a "Bug / regression" template. Please include the pakset and version, your
Windows version, the steps from a fresh start, and - this matters more than usual,
because most of the changed code is clipping and zoom - the zoom level and which
window was open. A screenshot and a minimal savegame help.

This is a candidate, not a proposal to merge. It can and probably will change based
on what testing and the discussion here turn up.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

I had a look at the code. It seems, the only difference is the output being 32 bit, but the images pixels still RBG565 bit? It's a bit lost in the include files.

For 32 bit, I think the darkening needs to be handled in the images on the fly with lazy caching, like zoom, and not using lookup tables which are impractically large compared to cache size. With 16 bit 128kB, bit with 4*(2^24) => 64MB, not fitting most caches anymore and thus almost slower than a calculation. Moreover, modern processor have a lot of parallel bytewise operations, so bytewise darkening could be very optimised by the compiler. If all fails, one could use a 256 bit table for darkening one channel after the other, but that sounds again slow (It will fit in the Level 1 cache ...)


makie

Quote from: prissi on September 10, 2026, 03:55:56 AMFor 32 bit, I think the darkening needs to be handled in the images on the fly with lazy caching, like zoom, and not using lookup tables which are impractically large compared to cache size. With 16 bit 128kB, bit with 4*(2^24) => 64MB, not fitting most caches anymore and thus almost slower than a calculation. Moreover, modern processor have a lot of parallel bytewise operations, so bytewise darkening could be very optimised by the compiler. If all fails, one could use a 256 bit table for darkening one channel after the other, but that sounds again slow (It will fit in the Level 1 cache ...)
Why was darkening handled via a lookup table in 16-bit colors? Presumably to avoid having to check for each of for the various special colors.

Darkening itself is very simple isn't it? Just simply subtract a value from each color. Arithmetic operations on modern CPUs are very fast, whereas memory accesses are slow.

In the future, we want to have even more special colors. These should be encoded in a separate graphic plane.

The question is: is there a need for handling a special color for this pixel? Is there a special color at this tile at all? If no then do darkening with subtraction.

QuoteIf all fails, one could use a 256 bit table for darkening one channel after the other, but that sounds again slow (It will fit in the Level 1 cache ...)
That doesn't work. To identify a special color, all three colors must be compared.

From my point of view, the old-style special colors should be separated into a own graphics layer during loading. That is necessary for 32-bit colors anyway.

Edit supplement:

If there is a wish for a lookup table, then the index should be a program internal sequential number, so that the table keep small and convert all spezial colors in this index. That would also keep the graphics layer for special colors small.
------
I don't have Windows, only Linux.



victor_18993

Hi, I'm looking over your comments and the code. I got back to work from vacation this week and haven't had much time, sorry.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Thanks both for reviewing the code.

Makie, a Linux x86_64 build is now available in the same pre-release:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-4-r12261-testing-1

Download the linux-x86_64-sdl2.tar.gz archive. It includes both renderers for comparison. Please use your own pakset, a separate folder, -singleuser and copies of your saves.

It was built on Ubuntu 26.04 and tested under WSL2 with a virtual display, so desktop feedback would help. It is dynamically linked; if it fails to start, please send your distribution and the terminal error.

Prissi, you are right: the legacy stored images remain 16-bit. The framebuffer and screen caches are ARGB8888, but that cannot recover colour detail already lost in the source.

The current implementation already caches the darkened images lazily. It also does not use a lookup table covering the full 24-bit colour space: the colour tables total about 267 KiB in this build, around 136 KiB more than the 16-bit version.

Makie, special colours already have dedicated codes and compact palette entries, but that is not the independent graphics plane you are proposing. Your suggestion goes further, especially where colour and alpha are still packed together in the legacy format.

For now, I have kept the candidate unchanged so we can compare behaviour. Feedback on zoom, info windows, transparency and longer sessions would be very welcome.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

I started the program and, oh shock, the window was completely black. No error message, nothing. Somehow I got the idea to resize the window and there it was, the pak set selection. Otherwise, the game runs without any issues. Trees with transparency flicker when they extend above the map. Tested on a large map with big cities.


old


supplement:
Performance -> ok
CPU using -> marginally higher
RAM using -> approximately the same

victor_18993

Thanks, Makie! I reproduced the black window and found the cause: the 32-bit renderer was missing its initial clipping rectangle, so nothing was drawn until resizing the window set one. Your resize tip helped track it down.

The fix is verified locally, and I'm preparing an updated Linux build.

I haven't reproduced the tree flicker yet. Which pakset and version are you using? Does it also happen with the 16-bit executable from the same archive? A savegame showing the affected area and the zoom level would help.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Yona-TYT


victor_18993

QuoteQuote from: Yona-TYT on 12/9/2026, 3:24:20
I'll wait for this one to do some testing. 


The Linux version is now available on GitHub, cheers.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Yona-TYT

error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory

There are dependency issues in Fedora.

The following are needed: libbz2.so.1.0

But Fedora only has:

/usr/lib64/libbz2.so
/usr/lib64/libbz2.so.1
/usr/lib64/libbz2.so.1.0.8


Edit.

I've created a library link in Fedora to match the one Simutrans looks for; however, this is just for testing purposes. The expected behavior is for Simutrans to work with the library links that the system provides by default.


The first issue I see is that the package installation window isn't displaying correctly:

'/home/yonatan/Descargas/simutrans-rgba32-revised5-r12261-linux-x86_64-sdl2/simutrans-rgba32'  -debug 3
Simutrans version 124.5.1 Nightly from Sep 12 2026 r12261
Message: simu_main():    Parsing /home/yonatan/Descargas/simutrans-rgba32-revised5-r12261-linux-x86_64-sdl2/config/simuconf.tab
Message: simu_main():    Version:     124.5.1 Nightly  Date: Sep 12 2026
Message: simu_main():    Debuglevel:  3
Message: simu_main():    base_dir:    /home/yonatan/Descargas/simutrans-rgba32-revised5-r12261-linux-x86_64-sdl2/
Message: simu_main():    install_dir: /home/yonatan/simutrans/paksets/
Message: simu_main():    user_dir:    /home/yonatan/simutrans/
Message: simu_main():    locale:      es
Message: dr_os_init(SDL2):    SDL Driver: wayland
Message: SDL_StartTextInput:   
Message: dr_query_screen_resolution(SDL2):    screen resolution width=1366, height=768
Message: simu_main():    simgraph_init disp_width=704, disp_height=560, fullscreen=0
Message: dr_query_screen_resolution(SDL2):    screen resolution width=1366, height=768
Message: dr_os_open():    Screen requested 704,560, available max 1366,768
Message: internal_create_surfaces(SDL2):    Renderer: opengl, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888
Message: internal_create_surfaces(SDL2):    Renderer: opengles2, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888
Message: internal_create_surfaces(SDL2):    Renderer: vulkan, Max_w: 16384, Max_h: 16384, Flags: 14, Formats: 2, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888
Message: internal_create_surfaces(SDL2):    Renderer: gpu, Max_w: 16384, Max_h: 16384, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888
Message: internal_create_surfaces(SDL2):    Renderer: software, Max_w: 0, Max_h: 0, Flags: 13, Formats: 8, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB555
Message: internal_create_surfaces(SDL2):    Using: Renderer: opengl, Max_w: 16384, Max_h: 16384, Flags: 10, Formats: 9, SDL_PIXELFORMAT_ARGB8888
Message: dr_os_open(SDL2):    SDL realized screen size width=704, height=560 (internal w=704, h=560)
Message: simu_main():    .. results in disp_width=704, disp_height=560
Message: simu_main():    Loading colours from /home/yonatan/Descargas/simutrans-rgba32-revised5-r12261-linux-x86_64-sdl2/config/simuconf.tab
Warning: simwin.cc themes_init():    Can't read themes from themes.tab
Message: font_t::load_from_freetype:    trying to load 'font/cyr.bdf' in size 11
Warning: font_t::load_from_freetype:    Cannot load font/cyr.bdf
Message: :    env_t::reload_and_save_on_quit=1
Message: SDL_EVENT:    0x207
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x302
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x302
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x302
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x400
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x200
Message: SDL_EVENT:    0x100


makie

Quote from: victor_18993 on September 12, 2026, 01:11:32 AMI haven't reproduced the tree flicker yet. Which pakset and version are you using? Does it also happen with the 16-bit executable from the same archive? A savegame showing the affected area and the zoom level would help.
It is pak128.german, you can always assume this if makie don't note else.
The Map is: https://makie.de/viele-große-stadte.sve
Zoom Level is not important, but move around with the mouse change the speed of flickering.
Quoteonly Trees with transparency
Look at the shadow of the trees and i think some load for the CPU is need.

QuoteDoes it also happen with the 16-bit executable from the same archive?
No

Addendum regarding "viele-große-stadte.sve":
If you try to load this map using a debug version of the program, an assertion by Prissi regarding invalid city boundaries is triggered. You might want to remove that assertion for testing purposes.

makie

Quote from: Yona-TYT on September 12, 2026, 03:22:05 AMWarning: simwin.cc themes_init():    Can't read themes from themes.tab
Message: font_t::load_from_freetype:    trying to load 'font/cyr.bdf' in size 11
Warning: font_t::load_from_freetype:    Cannot load font/cyr.bdf
@Yona-TYT
I think your test folder miss this, or the path isn't set.

I admit I ignored Victor's test instructions and simply threw the program into my normal installation.
That way, I don't have problems like that.

victor_18993

I'll look into the issue with Fedora and let you know as soon as I have something,




cheers.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Thanks, Makie and Yona-TYT! Your reports helped track down the startup bugs.

A new Linux build is ready:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-7-r12261-testing-1

It fixes the black startup window and missing text, and no longer needs the manual library symlink. The same package was tested on Debian 13, Fedora 43 and Fedora 44 using virtual X11 sessions.

Yona, could you try it and let me know whether both problems are gone? Please extract it into a separate folder, run with -singleuser and use copies of your saves.

Makie, the tree flicker is still open. A savegame and your pakset version would help me reproduce it.

This update is Linux-only; the Windows downloads are unchanged.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Yona-TYT

Quote from: victor_18993 on September 12, 2026, 05:15:58 PMYona, could you try it and let me know whether both problems are gone? Please extract it into a separate folder, run with -singleuser and use copies of your saves.
Perfect, I can now start Simutrans without any problems.  8)




There is a bug  when I use zoom out / in in the minimap, see this video:

https://github.com/Yona-TYT/imgs/raw/6bb25bf23767c90a6d91e333fcb4bad947a8df8f/Grabaci%C3%B3n%20de%20pantalla%20desde%202026-09-12%2015-08-20.mp4

Some icons are misaligned in the factory window:

makie

Quote from: victor_18993 on September 12, 2026, 05:15:58 PMMakie, the tree flicker is still open. A savegame and your pakset version would help me reproduce it.
Look above posting #21

Addendum:
16-bit mode also exhibits the rendering glitch affecting trees with alpha channels; however, there is no flickering, and the issue only appears when moving the mouse cursor (magnifying glass) from outside the map, across the map edge, and directly onto the tile containing the tree.

This is clearly visible with deciduous trees in autumn or spring. With coniferous trees, only the shadow rendering is incorrect.

If 32-bit doesn't flicker move around with the mouse cursor (magnifying glass) over trees and watch the trees at the map margin.

victor_18993

Revised-8 is now available for Linux SDL2 and Windows SDL2/SDL3:

https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-8-r12261-testing-1

It fixes the minimap drawing outside its window when zooming and the misaligned icons reported by Yona. The Windows builds also include the previous fix for missing text at startup.

Yona, could you check the minimap and factory window again? Thanks for the video — it helped catch the brief drawing error.

Makie, could you also retest the trees at the map edges? The image-offset fix may be relevant, but I have not reproduced the flicker and cannot claim it is fixed. "No change" would also be useful feedback.

Each package includes 32-bit and 16-bit executables for comparison. Please extract into a separate folder, add your pakset, run with -singleuser and use copies of your saves.

Still experimental and not integrated into Simutrans Standard.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Yona-TYT

It works fine now.

You know, I've noticed something interesting: your Linux builds do show the window decorations that the GNOME compositor assigns, but the official Simutrans versions don't.

So, the window should look like this (Your builds are fine):


Official version (GNOME compositor decorations don't appear):



Edit.

The currency symbol (Euro) is not displaying correctly; I suspect this also affects the official version:



By the way, Isaac is still punishing us with the attachments files.    ;D

makie

Quote from: victor_18993 on September 13, 2026, 11:21:04 PMMakie, could you also retest the trees at the map edges? The image-offset fix may be relevant, but I have not reproduced the flicker and cannot claim it is fixed. "No change" would also be useful feedback.
No change.

Yona as a role model—here are some videos:
new 32 bit
old 16 bit

As you can see, the bug itself is old, but it is triggered more frequently in 32-bit mode.

The alpha channel is drawn to the image itself multiple times; essentially, the image with the alpha channel is drawn over itself repeatedly.

Without an alpha channel, this goes unnoticed, since drawing the same image multiple times makes no difference.

prissi

It goes away, when using the outside graphics:
draw_outside_tile=1

I guess the outside "color" at that point is still white. Thus, there is nothing to blend with, and any belding will increase the brightness of the pixels.

victor_18993

I'll have to take a look at the project, sorry for the hiatus but I've had quite a bit of work lately, I'll try to share updates as I make progress,




Best regards.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi makie,

I've published revised-9 with the fix for the map-edge tree/shadow flickering you reported:

https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-9-r12261-testing-1

I can reproduce the problem reliably with revised-8, and with revised-9 it disappears in my tests. The change also fixes the same issue in the 16-bit renderer.

If you have a chance, could you try revised-9 with the savegame where you originally saw the problem? Your confirmation would be especially useful since your report led us to the root cause.

Thanks again for the recordings and for helping test this 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on September 23, 2026, 03:21:58 AMHi makie,

I've published revised-9 with the fix for the map-edge tree/shadow flickering you reported:

That looks good. I can't find any more errors.

victor_18993

Hi, I'm going to rebase everything onto the 125.0 stable branch to continue, I'll let you know as soon as the new beta is released.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi everyone,

I've published **RGBA32 revised-10** as a new public testing release:

https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-10-r12322-testing-1

This version has been rebased onto **r12322**, just after the Simutrans 125.0 release, so it is now much closer to the current codebase.

The main goal is still the same: **keep full compatibility with existing 16-bit paksets while allowing 32-bit RGBA artwork on top**.

Since revised-9, this build includes the XR32 asset pipeline, 1x/2x MRES support, CRC/bounds checks and the partial-transparency fixes. Windows SDL2, Windows SDL3 and Linux test builds are included, together with a small XR32 test kit and the source patches.

This is still an **experimental testing build**, not trunk and not an official Simutrans release.

The main open issue is still antialiased edges involving special colours such as company colours and lights. That will probably need explicit metadata from the artwork/exporter rather than trying to guess it inside Makeobj.

If anyone wants to test it, I'd be very interested in screenshots, visual regressions, crashes or cases where legacy paksets behave differently from normal Simutrans.

Thanks to everyone who has helped with testing and feedback so far.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on October 02, 2026, 03:55:19 PMThe main open issue is still antialiased edges involving special colours such as company colours and lights. That will probably need explicit metadata from the artwork/exporter rather than trying to guess it inside Makeobj.
I don't understand; please explain.

victor_18993

Quote from: makie on October 02, 2026, 04:02:33 PMI don't understand; please explain.
Sure. What I mean is this:

Simutrans recognises company colours and light colours because some exact RGB values have a special meaning.

For example, if a pixel is exactly a company-colour value, the game knows that it has to replace it with the selected player's colour.

The problem appears at antialiased edges.

Imagine a company-coloured area next to a normal grey area. Blender or another graphics program creates intermediate pixels between them to make the edge smooth. Those pixels are no longer the exact Simutrans company colour — they are mixtures of the company colour and grey.

So when Simutrans reads the image, it can recognise the central company-colour pixels, but it cannot know that those intermediate edge pixels were also intended to belong partly to the company colour. To the game they just look like ordinary RGB colours.

The same problem exists around night lights.

We tested trying to guess this automatically in Makeobj, but it is not reliable enough. Different artwork can produce the same intermediate RGB colour for completely different reasons.

That is why I mentioned metadata from the exporter. For example, Blender could export the normal RGBA image plus a small mask saying:

"these pixels belong to company colour 1"
"these pixels belong to this light"

Then Simutrans would know the intended meaning even on smooth/antialiased edges.

Exact special-colour pixels already work correctly. This is only about preserving their meaning through the partially blended pixels around their edges.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on October 02, 2026, 08:37:44 PMSo when Simutrans reads the image, it can recognise the central company-colour pixels, but it cannot know that those intermediate edge pixels were also intended to belong partly to the company colour. To the game they just look like ordinary RGB colours.
Yes
QuoteWe tested trying to guess this automatically in Makeobj, but it is not reliable enough. Different artwork can produce the same intermediate RGB colour for completely different reasons.
Please don't do it.

You try to generate the special colors via Blender automatically. My be this is possible or not. This is a special problem to Blender. Please do not integrate a solution to this problem in Makeobj.

The workflow of Pumuckl999s and my and may be some other graphic designer is:

Step 1: Create the the picture regardless of special colors.
Step 2: Eliminate the accidentally created special colors by replacing it to nearby color.
Step 3: Set special colors at the desired position manual.

If in future special colors are in separate plane there is no need for Step 2 and also there is no antialiased edges. See it as a mask, it is pixel exakt and no antialiasing. Maybe sdl3 or the graphics card do it for scaling. This is then after darkening for the night and handle the player colors.

The graphic stock contain no anti-aliased special colors.

prissi

I think too, either the old way as before (since we have already 32 bit PNGs anyway) or a new entry, with a second image name after a semicolon ";" with the mask. (Or even for. But I think atleast for the player colors, unsing red and green for masking with player colors 1 and player color 2 should be straight forward.) Maybe even a third image with the night appearance? So at dawn, the images are blended, which gives all the freedom for a night image.

victor_18993

Thanks, this makes sense.

I agree that Makeobj should not try to guess antialiased special colours from the final RGB image. The better direction is to keep that information explicit in the artwork/export pipeline, for example with separate masks/layers for player colours and lights.

I'm going to prototype that approach for XR32, while keeping legacy paksets fully compatible. I'll also look at the optional separate night image idea as a possible second step.

Thanks for the feedback — it matches very well with what the tests were already showing.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi everyone,

I've published a new public testing build of the 32-bit renderer work:

Revised-11 testing-1
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/rgba32-revised-11-r12322-testing-1

This version is mainly about solving one of the trickiest parts of the 32-bit work: special colours around anti-aliased edges.

Until now, we were trying to infer things such as player colours and lights from the final rendered image. That works in simple cases, but starts to become unreliable once Blender, anti-aliasing and semi-transparent edge pixels are involved.

Revised-11 changes the approach.

Instead of asking Makeobj to guess the meaning of those pixels, the artwork can now provide the visual image and the semantic information separately.

That gives us a much cleaner pipeline for things such as:

- player/company colours
- lights
- multiple lights affecting the same pixel
- anti-aliased edges
- linear-light composition
- normal RGBA transparency

The important part is that this does not replace the normal image. The visible artwork stays exactly that: the artwork. The extra data simply tells Simutrans what some pixels mean.

For artists, the public test kit includes simple examples for manual 2D work and Blender, so you can see how the idea works without needing the internal test material I used during development.

Compatibility has also been an important part of this work.

Old pak files continue to work with the revised renderer, and the existing old test paks are unchanged. I also tested the new semantic paks with the older builds that were actually part of the compatibility tests.

Windows and Linux Makeobj builds generate the same pak bytes, and the renderer results match between the tested Windows and Linux builds.

There is one known performance issue in testing-1:

For 32-bit images without semantic masks, rebuilding the zoom cache is currently around 10–12% slower than revised-10. This happens when the zoom level changes, not every frame during normal gameplay.

I already have that isolated as a separate optimisation task, so I decided not to delay this testing build or mix an untested optimisation into it. If the fix is good, it can go into testing-2.

A few other notes:

- macOS and Android have not been runtime-tested for this version.
- The Blender exporter changes are still prototype patches, not yet part of the published Blender Kit.
- Object Studio can validate semantic masks, but it does not yet have a full editing UI for them.
- The Renfe S453 artwork I used for some internal accuracy tests is not included in the release.

At this point I'd really like feedback from pakset artists and testers.

In particular, I'm interested in whether this workflow feels understandable from an artist's point of view, and whether you see any visual regressions with existing paksets.

If you test it, please mention your OS, build used, pakset and what you were testing. Screenshots are very welcome if something looks wrong.

Thanks again to everyone who commented on the earlier versions. The move away from colour-guessing and toward explicit semantic data came directly from those discussions, and I think revised-11 is a much stronger direction because of it.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Do you mean a mask per each player color? I think using the old player colors at (maybe 15%) PC0 TO (80%) PC7 and similar for the second player color. This way, the colors would stay the same for 16 bit and 32 bit paks, as surely users would (and should) be able to mix paks visially.

When talking about blender, rendering night images would be rather trivial and remove the need for special night colors althougether, allowing for an easy automated work flow. And even for handdrawn paks, adding a nigh image can easily done using the base image and then enabling all kind on night effects.

Not everyone uses blender, especially the Japanese community uses pixels a lot. Having so many extra maps woudl be prone to errors. But a single extra night map seems rather straight forward.

And for paks without night images or old paks, night images could be generated on load time, leading to unified handling of the night for all images, leaving only the player colors for special treatment.

So something like
Image[...]=IMG.a.b[,x,y][;Night-IMG.a.b[,x,y]|-][;PC1-IMG.a.b,x,y|-][;PC2-IMG.a.b,x,y]shoudl be even manageable for handdrawn images and give even more flexibility.

victor_18993

Quote from: prissi on October 04, 2026, 09:46:58 AMDo you mean a mask per each player color? I think using the old player colors at (maybe 15%) PC0 TO (80%) PC7 and similar for the second player color. This way, the colors would stay the same for 16 bit and 32 bit paks, as surely users would (and should) be able to mix paks visially.
When talking about blender, rendering night images would be rather trivial and remove the need for special night colors althougether, allowing for an easy automated work flow. And even for handdrawn paks, adding a nigh image can easily done using the base image and then enabling all kind on night effects.
Not everyone uses blender, especially the Japanese community uses pixels a lot. Having so many extra maps woudl be prone to errors. But a single extra night map seems rather straight forward.
And for paks without night images or old paks, night images could be generated on load time, leading to unified handling of the night for all images, leaving only the player colors for special treatment.
So something like
Image[...]=IMG.a.b[,x,y][;Night-IMG.a.b[,x,y]|-][;PC1-IMG.a.b,x,y|-][;PC2-IMG.a.b,x,y]shoudl be even manageable for handdrawn images and give even more flexibility.
Thanks, I think I understand the direction you mean now.

For player colours, yes: my current prototype stores explicit semantic information rather than trying to recover the player colour from the final anti-aliased RGB pixels. Keeping the traditional PC0–PC7 / second-player colour behaviour also sounds important to me, especially so that 16-bit and 32-bit objects can still be mixed without looking inconsistent.

Your night-image suggestion is particularly interesting.

If I understand it correctly, instead of carrying increasingly complex semantic information for lights, a 32-bit object could optionally provide:

- the normal/day image,
- a night image,
- and player-colour information.

For older paks, or objects without a night image, Simutrans could generate the night representation at load time using the traditional behaviour.

That would give the renderer a much more uniform model while also making the Blender workflow considerably simpler, since the artist can simply render the actual night appearance instead of encoding every light semantically.

It also seems much friendlier for hand-drawn graphics than having several different semantic maps.

I don't want to change revised-11 now that the testing build is published, but I think this is worth investigating as the next architecture step.

I'll make a small isolated prototype and compare the two approaches, particularly memory/pak size, day/night transitions, old-pak compatibility, player colours and the manual pixel-art workflow before proposing anything for trunk.

Thanks — this is exactly the kind of feedback I was hoping to get from the testing release.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on October 04, 2026, 10:00:07 AMYour night-image suggestion is particularly interesting.
The question that arises for me is: Can i create a night image from a day image, using GIMP for example, in the same way Simutrans does?
Adding lighting effects to a night image in GIMP is easy. Where I see a problem is in achieving a consistent map at night when using night images from various sources—old ones, new ones, or ones from a different pakset.


victor_18993

QuoteQuote from: makie on 4/10/2026, 12:29:13
I miss a compiled makeobj.

I'm uploading the compiled version of Makeobj now, I'll let you know, 


cheers.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi prissi,

I finished the public testing build of the DAY + optional NIGHT prototype based on revised-11:

https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12322-testing-1

The short version is: your idea works well, but the measurements point to a hybrid approach rather than replacing the legacy path.

For new XR32 content:
- DAY + optional NIGHT works well;
- traditional player colours are preserved;
- the legacy dusk transition can be matched correctly;
- artists gain much more freedom for lights and night effects.

For old content:
- keeping the existing legacy path is clearly better;
- generating NIGHT images at load time is too expensive in memory and cache rebuild time.

The current measured cost for native DAY/NIGHT content is roughly:
- +75–93% XR32 image memory
- +20–47% cache rebuild cost
- +2–12% pak size
- no measurable per-frame difference in the tests

I also published makeobj for Windows and Linux x86_64, and both produce byte-identical test paks.

Before taking this any further, I think there are three design decisions worth discussing:

1. image identity / merging, because the current merge logic can associate the wrong extra XR32 data;
2. whether the extra NIGHT image memory cost is acceptable;
3. whether the pak format should use an explicit marker rather than relying on filename syntax.

So I would treat this as a public architecture prototype for discussion, not as revised-12 yet.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

The old images are kept at 16 bit and not converted to 32 bit on load time? (Or rather lazily when used the first time?) I mean, the night images could be also rendered lazily, since many player do not use night mode.

victor_18993

Yes — I checked this directly.

Legacy images are already handled lazily: the original 16-bit pak data stays as-is, and the 32-bit representation is only created in recode_img() the first time the image is actually drawn. Scaled versions are also created on first use and then kept in memory.

The current DAY+NIGHT prototype does not do the same for NIGHT. NIGHT is fully decompressed when the pak is loaded, even if the player never uses night mode.

I made a small local prototype that lets NIGHT reuse the same lazy path as legacy images. The NIGHT data stays compressed after loading and is only decompressed the first time that image is actually drawn at night.

It does not change Makeobj or the pak format, and the rendered output is identical to the current prototype: 63,524 cache comparisons matched exactly, including dusk transitions, player colours, glow outside the DAY silhouette, zooms and MRES.

The main benefit is DAY-only memory use:
- pak64: 15.25 MB -> 8.67 MB (-43%)
- pak128: 57.27 MB -> 30.44 MB (-47%)

After the first night the memory usage becomes the same as before, because the NIGHT data is kept once materialized.

The trade-off is a one-time first-use cost. In the heaviest synthetic case I measured, 1,000 pak128 images reaching their first night together increased that frame from about 43 ms to 210 ms.

So your suggestion is definitely practical, and it reuses an existing engine mechanism rather than introducing a new cache system.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

I have run the new makeobj with STLAB_XR32_WRITE=1
It doubles the pak size.

In the game it looks all ok (beside the not working keyboard commands as shift 2)

But the graphics are 16 bit.
Look at this screenshot:

It is 4x enlarged for better visibility. It is the seawater. Left is the screenshot and right is how it should look. I am sorry i do right the tile position not exactly. You can see left there are only 16 various blue which leads to steps and areas.

For testing the water.pak
https://makie.de/seawater.zip

victor_18993

Thanks for the test, makie — your pak is actually fine.

I checked the full path and the 32-bit data is there and renders correctly. The missing step is that the test build also needs to be started with:

SIMUTRANS_XR32=1

Without that, Simutrans simply ignores the XR32 data and uses the legacy 16-bit images instead, which matches your screenshot exactly.

So this is mainly a documentation issue on my side — I did not make that runtime switch clear enough in the test release.

Thanks also for the seawater.zip and the screenshot; they made this very easy to isolate.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on October 06, 2026, 02:08:42 AMSIMUTRANS_XR32=1
ok this is the trick

At a quick glance, everything seems to be working. When zooming in to the map, there are occasional stray pixels at the tile edges. I'm not sure if that was already the case before.

I need to take a closer look at this when I have more time. It seems to me that I'll need to tweak the pak a bit in a few places.

makie

I'm a bit disappointed; I had expected more. The 16-bit and 32-bit versions look so similar that I initially suspected something wasn't working. It seems Pumuckl999 rendered most of his graphics in 16-bit color, so there's no difference. Many are dithered too. Though, I've often done that myself to avoid ugly-looking surfaces.

You really have to look closely to spot the differences.
Take a look at the roof inside the red circle in the image; the difference is only really visible when you zoom in. The onion dome above it to the left also has a slightly lighter, greenish sheen. The green area above the text and below the onion dome is smoother as well; however, Pumuckl did some tweaking on the onion dome itself with a pattern to prevent the surface from breaking up.



From my perspective, the 32-bit color is working fine.
I'll let you know if I find any later issues.

Nevertheless, the change is worthwhile because, in the future, there will be no need to account for the problems arising from 16-bit colors.


[DE]
Ich bin etwas enttäuscht. Ich hätte mir mehr erwartet. 16bit und 32bit sehen sich derart ähnlich dass ich anfangs glatt vermutet habe dass etwas nicht funktioniert. Pumuckl999 hat anscheinend die meisten seiner Grafiken auf 16 bit Farben gerendert, so dass kein Unterschied ist. Auch sind viele gedithert. Ok ich habe das auch oft getan um hässliche Flächen zu vermeiden.

Man muss wirklich suchen um Unterschiede zu finden.
Siehe Bild das Dach im roten Kreis. Den Unterschied sieht man erst in einer Vergrößerung wirklich. Auch das Zwiebeldach links darüber hat einen leicht hellern grünlichen Schimmer. Auch die grüne Fläche über dem Schriftzug und unter der Zwiebel ist glatter, aber dass die Zwiebel ein Muster hat, da hat Pumuckl nachgeholfen dass das nicht aufreißt.

Aus meiner Sicht funktioniert das mit den 32 Bit Farben.
Wenn ich noch einen Fehler finde melde ich mich.

Trotzdem lohnt die Änderung, weil man in Zukunft nicht mehr Rücksicht nehmen muss, auf die Probleme die sich aus den 16 Bit Farben ergeben.

makie

Another comparison of the cigarette factory.
Left: 16-bit; right: 32-bit.
At the bottom, I smoothed out the dithering using a blur effect.
The magnification is 8x, without anti-aliasing.
The small is 1x

makie

Found a bug:
If you zoom out max, there are pieces of the overhead line of the railways next to it. Too big and in the wrong place.

victor_18993

A new XR32 DAY+NIGHT testing build is available:

https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12337-testing-1

Important:
SIMUTRANS_XR32=1 must be set when starting Simutrans, otherwise it will use the legacy 16-bit graphics.

This build is now based on trunk r12337 and includes:
- the newer zoom table from r12336;
- fixes for 40px toolbar icons and icon_scaling;
- the fix for thin XR32 images/catenary appearing too large and displaced at extreme zoom-out;
- the existing DAY+NIGHT prototype.

Thanks to makie and Frank for the real-world testing and reports — both helped uncover issues that were not visible in the original test cases.

If you try it, feedback is especially welcome on:
- extreme zoom levels;
- catenary / wayobjs;
- larger GUI icons/themes;
- DAY/NIGHT graphics;
- gradients and alpha/transparency.

This is still an experimental testing build, so please report anything that looks wrong.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: makie on October 08, 2026, 06:47:05 AMIf you zoom out max, there are pieces of the overhead line of the railways next to it. Too big and in the wrong place.
That works now. Thank you.
-----------------------------------
At zoom levels other than 1:1, there are still distracting pixels along the tile edges when a dark road is drawn against a light background—though this doesn't bother me much.

See video:
https://makie.de/f32kr.webm
For comparison: old at maximum zoom in.

In old version, the street has more distinct stains.

Otherwise, things are going well.


QuoteDAY/NIGHT graphics;
I'm still not entirely clear on how to create the graphics for nighttime. How do you convert a daytime graphic into a nighttime graphic using, for example, GIMP?
How does Simutrans handle that? After all, it's supposed to look just like the old graphics.

makie

Oops, the menu bar is getting dimmed too. Was it like that in the previous version as well? I don't think so.

victor_18993

Quote from: makie on October 13, 2026, 10:12:08 AMOops, the menu bar is getting dimmed too. Was it like that in the previous version as well? I don't think so.

Thanks for pointing this out!
The toolbar does look unusually dark in your screenshot, especially compared to the settings window.
I'll look into it and compare the behaviour with previous versions to determine whether this is a recent regression or an existing issue related to the day/night brightness handling.
Could you confirm whether the toolbar also appears dark during daytime, or only at night? That would help narrow down the cause.
Thanks again for reporting it!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on October 18, 2026, 11:34:32 PMCould you confirm whether the toolbar also appears dark during daytime, or only at night? That would help narrow down the cause.
The menu bar dims when switching from day to night, like the map. Menus that are opened during the night also appear dark. When switching back to day mode, the menu bars become normal bright again—just like the map.
----------------------------------------------------------------------------------
Inspired by the thread here:
https://forum.simutrans.com/index.php/topic,24140.0.html
With a discussion on anti-aliasing.

In 2022, I experimented with a "pak512.german" set. To do this, I upscaled the "pak128.german" using anti-aliasing. I also added individual objects—such as the E69 locomotive, the "Adler" train, and various pedestrians—in higher resolution. I was curious to see how it would look in 32-bit color, so I processed the existing assets through the new version of "makeobj." The process took an hour; the uncompressed output was 14 GiB, and the compressed ZIP file is 9 GiB. It loads slowly and requires 24 GiB of RAM, but it actually runs quite well. The only issue is zooming: depending on the size of the window on the screen, the game tends to crash quickly when you try to zoom in or out.
I take that back; my computer simply ran out of RAM. It's running perfectly now with 32GiB of RAM and a 60GiB swap partition.

I find that this version in particular benefits significantly from 32-bit color. Surprisingly, the issues along the edges between the tiles disappear. If you'd like to compare, you can download the original 16-bit version—just remove the "32" from the link. Incidentally, the link below has been intentionally altered so that AI and search engine crawlers don't stumble upon this 9GB file; Otherwise, they would bring my server to its knees and cut off my internet access. Unfortunately, the project is dead, Pumuckl was already on his way to go and is no longer active, but it still serves well for testing purposes and for demonstrating what is possible.

PAK521.german-32.zip

[DE]
Mit einer Diskussion über Kantenglättung.

Ich habe im Jahre 2022 Versuche mit einem pak512.german gemacht. Dazu habe ich das pak128.german mit Kantenglättung hochskaliert . Einzene Objekte wie die E69, die Adler und einzene Fußgänger habe ich in höhere Auflösung ergänzt. Mal sehen wie das in 32bit Farben aussieht. Also den alten Stand durch das neue makeobj gejagt. Lief eine Stunde, unkompiermiert 14GiB als Zip noch  9GiB. Es läd langsam und brauch 24 GiB im Arbeitsspeicher aber läuft eigentlich gut. Nur Zoomen darf man nicht, je nach Größe des Fensters auf den Bildschirm stürzt es schnell beim Zoomen ab. Das nimm ich zurück, meinem Rechner ist schlicht der Arbeitsspeicher ausgegangen. Es läuft mit einer Swap von 60GiB und 32GiB wunderbar.

Ich finde gerade diese Version profitiert gut von den 32bit Farben. Erstaunlicherweise verschwinden die Problem bei den Kanten zwischen den Kacheln. Wer das Vergleichen will kann die 16Bit Orignal Version runter laden. Das 32 muss dann im Link weg. Der Link unten ist überigens absichtlich falsch damit die Spider der KI und Suchmaschinen den 9GiB Brocken nicht finden. Die würden mir sonst den Server in die Knie zwingen und meinen Internetzugang dicht machen. Das Projekt ist leider tot, Pumuckl war damals schon auf den Absprung und ist inzwischen nicht mehr aktiv, aber zum testen und um zu zeigen was möglich, taug es.

victor_18993

Thank you very much for the information, and especially for sharing your experiment with pak512.german!

Regarding the interface darkening, your confirmation is very helpful. The fact that both the toolbar and the menus become darker only during nighttime gives us a useful starting point for the investigation. I'll take a closer look at how the day/night lighting system interacts with the GUI rendering.

As for pak512.german, your experiment is particularly interesting in the context of our ongoing work on 32-bit graphics support.

What caught my attention most is that the issues with tile borders seem to disappear in the 32-bit version. It would be interesting to determine how much of this improvement comes from transparency and colour handling, and how much is related to the scaling and smoothing process.

The memory requirements are also valuable information. Although such a large pakset would currently be quite demanding for general use, it provides an excellent reference for exploring the graphical engine's limits and identifying potential areas for optimisation.

I'd like to run some controlled comparisons using a smaller selection of objects, with equivalent 16-bit and 32-bit assets, to evaluate visual quality, memory consumption and rendering performance.

This could help us better understand the practical benefits of 32-bit graphics and guide future improvements to the rendering pipeline.

Thank you again for sharing your work. Even if the original project is no longer actively maintained, your experiments could provide valuable insights for the continued development of Simutrans!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi everyone!
I've published a new experimental build of XR32 DAY+NIGHT, now rebased onto Simutrans trunk r12377.
This release includes several compatibility improvements, the new
set_texture_ptr
implementation, and fixes for MRES 2x icons and toolbar scaling.

Available builds:
  • Windows x64 — SDL2 and SDL3
  • Linux x64 — SDL2 and SDL3
  • Updated makeobj with XR32 support

All four build variants passed the automated tests and rendering checks in the tested environments.
The release also includes a test kit, source patches, documentation and known issues.

Download XR32 r12377 testing-1:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12377-testing-1

This is still an experimental project, separate from the official Simutrans trunk.
Feedback and testing are very welcome, especially with different paksets and Linux desktop environments.
Thanks to everyone who has been following the project and sharing feedback!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Please check the new SDL2 update routine. With 16 bit RGB565, the partial updates are faster. However, with SDL3, working directly on the texture (so no need to update it) may be faster as it may be now processed natively by the graphics adapter.

victor_18993

Thanks, prissi! That's an interesting direction, and definitely worth investigating.

I've taken a look at the SDL2 update routine and the differences with the current SDL3 implementation.

I'll run some controlled comparisons between partial texture updates and direct writes through locked streaming textures, testing both RGB565 and XR32's 32-bit rendering path.

One thing I want to verify is whether SDL3 actually reduces the transfer overhead, since locking a texture doesn't necessarily mean we're writing directly into GPU memory.

I'll also check how this interacts with Simutrans' dirty-region updates, as we wouldn't want to lose the efficiency of partial redraws.

If the results show a measurable improvement without affecting rendering correctness or backward compatibility, it could be a useful next step for both SDL3 and XR32.

Thanks for the suggestion!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi everyone!

I've just published XR32 DAY+NIGHT testing-2, still based on Simutrans trunk r12377.

This update focuses on improving stability and visual consistency:
  • Fixed shared images displaying incorrect 32-bit graphics.
  • Fixed 32-bit toolbar icons becoming too dark at night.
  • Improved scaling accuracy and catenary rendering.
  • Fixed additional MRES and zoom-related issues.
  • Preserved compatibility with existing 16-bit paksets.

All automated tests and rendering checks passed on Windows and Linux, with SDL2 and SDL3 builds available.

Download testing-2:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12377-testing-2

I'm also investigating the SDL3 texture optimisation suggested by prissi, comparing partial texture updates with streaming textures to determine whether we can improve rendering performance.

As always, this remains an experimental project outside the official trunk.

Feedback and testing are very welcome. Thanks everyone!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Quote from: prissi on November 01, 2026, 01:45:58 PMPlease check the new SDL2 update routine. With 16 bit RGB565, the partial updates are faster. However, with SDL3, working directly on the texture (so no need to update it) may be faster as it may be now processed natively by the graphics adapter.

Thanks, prissi! I've been investigating your suggestion, and the initial results are quite interesting.

I've completed 522 benchmark runs on a Radeon 780M at 1920×1080, comparing partial texture updates with locked streaming textures.

So far, the existing dirty-rectangle approach performs better than direct texture locking. With SDL3/D3D11, locking requires a full framebuffer redraw in our tested implementation, adding around 7 ms per frame. SDL2/D3D9 also shows an additional 1.4–3 ms.

However, your suggestion helped uncover a useful optimisation for XR32!
The current XR32 renderer uploads the entire framebuffer every frame, even when only a small area changes. Adapting the existing dirty-rectangle mechanism reduces frame time by approximately 0.4–1.3 ms in the real-game scenarios tested so far.

I also found two minor XR32 rendering issues during validation, related to alpha handling and day/night redraws.

I'm still completing the remaining backend and regression tests, so these are preliminary results. I'll share the final findings once the measurements are complete.

Thanks again for pointing me in this direction!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi prissi,

I've completed the investigation into your SDL2/SDL3 texture update suggestion, with 920 benchmark runs on a Radeon 780M under Windows 11.

The results are quite interesting!

For the official renderer, the existing framebuffer and partial
SDL_UpdateTexture approach remains the best option in the configurations tested.

With SDL3/D3D11 at 1920×1080, drawing directly into a locked streaming texture was around 4–16 ms slower per frame. SDL2 showed an additional 1.4–2.5 ms.

The main issue is that texture contents are not guaranteed to survive locking and unlocking. In our D3D11 tests, this required redrawing the entire framebuffer. The transfer cost is not necessarily eliminated either; it can simply move to the unlock operation.

However, the investigation revealed a useful improvement for XR32.

XR32 currently uploads the entire framebuffer every frame, even when only a small region has changed. Adapting the existing dirty-rectangle approach reduces frame processing time by approximately 0.3–1.1 ms at 1080p, reaching 1.7 ms at 2560×1440 in the tested scenarios.

The validation also uncovered two XR32 rendering issues involving alpha blending and day/night screen invalidation. Both are corrected in the experimental candidate.

The framebuffer comparison tests report zero differences for the corrected SDL2 and SDL3 implementations, and the existing XR32 regression tests continue to pass.

My recommendation is to keep the current trunk implementation unchanged and adopt partial texture updates for XR32 after completing the remaining platform validation.

These results are currently limited to one integrated AMD GPU under Windows. Other GPUs and operating systems still need testing.

Thanks again for the suggestion. It led to a measurable improvement for XR32 and helped us better understand the existing rendering pipeline!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Simutrans updates always the entire frame buffer, but transfers only the changed positions. Maintaining these regions is some overhead.

Allegro used the framebuffer directly and thus was much faster than SDL (1 at the time). However, they frequently broke their API with each release and it was not very portable (only DOS at the time). There was some support in the sources, but was removed when no longer working properly. (The softpointer support stemmed from that age, as DOS has no mouse pointer ...)

victor_18993

Thanks, prissi! That's a useful clarification, and the historical background on Allegro is interesting too.
You're right: the framebuffer is still rendered by the CPU. What we've optimised in XR32 is the transfer to SDL, not the rendering process itself.

And yes, maintaining dirty regions introduces overhead. That's precisely why I wanted to measure whether the reduced texture uploads would actually compensate for that additional work.

Fortunately, the results show that they do in scenarios with partial screen updates. At 1080p, XR32 now transfers around 0.15–0.45 MB per frame instead of approximately 7.9 MB, with measurable improvements in CPU frame time.

When the entire screen changes, however, the benefit disappears, and there are even some small regressions in scrolling scenarios.

The optimisation has now passed the XR32 regression and framebuffer-integrity tests on Windows SDL2/SDL3 and Linux under WSLg. It's prepared for the next experimental release.

I also agree that portability and maintainability should remain priorities. One of my main goals with XR32 is to evolve Simutrans without introducing unnecessary complexity or compromising the existing architecture.

Thanks again for sharing your experience. Understanding why certain approaches were adopted or abandoned in the past is extremely valuable when deciding how to move forward.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

XR32 testing-3 released — Dirty-region optimisation and rendering fixes

Hi everyone!

Following the recent discussion with prissi about SDL2/SDL3 texture updates, I've completed another round of development and validation of the experimental XR32 renderer.

XR32 testing-3 is now available:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12377-testing-3

The main improvement is the implementation of partial framebuffer uploads using dirty regions, instead of transferring the entire 32-bit framebuffer every frame.

At 1920×1080, this reduces texture transfers from approximately 7.9 MB to 0.15–0.45 MB per frame in scenarios where only part of the screen changes.

Across the measured scenarios, this resulted in CPU frame-time improvements ranging from 0.06 to 5.5 ms. When the entire screen changes, there is little or no benefit, and some scrolling scenarios show a small regression.

The investigation also helped identify and correct three additional XR32 rendering issues:
  • Incorrect alpha blending during SDL presentation.
  • Missing full-screen invalidation during day/night and company-colour changes.
  • A missing dirty-region invalidation in
    draw_rect.
Validation results:
  • 309/309 automated tests passed.
  • No visual differences in the verified framebuffer/presentation tests.
  • Windows SDL2 and SDL3 tested.
  • Linux SDL2 and SDL3 tested under WSLg (X11/Wayland).
  • No measurable memory regression.
  • Previous XR32 fixes remain intact.
The official 16-bit renderer is unchanged, and XR32 remains fully experimental. Native Linux desktops, macOS, Android, ARM and HiDPI configurations still need additional validation.

Regarding the original SDL discussion, my measurements continue to favour the existing framebuffer + partial
SDL_UpdateTexture approach over direct rendering into locked streaming textures on the tested hardware.

Thanks to prissi for suggesting this investigation, and to tomado for the useful historical context regarding the rendering architecture. Both contributions helped clarify the trade-offs and led to a measurable improvement in XR32.

I'm now investigating another architectural limitation: generating 32-bit water graphics for sloped coast tiles, which currently still rely on the traditional 16-bit path.

As always, feedback and testing on different platforms are very welcome!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

XR32 — Exploring new graphical possibilities for Simutrans artists



Hi everyone!

Following the recent XR32 testing-3 release, I've been exploring what native RGBA32 artwork could offer to Simutrans artists and pakset creators.

The goal is not to change Simutrans into a 3D game or replace its traditional visual style. Instead, I want to explore how richer colours, more precise alpha transparency and optional DAY/NIGHT artwork could enhance the existing isometric graphics.
I've prepared six original pak128-style sprite examples, each with separate DAY and NIGHT images.



These examples explore glass-roofed structures, transparent water details, vegetation, illuminated windows and signal lights.
The source package includes 12 RGBA PNG files, DAT definitions and reproducible generation code. The image files have been checked, but compilation with XR32 makeobj and in-game rendering still need to be verified.

There are also some interesting possibilities for future artwork, including softer smoke sprites, more detailed colour gradients, transparent glass and lighting effects painted directly into DAY/NIGHT images.

It's important to distinguish these from dynamic lighting, volumetric smoke or GPU effects, which are not implemented by XR32. The traditional 16-bit renderer already supports transparency and special lighting colours; XR32's advantage is preserving richer source colour and alpha information.

I would particularly welcome feedback from pakset artists:
  • Would optional DAY/NIGHT artwork be useful for your projects?
  • Which types of sprites would benefit most from RGBA32?
  • What requirements should the image format meet to remain practical for artists?
XR32 remains experimental, and backward compatibility with existing paksets remains a priority.

Español: Estoy preparando ejemplos gráficos para explorar las posibilidades de XR32: mayor precisión de color, transparencia RGBA y versiones gráficas independientes de día y noche. Son recursos experimentales; todavía deben comprobarse dentro del juego.

日本語: XR32の描画機能を活用した、pak128風の画像サンプルを制作しました。RGBA32による豊かな色表現、透明度、昼夜別の画像を紹介しています。現在は実験段階で、ゲーム内での動作確認はこれからです。日本のpakset制作者の皆さんからのご意見も歓迎します!

Thanks to everyone contributing feedback and technical suggestions to the project!





En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Simutrans supported transparent colors since several versions, and pak192 made ample use of it, e.g. for station roofs. Or the transparent steam of engines, even in pak64.

I think a separate night graphic adds a lot of freedom to the visual design and might be useful even for the old graphics.

For if you need transparent graphics, 2012 Hochbahn or 2000_track_hall in pak192. That could look nicer in 32 bit.
https://github.com/Flemmbrav/Pak192.Comic/tree/Standard/pakset/infrastructure/track/images/station

Andarix

Are the themes included in Simutrans created in 32-bit in their test versions?



Are you sure the files for testing-3 were newly created today? Because the date of the files in the zips is November 30, 2026.

victor_18993

For now, everything being tested in-game is synthetic textures generated by AI to make 32-bit demos. I'm going to see if any artist interested in trying out 32-bit would like to participate, since I've reached a point where I need to test with material created by artists, as AI won't give me enough quality synthetic models.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Andarix

Most graphics from the last 20 years or so are likely 24-bit without alpha.

It's questionable to what extent such graphics can be improved with alpha at a reasonable cost.

It's also questionable to what extent 24-bit graphics are degraded by reducing them to 16-bit. However, this would probably be noticeable in the details and especially with larger packsets. With 64 packsets, the difference will hardly be noticeable. Here, better scaling during zooming will likely be necessary. I can't say whether zooming benefits from 24-bit.

makie

Quote from: Andarix on November 02, 2026, 06:26:18 PMIt's questionable to what extent such graphics can be improved with alpha at a reasonable cost.
In Pak128.german:
All trees have shadows with an alpha channel.
All clouds of steam and smoke are transparent.

I've added / changed that. Previously, there were dithered black pixels. I added an alpha channel and then smoothed out the pixel structure using a blur effect. This is relatively easy to do in GIMP.

That looks significantly better, and not so crumbly.

victor_18993

For now, all benchmarks are being run on pak128German based on what our fellow member pointed out—it seems to be the pak with the most images adapted for a new system, and there are also lots of buildings from OTRP, etc... but the official one right now for all my benchmarks is Pak128German.

Recently I added pak192Comic to use 32-bit images, but I haven't finished testing yet. There are still about 6 hours of testing left on pak128German, which will give me the benchmark results so I can let you know if a new version of XR32 will be released.

Hopefully tomorrow I can post new data, and with any luck, if there are significant improvements, a new version.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

XR32 testing-4 released — 32-bit water now works on sloped coasts

Hi everyone!
I've just published XR32 testing-4, another experimental build of the 32-bit graphics prototype for Simutrans.

This update addresses an issue we've been investigating: although open water and flat coasts could already use RGBA32 graphics, the water on sloped coast tiles was still generated from the legacy 16-bit sea image.

What's new in testing-4?

The water on sloped coasts now uses the pakset's RGBA32 sea graphics, including during day/night transitions and at different zoom levels.

I've also introduced a small shared cache for the coast composition process. This reduced the reconstruction cost by approximately 4–5 times compared with the initial, unpublished implementation.

The 16-bit renderer remains unchanged, and existing paksets without 32-bit water continue to use their previous rendering behaviour.

Visual comparison
The following screenshot uses a deliberately magenta test sea to make the difference easy to identify. It is a real engine capture, not an AI-generated illustration.

https://github.com/Dkijas/simutrans-true32-renderer/raw/xr32-prissi-night-image-prototype-01-r12377-testing-4/docs/images/testing-4/xr32-r12377-testing-4-coast-mutant.png[/img[/url]]

Known limitation
At zoom 2/1, a few isolated sand-coloured pixels may appear in the water next to sloped coasts. This is a known issue (A11/H1) and will be investigated separately.

https://github.com/Dkijas/simutrans-true32-renderer/raw/xr32-prissi-night-image-prototype-01-r12377-testing-4/docs/images/testing-4/xr32-r12377-testing-4-h1-2x1.png[/img[/url]]

Testing and performance
The implementation passed 309 automated tests, along with graphical and stability checks on Windows SDL2/SDL3 and Linux under WSLg.

Typical frame times showed no measurable change. Some frames that rebuild coast water still have additional costs, particularly when zooming. Native Linux, macOS and ARM have not yet been certified.

Download testing-4:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12377-testing-4
To enable RGBA32 rendering, launch simutrans-rgba32 with SIMUTRANS_XR32=1.

A pakset containing actual 32-bit water data is required to see this particular improvement; the bundled test kit does not include one.

This remains an experimental build, not an official Simutrans release.

I'd also like to thank prissi, Markus and everyone who has contributed feedback. The discussions about transparency, lighting, NIGHT artwork and artist workflows have been particularly useful.

My next focus is validating real RGBA32 artwork from existing paksets, including Pak192.Comic, while preserving the graphical features that Simutrans already supports.

As always, feedback and testing are very welcome!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Why not using the same drawing as for the 16 bit water, as this is already animated using the transparent slopes and just uses drawing order? Blending is needed for the climates too, but I think you are already using that in the ground desc anyway.

victor_18993

Quote from: prissi on November 02, 2026, 11:50:34 PMWhy not using the same drawing as for the 16 bit water, as this is already animated using the transparent slopes and just uses drawing order? Blending is needed for the climates too, but I think you are already using that in the ground desc anyway.
Hi Prissi,
Thanks for the suggestion! That's a very good point, and it's particularly relevant to the coastline zoom issue we're currently investigating.

XR32 already reuses part of the existing system, including the slope geometry, masks and water animation structure.
The main difference is where the actual water colours come from.

In testing-3, the generated sloped-coast tiles still used the legacy 16-bit water texture, even when the pakset provided an RGBA32 version. This caused visible colour differences between open water and sloped coastlines.

Testing-4 addresses that by deriving those tiles from the original RGBA32 water artwork while retaining the existing slope geometry.

However, your suggestion raises an interesting question: could we reuse more of the original transparency and drawing-order mechanism instead of generating additional composed images?

That might also help with the remaining zoom alignment issue, although we'd need to verify the visual results and performance before changing the implementation.

You're also right about climate blending. The existing blending mechanisms are reused, but some internally generated terrain transitions still operate with 16-bit image data. Extending those paths to preserve RGBA32 precision is on the roadmap.
I'll include your suggestion in the A11/H1 investigation.

Thanks again! These kinds of observations are extremely valuable for keeping XR32 as simple and maintainable as possible. 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

The ground.ClimateTexture are still processed as 16-bit.

The same applies to the ground.LightTexture.
Especially in these cases, the effect is striking. The steps are clearly visible.


For tests this is a pak128.german with 32bit and removed dithering.
https://pak128-german.de/PAK128.german_2.5_beta.zip

victor_18993

Quote from: makie on November 03, 2026, 09:57:14 AMThe ground.ClimateTexture are still processed as 16-bit.

The same applies to the ground.LightTexture.
Especially in these cases, the effect is striking. The steps are clearly visible.


For tests this is a pak128.german with 32bit and removed dithering.
https://pak128-german.de/PAK128.german_2.5_beta.zip

Hi makie,
Thank you! This is a very useful observation, especially because you've provided a real pakset where the colour banding is clearly visible.

I've checked the current XR32 ground texture generation path, and you're right: ClimateTexture and LightTexture are still involved in 16-bit processing when the game generates ground tiles.

Testing-4 introduced a specific RGBA32 path for sloped-coast water, but the equivalent work for climate textures and slope lighting has not been completed yet.

🎨 This is particularly interesting because it could produce a much more noticeable visual improvement than simply preserving the original colours of individual sprites.

I've added both areas explicitly to our next graphics milestone (A12):
🔹 RGBA32 climate texture composition.
🔹 RGBA32 slope lighting and texture generation.
🔹 Preservation of existing terrain geometry and compatibility.

Your Pak128.German test resource gives us a very useful starting point for reproducible before/after comparisons.
The immediate priority is finishing testing-5, but A12 is becoming one of the most important next steps toward a visible graphics upgrade.

Thanks again for your contribution and for providing a practical test case! 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

Hi makie! 👋
Thank you again for pointing out the colour precision loss in
ClimateTexture and
LightTexture, and for providing a real Pak128.German test case.

🎨 Good news: your observation has already led to a working XR32 improvement!

I've completed the first A12 implementation and its technical validation, with some very encouraging results:

✅ ClimateTexture and LightTexture now use their RGBA32 data when generating terrain tiles.
✅ All 520 generated terrain tiles match an independent 8-bit reference model, pixel for pixel.
✅ Visible colour banding is greatly reduced:
  • One slope increased from 198 to 1,820 colours.
  • Snow increased from 16 to 480 colours.
✅ Terrain geometry, existing 16-bit graphics, company colours and previous XR32 corrections remain unaffected in the tested cases.

⚠️ One interesting difference: the terrain is now noticeably brighter, particularly the snow (approximately +8 to +13 RGB levels per channel). This comes from removing the old 5-bit colour truncation.
The climate, snow and beach transition masks still use their traditional 32 blending levels. Improving those separately remains on the roadmap.

Performance is unchanged in normal static or scrolling views, although some lighting and zoom transitions require slightly more processing.

🔬 Current status: CERTIFIED WITH LIMITATIONS — local candidate only. Not yet released.
I'd especially appreciate your artistic feedback on the brighter terrain. Our goal isn't simply to increase the number of colours, but to preserve the original artistic intention as faithfully as possible.

I'll share real in-game before/after comparisons once the testing-6 preparation is complete.

🙌 Thank you for helping us identify an improvement that could make a genuinely visible difference to Simutrans!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on November 03, 2026, 08:32:13 PMI'd especially appreciate your artistic feedback on the brighter terrain. Our goal isn't simply to increase the number of colours, but to preserve the original artistic intention as faithfully as possible.
I have reworked ClimateTexture—and not just by removing the dithering. Without this overhaul, the effect would barely be visible. I'm curious myself to see how it will look as a complete map; I might need to refine it further. It's quite possible that it will end up being brighter or more colorful.

In general, 32-bit color is a great thing: it offers more creative freedom, and, importantly, it eliminates the need for dithering—which otherwise compromises the detail and sharpness of the graphics.

However, the graphics do need to be adapted to take advantage of these new possibilities.

victor_18993

Hi makie! 👋

Thanks for the update! It's great to hear that you've already reworked ClimateTexture and may continue refining it.
As promised, I've prepared some real in-game comparisons showing the improvements from our latest XR32 work.

🎨 A12 — ClimateTexture and LightTexture in full 8-bit colour

The implementation is now technically certified on Windows SDL2 and SDL3, with some documented limitations.

The results are encouraging: the generated terrain no longer suffers from the previous 5-bit colour quantisation, gradients are noticeably smoother, and the original colour precision is preserved.
https://files.simutrans-germany.com/upload/comparison.rar
I've attached five comparisons:
  • Slopes: improved colour gradients and reduced banding.
  • Snow: differences in brightness and colour reproduction.
  • Steep snow slopes: a closer look at the brightest areas.
  • Climate transitions: the current behaviour with the existing blending masks.
  • Night rendering: how the new terrain composition behaves under night lighting.

One particularly interesting finding is that A12 produces brighter terrain, especially snow. We verified that this comes from removing the colour precision loss in the old renderer, rather than introducing additional brightness.

There is one detail worth discussing: four of the steepest illuminated snow tiles become pure white. This is caused by the combination of the pak's snow texture and light map. It was already present in the previous rendering path, although A12 makes the brighter result more apparent.

Since you've been working on ClimateTexture yourself, I'd really appreciate your artistic perspective:
  • Does the new rendering look closer to what you originally intended?
  • What do you think about the snow and the illuminated slopes?
  • Would you prefer adjusting the artwork, or does the more accurate colour reproduction look right to you?

The transition masks still use 32 blending levels, and A12 remains an unpublished local candidate for testing-6.
My goal is not simply to display more colours, but to ensure that the renderer respects the work of Simutrans artists as faithfully as possible.

Many thanks to you and the Pak128.German contributors for the artwork and the opportunity to test these improvements. Your feedback is genuinely helping shape XR32! 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

This looks good—just as I had imagined it.
Regarding the snow on the sun-facing slopes: it's true that the snow appears brilliantly bright in the sunlight. We have to see how it looks on a whole map. If it's too bright, we can simply darken the snow texture; We should not intervene from within the program.
Furthermore, it is also possible to darken the Light Texture.

victor_18993

Hi makie! 😊

Thank you for your feedback! I'm glad the results are close to what you expected.

I completely agree with your approach. The renderer should preserve the original artwork as accurately as possible, rather than artificially adjusting brightness to compensate for the old 16-bit limitations.

If the snow appears too bright when viewing the entire map, adjusting the snow texture or LightTexture in the pakset would be the more appropriate solution.

This is precisely what we're trying to achieve with XR32: giving artists greater control over colour, lighting and gradients without the engine losing precision during rendering.

For now, I'll keep the A12 implementation unchanged and proceed with the experimental testing-6 release.
Your observations have been extremely valuable in guiding this development. Thanks again for your contribution! 🎨
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

victor_18993

🚀 Simutrans XR32 — Testing-6 is now available!

I'm pleased to announce that XR32 testing-6 (r12377) has been published as an experimental pre-release for Windows and Linux!

🔗 Download:
https://github.com/Dkijas/simutrans-true32-renderer/releases/tag/xr32-prissi-night-image-prototype-01-r12377-testing-6
🎨 What's new — A12: 8-bit generated terrain
Following makie's observation that
ClimateTexture and
LightTexture were still being processed at 16-bit precision, we've implemented a new RGBA32 terrain composition path.
This allows the engine to preserve much more of the original artwork's colour information when generating terrain, slopes and snow.

The results are encouraging:
✅ ClimateTexture and LightTexture now use their XR32 colour data.
✅ Much smoother terrain gradients, with substantially less colour banding.
✅ Terrain displays approximately 2–4 times as many colours in the tested Pak128.German scenes.
✅ All 520 tested generated terrain tiles match an independent 8-bit reference model, pixel for pixel.
✅ The traditional 16-bit renderer, existing XR32 format, company colours, coast rendering and previous fixes are preserved.
The terrain may now appear brighter, particularly snow, because the old 5-bit colour truncation is no longer applied. This represents the source artwork more faithfully, although the artistic evaluation of complete maps is still ongoing.

🖥� Available builds

Windows x64
  • SDL2 — certified with limitations.
  • SDL3 — certified with limitations.
Linux x86_64
  • SDL2 — experimental, not certified.
  • SDL3 — experimental, not certified.
The release also includes makeobj for both platforms, source code, patches and documentation.
⚙️ How to enable XR32
Windows CMD:
set SIMUTRANS_XR32=1Linux:
SIMUTRANS_XR32=1 ./simutrans-rgba32For creating XR32-enabled pak files with makeobj:
STLAB_XR32_WRITE=1A compatible pak containing XR32 image data is required to see the improvements. No pakset is included in the release.
⚠️ Known limitations
  • Climate, snow and beach transition masks still use 32 blending levels.
  • Changes of lighting and zoom can require slightly more processing when rebuilding terrain images.
  • Some strongly illuminated snow slopes may become pure white.
  • Linux builds have not undergone full graphical certification.
  • XR32 remains experimental and is not yet integrated into the official Simutrans trunk.

Please use a separate installation and back up your savegames.
🙌 Acknowledgements

Special thanks to makie, whose observations and Pak128.German artwork helped identify and validate this improvement, and to prissi for his technical direction and contributions to Simutrans.
Thanks also to the pakset artists, the Japanese Simutrans community and everyone contributing ideas, testing and feedback.

💬 Feedback welcome!
I'd particularly appreciate feedback on:
  • Terrain gradients and climate transitions.
  • Snow brightness and illuminated slopes.
  • Performance during zoom and day/night changes.
  • Any Windows or Linux rendering issues.

Please include your operating system, SDL version, pakset and screenshots when reporting a problem.
XR32 is gradually moving from a working 32-bit rendering prototype towards a more complete graphics pipeline.
Thank you all for helping us get there! 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

makie

Quote from: victor_18993 on Yesterday at 03:53:28 AM⚠️ Known limitations
    • Climate, snow and beach transition masks still use 32 blending levels.
Either it works with more than 32 levels, or 32 levels are sufficient for this purpose. In any case, the result is fine as it is. I wouldn't change anything.
--------------------------
LightTexture

Terrain edges are OK, however corners in terrain edges are processed using 16-bit ClimateTexture and also 16-bit LightTexture .





makie

I ran a test on the overexposed, snow-covered slopes. I reduced the contrast of the light texture until structures on the sunlit slope became visible. It doesn't look good. At least on my screen, the contrast range isn't sufficient for a visually satisfactory result. The result might be better on an HDR screen, but who has one of those? In any case, it's unnecessary for playing Simutrans.

On the other hand, the snow slopes in Simutrans have always been overexposed, and nobody has complained.
I'll leave it as is.

martin509

Quote from: makie on Yesterday at 04:50:41 PMOn the other hand, the snow slopes in Simutrans have always been overexposed, and nobody has complained.
I'll leave it as is.

If I'll chime in, I'll say that I've definitely seen comments to the tune of "I tried Simutrans, but the [default pakset] graphics were eye-searing so I gave up and uninstalled" before. One reason we don't hear complaints may be because the people in the community giving feedback are going to be the ones who stuck around and either got used to it or moved to a pakset that's gentler on the eyes, and not the ones that uninstalled after five minutes.

I'm curious how the snow looks if you leave the contrast alone but turn down the overall brightness, if you haven't tried that already.

makie

Quote from: martin509 on Yesterday at 05:56:26 PMif you leave the contrast alone but turn down the overall brightness, if you haven't tried that already.
That's not possible. The brightness and contrast of all the more than a thousand objects are coordinated to fit together.

What's possible: Each player can change the brightness and contrast of their display. This can be done either directly on the monitor itself or in the screen settings of the respective system.

makie

Quote from: makie on Yesterday at 11:32:21 AMLightTexture

Terrain edges are OK, however corners in terrain edges are processed using 16-bit ClimateTexture and also 16-bit LightTexture .


New findings:
16-bit processing of terrain edges only occurs if the LightTexture contains special colors—for example, 6b6b6b.
If the LightTexture does not contain any such special colors, the terrain edge is processed using 32-bit color.

If you look closely at the picture, you can spot a few blue pixels; these are the special colors, which appear as blue pixels wenn within the LightTexture.

makie

For tests this is a pak128.german with 32bit and removed dithering.
https://pak128-german.de/PAK128.german_2.5_beta.zip

With an improved LightTexture.

From my perspective, everything is currently working.