Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old July 1, 2016, 02:08   #11
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by t4nk View Post
This is relevant to my interests Any news about it?
Real life got in the way - I'm hoping to get back into it soon
calris is offline   Reply With Quote
Old July 2, 2016, 16:18   #12
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by calris View Post
Real life got in the way - I'm hoping to get back into it soon
That would be great. For the last month I was working on a new, SDL2-based frontend for Angband. ATM it's complete (modulo bugs) and playable (on my machine, and, I think, on Nick's ). There are several things that bother me still, and tile_width/tile_height are very high on this list. I considered rewriting some parts of textui, but it would be too boring to do it alone. If you decide to return to improving Angband's UI, could you post on this forum then? I also don't think X11 is entirely adequate for the job...

Here's what I think should be done:
The text panels on the main term (messages line, status line, and player info on the left) should just become separate terms. There is no reason for them to be parts of the main term.
All menus (store interface, inventory, mouse click menus etc) should be popups, instead of being rendered on the main term. NextUI should know how to ask the frontend to spawn new terms (or term-like things). It could give some hints to the frontend about how to better place them. For example: "center the new term in the main term", or "place the new term such that its top left corner is over the top left corner of tile x, y of the main term". I don't see why any futher granularity is needed; thinking about pixels is frontend's job.
The textui should consider very carefully when to update the screen. Most display that are in use today can only be updated 60 times per seconds; currently, textui demands hundreds of updates a second. So the frontend has no other choice but to drop some frames; and it has very little information about how to do that in a reasonable manner. The visible effect of that is "flickering" of the screen. That's present in all Angband's UI (at least on Linux), except, OF COURSE, main-gcu.c.
Oh, and I'm completely sure the NextUI should drop all support for ncurses. Graphical and (pseudo)terminal UIs have completely different needs; and in any case, ncurses is already well served by existing textui.

Last edited by t4nk; July 2, 2016 at 16:34.
t4nk is offline   Reply With Quote
Old July 3, 2016, 00:47   #13
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,975
Donated: $40
Pete Mack is on a distinguished road
SDL is sort of a clunker--rather old design gfx. By many accounts SFML is much easier, as well as leaner and meaner.

http://www.sfml-dev.org/
Pete Mack is offline   Reply With Quote
Old July 3, 2016, 09:04   #14
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
SDL is sort of a clunker--rather old design gfx. By many accounts SFML is much easier, as well as leaner and meaner.

http://www.sfml-dev.org/
Are you going to write a frontend for Angband in SFML?
t4nk is offline   Reply With Quote
Old July 3, 2016, 09:47   #15
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
So, I'm thinking about giving it a go... (not the SFML stuff, LOL ). There are 30855 lines in ui-*.c ui-*.h lines... hopefully much of that could be reused. I think textui is actually pretty good (I like it a lot, a lot better than NPP UI), the only major problems are with tiles dimensions and Term_fresh()... hmm... I don't know
t4nk is offline   Reply With Quote
Old July 3, 2016, 10:58   #16
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by t4nk View Post
So, I'm thinking about giving it a go... (not the SFML stuff, LOL ). There are 30855 lines in ui-*.c ui-*.h lines... hopefully much of that could be reused. I think textui is actually pretty good (I like it a lot, a lot better than NPP UI), the only major problems are with tiles dimensions and Term_fresh()... hmm... I don't know
edit: ui-*.c code makes me RAGE, though! I know I won't be able to resist the temptation to rewrite pretty much all of it... so, I'm not doing it alone
t4nk is offline   Reply With Quote
Old July 3, 2016, 11:58   #17
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,975
Donated: $40
Pete Mack is on a distinguished road
I'll bite. What in particular do you dislike in the ui-* code? (It's a whole lot better than it was in 3.0.)

Quote:
Originally Posted by t4nk View Post
edit: ui-*.c code makes me RAGE, though! I know I won't be able to resist the temptation to rewrite pretty much all of it... so, I'm not doing it alone
Pete Mack is offline   Reply With Quote
Old July 3, 2016, 12:34   #18
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
I'll bite. What in particular do you dislike in the ui-* code? (It's a whole lot better than it was in 3.0.)
1) C89
2) Term, inkey_xtra, inkey_flag, text_out_pad (and the whole text_out_hook thing), ex_width, ex_offset, etc.
3) Magic numbers everywhere
Code:
void display_player_stat_info()
{
    ...
    /* Row */
    row = 2;

    /* Column */
    col = 42;
    ...
}

static void display_player_sust_info(void)
{
    ...
    /* Row */
    row = 2;

    /* Column */
    col = 26;
    ...
}
4) Ncurses-ness (Term_gotoxy(), cu, cv, TERM_XTRA_SHAPE, "icky corner"...)
5)
Code:
$ ack -i -c hack ui-term.c
30
And some other stuff
t4nk is offline   Reply With Quote
Old July 3, 2016, 16:02   #19
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,858
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by t4nk View Post
So, I'm thinking about giving it a go... (not the SFML stuff, LOL ). There are 30855 lines in ui-*.c ui-*.h lines... hopefully much of that could be reused. I think textui is actually pretty good (I like it a lot, a lot better than NPP UI), the only major problems are with tiles dimensions and Term_fresh()... hmm... I don't know
I was sort of imagining that a lot of the code could be shared. One of the things I was keen to avoid when thinking about NextUI was duplication of functionality. In an old GTK frontend, there were frontend-level windows for various things like object lists and monster lists, except rendered in a proportional font... which obviously broke really fast when things changed. Hopefully basics like textblock and maybe a 'virtual' term/grid type that is just used for drawing, not for input etc. and then overlaid onto a real display would avoid a lot of this.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old July 3, 2016, 21:38   #20
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,975
Donated: $40
Pete Mack is on a distinguished road
Tak-
The goal should be a clean, portable graphics package to get rid of all term-xxx.c files. I recommend against SDL, since it is really out of date on Windows (using directx 5!). The newer SFML package will actually work in Metro (windows 8/winphone) apps, as well as ios and android. That is *portable.* And yes it is C, not C++, so there still wouldn't be annoying binding errors between different C++ manglers. (It is the latter that makes Windows sound and image rendering a big problem.)
Pete Mack 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
RFC: Reworking sound sub-system calris Development 125 April 19, 2016 17:04
Reworking the entire magic system (yay)! TricksterWolf Development 8 September 20, 2015 21:22


All times are GMT +1. The time now is 01:48.


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