Wilderness encounters
Goto page Previous  1, 2
 
Post new topic   Reply to topic    mudlab.org Forum Index -> Design
View previous topic :: View next topic  
Author Message
Falco



Joined: 24 Jul 2005
Posts: 15
Location: The Drawing Room

PostPosted: Sat Sep 03, 2005 12:49 am    Post subject: Reply with quote

shasarak wrote:
In the system I was outlining the probabilities are not necessarily percentages, either. The unit is arbitrary. You might end up (in one particular type of tile) with chances like this:

Hill giant: 10
Orc: 6
Warg: 12
Troll: 4
Wild man: 8
Everything else: 0 or less.

In that instance, if there's a monster, the chances of it being a hill giant is 10 out of 40, or 25%. If the chances were:

Hill giant: 10
Warg: 12
Wild man: 8
Everything else: 0 or less.

Then that would mean a 50% chance of a hill giant.


Wouldn't that be a 33% chance of a hill giant? 10+12+8=30...10 of 30 is slightly more than 33%.
Back to top
View user's profile Send private message
Author Message
shasarak



Joined: 29 Jun 2005
Posts: 134
Location: Emily's Shop

PostPosted: Mon Sep 05, 2005 4:04 pm    Post subject: Reply with quote

Sorry, 33%, yes. (slaps forehead) Smile
Back to top
View user's profile Send private message
Author Message
KaVir



Joined: 11 May 2005
Posts: 565
Location: Munich

PostPosted: Sun Oct 02, 2005 4:28 pm    Post subject: Reply with quote

I finally settled on an approach, and thought I'd describe it here briefly in case anyone else is doing or considering something similar.

I've defined a set of area types, each of which includes one or more terrain types - for example a river area type includes north, south, east and west flowing rivers, as well as riverbanks, while a forest includes forest, forest edge, forest trails and forest clearings.

I then store a list of areas, with each area consists of a name, an area type, a covered coordinate range (from x/y to x/y), and an encounter list for land@day, land@night, water@day and water@night. Thus for example, wraiths can sometimes be encountered at night when travelling through Twilight Wood, while it's far more common to encounter nomads at an oasis while travelling through the Northern Desert.

The difficult part was dealing with rivers, particularly on small islands which have two or more rivers in close proximity - I had to do these in multiple parts (basically multiple copies of the same area, each covering different coordinate ranges). I also found it tricky dealing with places where rivers split, as I didn't want both branches to have the same name. This wasn't too difficult though, I just had to be very exact with the coordinates.

Another minor issue is that I've divided each terrain type into one of the area types, while in practice there are situations where a terrain type could belong to multiple area types (for example a pond in the forest should be part of the forest area, unless there's a pond area overlapping it). I'll eventually get around to changing this, I'm just feeling rather lazy at the moment.

I've also been thinking about how the system could be used to name entire islands. I think this would probably be better handled with a separate area list which differentiates only between ocean and non-ocean. The same concept could also be used to name oceans, but I think that would be difficult to handle well, as ocean boundries are hard to clearly define.

Another thing I plan to do is add lengthy descriptions for each area, allowing players to learn about rumours and historical information, and giving them an idea of what they can expect to find there. For the benefit of my blind players, I will also include an approximate distance and direction for each area.

I will use this system for the central hand-built core of the world. The rest of the world, which is generated, will continue using the standard approach to wilderness encounters - however the mobs will automatically scale in power the further out they are. I will expand the central part of the world as and when I have time, while the outer part will ensure that there never comes a time when a player cannot find a worthy opponent.
Back to top
View user's profile Send private message Visit poster's website
Author Message
KaVir



Joined: 11 May 2005
Posts: 565
Location: Munich

PostPosted: Tue Nov 15, 2005 1:09 pm    Post subject: Reply with quote

Quote:
I then store a list of areas, with each area consists of a name, an area type, a covered coordinate range (from x/y to x/y), and an encounter list for land@day, land@night, water@day and water@night.


I've started to realise that the four encounter lists are not sufficient - 'day' and 'night' are okay in general terms, but the solution should be generic enough to handle special cases as well, such as a headless horseman that only spawns at midnight, or a load of drunks who spawn near the tavern after closing time.

I'd also like the option of having separate lists for different seasons - brown treants in autumn and green ones in spring, peasants wearing woolen cloaks and thick mittens in winter, or light clothes in summer, and so on. Rather than being one of four states, this could also take into account the beginning and end of seasons, so that not all of the peasants suddenly change from light to heavy clothing, but instead it's a gradual shift with some wearing thicker clothes than others as the seasons become gradually colder.

By the same reasoning, weather could also be a factor, so that peasants might wear coats (and spawn more indoors than outdoors) when it's raining. You might also encounter peasant children flying kites when the weather is particularly windy, or building snowmen after a recent snowfall.

However this creates far too many options for any sort of static list. Some of it could be handled by the mobs themselves (different eq sets based on season, or perhaps based on temperature with a 'tolerate' stat for each mob type), but even then I think it's going to need a more script-like approach.

Any thoughts on how to go about this?
Back to top
View user's profile Send private message Visit poster's website
Author Message
Kjartan



Joined: 13 May 2005
Posts: 110

PostPosted: Wed Nov 16, 2005 3:52 pm    Post subject: Reply with quote

It seems that something like Shasharak's approach would still work. You have one big list. Each monster on the list has a likelihood, which is just a static number and which can have any scaling you like, doesn't have to be a probability. Then you have a whole bunch of checks that can be associated with each list item, like

tile is one of x, y, or z
region is one of x, y, or z (for your specific ranges of hills)
time of day is between x and y
month of year is between x and y
there are less than x of these monsters currently at large
always create this monster if it has a nonzero chance

When you are picking a wandering monster, pass through the list and evaluate which ones are possible for the location and other conditions, making a reduced list. Then, normalize the probabilities based on the likelihood numbers on the reduced list just like Shasharak suggested, roll the dice, and there you go.

The "always create" item sort of violates this, it's for your headless horseman example. You would say for that one something like: time is between midnight and 1 am, must be less than 1, always create.
Back to top
View user's profile Send private message Visit poster's website
Author Message
Teelf



Joined: 12 May 2005
Posts: 21
Location: Seattle, WA

PostPosted: Wed Nov 16, 2005 6:29 pm    Post subject: Reply with quote

Sounds like a Constraint Satisfaction Problem to me.

Maybe some research in that direction could lead to a simple CSP solver that could handle this generically. There would be different ways of handling the search space.

One I can think of is to create [mob, probability] pairs and add constraints for those. The reason for this is to allow the same mobs to have different probablities for different constraints:

Constraint: [headless horsemen, .45] -> time:12-13, terrain:swamp|forest, ...)
Constraint: [brown treant, .9] -> season:autumn, area:treant_land
Constraint: [hill giant, .9] -> terrain:mountain
Constraint: [hill giant, .1] -> terrain:plain (the occasional hill giant strays from home)

Have the CSP solver return a list of [mob, probability] pairs that satisfy the contraints and do what you will with it.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Design All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign