Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 6, 2012, 06:41   #1
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,365
AnonymousHero is on a distinguished road
Fixing the X11 port?

Hi all,

It seems that the X11 support in Angband is unbearably slow these days, especially at large window sizes -- it's not "flicker", you can literally watch it redraw the dungeon screen when it's maximized. Rather than any specific thing I think this may simply be a case of the port doing everything synchronously and painting every little thing using individual calls to Xlib rather than just generating a bitmap in-memory and blitting it using a single to XRenderImage (or whatever it's called).

So, why don't I just use the SDL port? The blocker for me is that it doesn't support multiple windows(*). It also has some behavior which seems odd to me UI-wise, but that's minor compared to the lack of multi-window support.

It's been annoying me so much that I was seriously considering an attempt at fixing it(**). I see two options: 1) Using something like Cairo in the X11 module and using that to render everything to an in-memory surface and blitting it in a single Xlib/Xrender/whatever call, or 2) Adding a port to a different game library than SDL.

I was looking around for SDL alternatives and happened upon the Allegro game library. Does anyone have any experience with that? I implemented a little demo and the API seems pretty sensible and easy to use, and crucially, it does support multiple OS-level windows.

I guess this my question to the current developer cabal: Which of these options do you think would be a) most likely to actually make it into Vanilla, and b) the easiest in terms of code?

(*) I realize that multi-window support has been promised for the in-development SDL 1.3 (which has later been renamed SDL 2.x) for ages. However none of the Linux distros which I'm aware of ship anything later than 1.2.x, and I have absolutely no idea how close 2.x is to release. Given the length of time we've been waiting already, I'm not holding my breath.

(**) If this happens, it's at least a few months out -- too busy and worn-out to do any serious hacking at the moment.

Last edited by AnonymousHero; October 6, 2012 at 11:37.
AnonymousHero is offline   Reply With Quote
Old October 6, 2012, 10:07   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,174
Donated: $60
Nick is on a distinguished road
There is one big reason to keep the x11 port - running the borg in xscreensaver.

That said, I'm sure if there were a functional Allegro port, it would be happily adopted. Ease of coding? I know nothing.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old October 6, 2012, 14:42   #3
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by AnonymousHero View Post
Hi all,

It seems that the X11 support in Angband is unbearably slow these days, especially at large window sizes -- it's not "flicker", you can literally watch it redraw the dungeon screen when it's maximized. Rather than any specific thing I think this may simply be a case of the port doing everything synchronously and painting every little thing using individual calls to Xlib rather than just generating a bitmap in-memory and blitting it using a single to XRenderImage (or whatever it's called).

So, why don't I just use the SDL port? The blocker for me is that it doesn't support multiple windows(*). It also has some behavior which seems odd to me UI-wise, but that's minor compared to the lack of multi-window support.

It's been annoying me so much that I was seriously considering an attempt at fixing it(**). I see two options: 1) Using something like Cairo in the X11 module and using that to render everything to an in-memory surface and blitting it in a single Xlib/Xrender/whatever call, or 2) Adding a port to a different game library than SDL.

I was looking around for SDL alternatives and happened upon the Allegro game library. Does anyone have any experience with that? I implemented a little demo and the API seems pretty sensible and easy to use, and crucially, it does support multiple OS-level windows.

I guess this my question to the current developer cabal: Which of these options do you think would be a) most likely to actually make it into Vanilla, and b) the easiest in terms of code?
TINC, of course.

a) is easy: anything submitted as a pull request on github that actually works will be included in 3.5 - improved X11, or Allegro, or both.

b) is harder: the X11 port is ancient but also relatively simple: it might not be too hard to 'fix' it. But writing a frontend from scratch is also not supposed to be hard in Angband, as there are many to learn from. (Disclaimer: I don't do UI stuff.)

SDL 1.3 is the Duke Nukem Forever of libraries. When it finally arrives it will be ludicrously out of date.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old October 7, 2012, 08:51   #4
fph
Knight
 
Join Date: Apr 2009
Location: Berlin / Italy
Posts: 620
fph is on a distinguished road
Quote:
Originally Posted by Nick View Post
There is one big reason to keep the x11 port - running the borg in xscreensaver.
If that's the only reason, wouldn't it be easier to adapt the screensaver borg to use SDL, rather than maintaining an additional port just for it?
__________________
Dive fast, die young, leave a high-CHA corpse.
--
You read a scroll labeled 'lol gtfo' of Teleport Level.
fph is offline   Reply With Quote
Old October 7, 2012, 11:23   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by fph View Post
If that's the only reason, wouldn't it be easier to adapt the screensaver borg to use SDL, rather than maintaining an additional port just for it?
The other good reason is that almost every unix installation in the world has the X libs and should be able to run the X11 port out of the box. Not all will have libs for SDL, Allegro, GTK or even ncursesw.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate 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
Fixing dir, shift-dir and ctrl-dir keys part 1: Win client PowerWyrm Development 14 June 4, 2012 15:30
Fixing dir, shift-dir and ctrl-dir keys part 2: GCU client PowerWyrm Development 1 June 1, 2012 19:34
Need advice... X11 vs. SDL Therem Harth Development 25 October 25, 2011 03:35
Angband under X11 Magnate Vanilla 3 December 13, 2009 21:56
Why no tile support in x11 port? bdo Vanilla 2 February 2, 2009 22:42


All times are GMT +1. The time now is 14:04.


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