News:

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

A Simutrans Prettification Project + Open GL dev

Started by _Hajo_, January 31, 2023, 08:20:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andarix

Since these are the crossings, it is reasonable to suspect that it has something to do with the switches for rails, which do not exist on roads.

Wiki - Switches for tracks

Andarix

windows ogl 11019 - v0.03

Windows version crashes immediately upon startup.

_Hajo_

#142
Quote from: Andarix on January 04, 2024, 12:58:44 PMIf I could wish for something, the start screen as a patch for standard.

It wont be easy to do this, because it depends on my open gl related extensions to Simutrans. But it's not impossible.

Quote from: Andarix on January 04, 2024, 04:23:48 PMSince these are the crossings, it is reasonable to suspect that it has something to do with the switches for rails, which do not exist on roads.

It works though with the old pak files with 16 bit graphics, but not with the new ones with 32 bit graphics. So something went wrong there either in my new makeobj, or in the way I load images from the new pak files. Technically Simutrans thinks the crossing are there, I can open an info window for them, just nothing is display on screen. I'll play Sherlock Holmes for a few hours and look for the missing images. Or Indiana Hajo, the quest of the lost road.

Quote from: Andarix on January 04, 2024, 05:19:03 PMWindows version crashes immediately upon startup.

Confirmed. It's because the new backdrop and logo image for the title screen was not included in the download and it fails when trying to load it. Obviously my build scripts need an update. I'll fix that, shouldn't take long.

Edit: I fixed the build script. Windows nightly r11021 worked in my test.
Edit 2: Crossing and switches are back. It was a mistake in my new Makeobj.

Andarix

Do themes also need customization?

The pak64.german theme causes a crash (windows and linux). Since it was selected before the update, starting it also causes a crash.

The start only works after deleting the settings files *.xml.

_Hajo_

I'm now and then testing with the "modern" theme, that used to work. It is my intention to maintain compatibility with both, existing pak sets and themes.

So I consider this a bug. Where can I get the pak64.German theme? I want to test it and fix the problem.

_Hajo_

I did some fixes last evening, related to loading the images from pak files (16 bpp and 32 bpp, I had changed some stuff there for the new 32bpp pak files), and could fix one or two illegal memory accesses. Being used to Java which has automatic memory management and automated access checking, also nothing like malloc and free, I'm notoriously bad with manual memory management in C++, sorry for that. Valgrind helps though.

I've tested the latest nightly for Linux (r11023) and it works with the theme.

_Hajo_

Only small updates this time:

- The minimap got a forced refresh now after the map window was resized.
  This change might also avoid the weird updates in black areas, but I'm not 100% sure about that.

- The minimap got a different, Minecraft-map inspired color scheme.
  To me it looks more friendly, opinions are welcome.

- The "transparent trees" display option works again.

Latest nightly with fresh bugs and yet unseen crashes,
https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

_Hajo_

Some small improvements again:

  • CHG: Improved initial size calculation for display options dialog.
  • FIX: Transparent building display option works again.
  • FIX: Refresh minimap only once after map window resize.
  • CHG: Silver is now standard theme.
  • CHG: Normal text color for pak selector texts.

https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

_Hajo_

Forgot to push a change. There is one more. I've tried to improve the info window for city houses, clean up the info, highlight the numbers.

Build is running, update should be available in a few minutes.

_Hajo_

I've merged the recent changes from Simutrans Standard. There were some conflicts in the domain of making a new map, loading/saving games, the banner and the options window. I've tried to solve them, but there might be problems that I did not catch in my tests.

So, the state before the merge is now here:
https://github.com/Varkalandar/simutrans_ts/releases/tag/GL_v0.03

And the state after the merge can be downloaded here:
https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

Besides fixes and new functions that came from Standard, no changes were made from my side.

_Hajo_

Would it be better to have the numbers right aligned?


Yona-TYT


_Hajo_


isidoro

Wouldn't it be $1000 instead of 1000$?

Flemmbrav

Quote from: _Hajo_ on January 07, 2024, 06:28:46 PMOnly small updates this time:

....
- The minimap got a different, Minecraft-map inspired color scheme.
  To me it looks more friendly, opinions are welcome.
....

I like! I'd also love to set the minimap colours from the Pakset-side, so it'll better fit the climates .

Leartin

Quote from: Flemmbrav on January 11, 2024, 11:39:20 PMI like! I'd also love to set the minimap colours from the Pakset-side, so it'll better fit the climates .
The minimap is a heightmap, not a climate map. Fitting the minimap to climates would work best with the minimap actually showing climates, an Extension Request.
But I agree that minimap colors could be set by pakset. Especially paksets outside the norm (like the new bitlit, the old handdrawn, and even excentrique) would benefit.

_Hajo_

Quote from: isidoro on January 11, 2024, 11:21:51 PMWouldn't it be $1000 instead of 1000$?

Didn't really think about that, it's the same code in Standard. But it will look better with the leading currency sign, indeed.

_Hajo_

Quote from: Flemmbrav on January 11, 2024, 11:39:20 PMI like! I'd also love to set the minimap colours from the Pakset-side, so it'll better fit the climates .

That's possible. Technically it's just a table of numbers, which can easily be read from a file too.

_Hajo_

Quote from: Leartin on January 12, 2024, 09:32:00 AMFitting the minimap to climates would work best with the minimap actually showing climates, an Extension Request.

I think that option already exists. If I remember right, one if the many buttons sets the map to show climates.

_Hajo_

Last coding job before the weekend - I have tried to restore the shore transitions in Simutrans GL. There is a minor difference to Simutrans Standard though. Simutrans GL uses the water texture from the ground textures, Simutrans Standard uses a synthesized texture from the water tiles. I think for most pak sets it should work fine but if needed I can try to adapt to the synthesized texture approach from Standard now that I have figured out the rest of the code.

I think this can be further improved, at the moment I'm happy that I finally figured out how to emulate the alpha mapping of the shore map with the tiles in Open GL.

Good news, I think I can use a similar approach to bring the climate transitions back. They use the same trickery as the shore transitions.

Have a nice weekend everyone!

Leartin

Quote from: _Hajo_ on January 12, 2024, 10:10:07 AMI think that option already exists. If I remember right, one if the many buttons sets the map to show climates.
There is an option to show climates instead of heights. I was thinking of a hybrid, that uses different hues for the climates and brightness for height. Anyway, that's off topic.

_Hajo_

So, finally I got the climate transitions back. My head and vector math surely are no friends. But it works.

There is currently a bug that causes the game to crash shortly after creating a new map. I have not fully figured out why that happens yet, just want to let you know it's on my list.

_Hajo_

I've been working on an Open AL based sound player for Simutrans GL, but sadly a lot of time was lost due to hard-to-solve build problems, libraries and dependencies. Now I have build actions that produce binaries that run with sound on my Linux Mint 21 and Windows 10, but I have no good idea if they will run anywhere else.

Furthermore the sound player is very primitive and needs more work, e.g. it can currently only play one sound at a time.

https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

PS: IF there is no sound, check the sounds settings. It seems the former Simutrans GL versions saved settings with all sounds muted and you have to deselect the "Mute all sounds" box in the sound settings manually to get sounds back.

_Hajo_

Good buttons say "click" now in Simutrans GL!

Most of them ... the pak selector is shown before the game has loaded any sounds, so right now I can'tlet the game play sounds at that time, but the usual in button in the game now make the click sound which is defined by the selected pak set. I hope I can some day change that to a theme defined click sound instead.

The sound player got cleaned up and can play up to 4 concurrent sounds now. Furthermore I could reduce the memory footprint of the Open AL sound player a little. Valgrind says I did not create any new memory errors.

https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

Besides the sound related changes, not much else happened. I have merged all changes from Standard, and it seems to work.

_Hajo_

After making the UI more clicky, I remembered a suggestion of Andarix, to make depot windows show vehicles in the same size for all pak sets. Andarix suggested 96 pixel or 128 pixel size for that. I took 96 for my tests with Simutrans GL.

The zoomed images are of good quality for pak set sizes of 128 and more pixels, but get blurry if smaller images have to be scaled up. I've attached examples from 48 up to 144 pixel sets.

If someone wants to try, the new depots are in this version:
https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

_Hajo_

Still trying to clean up the info windows. Just noticed that money values are formatted differently in different windows. I'll try to unify that.

_Hajo_

I found a pretty bad bug in texture loading that could cause truncated, or partly transparent textures, where there should have been full colored textures shown.

This particularly affected pak sets with many objects and/or large graphics, cause it happened when a new texture atlas page was about to be used. Graphics were still loaded to the former page, at the very bottom and got truncated before the change was actually made.

Now the calculation of when to write to a new atlas page should be correct. So if you had strange filckering, truncated or just missing textures, please try version r11077:

https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly

_Hajo_

Took a while, but I found the cause of the random crashes after generating a new map. My code did not wait for the last simulation loop to finish, and occasionally created a new map while the loop was still running.

I think I got it right now. At least in my tests I had no more random crashes after creating a new map. The fix is in r11083, and I've also merged all recent changes from Simutrans Standard:

https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly


Yona-TYT

#168
Last night Github is not running on my Linux district, however I have tested the Windows executable using Wine and it works.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/casa/Descargas/simulinux_gl-x64(4)/simutrans/simutrans
[Thread debugging using libthread_db enabled]                                                                                 
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: the debug information found in "/home/casa/Descargas/simulinux_gl-x64(4)/simutrans/lib/libXau.so.6.0.0" does not match "/home/casa/Descargas/simulinux_gl-x64(4)/simutrans/lib/libXau.so.6" (CRC mismatch).
[New Thread 0x7fffdfdff6c0 (LWP 12229)]                                                                                       
[New Thread 0x7fffdf5fe6c0 (LWP 12230)]
[New Thread 0x7fffd7fff6c0 (LWP 12232)]                                                                                       
[New Thread 0x7fffd77fe6c0 (LWP 12233)]                                                                                       
[New Thread 0x7fffd6ffd6c0 (LWP 12234)]
Thread 6 "pw-alsoft" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd6ffd6c0 (LWP 12234)]
client_node_transport (data=0x5555569adc60, readfd=25, writefd=24, mem_id=0, offset=0, size=2312)
    at ../pipewire-jack/src/pipewire-jack.c:1588
1588            c->socket_source = pw_loop_add_io(c->loop->loop,                                                             
(gdb) where
#0  client_node_transport (data=0x5555569adc60, readfd=25, writefd=24, mem_id=0, offset=0, size=2312)
    at ../pipewire-jack/src/pipewire-jack.c:1588
#1  0x00007fffde0dce4a in client_node_demarshal_transport (data=<optimized out>, msg=<optimized out>)
    at ../src/modules/module-client-node/protocol-native.c:380
#2  0x00007fffde1dc021 in process_remote (impl=impl@entry=0x5555569d6be0) at ../src/modules/module-protocol-native.c:1037
#3  0x00007fffde1dc808 in on_remote_data (data=0x5555569d6be0, fd=22, mask=1) at ../src/modules/module-protocol-native.c:1071
#4  0x00007fffded02f16 in loop_iterate (object=0x5555569ae378, timeout=<optimized out>) at ../spa/plugins/support/loop.c:496
#5  0x00007fffdedafdd7 in do_loop (user_data=0x5555569ae240) at ../src/pipewire/thread-loop.c:295
#6  0x00007ffff7688897 in start_thread (arg=<optimized out>) at pthread_create.c:444
#7  0x00007ffff770f6fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
(gdb)

Edit.


At least in wine the zoom seems to work better, but that gray rectangle seems intriguing to me.

I'm not sure but I think that is (or should be) the custom image background in the paksets.




209CATrus

Your progress seems really interesting, i think your actions might in fact bring Ranran, the Extended GUI Department Pork, out of stasis. I'm sure he can help you with many things. Also, 128Britain has all its sprites rendered after 3D models, so maybe one day Simutrans goes 3D (not counting on prettiness considering the polycount, but realistic day/night with shadows and whatnot, just slap a pixel filter on).

_Hajo_

Thank you! The gui renovation has turned out to be kinda scary, I want to do a better depot and also a new schedule window, but somehow I feel intimidated and don't actually start the work.

For the 3d part, I think a hybrid display is possible with bitmaps as we have them now and 3d models displyed in between. So a smooth transition seems possible, replacing the bitmaps with 3d models step by step.

Now spring is coming though, and with warmer weather my focus will shift towards gardening and outdoor activities. So progress will slow down some the next months.

Andarix

Quote from: _Hajo_ on January 17, 2024, 07:46:59 PMAfter making the UI more clicky, I remembered a suggestion of Andarix, to make depot windows show vehicles in the same size for all pak sets. Andarix suggested 96 pixel or 128 pixel size for that. I took 96 for my tests with Simutrans GL.

The zoomed images are of good quality for pak set sizes of 128 and more pixels, but get blurry if smaller images have to be scaled up. I've attached examples from 48 up to 144 pixel sets.

If someone wants to try, the new depots are in this version:
https://github.com/Varkalandar/simutrans_ts/releases/tag/Simutrans_GL_Nightly


mmh, an alternative would be to add a customized depot graphic to the pak file.

_Hajo_

So, I'm back for some more Simutrans development. The past months I've been learning Rust, which has some nice ideas, lots of safety checks by the compiler too, but at the cost of being quite restrictive in regard to what sort of code is "legal" to write. That is it has to be written in such a way that the compiler can check the code for correctness, e.g. not to have any race conditions or illegal memory accesses.

Also I've been learning some about more modern OpenGL. More modern than what I used in Simutrans GL so far. It will need some fairly deep changes, but with so called fragment shaders it should be fairly easy to get the player color feature for vehicles and player buildings back. I have no idea though right now about the performance impact, I expect it to be small though.

Not much has happened yet, Simutrans GL now resides in a repository actually named simutrans_gl, and I could merge all changes from Standard up to Monday this week.

https://github.com/Varkalandar/simutrans_gl

I also changed the name of the "nightly" builds to "development snapshots", because they are recreated each time the repository is updated, any time of the day or night.

https://github.com/Varkalandar/simutrans_gl/releases/tag/dev_snapshot

Little additions yet, just support of three font sizes now, the standard size, a larger and a smaller variant. The smaller is used in the minimap at the moment, but it seems hard to read, so maybe I'll revert that change again.

Next I'll do some playtesting and see what bothers me, and what I want to change.

Yona-TYT

I'm glad to see you back here.

Now that I have a modest AMD graphics card I'd like to run some performance tests.  8)