Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 9, 2008, 00:55   #1
Zero
Apprentice
 
Join Date: Jan 2008
Posts: 83
Zero is on a distinguished road
Edit File For Dungeon Generation?

We have an edit file for vaults, and that's great, but the standard room types like:

Code:
#########     #####    #########
# # # # #     #   #    # # # # #
## # # ##   ### # ###  #       +
# # # # +   #  ###  #  #       #
## # # ##   ### # ###  # # # # #
# # # # #     #   #    ###+#####
#########     ##+##
These are hard-coded, as are their depths. The code that determines whether a room will be lit or dark on creation is also hard-coded. The number of monsters, traps, objects, veins, treasure... all hard-coded. Perhaps instead of the autoscum option, we should have an edit file that allows the specification of chances for pits, vaults, out-of-depth monsters and items, destroyed levels, and item quality.

No, I'm not volunteering for the job!
Zero is offline   Reply With Quote
Old January 9, 2008, 03:40   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,606
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Zero View Post
We have an edit file for vaults, and that's great, but the standard room types like:

Code:
#########     #####    #########
# # # # #     #   #    # # # # #
## # # ##   ### # ###  #       +
# # # # +   #  ###  #  #       #
## # # ##   ### # ###  # # # # #
# # # # #     #   #    ###+#####
#########     ##+##
These are hard-coded
... as they always will be without a scripting language ...

Quote:
as are their depths. The code that determines whether a room will be lit or dark on creation is also hard-coded. The number of monsters, traps, objects, veins, treasure... all hard-coded. Perhaps instead of the autoscum option, we should have an edit file that allows the specification of chances for pits, vaults, out-of-depth monsters and items, destroyed levels, and item quality.
Seems like a reasonable idea, and probably makes some kinds of balancing easier. Has the nice advantage of separating various constants well out of the source, thus reducing magic numbers.

(Not that you can separate out "item quality", since the game has no concept except in how it prices up items, which should be hardcoded.)

Quote:
No, I'm not volunteering for the job!
It really shouldn't be too hard as long as the file is a simple key/value pair-type thing. The parser is the annoying bit.
takkaria is offline   Reply With Quote
Old January 9, 2008, 17:55   #3
Zero
Apprentice
 
Join Date: Jan 2008
Posts: 83
Zero is on a distinguished road
Quote:
as they always will be without a scripting language
We have an edit file for vaults. Why not an edit file for rooms in general? Too much work? I wouldn't criticize you if that's the reason, it just doesn't make sense to me that we'd need a scripting language to handle it.

Quote:
Seems like a reasonable idea, and probably makes some kinds of balancing easier. Has the nice advantage of separating various constants well out of the source, thus reducing magic numbers.
Exactly. Reduce as many magic numbers as you can, and the code becomes much more modular and modifiable, making it easier for people to make variants.

Quote:
(Not that you can separate out "item quality", since the game has no concept except in how it prices up items, which should be hardcoded.)
I was referring to the chances of a generated item being cursed, average, good, ego, or artifact at specified depths.

Code:
0 400 400 196 3 1
1 395 395 205 4 1
...
That would be level zero, 40%, 40%, 19.6%, .3%, .1% for cursed, average, good, ego, and artifact, respectively. I'm just pulling those numbers out of my ass as an example. You'd just load them into a 2-dimensional array, and then whenever you create an object, get a random integer from 0 to 999 to obtain the quality. I think that would make more sense than hardcoded percentages for going from one quality to another. If you think steps of .1% is too much and want finer control, you could just get a random number from zero to maxint and require the quality numbers for each level to add up to maxint:

0 30000 30000 5000 500 36

... or something

The reason I suggest this is in case people want to make variants with significantly more or less than 100 levels.

Last edited by Zero; January 9, 2008 at 18:09.
Zero is offline   Reply With Quote
Old January 9, 2008, 19:17   #4
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,606
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Zero View Post
We have an edit file for vaults. Why not an edit file for rooms in general? Too much work? I wouldn't criticize you if that's the reason, it just doesn't make sense to me that we'd need a scripting language to handle it.
To specify the algorithms for dungeon generation in an edit file would be to invent a new scripting language, and that is not something I'm interested in doing.

Quote:
Exactly. Reduce as many magic numbers as you can, and the code becomes much more modular
The modularity actually remains about the same, just with fewer magic numbers.

Quote:
and modifiable, making it easier for people to make variants.
The "make it easier for people to make variants" argument sounds reasonable, but it's not -- the good variants make far, far more interesting changes than tweaking the edit files. You can change the flavour of the game substantially by changing the edit files, but the game is essentially the game.

Quote:
I was referring to the chances of a generated item being cursed, average, good, ego, or artifact at specified depths.

Code:
0 400 400 196 3 1
1 395 395 205 4 1
...
That would be level zero, 40%, 40%, 19.6%, .3%, .1% for cursed, average, good, ego, and artifact, respectively. I'm just pulling those numbers out of my ass as an example. You'd just load them into a 2-dimensional array, and then whenever you create an object, get a random integer from 0 to 999 to obtain the quality. I think that would make more sense than hardcoded percentages for going from one quality to another.
There are no hardcoded percentages at the moment -- just a series of obscure and slightly crufty calculations -- so this kind of thing would be a substantial rethink of the way objects are generated. Not to say it's a bad idea, but it's not quite as simple as just transplanting a system to the edit files. In addition to this, you might actually want a formula to determine chances, rather than having a file describe each level line-by-line. To parse a formula, you again have to write essentially a small scripting language.
takkaria 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
Editing the monster.txt file Jothar Hillpeople Vanilla 3 September 4, 2008 21:23
making a semi-variant (more talk about modifying the /edit .txt files) will_asher Variants 20 December 2, 2007 11:38
Any chance for (compiled) Angband 3.0.9 debian file? ivanj Vanilla 9 November 3, 2007 12:29
Changes to lib/edit files Iemortal Vanilla 1 September 23, 2007 06:26
Dungeon Size ? lugonn Vanilla 5 September 2, 2007 13:11


All times are GMT +1. The time now is 17:31.


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