Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 8, 2011, 18:59   #1
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 908
Therem Harth is on a distinguished road
Need advice... X11 vs. SDL

As most of you probably know, I've been working for some time on a T2 variant (or maybe more accurately "semi-variant"). Currently I think it's almost ready to release... But first I'd like to clean up the user interface stuff.

I've got two choices for the UI, as far as I can tell...

1. Use the Windows interface for Windows and the X11 interface for everything else.

The good: more effort seems to have gone into maintaining these interfaces than SDL, and X11 gives me the least grief on Linux.

The bad: sound support only exists for Windows. X11 works on Linux and Mac, but might not work on OSes like Haiku down the road. I don't have a Windows machine I can do development on, so bugfixes for the Windows interface would be... difficult. Finally, shipping binaries for different Linux distros (let alone Mac) might be an issue.

2. Use SDL and ditch everything else.

The good: it's only one UI, and it's cross platform, which should make things easier (once I get my footing with it).

The bad: the T2 SDL interface appears not to have been maintained for a while, and is missing a LOT of features. It is also excruciatingly sluggish, for reasons I'm having trouble figuring out.

...

Which path do you guys think I should take? Seeing as V uses SDL as the default I'm inclined to go that way, but I have a feeling it might be kind of painful.
Therem Harth is offline   Reply With Quote
Old June 8, 2011, 19:04   #2
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,793
Derakon is on a distinguished road
I really don't like the SDL interface for Angband, since I'm heavily reliant on having multiple windows, and SDL only supports one window. Sure you can subdivide that window, but it's nowhere near as usable as having multiple distinct windows.

I don't see lack of sound as being an issue...but then again I haven't tried playing with sound for over a decade. Being unable to debug Windows problems is going to be an issue for you regardless of what you do since you don't have a Windows machine to test on.
Derakon is offline   Reply With Quote
Old June 8, 2011, 19:07   #3
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 38
Posts: 1,516
d_m is on a distinguished road
In a selfish way, I would like for you to work on SDL. I think V's SDL is better than T2's SDL and we could maybe try to port many of its features over. Also, I think SDL has good support for sound and other features.

As far as I know the one big "problem" with SDL is that it only supports using a single window, so you end up with "virtual windows" inside one big (possibly fullscreen) window. I personally like this behavior pretty well although some people might not. The biggest problem I have with SDL right now are the fonts (which I think are ugly) and also the general Angband UI (I think it needs some work, some of the text is too small, weird feel) but I think it's definitely fixable.

Takkaria has talked about moving more of our ports over to SDL and it would need to get some love and attention for that to happen. It'd be great to get another developer on board who's excited about working on SDL and who we could collaborate with.

If you want to chat about it, feel free to hang out in #angband-dev and ask about it. Many of us are idle there but usually someone is around to chat.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old June 8, 2011, 19:09   #4
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 38
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by Derakon View Post
Being unable to debug Windows problems is going to be an issue for you regardless of what you do since you don't have a Windows machine to test on.
This is a huge problem for the current V devteam. As far as I know Fizzix is the only dev who actually runs Windows. I end up working on lots of Windows issues using Mingw + WINE, which is kind of frustrating but does (mostly) work.

If you try to do this I recommend getting crossbuilding working using Mingw + WINE. I can help you get this set up if you're using Linux.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old June 8, 2011, 19:29   #5
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,793
Derakon is on a distinguished road
Getting off-topic, but personally, I think the best way to go moving forwards is OpenGL. This gives you plenty of flexibility at the cost of some increased complexity. I know it took me awhile to figure out how to do 2D display properly in OpenGL, but now that I have it it makes things much simpler for me. And there's no single-window constraint (using a UI library like Qt or wxWidgets), but if you want to you can still do the "virtual subwindow" thing. You just render to a texture and then render that texture to the canvas as a subwindow, instead of rendering directly to the canvas. Presumably the current SDL implementation does something similar using surfaces.

Two big things you can do in OpenGL that SDL doesn't handle well: image transformations and 3D. 'Nuff said about the latter, but for the former, OpenGL could trivially do the 'M' map functionality by simply applying a scaling factor before rendering. SDL does everything in software which makes such effects much more expensive. Of course Angband currently does some "smart" downscaling to fit within the constraints of the ASCII tileset, at the cost of fidelity.
Derakon is offline   Reply With Quote
Old June 8, 2011, 19:49   #6
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 908
Therem Harth is on a distinguished road
Wow, thanks for the replies... I kind of expected nobody to say anything.

Derakon: What are the alternatives? Tk maybe? I know pretty much zilch about GUI programming, but TK looks rather easy to use (at least in scripting languages)...

d_m: I was thinking of trying to port V's SDL interface to T2, but frankly I may not have the skills to do it on my own, so thank you for the offer of help!

Re MinGW and Wine, that sounds like a good idea, and maybe less of a pain than developing on Windows (which I find to be very annoying).

As for OpenGL... In theory, it sounds wonderful. In practice, I'm really not sure. My netbook can run Nexuiz with no problems, but it almost chokes on ToME 4, which makes me think that software rendering in OpenGL is a lot more expensive than in SDL (seeing how fast the Vanilla SDL interface is). And as for hardware acceleration, ideally that should be optional I think. IMO a text-based game should be able to run under Xvesa, or on machines with really bad hardware (think S3 Savage and Unichrome).
Therem Harth is offline   Reply With Quote
Old June 8, 2011, 19:57   #7
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,793
Derakon is on a distinguished road
I've never used Tk myself, so I don't really know what its limitations and capabilities are.

Properly-written OpenGL should be strictly faster than properly-written SDL. SDL uses software rendering for everything, even if you have a graphics card; OpenGL just uses software rendering if a graphics card isn't available. If ToME 4 has a laggy UI, then that's ToME 4's fault, not OpenGL's fault. Put another way, there are thousands of games out there that use OpenGL for rendering, do way more complicated stuff than turn-based tile-based RPGs, and run just fine on ten-year-old hardware.

OpenGL can run over the network, too. I have some apps I maintain for work that use OpenGL rendering and can be run over the network. Of course you wouldn't be able to play inside a terminal (you'd have to use X forwarding instead), but any multi-window mode is going to have that problem.
Derakon is offline   Reply With Quote
Old June 8, 2011, 20:54   #8
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 908
Therem Harth is on a distinguished road
Okay, I think I've reached a decision... I'm going to start trying to port over the V SDL interface in a new branch. For now I figure I'll leave the X11, curses, and Windows modes in; but I will eventually remove stuff like XAW and GTK support.

This is mostly because SDL looks fairly simple to deal with, from what I've seen of it, and a lot of the stuff is there already; whereas OpenGL is a whole new thing, and looks more complicated. Here's to hoping it won't eventually bite me in the rear.
Therem Harth is offline   Reply With Quote
Old June 8, 2011, 22:45   #9
Tobias
Adept
 
Tobias's Avatar
 
Join Date: Dec 2009
Posts: 172
Tobias is on a distinguished road
How do I even start the windows sdl version? I never figured that out.

On linux I only use the sdl version. Having all the subwindows together in a big window is just so convenient.
__________________
My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2
Tobias is offline   Reply With Quote
Old June 8, 2011, 23:07   #10
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Quote:
Originally Posted by d_m View Post
As far as I know the one big "problem" with SDL is that it only supports using a single window, so you end up with "virtual windows" inside one big (possibly fullscreen) window.
This is the reason I never use SDL. Using a single window completely breaks multi-monitor setups. (Most games can get away with it, but in *banding I rely heavily on the various status windows.)

EDIT: Btw, one of the reasons the X11 interface is awful (from a programming point of view) is its reliance on Xlib/Xaw. If you were to use Qt or WxWindows it'd be a lot nicer to program.
AnonymousHero is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NPP sdl Nick Variants 10 July 15, 2010 06:23
Angband under X11 Magnate Vanilla 3 December 13, 2009 21:56
Down with the SDL! Pete Mack Development 0 August 13, 2009 04:26
SDL sound Nick Development 1 July 16, 2009 21:14
Ubuntu SDL Help? benhamill Vanilla 12 February 24, 2009 21:19


All times are GMT +1. The time now is 02:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.