Welcome to Intellivision Online! A dedicated Intellivision forum for classic and new Intellivision fans.

Join the forum, it's quick and easy

Welcome to Intellivision Online! A dedicated Intellivision forum for classic and new Intellivision fans.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password



Social bookmarking
Social bookmarking reddit  Social bookmarking google      




Bookmark and share the address of on your social bookmarking website

Who is online?
In total there are 7 users online :: 0 Registered, 0 Hidden and 7 Guests :: 2 Bots

None

[ View the whole list ]


Most users ever online was 189 on Sun 22 Sep 2013, 8:05 am
RSS feeds

Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


The Intellivision Forums
Statistics
We have 411 registered users
The newest registered user is JustClaws

Our users have posted a total of 4128 messages in 866 subjects
Search
 
 

Display results as :
 


Rechercher Advanced Search

The Intellivision Forums

You are not connected. Please login or register

 » Intellivision » Mattel Intellivision » Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation

Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation

Go down  Message [Page 1 of 1]

intylab

intylab
Member
Member
I spent the last few days deciphering the method used to generate the dungeons.  Maybe somebody will find it useful.


First, two images showing the shapes of the eight rooms, and the layout of the two dungeon types.
Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation Addcmr10

Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation Addcmm10


Your starting point is always room "4" in the NW corner of one of the maps, which I highlighted in red.

There are 16 unique dungeons with two variables:

  • Which of the eight rooms is bound to "4" (the others follow in sequence)
  • Which of the two dungeon types you're in: single-width or double-width


Note the room shapes.

  • All the rooms are 9x9 "background cards" in size (72x72 pixels).
  • The middle card on three of the edges - the three directions you can travel to - is where one room connects to another.
  • The center card is the spawn point for: yourself, monsters, pickup items, and the exit (or crown halves).
  • The card just south of the spawn point, regardless of orientation is where visual "artifacts" appear: rat droppings, demon bones, and skulls.
  • All the rooms are rendered using six GROM character tiles: blank (#0), full (#95), and half-filled along a diagonal (#116-119).
  • The rooms are rotated in 90° increments based on the three directions you can go.
  • There is one row/column full of empty cards in the direction you can't go.
  • Movement always happens in one-tile increments, though the animation is smooth.  You and the monsters can only move where there are filled tiles.  Diagonals within the "tunnels" are for visual effect, so you're not seen walking through walls while travelling diagonally.  The diagonals also effect the angle of refraction for arrows.


Next, note the two dungeon maps.  The double-width map is first.

  • All rooms appear 4 times, and starting in the north tier, they recur one room SE from the previous one until the south tier.
  • For rooms 1-3, use the E-W wraparounds to see how the pattern continues.
  • The patterns continue in circular numeric order.
  • The only difference in the single-width dungeons is that the wraparounds west of the starting column go to the fourth column of what would otherwise be the double-width dungeon.
  • Only rooms 1-7 are used in the single-width dungeons, which is why I arranged the starting point to be room "4".


A fast way to tell which type of dungeon you're in is to travel N then W.  If the room has the same shape as the starting room but is rotated 90° clockwise, then you're in a single-width dungeon.

The 8 room shapes, ordered from left to right, follow the same sequence as the numeric labels in the dungeon maps.  Visualize one of those "Translation Wheels" where you would turn one wheel that's pinned on top of another which is larger and forms an outer ring.  You could turn the bottom wheel, with the labels 1-8 printed around it, to point the number 4 to the one room shape on the top wheel, and then all the other shapes would conform to the other labels.

Rooms are always drawn when they appear within the viewing area.  To hide them until they're marked as "visited", they are drawn with the foreground and background colors being the same, like the "invisible robot" in Night Stalker.  Moving objects inside of unvisited rooms are hidden except for the blobs.

That leaves a few things for me to discover.  I will check to see if there's a relationship between the "cardtab" position on the map and the dungeon variables.  I still don't know whether the skulls have any significance, and how the procedural generation determines the placement of skulls, quivers, exits, and quest items.

If anybody wants me to also lay out the mechanics of the five dungeons (Cloudy Mountain and the four colors of the other mountains), I will.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."

TestaOn, Black_Tiger and FDR4Prez like this post

https://linktr.ee/intylab

Rev

Rev
Admin
Admin
Very interesting! Nice work.


________________________________________
This Revolution will be Intellivised!
http://www.intvrevolution.com

TrekMD

TrekMD
Moderator
Moderator
This is very nice indeed!
Thanks!


________________________________________
Going to the final frontier...gaming!
Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation IntellivisionBanner-TrekMD2_zps814444c5
https://plus.google.com/+EugenioAngueira

cmadruga


Rookie
Rookie
Fascinating the analogy with invisible robots.

I assume monsters lie dormant in those hidden rooms until revealed? Or attacked.

intylab

intylab
Member
Member
Firing an arrow in the vicinity wakes them up, whether or not you hit them.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."
https://linktr.ee/intylab

cmadruga


Rookie
Rookie
How is the “vicinity” defined?
Is it by the monster’s sprite and the player’s one being displayed simultaneously?

intylab

intylab
Member
Member
That I don't know yet. It probably has to do with being in an adjacent room as the monster. Sometimes you'll fire an arrow and hear the hiss of a snake or the roar of a dragon, but it might get stuck in a rut while trying to follow a direct path toward the player, which is why you won't see it approaching until you move.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."
https://linktr.ee/intylab

Wardu


Janitor
Janitor
Hello, I found your article fascinating and very well documented. , I was a huge fan of this game during the 80's !!!
I am myself developing this game with the API Unity, for my pleasure and I have learned a lot while reading your document.
You say, "If anyone wants me to introduce the mechanics of the five dungeons (Cloudy Mountain and the four colors of the other mountains) as well, I will." I am obviously very interested in this presentation!
Thank you very much and again well done for your work. Very Happy

intylab

intylab
Member
Member
Wardu wrote:Hello, I found your article fascinating and very well documented. , I was a huge fan of this game during the 80's !!!
I am myself developing this game with the API Unity, for my pleasure and I have learned a lot while reading your document.

That will be fun to see when it's ready.

Wardu wrote:You say, "If anyone wants me to introduce the mechanics of the five dungeons (Cloudy Mountain and the four colors of the other mountains) as well, I will." I am obviously very interested in this presentation!

Okay.

All dungeons contain:

ElementFunction
BatsMake noise so you can't hear the snakes or dragons nearby
SpidersEat your arrows
BlobsMove slowly and cause the most damage when touched
Quivers5 extra arrows on highest difficulty, +2 extra arrows foreach lower difficulty
SkullNo function?

The five dungeons determine the three major enemies you will encounter and what they are guarding.

DungeonThese monsters ...guard this ...and this.Extra monster
Gray mountainRatsQuiverExitSnake
Blue mountainDemonsBoatExitDragon
Red mountainSnakesAxeExitRat
Purple mountainDragonsKeyExitDemon
Cloudy mountainWinged DragonOne crown halfOther crown halfSnake
Wardu wrote:Thank you very much and again well done for your work. Very Happy

I'm glad you enjoyed it.  I enjoyed deconstructing it myself.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."

TestaOn and FDR4Prez like this post

https://linktr.ee/intylab

Wardu


Janitor
Janitor
Thanks for these informations.
Have you, by any chance, analyzed the way cards are generated at the start of the game? (those with the mountains, forest, river, wall and cloudy mountain?
Thank you again for your help.

intylab

intylab
Member
Member
Wardu wrote:Thanks for these informations.
Have you, by any chance, analyzed the way cards are generated at the start of the game? (those with the mountains, forest, river, wall and cloudy mountain?
Thank you again for your help.

I'm looking at the ROM disassembly now, just for fun.  One thing I just discovered is that you can automatically win the game with a key combination at startup.  On the right controller, hold any two action buttons (save the top two) and the disc in the WNW position, and reset.  The game will start, and you will suddenly have the crown in the cabin.

I'll see what other goodies I find in the ROM.  I don't imagine I'll uncover too much with the map generation though.  I always thought the game just selected one of four maps at random.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."

TestaOn likes this post

https://linktr.ee/intylab

intylab

intylab
Member
Member
Status update on ROM hack:

I had hacked this game before to grant infinite lives and infinite arrows, and I knew which memory addresses retained those values.

Nothing too exciting yet about map generation, but I did uncover the memory location that retains your expedition's position on the map.  You may or may not know about the cheat that lets you jump to a position near the opposite corner of the map.  It looks more like a bug exploit than an explicit cheat.  
Click here to read about it:
Move to the NW corner of the map and press 1 to disappear into a position off the visible portion of the map.  Press 1 again, and your expedition will appear to be in the center of the map but will actually be 4 positions west from the SE corner.  Move in a valid direction from there to see your updated position.

What's happening is that the memory address that retains your position has a value equal to the row and column of the map's grid.  The value is 20 * row + column.  Because this game keeps the border extension bits raised for both axes, the visible range is 1-11 for the rows (11 being at the bottom of the screen) and 1-19 for the columns (19 being at the right).  Without those border extensions, the ranges would begin at 0.  When you're in the visible NW corner, your position is $15, the hexadecimal equivalent of 21 (row 1, column 1).  Moving NW from there subtracts 21, making its value 0.  As it turns out, the code assumes 0 to be a valid position.  Because this is an 8-bit unsigned variable, moving NW again sets its value to $eb, or 235, which is row 11, column 15.  This is a similar bug to the infamous 256th level of Pac-Man.

Another variable I uncovered is the difficulty level.  Its value ranges from 0 (hardest) to 3 (easiest).  The code immediately following the title screen fetches a value from the Executive ROM, whose range is 3-6, based on which key you pressed to start the game.  That range is normally used to set the time delay, but in this case, 3 is subtracted from the fetched value and then saved to this other address used by the game.  Poking the value 4 freezes the enemies and causes them to be redrawn in random locations in the room, when you move so they scroll off the screen, and then return.  It also changes the color of Cloudy Mountain to black and seems to cast a shadow so the nearby grass is a darker shade of green (of course I know why that is).  Higher values end up crashing the game.

Maybe what I could do for fun is hack the ROM to subtract only 2, putting the difficulty level in the range 1-4.  That would make the highest difficulty inaccessible, but then again, you wouldn't be having infinite lives and arrows if you wanted more of a challenge.



Last edited by intylab on Wed 09 Dec 2020, 2:57 pm; edited 1 time in total (Reason for editing : Fixed typo)


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."

TestaOn likes this post

https://linktr.ee/intylab

13Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation Empty Very simple... Wed 09 Dec 2020, 3:26 pm

Wardu


Janitor
Janitor
Indeed, there are quite simply 4 map configurations and the mountains are either impassable or black: it's very simple! (but I hadn't seen it ...)
This game is really very well done!
Thanks for your help...

intylab

intylab
Member
Member
I was still poking around a bit, and I managed to find where in memory player damage is retained.  You die if this value reaches $a0 (160).  The two high-order bits determine your color, so you turn blue at $40 (64, or 40% life lost) and you turn red at $80 (128, or 80% life lost).  Getting hit by a ricocheted arrow raises your damage by $50 (80, or 50% life lost).

I put in a hack to make your character invincible by not checking to see if your damage counter is greater than 159.  When it reaches 192, you turn tan, and then it overflows past 255 back to 0.  Standing on a blob makes you cycle rapidly through the colors.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."

TestaOn likes this post

https://linktr.ee/intylab

Wardu


Janitor
Janitor
Several things :
- I'll be happy to send you a copy of my game when it's ready but it's not quite for tomorrow Smile
- for the skulls in the dungeons, I have an explanation: it would be the victims left everywhere by the winged dragons of the cloudy mountain to scare the adventurers. Difficult to verify but it is true that their function is not obvious.
- I am analyzing the information you sent me on the configuration of the card in row and column. I'll keep you informed.
Just for information, is it complex to disassemble a rom? And what tool do you use?

intylab

intylab
Member
Member
Wardu wrote:Just for information, is it complex to disassemble a rom? And what tool do you use?

I have my Portable Intellivision Development Environment with the Disassembly Script (downloadable at the bottom of that same page).  It's all running through Termux and XServer XSDL on an Android device.  Within the environment, I've got jzIntv and the bundled disassembler, dasm1600.

The script checks for an existing hacked copy first, and if found, simply opens the disassembled file and the .cfg (where I put ROM pokes) within emacs.  If not found, it looks for a .rom file and runs rom2bin (also bundled with jzIntv) to generate a .bin and .cfg file with " (Hack)" appended to the filename, and then runs dasm1600 to generate the .asm file, and then opens the .asm and .cfg files in emacs as before.

From there, knowing what you're looking for in the .asm file depends on how much experience you have with Assembly Language and the 1600 instruction set, plus the quirks of the Executive ROM (which most of the original games put to use).  A lot of what I learned 20 years ago came from my humble beginnings of reading "Your Friend The EXEC".  Also keep in mind, there are a lot of techniques used to squeeze as much as possible into such a small amount of ROM space.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."
https://linktr.ee/intylab

17Advanced Dungeons & Dragons Cloudy Mountain - Dungeon Procedural Generation Empty Have fun with an old game! Thu 10 Dec 2020, 5:29 am

Wardu


Janitor
Janitor

Hello,
- for the generation of maps, I split the map with 11 lines and 19 columns and it actually works very well.
This helped me a lot because I am able to generate the 4 maps with different tiles (forest, river, .., and of course mountains).
With these maps and the dungeon mechanics you gave us at the start: I'm starting to have a game that looks like the original !!!
Of course, I still have a lot of programming to do but it's really exciting and it's thanks to you.
I never imagined finding so much information about a game that's almost 40 years old !!
- I also examined the portable Intellivision development environment, it is obviously also very interesting but it is another way, and as it requires a lot of investment and time: I prefer to stay on my game development idea who took a leap forward Smile
Anyway, thank you very much for your help and long life to your blog! Laughing

intylab likes this post

Admin

Admin
Admin
Admin
Maybe one day a new ADD game!


________________________________________
Rev - Admin - www.IntellivisionRevolution.com

intylab likes this post

http://www.intvrevolution-forum.com

dz-jay


Rookie
Rookie
Regarding the skulls, I seem to recall getting the impression from the manual (and from observations) that the skulls and droppings signal the presence of a monster nearby.  I believe it was droppings for rats, skulls for demons or dragons.

Perhaps you could confirm this by looking to see if they are always spawned in an adjacent room to where a monster spawns.

Other than that, I do not think they serve any purpose.  They are purely a visual cue, in the same way that the breathing sounds provide an audible cue.

  dZ.

intylab

intylab
Member
Member
I'm pretty sure the skulls have no purpose. Maybe they would fool somebody into firing an arrow for no reason.

The droppings and bones are the visual warnings for the rats and demons. The audible warnings are for the snakes and dragons (slithering and snoring). Every cave has at least one monster with an audible warning. Cloudy Mountain is the only cave without any monsters with a visual warning.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."
https://linktr.ee/intylab

cjherr


Janitor
Janitor
Very cool stuff! One of my favorite Intellivision games.

intylab likes this post

dz-jay


Rookie
Rookie
intylab wrote:I'm pretty sure the skulls have no purpose.  Maybe they would fool somebody into firing an arrow for no reason.

You mean, they are just placed randomly with no connection to monster placement?

intylab

intylab
Member
Member
I think so. I never studied the significance of the skulls.


________________________________________
__________
"They'll never do it in time!"
"The code! The code! Figure out the code!"
"It won't be easy!"
"Cut this out second, this fourth, this first, this third."
https://linktr.ee/intylab

Sponsored content


Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum