The International Simutrans Forum

 

Author Topic: GDI versus SDL (Windows only)  (Read 13212 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
GDI versus SDL (Windows only)
« on: May 19, 2009, 12:05:57 AM »
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).

Offline colonyan

  • Devotee
  • *
  • Posts: 526
  • Full and Warm
Re: GDI versus SDL (Windows only)
« Reply #1 on: May 19, 2009, 01:17:56 AM »
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.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3659
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: GDI versus SDL (Windows only)
« Reply #2 on: May 19, 2009, 03:50:05 AM »
For me, SDL runs seamlessly at 2048x1536, whereas GDI is slow even at startup screen size.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: GDI versus SDL (Windows only)
« Reply #3 on: May 19, 2009, 11:30:24 AM »
I use SDL, but most likely just because I always used the SDL version.

Offline dantedarkstar

  • *
  • Posts: 98
Re: GDI versus SDL (Windows only)
« Reply #4 on: May 19, 2009, 01:40:13 PM »
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).

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: GDI versus SDL (Windows only)
« Reply #5 on: May 19, 2009, 01:56:13 PM »
SDL can not allow type asian language.

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

Offline wipi35

  • Devotee
  • *
  • Posts: 250
  • Imagination is more important than knowledge
  • Languages: NL,EN,GE,FR
Re: GDI versus SDL (Windows only)
« Reply #6 on: May 19, 2009, 02:32:36 PM »
I use GDI, but most likely just because I always used the GDI version.

knightly

  • Guest
Re: GDI versus SDL (Windows only)
« Reply #7 on: May 19, 2009, 03:21:42 PM »
I prefer SDL version :)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: GDI versus SDL (Windows only)
« Reply #8 on: May 19, 2009, 03:32:18 PM »
Knightly,

why do you prefer the SDL version?

knightly

  • Guest
Re: GDI versus SDL (Windows only)
« Reply #9 on: May 19, 2009, 03:41:28 PM »
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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9557
  • Languages: De,EN,JP
Re: GDI versus SDL (Windows only)
« Reply #10 on: May 19, 2009, 08:11:55 PM »
Sadly the SDL version on windows uses exactly the same midi routines as the GDI version ...

Offline KrazyJay

  • *
  • Posts: 172
  • Infrastructure & Transportation Junk
Re: GDI versus SDL (Windows only)
« Reply #11 on: May 20, 2009, 07:19:41 AM »
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.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: GDI versus SDL (Windows only)
« Reply #12 on: May 20, 2009, 08:40:17 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.

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

  • Guest
Re: GDI versus SDL (Windows only)
« Reply #13 on: May 20, 2009, 09:56:24 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.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: GDI versus SDL (Windows only)
« Reply #14 on: May 20, 2009, 10:29:34 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.

Offline KrazyJay

  • *
  • Posts: 172
  • Infrastructure & Transportation Junk
Re: GDI versus SDL (Windows only)
« Reply #15 on: May 20, 2009, 04:51:08 PM »
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.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: GDI versus SDL (Windows only)
« Reply #16 on: May 20, 2009, 05:10:04 PM »
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.
« Last Edit: May 20, 2009, 07:26:28 PM by VS »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: GDI versus SDL (Windows only)
« Reply #17 on: May 20, 2009, 06:11:47 PM »
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.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: GDI versus SDL (Windows only)
« Reply #18 on: May 20, 2009, 06:22:27 PM »
So far I thought I could see the difference. So, I was probably wrong :-\ It is most visible when dragging the screen.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: GDI versus SDL (Windows only)
« Reply #19 on: May 20, 2009, 06:27:47 PM »
It may be that the difference shows up more on some systems than others.

Offline KrazyJay

  • *
  • Posts: 172
  • Infrastructure & Transportation Junk
Re: GDI versus SDL (Windows only)
« Reply #20 on: May 20, 2009, 06:51:35 PM »
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...
 

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: GDI versus SDL (Windows only)
« Reply #21 on: May 20, 2009, 07:29:38 PM »
Oops, I jut now realized that KrazyJay's question wasn't the beginning of thread. I apologize.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9557
  • Languages: De,EN,JP
Re: GDI versus SDL (Windows only)
« Reply #22 on: May 20, 2009, 09:54:41 PM »
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.