Skip to main content
Topic: GDI versus SDL (Windows only) (Read 19562 times) previous topic - next topic

GDI versus SDL (Windows only)

As of Simutrans-Experimental version 3.10, it has, like Simutrans-Standard, been available in both GDI and SDL versions for Windows. Eventually, I plan to release full installer packages for each platform, including Windows, incorporating a complete Simutrans-Experimental compatible pakset, and all the files necessary to run Simutrans-Experimental without the user having to undertake configuration. For the Windows release, I am interested in people's views as to whether the GDI or SDL version ought be preferred. Any testing would be much appreciated, especially with 192 sized paksets (I have had some trouble with SDL with Pak192.Comic and maximising the window).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: GDI versus SDL (Windows only)

Reply #1
GDI, I will vote if asked to choose one.
SDL can not allow type asian language. Although it can display.
Of course I can still manage with SDL so its not that strong request from me.
Also SDL feel like runs little smootier.

Re: GDI versus SDL (Windows only)

Reply #2
For me, SDL runs seamlessly at 2048x1536, whereas GDI is slow even at startup screen size.

Re: GDI versus SDL (Windows only)

Reply #3
I use SDL, but most likely just because I always used the SDL version.

Re: GDI versus SDL (Windows only)

Reply #4
I use SDL version because it runs smoother and "hangs" only for a second when loading new music track (while the GDI version does that often in 3-5 seconds, which is annoying pause in the middle of intense transport network building). I also notice that GDI version is in general slower and more "choppy" - the minimap and main map scroll smoother on SDL, the loading times seem to also be somehow shorter on SDL.
As far as I remember I used SDL version of the game whenever possible. The only quirk is that the fulscreen window mode (I mean, when you maximize window), the window seem to be misaligned by about half the title bar upwards (half the title bar if offscreen, there is appropriate gap below the bottom of the window and the windows bar), but it doesn't hurt gameplay at all.
Never used anything aside from pak64 and pak128, so no idea how pak192 works (and if it does).


Re: GDI versus SDL (Windows only)

Reply #6
I use GDI, but most likely just because I always used the GDI version.

Re: GDI versus SDL (Windows only)

Reply #7
I prefer SDL version :)

Re: GDI versus SDL (Windows only)

Reply #8
Knightly,

why do you prefer the SDL version?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: GDI versus SDL (Windows only)

Reply #9
James,

As Dantedarkstar said, GDI causes quite a few seconds of freeze when loading new music track. I also experienced this. Thus, I think it's better to have SDL, so that players will not experience such freezes. :)

There should also be a "historical" reason for preferring SDL version, as I always choose it over GDI for Simutrans Standard. However, I can't remember that reason now :P

Re: GDI versus SDL (Windows only)

Reply #10
Sadly the SDL version on windows uses exactly the same midi routines as the GDI version ...

Re: GDI versus SDL (Windows only)

Reply #11
I always downloaded both, but mostly used SDL. Reason? It sounds better then GDI. I think I'm not experienced enough and not aware of the real difference between those two, I'm also not aware of future compability issues, but I remember GDI doesn't require extra components to be installed, so that slightly got my preference.
Played Simutrans in:
~ The Netherlands ~ United Kingdom ~ Taiwan ~ Belgium ~


Simutrans player

Re: GDI versus SDL (Windows only)

Reply #12
... not aware of the real difference between those two, I'm also not aware of future compability issues, but I remember GDI doesn't require extra components to be installed, so that slightly got my preference.

SDL is a cross plattform multimedia library, while GDI is Windows only. From a developers point of view that is important, code for SDL will work on many platforms, and needs only to be written once.

From a users point of view things may look different, he mostly is interested what is easier to install and performs better on his platform.

There should also be a "historical" reason for preferring SDL version, as I always choose it over GDI for Simutrans Standard. However, I can't remember that reason now :P

Very old Simutrans versions used Allegro as multimedia library, then came SDL, and later GDI (for windows only, while the others have been used for Windows and Linux, SDL also for BeOS versions). So the historical reason might just be, that at times there was nothing else but SDL.

Re: GDI versus SDL (Windows only)

Reply #13
Very old Simutrans versions used Allegro as multimedia library, then came SDL, and later GDI (for windows only, while the others have been used for Windows and Linux, SDL also for BeOS versions). So the historical reason might just be, that at times there was nothing else but SDL.

Really sorry for misleading you, Hajo, for what I meant by "historical" reason is not really historical. I deliberately put the word "historical" in quotation marks simply because of this -- that is only a joke. I did not discover Simutrans until half a year ago, and IIRC the first version I tried was 99.xx only.

Re: GDI versus SDL (Windows only)

Reply #14
Really sorry for misleading you, Hajo, for what I meant by "historical" reason is not really historical.

No worries :) Maybe I still could shed some light on the topic for the other people who feel confused about the duality of SDL and GDI versions for Windows. Till 2005 or so, there was only SDL.

Re: GDI versus SDL (Windows only)

Reply #15
No worries :) Maybe I still could shed some light on the topic for the other people who feel confused about the duality of SDL and GDI versions for Windows. Till 2005 or so, there was only SDL.


Without trying to get off-topic, if SDL has a broader/cross-platform support, is easier for coders and programmers, then why was GDI invented? Aren't there other options that also and maybe better support our wishes for the future? I can imagine that a specific way of coding wont last for centuries. Are there any hints yet in favor of one or another? Sorry for getting off-topic, but now Simuthaners are busy with implementing experimental functions and some great paks are being developed, maybe switching to a better platform (if existing) might be the right time.
Played Simutrans in:
~ The Netherlands ~ United Kingdom ~ Taiwan ~ Belgium ~


Simutrans player

Re: GDI versus SDL (Windows only)

Reply #16
Edit: I realized only now that this was originally about James' question. I tried to answer to KrazyJay's one, above this post, which is slightly different.

Well. Main advantage of SDL is the multiplatform availability. Apart from that, its implementation on Windows uses DirectDraw to utilize hardware acceleration - thus it easily outperforms GDI, which is mostly for drawing user interfaces, the simple and uncomplicated way. If you say GDI to me, I think about things like buttons and windows and menus - that's the GDI stuff, not games. The hidden gem is, along with the underlying Windows, GDI can handle well letters like ěščůýáííýäшвпиעִבְרִית海外のフリ and millions others. Specifically reading them from keyboard, which is where SDL kind of fails.

That Simutrans can use more backends for i/o is really a blessing. It's much better than just being tied to one, albeit multiplatform library.

And by the way, SDL sucks, as many people say. In short: slow development and great resistance to bug reports.

Other options? Allegro is iirc pretty fast as well. Theoretically we could go for full hardware acceleration with OpenGL (just tiles in z-axis). Other than that, there aren't that many options. I didn't know of any and found only two things that might be worthy looking into - SMFL and Cairo. There is a lot of convergence in this area and with Allegro and SDL there is not much need for alternatives. Most of the libraries are just wrappers for SDL or OpenGL anyway.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: GDI versus SDL (Windows only)

Reply #17
As far as performance is concerned, the graphics are not (with the exception of trees, which, both in GDI and SDL slow things down considerably), as far as I can tell, the main drain on performance: the simulation engine itself is the main drain on performance.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: GDI versus SDL (Windows only)

Reply #18
So far I thought I could see the difference. So, I was probably wrong :-\ It is most visible when dragging the screen.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: GDI versus SDL (Windows only)

Reply #19
It may be that the difference shows up more on some systems than others.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: GDI versus SDL (Windows only)

Reply #20
Thanks for the detailed explanation, it's really much appreciated!

Basically, if I get it right, we have SDL for performance and usability on different platforms, and GDI for it's extended language support. It's quite hard to prefer either of those; you sacrifise a litte of speed for the majority in order to keep every language supported or you dissatisfy a smaller group of fans in order to speed up things for the rest. But based on what I have heard today I surely do understand this thread much better.

Hopefully I didn't mess up your original question, James...
 
Played Simutrans in:
~ The Netherlands ~ United Kingdom ~ Taiwan ~ Belgium ~


Simutrans player

Re: GDI versus SDL (Windows only)

Reply #21
Oops, I jut now realized that KrazyJay's question wasn't the beginning of thread. I apologize.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

 

Re: GDI versus SDL (Windows only)

Reply #22
Actually performs depends very much on the display driver. Theoretically GDI should be faster (and on some machines it is), since less overhead occurs. However, Allegro is the fastest, since it lets you draw directly in the screen buffer. eliminating one copy operation. The downside is, that Allegro does not allow window resizing.