## Random Dungeon Creator

Expand Messages
• Greetings! I ve recently started programming a random dungeon creator for CC2 that is implemented through the Intercom communication with my PowerBASIC
Message 1 of 10 , Jan 4, 2003
• 0 Attachment
Greetings!

I've recently started programming a random dungeon creator for CC2 that is
implemented through the Intercom communication with my PowerBASIC
(www.powerbasic.com) program. I took the excellent examples provided by L.
Lee Saunders (http://www.profantasy.com/devzone/) for the CC2 end of it. I
also used the dungeon creation example of James Buck
(http://www.aarg.net/~minam/dungeon_design.html) and have nearly
implemented all of his algorithm. I used a different maze-generating
algorithm known as the Growing-Tree that I found at the Think Labyrinth!
(http://www.astrolog.org/labyrnth/algrithm.htm), an excellent site
recommended by Mr. Buck.

I'm currently in Section Three of Mr. Buck's example of dungeon creation
(adding rooms and such) and I've taken a brief respite to learn how to send
my data to CC2. I've figured out a way to send the various walls and such
and you can see a CC2 example of my current state:

http://www.reonis.d2g.com/CC2/dungex.png
http://www.reonis.d2g.com/CC2/dungex.fcw

...my problem is learning macros and using them to send the data. To send
the dungeon to CC2, my program cycles through each subscript of my array to
then output each cell of the dungeon. My array stores which walls are not
blocked off:

1=North open
2=South open
4=East open
8=West open

I add the numbers for each area into that spot of the array. So, if you
are travelling a passageway North and come to a "T" intersection, my array
would store that cell as 14; meaning that from that cell, you can travel
South (2), East (4) and West (8)...8+4+2=14. When I want to send this data
to CC2, I cycle through each subscript of the array and then output that
block into CC2. So, if my array stored 5, I'd output something that looks
like |__ to CC2 with the line:

SndMessage 30000, "PATH 45,45 45,35 55,35" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF

...as you can tell from the example map, that does output correctly. I can
output my entire array without a problem. Now reading the setup and some
history, here comes a few various questions.

1. Is it possible to convert my current walls into something similar to
Morgan Olden's output from the BlockWall macros? What about floor tiles
into something like Mr. Olden's Random Floor Tiles macro?

2. When I send this series of commands, CC2 always hiccups and gives me an
error:

SndMessage 30000, "COLOR 252" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF
SndMessage 30000, "BOX 45,35 55,45" + \$CRLF + \$CRLF + "SENDM 1" +
\$CRLF
SndMessage 30000, "COLOR 0" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF

"Warning Campaign Cartographer 2 cannot perform the command: 1"

...if I accept the messages and troop on, I do get a series of boxes with
my grayish color; but, I don't understand the message.

3. Would users prefer each cell be separate or all of the various cells
combined into one path?

4. If you had suggestions to give for features in a random dungeon creator
for CC2; what would you be looking for?

Please forgive my long ramblings and basic understanding of macro
programming; but, I'd really like to beat this idea into submission.

Don Ewald
dpe@...
• There s a file available from the CC2Macros list that has all the user created Macros changed into Scripts. If you like, I could email the file to you. I
Message 2 of 10 , Jan 4, 2003
• 0 Attachment
There's a file available from the CC2Macros list that has all the user
created Macros changed into Scripts. If you like, I could email the file to
you.

I really like what you've done with Jamis' dungeon generator.

As for suggestions, hmmm. Maybe including a grid. Just coming up with a
random dungeon layout would cut down the time for making maps of this type.

Anna M. Dobritt
RPG Freelancers Guide
http://www.rpgfreelancers.com/index.html
Freelance Cartographer
http://rpgmaps.mortality.net

----- Original Message -----
From: "Don Ewald" <dpe@...>
To: <cc2-dev-l@yahoogroups.com>
Sent: Saturday, January 04, 2003 2:57 PM
Subject: [cc2-dev-l] Random Dungeon Creator

> Greetings!
>
> I've recently started programming a random dungeon creator for CC2 that is
> implemented through the Intercom communication with my PowerBASIC
> (www.powerbasic.com) program. I took the excellent examples provided by
L.
> Lee Saunders (http://www.profantasy.com/devzone/) for the CC2 end of it.
I
> also used the dungeon creation example of James Buck
> (http://www.aarg.net/~minam/dungeon_design.html) and have nearly
> implemented all of his algorithm. I used a different maze-generating
> algorithm known as the Growing-Tree that I found at the Think Labyrinth!
> (http://www.astrolog.org/labyrnth/algrithm.htm), an excellent site
> recommended by Mr. Buck.
>
> I'm currently in Section Three of Mr. Buck's example of dungeon creation
> (adding rooms and such) and I've taken a brief respite to learn how to
send
> my data to CC2. I've figured out a way to send the various walls and such
> and you can see a CC2 example of my current state:
>
> http://www.reonis.d2g.com/CC2/dungex.png
> http://www.reonis.d2g.com/CC2/dungex.fcw
>
> ...my problem is learning macros and using them to send the data. To send
> the dungeon to CC2, my program cycles through each subscript of my array
to
> then output each cell of the dungeon. My array stores which walls are not
> blocked off:
>
> 1=North open
> 2=South open
> 4=East open
> 8=West open
>
> I add the numbers for each area into that spot of the array. So, if you
> are travelling a passageway North and come to a "T" intersection, my array
> would store that cell as 14; meaning that from that cell, you can travel
> South (2), East (4) and West (8)...8+4+2=14. When I want to send this data
> to CC2, I cycle through each subscript of the array and then output that
> block into CC2. So, if my array stored 5, I'd output something that looks
> like |__ to CC2 with the line:
>
> SndMessage 30000, "PATH 45,45 45,35 55,35" + \$CRLF + \$CRLF + "SENDM 1" +
\$CRLF
>
> ...as you can tell from the example map, that does output correctly. I
can
> output my entire array without a problem. Now reading the setup and some
> history, here comes a few various questions.
>
> 1. Is it possible to convert my current walls into something similar to
> Morgan Olden's output from the BlockWall macros? What about floor tiles
> into something like Mr. Olden's Random Floor Tiles macro?
>
> 2. When I send this series of commands, CC2 always hiccups and gives me an
> error:
>
> SndMessage 30000, "COLOR 252" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF
> SndMessage 30000, "BOX 45,35 55,45" + \$CRLF + \$CRLF + "SENDM 1" +
> \$CRLF
> SndMessage 30000, "COLOR 0" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF
>
> "Warning Campaign Cartographer 2 cannot perform the command: 1"
>
> ...if I accept the messages and troop on, I do get a series of boxes with
> my grayish color; but, I don't understand the message.
>
> 3. Would users prefer each cell be separate or all of the various cells
> combined into one path?
>
> 4. If you had suggestions to give for features in a random dungeon
creator
> for CC2; what would you be looking for?
>
> Please forgive my long ramblings and basic understanding of macro
> programming; but, I'd really like to beat this idea into submission.
>
> Don Ewald
> dpe@...
>
>
> To Post a message, send it to: cc2-dev-l@...
> To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
• Greetings! Okay, with a bit of frustration I was able to figure out question two. The second \$CRLF was the culprit. It was telling CC2 to repeat the last
Message 3 of 10 , Jan 4, 2003
• 0 Attachment
Greetings!

Okay, with a bit of frustration I was able to figure out question two. The
second \$CRLF was the culprit. It was telling CC2 to repeat the last
command. On with progress...

Don Ewald
dpe@...
• Don, First, please let me commend you on your efforts thus far; very impressive! I m glad to see the spirit of CC2 innovation is alive and well. In response to
Message 4 of 10 , Jan 4, 2003
• 0 Attachment
Don,

First, please let me commend you on your efforts thus far; very impressive!
I'm glad to see the spirit of CC2 innovation is alive and well. In response
to your query (#1 below), I have a few ideas that might help.

As Anna suggested, the code to the macros you mentioned (Blockwall) are
available in several formats. Use them as you will.

All of the necessary macro commands could be passed to CC2 via Intercom.
What is the performance like with this process? Rather than passing several
hundred lines of macro code with this process, it may prove to be more
efficient to call an external script to perform the bulk of the work, For
example, assuming that the script 'DrawSection' will draw one grid section,
and requires the variables 'Position' and 'SectionType', then you could use
an Intercom command like:

SndMessage 30000, "GP Position 12,34;GV SectionType 2;SCRIPTM
#DrawSection.scr" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF

In theory, of course! ;)

Hope this helps,

Morgan

Don Ewald
<dpe@... To: cc2-dev-l@yahoogroups.com
> cc:
Subject: [cc2-dev-l] Random Dungeon Creator
01/04/03 02:57 PM
cc2-dev-l

Greetings!

I've recently started programming a random dungeon creator for CC2 that is
implemented through the Intercom communication with my PowerBASIC
(www.powerbasic.com) program. I took the excellent examples provided by L.

Lee Saunders (http://www.profantasy.com/devzone/) for the CC2 end of it. I

also used the dungeon creation example of James Buck
(http://www.aarg.net/~minam/dungeon_design.html) and have nearly
implemented all of his algorithm. I used a different maze-generating
algorithm known as the Growing-Tree that I found at the Think Labyrinth!
(http://www.astrolog.org/labyrnth/algrithm.htm), an excellent site
recommended by Mr. Buck.

I'm currently in Section Three of Mr. Buck's example of dungeon creation
(adding rooms and such) and I've taken a brief respite to learn how to send

my data to CC2. I've figured out a way to send the various walls and such
and you can see a CC2 example of my current state:

http://www.reonis.d2g.com/CC2/dungex.png
http://www.reonis.d2g.com/CC2/dungex.fcw

...my problem is learning macros and using them to send the data. To send
the dungeon to CC2, my program cycles through each subscript of my array to

then output each cell of the dungeon. My array stores which walls are not
blocked off:

1=North open
2=South open
4=East open
8=West open

I add the numbers for each area into that spot of the array. So, if you
are travelling a passageway North and come to a "T" intersection, my array
would store that cell as 14; meaning that from that cell, you can travel
South (2), East (4) and West (8)...8+4+2=14. When I want to send this data
to CC2, I cycle through each subscript of the array and then output that
block into CC2. So, if my array stored 5, I'd output something that looks
like |__ to CC2 with the line:

SndMessage 30000, "PATH 45,45 45,35 55,35" + \$CRLF + \$CRLF + "SENDM 1" +
\$CRLF

...as you can tell from the example map, that does output correctly. I can

output my entire array without a problem. Now reading the setup and some
history, here comes a few various questions.

1. Is it possible to convert my current walls into something similar to
Morgan Olden's output from the BlockWall macros? What about floor tiles
into something like Mr. Olden's Random Floor Tiles macro?

2. When I send this series of commands, CC2 always hiccups and gives me an
error:

SndMessage 30000, "COLOR 252" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF
SndMessage 30000, "BOX 45,35 55,45" + \$CRLF + \$CRLF + "SENDM 1" +
\$CRLF
SndMessage 30000, "COLOR 0" + \$CRLF + \$CRLF + "SENDM 1" + \$CRLF

"Warning Campaign Cartographer 2 cannot perform the command: 1"

...if I accept the messages and troop on, I do get a series of boxes with
my grayish color; but, I don't understand the message.

3. Would users prefer each cell be separate or all of the various cells
combined into one path?

4. If you had suggestions to give for features in a random dungeon creator

for CC2; what would you be looking for?

Please forgive my long ramblings and basic understanding of macro
programming; but, I'd really like to beat this idea into submission.

Don Ewald
dpe@...

To Post a message, send it to: cc2-dev-l@...
To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
• Is it also possible to include diagonal cardinal directions in the variable for determining the open directions? Just a thought. Some dungeons also do
Message 5 of 10 , Jan 5, 2003
• 0 Attachment
Is it also possible to include diagonal cardinal directions in the
variable for determining the open directions? Just a thought. Some
dungeons also do diagonal passages etc. Your implementation of this
idea is great! I've always wished CC2 could do this (and I guess it
always could, with the right "motivation" ;) ).

Latharion

> -----Original Message-----
> From: Don Ewald [mailto:dpe@...]
> Sent: Saturday, January 04, 2003 1:58 PM
> To: cc2-dev-l@yahoogroups.com
> Subject: [cc2-dev-l] Random Dungeon Creator
>
>
> Greetings!
>
> I've recently started programming a random dungeon creator
> for CC2 that is
> implemented through the Intercom communication with my PowerBASIC
> (www.powerbasic.com) program. I took the excellent examples
> provided by L.
> Lee Saunders (http://www.profantasy.com/devzone/) for the CC2
> end of it. I
> also used the dungeon creation example of James Buck
> (http://www.aarg.net/~minam/dungeon_design.html) and have nearly
> implemented all of his algorithm. I used a different maze-generating
> algorithm known as the Growing-Tree that I found at the Think
> Labyrinth!
> (http://www.astrolog.org/labyrnth/algrithm.htm), an excellent site
> recommended by Mr. Buck.
>
> I'm currently in Section Three of Mr. Buck's example of
> dungeon creation
> (adding rooms and such) and I've taken a brief respite to
> learn how to send
> my data to CC2. I've figured out a way to send the various
> walls and such
> and you can see a CC2 example of my current state:
>
> http://www.reonis.d2g.com/CC2/dungex.png
> http://www.reonis.d2g.com/CC2/dungex.fcw
>
> ...my problem is learning macros and using them to send the
> data. To send
> the dungeon to CC2, my program cycles through each subscript
> of my array to
> then output each cell of the dungeon. My array stores which
> walls are not
> blocked off:
>
> 1=North open
> 2=South open
> 4=East open
> 8=West open
>
> I add the numbers for each area into that spot of the array.
> So, if you
> are travelling a passageway North and come to a "T"
> intersection, my array
> would store that cell as 14; meaning that from that cell, you
> can travel
> South (2), East (4) and West (8)...8+4+2=14. When I want to
> send this data
> to CC2, I cycle through each subscript of the array and then
> output that
> block into CC2. So, if my array stored 5, I'd output
> something that looks
> like |__ to CC2 with the line:
>
> SndMessage 30000, "PATH 45,45 45,35 55,35" + \$CRLF + \$CRLF +
> "SENDM 1" + \$CRLF
>
> ...as you can tell from the example map, that does output
> correctly. I can
> output my entire array without a problem. Now reading the
> setup and some
> history, here comes a few various questions.
>
> 1. Is it possible to convert my current walls into something
> similar to
> Morgan Olden's output from the BlockWall macros? What about
> floor tiles
> into something like Mr. Olden's Random Floor Tiles macro?
>
> 2. When I send this series of commands, CC2 always hiccups
> and gives me an
> error:
>
> SndMessage 30000, "COLOR 252" + \$CRLF + \$CRLF +
> "SENDM 1" + \$CRLF
> SndMessage 30000, "BOX 45,35 55,45" + \$CRLF + \$CRLF
> + "SENDM 1" +
> \$CRLF
> SndMessage 30000, "COLOR 0" + \$CRLF + \$CRLF + "SENDM
> 1" + \$CRLF
>
> "Warning Campaign Cartographer 2 cannot perform the command: 1"
>
> ...if I accept the messages and troop on, I do get a series
> of boxes with
> my grayish color; but, I don't understand the message.
>
> 3. Would users prefer each cell be separate or all of the
> various cells
> combined into one path?
>
> 4. If you had suggestions to give for features in a random
> dungeon creator
> for CC2; what would you be looking for?
>
> Please forgive my long ramblings and basic understanding of macro
> programming; but, I'd really like to beat this idea into submission.
>
> Don Ewald
> dpe@...
>
>
> To Post a message, send it to: cc2-dev-l@...
> To Unsubscribe, send a blank message to:
> cc2-dev-l-unsubscribe@...
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
• Greetings Morgan and all! You---- First, please let me commend you on your efforts thus far; very impressive! Many thanks! I m quite proud of the progress
Message 6 of 10 , Jan 5, 2003
• 0 Attachment
Greetings Morgan and all!

You---->First, please let me commend you on your efforts thus far; very
impressive!

Many thanks! I'm quite proud of the progress that I've made. My two
biggest hurdles, programmatically creating a maze and finding a way to
communicate it to CC2, have been overcome.

You---->As Anna suggested, the code to the macros you mentioned (Blockwall)
are available in several formats. Use them as you will.

Great! I really am impressed by your macros and I wish I had half the
understanding of them that I should. I've edited (mangled?) the Blockwall
script to allow me to send it up to four points and it now creates the wall
of my dungeons. The only downside is speed. It takes a long time on my
machine to create the example map found below, I kicked the program off,
read Smithsonian for fifteen minutes hoping it would finish quickly. I
then went downstairs for a milk and cookie break and came back up to a nice
map.

You---->All of the necessary macro commands could be passed to CC2 via
Intercom. What is the performance like with this process?...it may prove to
be more efficient to call an external script...

Slower than I would like. My program waits between each command for CC2 to
finish processing and unfortunately the communication between the two isn't
exactly Godspeed. I took your suggestion and tested out scripts and I am
quite pleased. CC2 does process scripts faster than communicating through
Intercom. So, I ditched Intercom entirely and am now outputting my data
into script form. This doesn't mean that I've totally forgotten about
Intercom; but, for basic dungeon creation I think scripts will be my answer.

http://www.reonis.d2g.com/CC2/dungex3.png
http://www.reonis.d2g.com/CC2/dungex3.fcw

I have finished many of my goals with this and I do have a few more to go.

To do:
-Make tan background image one box instead of many
-Make the various colors for map editable
-Implement doors
-Make variable to determine if doors are Secret or Concealed
-Find faster way to create walls
-Try and time a dungeon tile fill
-Make the various variables user editable
-Create a GUI environment for future users
-Implement a prettier border scheme as well as cartographic touchs like
compass and such
-Have rooms hotspot with an outside text file or executable to flesh out
descriptions--look into Campaign Suite

Finished:
-Dungeon creation is based on a 2d, Normal, Orthogonal, Perfect
passage-carving Maze using the Growing-Tree algorithm (though other
algorithms are a variable away)
-Maze is then sparcified to lessen density and then loopified to create
loops. This process still allows you to explore every square that is
available.
-Using a weighting system we place rooms in the best place possible (least
interference with the existing dungeon)
-Various stuff on the correct layers
-Room width, room height, room number, dungeon width, dungeon height, maze
algorithm, dungeon block size, sparcity, loopity and loopity percent
variables implemented
-Output to CC2 script

Don Ewald
dpe@...
• In a message dated 1/5/2003 8:13:43 PM Eastern Daylight Time, ... What is your attached file? Mike Group Owner InfinityScripters, AuroraScripters &
Message 7 of 10 , Jan 5, 2003
• 0 Attachment
In a message dated 1/5/2003 8:13:43 PM Eastern Daylight Time, latharion@... writes:

Is it also possible to include diagonal cardinal directions in the
variable for determining the open directions?  Just a thought.  Some
dungeons also do diagonal passages etc.  Your implementation of this
idea is great!  I've always wished CC2 could do this (and I guess it
always could, with the right "motivation"  ;)  ).

Latharion

Mike Group Owner InfinityScripters, AuroraScripters & AuroraModers

http://groups.yahoo.com/group/InfinityScripters/

http://groups.yahoo.com/group/AuroraScripters/?yguid=39597670
http://groups.yahoo.com/group/AuroraModers/
AI Scripting Ring for Infinity Engine and Aurora Engine Games
http://l.webring.com/hub?ring=aiscriptingringf
http://nwn.bioware.com/guilds_registry/viewguild.html?gid=481

"Begone, foul dwimmerlaik, lord of carrion! Leave the dead in peace!"  Dernhelm
"Come not between the Nazgûl and his prey! Or he will not slay thee in thy turn. He will bear thee away to the houses of lamentation, beyond all darkness, where thy flesh shall be devoured, and thy shriveled mind be left naked to the Lidless Eye." The Witch King
A sword rang as it was drawn.
"Do what you will, but I will hinder it, if I may."  Dernhelm
"Hinder me? Thou fool. No living man may hinder me!"  The Witch King
Then Merry heard of all sounds in that hour the strangest.  It seemed that Dernhelm laughed, and the clear voice was like the ring of steel.
"But no living man am I! You look upon a woman. Eowyn I am, Eomund's daughter. You stand between me and my lord and kin. Begone, if you are not deathless! For living or dark undead, I will smite you, if you touch him."  Eowyn/Dernhelm
The winged creature screamed at her, but the Ringwraith made no answer, and was silent, as if in sudden doubt.  Very amazement for a moment conquered Merry's fear.  He opened his eyes and the blackness was lifted from them.

"The Return of the King"
• Intercom can be used as follows: Intercom asks your program to generate a script. When the script has been created, your program requests that CC2 runs the
Message 8 of 10 , Jan 6, 2003
• 0 Attachment
Intercom can be used as follows:
When the script has been created, your program requests that CC2 runs the
script.

Simon
• Greetings Simon! You---- Intercom asks your program to generate a script. When the script has been created, your program requests that CC2 runs the script.
Message 9 of 10 , Jan 6, 2003
• 0 Attachment
Greetings Simon!

has been created, your program requests that CC2 runs the script.

Dynamite idea! I overlooked that one and I'll definitely try to implement
it. This interacting with CC2 is way beyond anything I thought possible
before.

Don Ewald
dpe@...
• While it is generating the script, it s probably an idea to put up a task bar so that they don t do anything in CC2 to interfere with your intercom command to
Message 10 of 10 , Jan 7, 2003
• 0 Attachment
While it is generating the script, it's probably an idea to put up a task
bar so that they don't do anything in CC2 to interfere with your intercom
command to run the script file.
Simon

-----Original Message-----
From: Don Ewald [mailto:dpe@...]
Sent: 07 January 2003 00:22
To: cc2-dev-l@yahoogroups.com
Subject: Re: [cc2-dev-l] Intercom vs scripts

Greetings Simon!

has been created, your program requests that CC2 runs the script.

Dynamite idea! I overlooked that one and I'll definitely try to implement
it. This interacting with CC2 is way beyond anything I thought possible
before.

Don Ewald
dpe@...

To Post a message, send it to: cc2-dev-l@...
To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Your message has been successfully submitted and would be delivered to recipients shortly.