News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

GDI versus SDL (Windows only)

Started by jamespetts, May 19, 2009, 12:05:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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.

colonyan

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.

Isaac Eiland-Hall

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

Spike

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

dantedarkstar

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).
Links+Tutorial: Make heightmap of any part of world !
http://forum.simutrans.com/index.php?topic=2210.0

z9999

Quote from: colonyan on May 19, 2009, 01:17:56 AM
SDL can not allow type asian language.

In latest version, you can paste text from clipboard with Ctrl+V. (Windows only)

wipi35

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

knightly


jamespetts

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.

knightly

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

prissi

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

KrazyJay

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

Spike

Quote from: KrazyJay on May 20, 2009, 07:19:41 AM
... 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.

Quote from: Knightly on May 19, 2009, 03:41:28 PM
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.

knightly

Quote from: Hajo on May 20, 2009, 08:40:17 AM
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.

Spike

Quote from: Knightly on May 20, 2009, 09:56:24 AM
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.

KrazyJay

Quote from: Hajo on May 20, 2009, 10:29:34 AM
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

VS

#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!

jamespetts

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.

VS

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!

jamespetts

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.

KrazyJay

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

VS

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!

prissi

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.