Skip to main content
Topic: sdl vs gdi (Read 6416 times) previous topic - next topic

sdl vs gdi

Having just downloaded the all-in-one package, running it, noticing it feels a little slow (default map), then looking around at the 'how to get' post... Looks like there's only one Windows executable. Do I guess correctly that it's based on the GDI binary?

If so, might there be a discussion about compiling an SDL-based binary?

At least on my system, the SDL one offers me tons more speed. Like, I can run SDL full-screen 1600x1200 and scroll smoothly; but with GDI, even at initial smaller size, it's not smooth. That difference in speed means smaller games under GDI...

Now, if I'm wrong and it's already using SDL, it just means on my machine, it's rather slow.

Either way, I'm going not to find out what all was changed over the past few versions so I can try it all out now. :D

Re: sdl vs gdi

Reply #1
Isaac,

thank you for your feedback :-) There is an SDL version regularly compiled for Simutrans-Experimental: it is available with the binaries only package (see here for details). The complete package is designed for less experienced users, and so must be as simple to set up as possible. Having a choice between the GDI and SDL binaries would make things too complicated. I therefore had to decide which to use.

I chose the GDI because (1) it matches the look and feel of Windows better; (2) it does not require its own libraries to be installed; (3) it has a proper icon in the top left hand corner, unlike the SDL version; and (4) for most people, it should be slightly faster, because it requires no extra libraries.

I am not sure why, in your particular case, it is so much slower. However, all that you need to do is download the SDL version from the binaries only package and extract it into the Simutrans-Experimental directory :-)
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: sdl vs gdi

Reply #2
Off-topic: How come roughly 50% of techies (including those on other forums) state SDL is faster, but another 50% says GDI is faster? On Isaac's system GDI doesn't work so well at all, but on my system I hardly see any difference...
Played Simutrans in:
~ The Netherlands ~ United Kingdom ~ Taiwan ~ Belgium ~


Simutrans player

Re: sdl vs gdi

Reply #3
Somewhere down under, both of them try to use hardware acceleration if available (I think, based on what other people said). That could be the difference... depending on how they go about it and what is available (OpenGL vs. DirectDraw). Maybe :)

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: sdl vs gdi

Reply #4
But there's no possibility to use hardware acceleration in Simutrans - there are no 3d graphics...
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: sdl vs gdi

Reply #5
Indeed there is: even blitting bitmaps can get a lot faster if done better - somehow :) Notice that eg. DirectX is a sort of umbrella name for a whole family of technologies (?) named DirectSomething (see Wikipedia entry) and handling 3D is only one component on that list.

But all the libraries hide this aspect thoroughly so there is no telling how much that actually affects us.

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: sdl vs gdi

Reply #6
The actual reason is that simutrans uses 16Bit graphics which is slowly fading out (Vista dooes not offer them on the display setting dialog, even though it still supports them for fullscreen). Depending on the driver going via DirectX, OpenGL, or native may be faster because it still uses the blitter chip for 16bit mode. However, which method is faster is really unpredictable and depends on the graphics driver and OS.

Re: sdl vs gdi

Reply #7
i'm sorry to ask you a silly question, but if 16bit is getting outdated, why don't we switch to a newer format?

Re: sdl vs gdi

Reply #8
I'd list memory consumption and performance problems. At least the drawing routines of Simutrans will get slower with 32 bit images. These are one step earlier in the graphics pipeline than the routines that Prissi mentioned, which will actually display the pre-drawn screen buffer of Simutrans.

It's hard to predict if 32 bit sprites will be faster, but I'd put my bet on "slower" unless Simutrans' drawing routines changed drastically since I worked on them.

 

Re: sdl vs gdi

Reply #9
32 Bit copying is not faster, but also not much slower. But it has double memory consumption for five lookup tables and main screen without any gain ...

Re: sdl vs gdi

Reply #10
how far does the backward compatiblity to old hardware go? i mean that mostly regarding processing power and memory capacity. or are there (plans) for other platforms i overlooked yet.

even with large maps, many cities and convoys it doesn't have any hit on my system, and it's fairly old and was definitely not highend at that time.

ps.: after reading again i think it could be missunderstood, i ask out of interesst only.

Re: sdl vs gdi

Reply #11
The graphics are 16Bit anyway, so there is no new detail to gain from going 24 bits (or 32 bit). Also thinking of I phone and similar gadgets, memory and speed are concerns there.