Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old November 21, 2010, 03:28   #1
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,002
fizzix is on a distinguished road
FEAT_INVIS and FEAT_DOOR_HEAD

If I'm reading the code correctly, the numbering of terrains in terrain.txt is used directly by the code in order to determine what to do with specific features. Adding more floor terrains seems like it would require one of the following:

1) simplest solution: move all non-floor terrains later in terrain.txt, and change the values of FEAT_INVIS and FEAT_DOOR_HEAD. Then add the new floor types to the beginning. This keeps the old clunky format, but won't break anything.

2) Abandon FEAT_INVIS and FEAT_DOOR_HEAD and instead use flags for all the calls. There are a *lot* of changes that would need to be done, but may be doable.

Is there a good reason why door selection was not done by flags and rather by calling the indexes in terrain.txt directly?
fizzix is offline   Reply With Quote
Old November 21, 2010, 05:09   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,928
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by fizzix View Post
If I'm reading the code correctly, the numbering of terrains in terrain.txt is used directly by the code in order to determine what to do with specific features. Adding more floor terrains seems like it would require one of the following:

1) simplest solution: move all non-floor terrains later in terrain.txt, and change the values of FEAT_INVIS and FEAT_DOOR_HEAD. Then add the new floor types to the beginning. This keeps the old clunky format, but won't break anything.

2) Abandon FEAT_INVIS and FEAT_DOOR_HEAD and instead use flags for all the calls. There are a *lot* of changes that would need to be done, but may be doable.

Is there a good reason why door selection was not done by flags and rather by calling the indexes in terrain.txt directly?
Like a lot of horrible stuff in Angband, because it made sense in Pascal in the 80s. Either approach seems justifiable, but I'd advocate the first. The second will take a lot of work and it might not even be worth it.
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old November 21, 2010, 16:12   #3
Sirridan
Knight
 
Sirridan's Avatar
 
Join Date: May 2009
Posts: 560
Sirridan is on a distinguished road
I'm dealing with this in pyAngband as well, and I've decided to add a feature_arg variable to the DungeonCell structure which holds information about terrain and such. This basically would just tell how jammed and locked the door is, so that way you don't have to fuss with a new terrain type for each level of jammed/lockedness the doors have.

But as for how it works in the C code, it does, and yeah, changing it will/would be a huge hassle.
Sirridan is offline   Reply With Quote
Old November 27, 2010, 23:40   #4
andrewdoull
Unangband maintainer
 
andrewdoull's Avatar
 
Join Date: Apr 2007
Location: Sydney, Australia
Age: 44
Posts: 872
andrewdoull is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Like a lot of horrible stuff in Angband, because it made sense in Pascal in the 80s. Either approach seems justifiable, but I'd advocate the first. The second will take a lot of work and it might not even be worth it.
I'd argue that the flag based approach is worth it. But I've gone through that pain and have probably forgotten how bad it was...

Andrew
__________________
The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
In UnAngband, the level dives you.
ASCII Dreams: http://roguelikedeveloper.blogspot.com
Unangband: http://unangband.blogspot.com
andrewdoull is offline   Reply With Quote
Old November 27, 2010, 23:57   #5
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,708
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by andrewdoull View Post
I'd argue that the flag based approach is worth it. But I've gone through that pain and have probably forgotten how bad it was...
I've gone to mostly flag based in FA, too - and my recollection is that it was relatively not too bad.
__________________
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 November 30, 2010, 01:04   #6
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by andrewdoull View Post
I'd argue that the flag based approach is worth it. But I've gone through that pain and have probably forgotten how bad it was...

Andrew
NPP terrain is all flag based, and I think it was worth it. Of course, I 'borrowed" all of Andrew's hard work istead of creating it from scratch.

It actually wouldn't be too much work to take the code out of NPP and put it in vanilla, since the code bases are similar again.
nppangband 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


All times are GMT +1. The time now is 22:54.


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