Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 10, 2014, 21:14   #1
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: https://gitlab.com/miramor
Posts: 894
Therem Harth is on a distinguished road
Four types of granite walls?

I'm finally trying to add terrain (of a sort) to Neoband, but I'm wondering, why are there four types of granite walls (never mind doors) in lib/edit/terrain.txt? If I add a new type of wall, door, etc. will I have to add four versions? Or is this a thing for graphical tiles, that I can safely ignore?
Therem Harth is offline   Reply With Quote
Old March 11, 2014, 02:33   #2
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,001
fizzix is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
I'm finally trying to add terrain (of a sort) to Neoband, but I'm wondering, why are there four types of granite walls (never mind doors) in lib/edit/terrain.txt? If I add a new type of wall, door, etc. will I have to add four versions? Or is this a thing for graphical tiles, that I can safely ignore?
It's for dungeon generation. Currently adding terrain is kind of a nightmare due to some awful legacy code. It's getting overhauled in the restruct branch (I think) and it's about time.
fizzix is offline   Reply With Quote
Old March 11, 2014, 09:26   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,173
Donated: $60
Nick is on a distinguished road
With Neoband being based on 3.2.0, adding terrain is easy enough, but the difficult part is making sure it behaves correctly. Things you need to consider include
  • You need to add a
    Code:
    #define FEAT_MARSHMALLOW indexno
    (or whatever) to defines.h, where indexno is its number from terrain.txt
  • LoS considerations - you will need to make sure your terrain gets the CAVE_WALL flag if it is meant to block LoS, or doesn't if it isn't (see cave_set_feat in cave.c)
  • Where it is placed in the order of terrain - a lot of things are done based on facts like "every terrain feature with index >= secret doors is a wall"
  • Any behaviour specific to what you want to introduce

As fizzix says, it's all a bit painful, but kind of fun in a grim sort of way
__________________
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 March 11, 2014, 12:39   #4
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: https://gitlab.com/miramor
Posts: 894
Therem Harth is on a distinguished road
Thanks... So I guess I won't need to add four types of e.g. coal seam?

(I take it that removing the need for multiple granite walls, etc. would be nontrivial?)

BTW I notice the trap implementation requires a terrain feature for each trap type. Ick.
Therem Harth is offline   Reply With Quote
Old March 11, 2014, 13:49   #5
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,469
Derakon is on a distinguished road
I believe the multiple wall types are to indicate things like "this wall is part of the border of a room" and "this wall is in a corridor". Such information is important for laying out the dungeon but is only really relevant for basic wall types.
Derakon is offline   Reply With Quote
Old March 11, 2014, 14:01   #6
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: https://gitlab.com/miramor
Posts: 894
Therem Harth is on a distinguished road
Oh dear. I'd wanted to add wall types, among other things. Unless you mean "only relevant for granite/perm walls/doors."

Thanks though, I will see if I can come up with a better way of doing things. (Not that I rate my chances that high.)
Therem Harth is offline   Reply With Quote
Old March 11, 2014, 20:46   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,173
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
Oh dear. I'd wanted to add wall types, among other things. Unless you mean "only relevant for granite/perm walls/doors."

Thanks though, I will see if I can come up with a better way of doing things. (Not that I rate my chances that high.)
As long as you change granite to other types of wall after the basic room layout has been done, you're fine.

At this stage of the code restructure the multiple types of granite have been removed, and traps are no longer terrain. See the restruct branch on Github if you're interested.
__________________
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 March 11, 2014, 20:53   #8
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: https://gitlab.com/miramor
Posts: 894
Therem Harth is on a distinguished road
Thank you and thank you. I may see about merging some code from that...
Therem Harth 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
Love the new room types CunningGabe v4 32 April 29, 2012 17:16
New pit types Nomad Development 81 February 23, 2012 11:49
Weapon types ekolis Vanilla 0 July 3, 2010 17:14
Types of vaults Wraitheist Vanilla 5 September 8, 2008 01:53
Granite tile display in Vista gunduzs Vanilla 1 May 16, 2008 08:26


All times are GMT +1. The time now is 23:46.


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