[comp.sources.wanted] Terrain Generator

cuddy@convex.UUCP (03/01/88)

    I'm looking for a terrain generator for a dungeon game I'm planning
    to write.  (or at least an algorithm to generate the terrain.. I can code
    it myself)  I'll take it in just about any language ('cept maybe smalltalk
    or 4004 asm!)  Also, If anybody has any Ideas (is that a dumb question?) 
    about what should be in the game, please mail them to me.
    The Ideas I have so far are:

      * Multiuser, Multiplayer
      * Infinite landscape
      * Player created dungeons (when you get high enough with enough gold,
	you can create dungeons that others can go through)
      * Tons of magic items, monsters, spells
      * configurable controls (maybe defaults to hack style or whatver..)
      * tows, cities, castles, keeps: all with people who interact with
	the world
      * rumors that are spread by players (from their experiences) and by
	NPC's (my how rumors get exaggerated..)
      * AND MUCH, MUCH, MORE!

    I'm thinking about using the D&D system for most things (although adapting
    it for computer use).

    my email address is:
	{uiucdcs,ihnp4,sun,allegra}!convex!cuddy
    
    any and all replies will be greatly appreciated. 

Mike Cuddy
CONVEX Computer Corp.
701 N. Plano Road
Richardson, TX  75081
214-952-0200

peter@prism.TMC.COM (03/04/88)

I have played some D&D games, and one thing I have noticed as an erstwhile
economist and science fan, is that worlds often seem to be populated by
monsters whose sole reason of being is to be a nuisance to you.
In other words there is a certain 'sterility' to the worlds that often
get created.
The idea that I have, and which should help you create a world I hope, is
that even monsters need to do the four f's(feeding fighting fleeing f***ing).
In most eco-systems the total number of organisms depends on the energy 
available to the system.

Note: For 10lbs of prey are needed to support 1 lb of predator.
Thus I am sure that given the many levels of monsters you might have
different levels praying on each other. Instead of pounds of meat as 
a measure of food one might have LFU's (Life Force Units) in the monster/
magical realm. Thus it might take 10 1st level demons to feed 1 2nd level
demon. Also the higher up one is on the food chain the more intelligent.

Thus more intelligent demons/monsters might have some sort of farming going
on. Wherever there is farming there tends to be surplus. Wherever there is
surplus there is some kind of commerce. Thus a dungeon might be thought of
as an underground eco-system/economy. You might have demons with MBA's 
administrating aspects of the dungeon. You might have times when the 
dungeon suffers 'rush-hour' grid lock, and other times when it's quiet.

I think a good way to think about a dungeon, is to think of a war-torn
city, like Beirut(or LA's Watts). 
You have various factions fighting each other:
Druze, Amal, Hasb'allah,Phalangists,Syrians,PLO,Shiites,Sunnis,Maronites,
etc etc etc. You still have merchants going about their business supplying
the city with food, arms, luxuries, power, water, medicine. You have civilians
working in the city often at the risk of becoming victims of random snipers,
bombers, kidnappers etc. And there would be you, trying to complete some 
mission. You would need some sort of briefing and a network of contacts.

Thus I would probably use an object oriented approach. I would have
objects such as 'containers' and 'connectors'. A container could be a
a building, a room, or a cup. A connector could be a road, bridge, stairs,
hallway, or an opening. You would also have operators to work on your
various objects 'connect' 'randomly generate' . Your generator would then
use some set of rules to connect the various containers with each other.
I mean think of how a city is built. The top most container is the universe,
then our galaxy, then our solar system, then our planet, then our continent,
then our country, then our city, then our building, then our room, then our
cubicle. You then describe the relationship between these containers (
inverted tree structure). So there is some sort of self-similarity to be
taken advantage of. Further coding can be made easier if you have some
basic container module which can generate a city, a building, a room, a glass
depending on some parameter you pass to it. 

I think this process of using self-similarity can also apply to other objects
that fill this world: 'connectors' ->'stairs,roads,pipes,wires,ducts,hallways'
If you think of connectors really as a means of conveying something to 
someplace else then there might be another class of objects that can be
'conveyed'->'organisms,machines,fluid etc'

The point that I want to make is that the world can be made up of a few
classes of abstract objects, which may have many different instantiations.

So this top-down, building block approach makes life and the process of
expanding the world easier; instead of having to create entire new modules
to accomodate a treasure chest for example you just add it to the 'container'
list of things.

Anyway, a project at the company I used to work at, involved modeling 
a military installation in terms of locations and connections. 
Example: You have location, say the inside of a safe, and you have
three connectors/actions that represent the way to get into the safe by
blow torch, explosive, or by knowing the combination. Each action had a 
probability of success and a duration. Now the safe is in a room that has
two connectors/actions: window or door. Breaking the window or the door
in turn has a probability of success and a duration. Modelling this thing
was definitely non-trivial because of the user interface and the assessment
of overall risks, and finally because of special cases.
But it was successfully completed and the software could thus model many
types of installations.

Thus I hope this will help, I would suggest reading AI books on 'Frames'
or 'Frame-worlds', for the ideas that I have talked about are essentially
derived from a 'frame' oriented approach.
----
Peter J. Stucki --  peter@mirror.TMC.COM	
  UUCP   :  {mit-eddie, ihnp4, harvard!wjh12, cca, cbosg, seismo}!mirror!peter
  TryThis:  peter@mirror.zone1.com
                  (we forward for .zone1.com)
Mirror Systems	2067 Massachusetts Avenue  Cambridge, MA, 02140
Telephone:	617-661-0777 extension 131

"Don't hope for miracles! Rely on them!"
---