Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 9, 2018, 00:25   #1
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
Future-proof cross-platform interface library, only GCU / ncurses?

When I try to compile older angband variants, I see all kinds of libraries break. SDL 1 breaks, because SDL 2 is the new standard and is not backward compatible. GTK breaks too. If the variant is no longer maintained, these probably no longer compile.

It looks like only GCU / ncurses and X11 always compile consistently even for unmaintained variants. And ncurses also has built-in Windows and Mac support (not X11?). So does that mean ncurses is the only future-proof interface that will work on any platform, or is there another cross-platform interface library that is highly recommended today?
droof is offline   Reply With Quote
Old February 9, 2018, 09:32   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,971
Donated: $40
Pete Mack is on a distinguished road
X11 works on Mac with a bit of effort. (On Windows too, but I hate it.) At some point you are just better dropping in a new(er) main-xxx.c file and a modern makefile. (All you need to change is makefile.src)
Pete Mack is offline   Reply With Quote
Old February 9, 2018, 10:16   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,188
Donated: $60
Nick is on a distinguished road
There has been an SDL2 interface written for V, but Ihaven't looked at it properly and am not sure how complete it is.
__________________
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 February 9, 2018, 13:25   #4
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,406
PowerWyrm is on a distinguished road
What's wrong with SDL 1? The libs are still available, so you shouldn't have any problem compiling...
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old February 9, 2018, 15:15   #5
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 598
Gwarl is on a distinguished road
Quote:
Originally Posted by droof View Post
When I try to compile older angband variants, I see all kinds of libraries break. SDL 1 breaks, because SDL 2 is the new standard and is not backward compatible. GTK breaks too. If the variant is no longer maintained, these probably no longer compile.

It looks like only GCU / ncurses and X11 always compile consistently even for unmaintained variants. And ncurses also has built-in Windows and Mac support (not X11?). So does that mean ncurses is the only future-proof interface that will work on any platform, or is there another cross-platform interface library that is highly recommended today?
What I did of course was use a javascript terminal emulator to provide a frontend - everything then runs everywhere. There are no graphics though. Yet.

But I hope to one day find the time to do it. Plain text output is very ordered and it wouldn't be difficult to give a computer a general description of what an angband output is attempting to display in order to present it graphically.
Gwarl is offline   Reply With Quote
Old February 9, 2018, 15:50   #6
fph
Knight
 
Join Date: Apr 2009
Location: Berlin / Italy
Posts: 631
fph is on a distinguished road
What is your goal here? Compiling old versions of Angband, or figuring out which interface you should use for a variant you are developing?
__________________
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 February 9, 2018, 21:46   #7
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
I'm trying to find my way through the Unangband codebase. It's huge and I'd prefer not to worry about interfaces and platform compatibility as I focus on gameplay changes without causing bugs on specific interfaces.

I see a lot of custom code for platform-specific interfaces. X11 for Linux, Win32 for Windows, Carbon for Mac. Each interface has a lot of custom code.

Ideally I'd prefer a single worry-free maintenance-free write-once interface for all platforms, so that all platforms run on the same code and making testing easier.

From compiling older unmaintained variants, ncurses and X11 seem code maintenance free. These always work and never cause trouble for me, even if the last code update was 2003 (like zangband). Even though I'm running the latest Ubuntu.

SDL 1 does still work with some lib dependency effort, but the SDL 2 compatibility break doesn't make it maintenance free like ncurses or X11.

Ncurses says it supports Windows natively since version 5.8, so if that works as easy as any other Windows application, this might be my best bet.

Is there any other interface library that is worth reading up on for me, to create a "write once, use anywhere, don't worry about the singular interface code anymore and just focus on gameplay" kind of interface?

Can ncurses or X11 run on Windows without the user having to jump through hoops to get it running if they have a pre-compiled binary?
droof is offline   Reply With Quote
Old February 9, 2018, 22:57   #8
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,365
AnonymousHero is on a distinguished road
Quote:
Originally Posted by droof View Post
Is there any other interface library that is worth reading up on for me, to create a "write once, use anywhere, don't worry about the singular interface code anymore and just focus on gameplay" kind of interface?
Ah, the old "write once, use anywhere" idea . The closest you're probably going to get is if you represent everything using an RGB bitmap and just write that to some abstract "screen". However, that leaves you without (true) console support and you'd have to write basically everything yourself (or rely on libraries).

(Input is a separate matter, but keyboard is usually not *that* bad to just map more-or-less directly. However, it does have to integrate cleanly into the event loop.)

Most graphical UIs can support this type of application with minimal "shim" code, but performance can be an issue, especially on high-resolution screens. (If you're using e.g. OpenGL or similar, you should be fine, but... that's not really universal, so...)

Quote:
Originally Posted by droof View Post
Can ncurses or X11 run on Windows without the user having to jump through hoops to get it running if they have a pre-compiled binary?
No. (Well, ncurses maybe, but I'm doubtful.)
AnonymousHero is offline   Reply With Quote
Old February 10, 2018, 00:27   #9
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 598
Gwarl is on a distinguished road
It'll work fine with a precompiled binary. You may have to do some hacks with pdcurses to compile said binary though.
Gwarl is offline   Reply With Quote
Old February 10, 2018, 16:42   #10
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
The abstract screen approach is a fun idea. That sounds like a graphical equivalent of ncurses. If someone ever decided to pick that idea up, I'll use it

PDcurses works like a charm, that's great! I can compile for linux natively with ncurses and cross-compile for windows with pdcurses. Mac can probably do ncurses as well. PDcurses also supports SDL 1 and 2, very interesting if I can get the SDL library to cross-compile.

Now my GCU colors are messed up. My terminal only has 16 colors by default, so I'll optimize for those 16 colors and hope the Windows console build can use equivalent colors. Then back to the fun part, gameplay ^^

Thanks everyone!
droof 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
[T2] ncurses interface problems Therem Harth Development 5 October 24, 2011 02:57
Reentrant ncurses konijn_ Development 0 July 15, 2010 01:05
What Platform(s) do you play Angband on? d_m Vanilla 15 November 17, 2009 20:12
libband - trying again to make a common code library for *bands CJNyfalt Variants 26 October 8, 2008 02:15
NCurses aricz Vanilla 16 June 15, 2007 16:31


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


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