Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old August 9, 2016, 05:46   #31
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Bump

The first significant milestone has been achieved - Angband now can be compiled with the new UI.
That by itself maybe doesn't mean much. Nothing works yet, in particular, there is no frontend that can work with it.
Still... 30000 lines of C were refactored. All the ui-* files (except ui-signals.c) were converted to the new Term API. The changes are big... It was a lot of work.
I did cut some corners. The signals stuff was excluded, and I'm not at all sure the UI should handle them (btw, I wrote in the commit that handler functions don't do anything, but I just didn't notice the ifdef soup ). Signals probably should be handled by main-gcu.c. I don't see why anything else should care...
There are also "wizard" files (wiz-debug.c and friends). I disabled them for now. They should either call themselves ui-debug etc, or they shouldn't call into Text UI directly.
Tile picker, glyph picker, the '/' command and a couple other things that I don't remember are all casualities of the refactoring.
Step two is to actually adapt one of Angband's frontends to the new UI. I think I'll use the best one available
t4nk is offline   Reply With Quote
Old August 9, 2016, 09:41   #32
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,660
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Bump

The first significant milestone has been achieved - Angband now can be compiled with the new UI.
That by itself maybe doesn't mean much. Nothing works yet, in particular, there is no frontend that can work with it.
Still... 30000 lines of C were refactored. All the ui-* files (except ui-signals.c) were converted to the new Term API. The changes are big... It was a lot of work.
I did cut some corners. The signals stuff was excluded, and I'm not at all sure the UI should handle them (btw, I wrote in the commit that handler functions don't do anything, but I just didn't notice the ifdef soup ). Signals probably should be handled by main-gcu.c. I don't see why anything else should care...
There are also "wizard" files (wiz-debug.c and friends). I disabled them for now. They should either call themselves ui-debug etc, or they shouldn't call into Text UI directly.
Tile picker, glyph picker, the '/' command and a couple other things that I don't remember are all casualities of the refactoring.
Step two is to actually adapt one of Angband's frontends to the new UI. I think I'll use the best one available
This is brilliant, well done. I will try to have a proper look at it some time...
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old August 11, 2016, 11:16   #33
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Bump
https://postimg.org/image/bki03nh45/
It is super, super alpha... I was able to take several steps in town

So the next step is: fix the frontend and try to get through the birth menu without segfaults and failed assertions.

Last edited by t4nk; August 11, 2016 at 12:10.
t4nk is offline   Reply With Quote
Old August 11, 2016, 13:13   #34
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,827
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Bump
https://postimg.org/image/bki03nh45/
It is super, super alpha... I was able to take several steps in town

So the next step is: fix the frontend and try to get through the birth menu without segfaults and failed assertions.
Very impressive
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old August 12, 2016, 11:44   #35
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Returning to SDL2 frontend feels so good It's great that I can finally see something displayed on screen. I believe I refactored it enough and can now concentrate on the text ui again... So, I'd like some advice.
The old Term API is really relaxed about various errors:
Code:
    /* Verify */
    if ((x < 0) || (x >= w)) return (-1);
    if ((y < 0) || (y >= h)) return (-1);
The new one is very strict:

Code:
    assert((x) >= 0); \
    assert((x) < TOP->width); \
    assert((y) >= 0); \
    assert((y) < TOP->height); \
That leads to crashes, right in the birth menu:
Code:
angband: ui2-term.c:339: term_wipe_line:
Assertion `(y) < (term_stack.stack[term_stack.top])->height' failed.
Aborted
Because the menu tries to print something off screen... which approach is better? I prefer strict, but UI was written around old Term, which tries to just ignore all errors... opinions?
t4nk is offline   Reply With Quote
Old August 12, 2016, 16:15   #36
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,827
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by t4nk View Post
The old Term API is really relaxed about various errors / the new one is very strict / which approach is better? I prefer strict, but UI was written around old Term, which tries to just ignore all errors... opinions?
strict is way better. We've had a gradual trend towards being stricter with function arguments for several years, so if you can be bothered, it would be great to continue this.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old August 13, 2016, 00:19   #37
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Quote:
Originally Posted by takkaria View Post
strict is way better. We've had a gradual trend towards being stricter with function arguments for several years, so if you can be bothered, it would be great to continue this.
Yes, I'll keep the Term like it is. It's really better in the long run, or even in the short run.

Oh, and to Nick: you said you have some thing to do in RL; don't let my work bother you! My intention is to produce something reasonably stable and relatively polished, and there is still a long way to go. Also, lately I'm having some vague thoughts about how to make ncurses client work with it... it will take some time before I'll cosider the new text ui a beta! As for now, everything is subject to change without notice, so looking at it too hard is probably not even very useful
t4nk is offline   Reply With Quote
Old August 13, 2016, 08:11   #38
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Wow, I didn't expect so many things to work! Making good progress...
https://postimg.org/image/riaon99kb/

edit: Maybe I'll do it sooner than I expected. Player can already move on the map, enter dungeon, take many steps before segfault Probably some arithmetic errors when calculating map offsets...

edit2: term stack in action: https://postimg.org/image/fr46heizp/

Last edited by t4nk; August 13, 2016 at 12:57.
t4nk is offline   Reply With Quote
Old August 14, 2016, 07:20   #39
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Perhaps some people might want to compile it (hi calris! ) Here's the installation instructions (FOR LINUX):

1) clone my repo and checkout 'textui2' branch:
Code:
git clone https://github.com/t4nk074/angband
cd angband
git checkout textui2
2) Install SDL2, SDL2_ttf, SDL2_image libraries and their dev files (headers and sdl2-config utility) - assuming Debian-based system:
Code:
apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev
(you might also find this useful: https://wiki.libsdl.org/Installation)

3) Configure angband and disable all frontends:
Code:
./configure --with-no-install --disable-curses --disable-x11
4) There is a Makefile.ui2 in angband's src directory. Just use it:
Code:
cd src
make -f Makefile.ui2
Note that it compiles without optimizations and with address sanitizer enabled, but I found performance to be ok.

5) Now, if everything is ok, you should be able to run Angband with Text UI2 and SDL2:
Code:
../angband -msdl2
If it doesn't work, let me know! Anyway, works for me

Last edited by t4nk; August 14, 2016 at 08:58.
t4nk is offline   Reply With Quote
Old August 14, 2016, 12:30   #40
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Really want to nuke the "-more-" prompt... it's buggy and complicates everything
t4nk 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
High element reform Nick Vanilla 49 December 12, 2015 21:04
Any benefit to eating when full? Ingwe Ingweron Vanilla 2 September 27, 2014 01:04
Fightless the full-casting mage fizzix AAR 65 July 27, 2010 09:11
Identification Reform Susramanian Vanilla 36 March 8, 2010 20:23
Help with diving (warning: long) bebo Vanilla 6 January 22, 2009 03:23


All times are GMT +1. The time now is 19:38.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.