Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 17, 2013, 20:25   #1
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 905
Therem Harth is on a distinguished road
Adding terrain to V

I am really interested in adding more colorful and more interesting terrain to my variant, and now that I have some free time again I should be able to do it. Problem is I don't know where to start.

How is terrain implemented in variants like NPP and FA, compared to Vanilla? Can anyone give me a rough outline of the differences, before I go code-diving? How much code modification am I going to need, to add terrains with different effects?
Therem Harth is offline   Reply With Quote
Old March 17, 2013, 21:36   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,419
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
How is terrain implemented in variants like NPP and FA, compared to Vanilla? Can anyone give me a rough outline of the differences, before I go code-diving? How much code modification am I going to need, to add terrains with different effects?
V tends to base terrain interaction on the actual feature (eg if it's a down stair, do this), or sometimes on ranges of terrain features (which makes it a bit dependent on the order of terrain in the terrain file (and defines.h).

FA has moved completely (I think) to terrain flags, where each terrain type has certain properties (allow line of sight, hold objects, burn you, etc), and game interactions happen based on the property. Getting there took a bit of modification, but if you're going to have significant new terrain, I'd recommend doing something like this sooner rather than later.

I'm not sure of all the details of how NPP does it, but NPP's terrain came from UnAngband originally, and is considerably more varied than FA's. I know it has persistent effects as well as terrain, and terrain that does stuff...
__________________
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 18, 2013, 00:16   #3
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 905
Therem Harth is on a distinguished road
Hmm. Now that I think about it...

With Neoband ATM my bad habits are really coming back to bite me - the bookless spell system is a pile of redundant spaghetti code. I don't actually have an API, just a bunch of rough guidelines that I'm following.

Now that I have a better idea of what I want, and am slightly more experienced, I think it may be more productive to start over with a different variant; preferably one with terrain support built in.
Therem Harth is offline   Reply With Quote
Old March 18, 2013, 00:32   #4
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
In NPP (based on Unangband), the terrain becomes completely flag-based, whereas in Angband, all terrain chatacteristics are based on the terrain number entry. For example, all stores are in a sequence, all monster traps, all walls, etc. Change the order, and the game breaks. The transition is *extremely* painful. In some places in the C code the terrain is a simple hard-coded number, making it hard to find. Be prepared for lots of de-bugging.

Personally, in hindsight I think the terrain system in NPP is overly complicated, and I would recommend usuing something simpler. We have this amazing system that allows to do almost anything we want, and we barely use 1% of its capabilities. In the end, terrain just isn't that interesting, and players are far more interested in objects and monsters.

At a glance, FAangband probably has a much better terrain setup than NPP.
__________________
NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
nppangband is offline   Reply With Quote
Old March 18, 2013, 01:30   #5
Therem Harth
Knight
 
Therem Harth's Avatar
 
Join Date: Jan 2008
Location: New England winter
Posts: 905
Therem Harth is on a distinguished road
Does FA inherit it from O? I forget...

Mostly I'm interested in terrain for atmosphere reasons - it would be nice, I think, to have terrain that complemented the foes du jour (even if it was mostly just scenery). But yes, if it takes that much work I may leave it be.
Therem Harth is offline   Reply With Quote
Old March 18, 2013, 03:29   #6
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
Does FA inherit it from O? I forget...

Mostly I'm interested in terrain for atmosphere reasons - it would be nice, I think, to have terrain that complemented the foes du jour (even if it was mostly just scenery). But yes, if it takes that much work I may leave it be.

Yes, FA is based on O. I didn't mean to discourage you from terrain in general, just the NPP system. I would bet that FA isn't too bad to implement.
__________________
NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
nppangband is offline   Reply With Quote
Old March 18, 2013, 07:51   #7
Mondkalb
Knight
 
Mondkalb's Avatar
 
Join Date: Apr 2007
Posts: 914
Mondkalb is on a distinguished road
I like he FAangband terrain in the dungeons. I adds some flavor to the otherwise rather colorless corridors and rooms of Angband.
It's less drab if you stumble into a room with a water basin or even some green spots or lava every now and then.

I also remember a nice variety of terrain in Zangband.
Mondkalb is offline   Reply With Quote
Old March 18, 2013, 08:22   #8
Mikko Lehtinen
Veteran
 
Join Date: Sep 2010
Posts: 1,246
Mikko Lehtinen is on a distinguished road
I hacked EyAngband's trap layer code to create Halls of Mist's terrain features.

All additional terrain features are painted with "decorations" on the trap layer. A tree is a painted rubble; a statue is a painted granite wall; a table is a painted floor.

In most respects the new features behave exactly like what they are based on. I haven't modified monster AI or visibility rules at all, for example. Decorations affect graphics and some terrain-specific (mostly hard-coded) interactions with the terrain features.

How flexible Vanilla's trap layer is nowadays? Can a granite wall have a trap on it?

I'm not recommending Mist's system to anyone, it's spaghetti, just throwing out some ideas.
Mikko Lehtinen is offline   Reply With Quote
Old March 18, 2013, 10:25   #9
Mikko Lehtinen
Veteran
 
Join Date: Sep 2010
Posts: 1,246
Mikko Lehtinen is on a distinguished road
Quote:
Originally Posted by nppangband View Post
In the end, terrain just isn't that interesting, and players are far more interested in objects and monsters.
That's at least partly an implementation problem. Terrain features could have effects that are almost as relevant to gameplay as monsters or items.

Also, I think it's a good idea to tie many terrain features to player's skills, attributes or items somehow. All these are very relevant to how you interact with monsters, why not with terrain features? In Mist, your skill scores in Perception, Alchemy, Jumping and Saving Throw affect how beneficial or dangerous terrain features are to you. Some items combo with terrain features to create big effects.

Personally, I want every single terrain feature to be very relevant for gameplay, at least potentially. I find this approach is better for the game's athmosphere, too, than having terrain features just for flavour.
Mikko Lehtinen is offline   Reply With Quote
Old March 18, 2013, 10:34   #10
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by Mikko Lehtinen View Post

How flexible Vanilla's trap layer is nowadays? Can a granite wall have a trap on it?
I don't think Vanilla has a trap layer. A trap is one terrain type that just turns into an empy floor when disarmed.
__________________
NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding 3 dimensions to a 2D roguelike xibalba Idle chatter 12 February 22, 2012 13:41
Adding a new shop to Angband 3.1.1 Kyle Development 9 October 30, 2010 21:56
Adding Fonts? (X11 version) danaris Vanilla 8 March 17, 2010 19:12
Adding Effects to Angband PaulBlay Development 0 March 28, 2009 13:08
Terrain changes visible outside characters sight -- Feature or Bug?? Elsairon Vanilla 3 June 12, 2007 14:04


All times are GMT +1. The time now is 15:02.


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