Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re{9}: Modules: Building blocks for the Daft Adventure

by dragonchild (Archbishop)
on Jun 12, 2001 at 19:54 UTC ( [id://87847]=note: print w/replies, xml ) Need Help??


in reply to Re{8}: Modules: Building blocks for the Daft Adventure
in thread Modules: Building blocks for the Daft Adventure

*laughs* Tiefling, my friend. That is one very good reason why OO is better (at some things) than top-down. Coding something up like this in an OO language would be an extremely simple thing.
  1. Define what each point knows about and knows how to do. Does it know about the wind direction? Does it know about temperature? What about composition (earth, stone, water, air, etc)? I'm sure you can come up with some 30-40 things each grid point knows about.
  2. Create a grid object containing, say, 50x50x10 of these objects. The grid needs to be able to coordinate between the various points, for things like wind changing direction or a warm front moving through. Heck, just for things like daybreak. :-) (There's a number of niftykeen Perl tricks that can be done here to reduce the number of lines and increase the readability.)
  3. Populate said grid.
Here's the neat part - you have a Map::Grid class and a Map::Point class. The Grid will have, maybe, 500 lines of code and the Point might have 1000 or so. Not all that much, if you think about the fact that that's your entire 3-D world.
  • Comment on Re{9}: Modules: Building blocks for the Daft Adventure

Replies are listed 'Best First'.
Re: Re{10}: Modules: Building blocks for the Daft Adventure
by Tiefling (Monk) on Jun 12, 2001 at 20:12 UTC
    All very interesting. But don't forget that I previously had 1800 rooms - the equivalent of your grid points - so it's going to be a little tricky defining them in terms of 1500 lines of data - even allowing for the fact that exit data will be largely redundant. How would you deal with, say, doors? And hang on two ticks: 50x50x10 points is 25 000 areas. How do we go about defining a world with non-generic location descriptions with 25 000 locations in only 1500 lines of code?

    You've seriously got me baffled now.

    Tiefling

    tieflet|at|hotmail|dot|com -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GAT d++ s:- a-- C++ UL P++ L++(+) E? W+(++) N+ o? K w+(--) !O M- V? PS+ PE- Y PGP- t+ 5 X+ R+++ tv- b+++ DI++++ D+ G+ e++ h!(-) y +? ------END GEEK CODE BLOCK------

      Ah, there's the joy of it: 1500 lines of code defines "a grid point", and then when you create your map, you instantiate however many gridpoints with the properties you want. If I understand what dragonchild means, a gridpoint is probably smaller than a room, having properties such as opacity, density, and the like (that is, you can or cannot see or move through it in certain directions).

      While I am not (by any means) experienced in D&D matters, I would love to join up to try to make that kind of a 3D world system workable.



      If God had meant us to fly, he would *never* have give us the railroads.
          --Michael Flanders

        As you may have deduced from my handle (or not), I'm a fan of the old Planescape setting. I would _like_ to have a map that wasn't so tied to geometry as this would be. Being able to map the hideous contours of the Abyss would be, while inessential, distinctly nice. This comment, of course, also goes for any Cthulhu implementation, wherein the Dreamlands and other curious locales might exist.Consequently:

        Desirable properties of a 'room':

        • Type - dungeon passage, dungeon chamber, tavern, etc. Possibly to be used as the superclass of the room, so that properties can be generalised.
        • Description - optional, but desirable. If the description is undefined, it gets inherited from the type. Description should decompose into Visual, Auditory, Olfactory, Tactile and several Ranged components, not all of which are needed. The Ranged components are my preferred answer to the sightlines query, consisting of a distance (for comparison with fog and darkness) and a nice description of the object visible at that distance.
        • Lighting effects present
        • Susceptibility to weather
        • Latitude and longitude, for determining weather. Possibly also a 'planitude' to determine whether the rain is likely to be water, frogs or blood.
        • Exits. Abstract links to other rooms, identified by direction, and possibly also by location in the room (see below) and/or some kind of subsidiary descriptor. Whilst it might not be fair, I'd like to use this section to describe any locations accessible with fly, passwall, etc, here, rather than risk the players breaking the system by indiscriminate use of travel spells.
        • Liquid nature and depth, if any.
        • Contents. Well, duh. :-)


        I hope that lot helps to clarify how I've been thinking thus far.

        Tiefling

        -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GAT d++ s:- a-- C++ UL P++ L++(+) E? W+(++) N+ o? K w+(--) !O M- V? PS+ PE- Y PGP- t+ 5 X+ R+++ tv- b+++ DI++++ D+ G+ e++ h!(-) y +? ------END GEEK CODE BLOCK------

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87847]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-24 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found