Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 13, 2018, 00:31   #1
droof
Apprentice
 
Join Date: Dec 2013
Posts: 65
droof is on a distinguished road
Best code examples for terrain generation, AI and quests?

I want to learn more about how terrain generation, monster AI and quests work.

I'm looking for the Angband variants that offer the best code example for each feature, so I can play around in the code and learn from it. Also maybe try to port a feature from one variant to another as a learning exercise if that isn't too tricky.

So far I've found these variants as examples:
1 - Terrain / room generation: Unangband or Zangband
2 - Monster AI: Oangband or Sangband (is 4GAI still the best example?)
3 - Quests: no idea

From what I've seen in code, Unangband has the most variety, but Zangband has very clean and tidy code. So I'll probably look into Zangband first, because it is easier to read and change.

I've only heard about 4GAI being the best Angband AI, originating from Oangband and Sangband. Is that still true and if so, which variant should I look into as the easiest to read or most recent example?

Which Angband variant has the best code example for quests?

If anyone can give me advise, please let me know.
droof is online now   Reply With Quote
Old February 13, 2018, 01:25   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,862
Donated: $60
Nick is on a distinguished road
Terrain: If you're looking at wilderness, FAangband has generation which is different from Z (and descendants) or Un. For room generation, I'd actually look at the template approach in current V; if you want true procedural rather than templates, I think PosCheng may have some (but I'm not sure).

O, S, FA and NPP all have 4GAI; NPP is possibly the most accessible, but I would recommend going back to a quite old version - 0.5, or maybe even 0.4 before UnAngband terrain came in.

NPP and Steam have random quests available from town; I believe they got this from EyAngband, but I'm not 100% sure. For fixed quests, I think all the Zangband family have them; I think they are dependent on having wilderness.

I'm sure I've got some of this wrong and will be corrected
__________________
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 February 13, 2018, 03:12   #3
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,397
Donated: $40
Pete Mack is on a distinguished road
Nick is right: for cleanest code, start from current V and add features. It is MUCH cleaner than any of the older branches.
Pete Mack is offline   Reply With Quote
Old February 13, 2018, 16:55   #4
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 322
EpicMan is on a distinguished road
For quests you might look at ToME 2 and Portralis (was NewAngband). Both have multi-stage quests taking place over multiple locations.

Hengband/Poschengband have pretty cool quests, but they are basically just instances / special levels.
EpicMan is offline   Reply With Quote
Old February 13, 2018, 17:35   #5
Gwarl
Swordsman
 
Join Date: Jan 2017
Posts: 467
Gwarl is on a distinguished road
Quote:
Originally Posted by Nick View Post
I'm sure I've got some of this wrong and will be corrected
Fixed quests come from Kangband, which didn't have an overworld as such.. just an elaborate town/wilderness area (seven of them, handmade). Z took quests from there.. in fact it's impossible (or just difficult and never before attempted) to have fixed quests outside of town afaik.
Gwarl is offline   Reply With Quote
Old February 13, 2018, 23:20   #6
droof
Apprentice
 
Join Date: Dec 2013
Posts: 65
droof is on a distinguished road
I spent quite some time with room templates, but problem was that I recognised all my own templates. I hope true room generation will keep me more surprised while playing and tweaking.

I'll start with just a room generator, since that looks more modular and maybe easier to understand and start with.

For 4GAI, I found NPP 0.5 on github. Looks like NPP's melee2.c is roughly Sang's monmove.c. I'll have fun with them. Is there some kind of manual that explains 4GAI and how it hooks into Angband?

I'll check out EyAngband and Kangband for random and fixed quest code, or else Steam and Zang if I can't find working links to Ey and Kang. Quest code is probably more difficult than rooms and AI, so I'll keep that for last.

Great sources, thanks everyone!
droof is online now   Reply With Quote
Old February 14, 2018, 02:35   #7
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,397
Donated: $40
Pete Mack is on a distinguished road
Yes, NPP AI is good. (So is O/FA.)
Pete Mack is offline   Reply With Quote
Old February 14, 2018, 05:45   #8
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,154
wobbly is on a distinguished road
NPP has AI which is strong but to my mind it can be annoying and feels unnatural. For an example watch an umber hulk which will not use a corridor instead moving parallel to it through the wall. It's harder but feels a little off.
wobbly is offline   Reply With Quote
Old February 14, 2018, 06:09   #9
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,841
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by droof View Post
For 4GAI, I found NPP 0.5 on github. Looks like NPP's melee2.c is roughly Sang's monmove.c. I'll have fun with them. Is there some kind of manual that explains 4GAI and how it hooks into Angband?
There has been quite a lot of chat on this forum about how having super-smart monsters a la 4GAI is maybe not actually the best thing for gameplay. If you search for AI related threads I'm sure it'll come up. Monster mana also seems like a bit of a dead end to me. As Nick put it recently, you just end up killing the monster twice: first you drain its mana and then you drain its HP.

The original 'manual' for the 4GAI code is avaiable here:
http://web.archive.org/web/200501241..._misc/4GAI.txt

Andrew Doull wrote a four-part series about the 4GAI that I seem to remember was worth reading too: http://roguelikedeveloper.blogspot.c...e-history.html
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old February 14, 2018, 08:30   #10
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,154
wobbly is on a distinguished road
Almost forgot Sil's AI is worth a look though it would be harder to port to a different variant.
wobbly 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
Terrain Nick Vanilla 14 February 23, 2014 00:07
Help: Bad Code Generation? chris Development 5 July 18, 2012 18:31
Chengband # of random quests prompt ekolis Variants 9 June 18, 2012 01:17
NPP Quests: Will character level affect quest difficulty?? Nemesis Variants 11 October 7, 2009 04:37
[Z] Completing quests Parcae Variants 2 October 14, 2007 20:41


All times are GMT +1. The time now is 14:07.


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