The use of tables, etc, is very well done now. I made some early stabs at 10 years ago in the leadup to v3.5. But where it is now is vastly improved. (Flag values, for example!) The only potential downside is any variant maintainer will have a difficult time applying the improvements because they are so extensive and with so much file reorganization--diff3 doesn't work well.
Really impressed with the angband code base
Collapse
X
-
Thanks Pete, there's been a lot of work gone into it over a long time.
The aim is to move more stuff still out to edit files - messages, for example - and only have compiled-in tables where strictly necessary.One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie. -
Some portion of this might be just from a shift in coding style from having opening braces on separate lines? But that's a good count! I would have figured that the codebase was increasing in size, but seems like that's an illusion caused by having the code spread across more files.takkaria whispers something about options. -more-Comment
-
The use of tables, etc, is very well done now. I made some early stabs at 10 years ago in the leadup to v3.5. But where it is now is vastly improved. (Flag values, for example!) The only potential downside is any variant maintainer will have a difficult time applying the improvements because they are so extensive and with so much file reorganization--diff3 doesn't work well.PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!Comment
-
...and just what part was the hardest?
It occurs to me that a separate changes.txt file in the src directory should have a list of all the historical improvements, since most variants forked from 3.0.
I can start: (Note: code cleanup and UI only. No gameplay changes)
Removal of lua (3.1.0)
Menus (3.1.0)
Events (3.1.0)
Knowledge (3.1.0)
First use of generator .h files and use of loops instead of of ugly switch blocks (3.1.0)
commands function pointers ("object oriented" C) 3.1.1
Event-driven display (3.1.3?)
I don't know when the other changes were made
Readable .txt files/
prettification of txt parser
Full use of loops/generator .h files
Clean implementation of extended flags
Cleanup of options
Reorganization to comprehensible file names
I don't know what else. (These all belong in any notional angband base)
The code now makes an excellent example for well written C. (3.0.x was emphatically not, although it has moments of brilliance, like the illumination computation and terminal model.)
Comment
-
Nothing was hard... except porting 20+ pages of commits from the master branch and for each checking how it would work with real time + multiplayer. Currently, the only big problem with the Angband source code is that it implies in too many places that there is only one player and uses the "player" global variable:
Code:void foo(struct player *p) { do_something(player); <-- should be do_something(p) ... if (monster_is_visible) {...} <-- should be if (player_can_see_monster(p)) ... }
PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!Comment
Comment