Jump to content
Random Terrain

Procedural Generation for batari Basic Games?

Recommended Posts

I recently heard about Procedural Generation and it seems to be closely related to Controlled Randomness (something I've been interested in since the 1970s).

 

The Wikipedia page for Procedural Generation says that it's "a method of creating data algorithmically as opposed to manually, typically through a combination of human-generated assets and algorithms coupled with computer-generated randomness and processing power." It also says "In video games, it is used to automatically create large amounts of content in a game. Advantages of procedural generation include smaller file sizes, larger amounts of content, and randomness for less predictable gameplay."

 

I stumbled upon the term Procedural Generation when looking up No Man's Sky after somebody mentioned the game in a video. Speaking of No Man's Sky, the video below has a good description of the game.

 

 

Here's the text from that section of the video:

 

"The most impressive simulation of an entire universe has now been created by a small team of 15 indie developers. The game 'No Man's Sky' is probably the most complex and the largest game world ever created and it fits on a single DVD. Every player starts exploring on a randomly chosen planet in the games' universe. The players starting coordinates are the variable that is put into the games' sophisticated, but still simple formulas. The result creates the whole visible game world in real time. It would be impossible to store all of the details using traditional methods. You would need entire data centers to store the data of the roughly 18 QUINTILLION true-to-scale planets, together with their unique ecosystems. It doesn't  matter if it is a whole planet, a space ship, a tree, a rock or a single blade of grass--every detail is the fractal result of a mathematical formula. So, one of the most realistic and complex simulations of our cosmos emerges from nothing but mere mathematics!"

 

If you've read this far without falling asleep, I'm not talking about creating random mazes like you might see in a game like Maze Craze. I'm talking about creating different types of games using Procedural Generation. Playfield scenery or rooms for adventure games, platforms and enemy placement for scrolling platform games, road curves and scenery for racing games, planets to land on similar to Moonsweeper, and anything else you can think of.

 

I'm bad at math and basically any kind of thinking that requires an IQ over 75, so I can't come up with the magical algorithms myself, but if anyone has any ideas on how to do this magic on the Atari 2600 for batari Basic users, a lot of ROM could be saved while providing more content and even programmers could be pleasantly surprised every time they play their own games.

  • Like 2

Share this post


Link to post
Share on other sites

I've used procedural generation like this recently in an Atari game and remember thinking RT would like this! :)

 

Slight distinction, the parts of the game scene created by objects drawn algorithmically = procedural generation. 

 

Randomly seeding the generator is key as described in the article, but I think it's a complementary technique so better to envision as a seperate process once we've built our generator, with many ways to accomplish ranging from rocket science to easier methods.


Here are few examples using the Player to seed the generator:


The Procedural generator in KC Monster Maze erases and redraws portions of the maze and is randomly seeded by the player whenever a Monster is eaten as the Monster rejoins the process at a different point in the sequence randomly creating new movement paths for them.

 

The procedural generators in BREAKOUT 2002 are the characters and a zone of the board that bounces them and get seeded randomly by players movements or by shooting the AI.

 

  • Like 1

Share this post


Link to post
Share on other sites

I've done a lot of different experiments with Procedural Content Generation (PCG) for different games.  One caveat is that PCG means something a little different to different people, but I'll give my 2 cents on my experiences in using it for the Atari.

 

Dragon's Descent leverages PCG to a large extent, my rough estimate is that there are around a half million mazes that can be explored on a 16k cartridge, starting from around 65,000 initial first levels.

 

While I use PCG for maze generation, it's combined with some other elements so it's not just a simple Maze Craze clone - it's a Roguelike, or a Zelda-lite, where I can fit a key, treasure room, and other elements that allows complete, navigable levels that the user can play through or even revisit.  The two Atari difficulty switches give the player a "Random" mode and an "Infinite" mode - the player can start in a wholly unfamiliar maze while still knowing the rules for surviving it.  Alternatively, that can play the "default" maze and become very familiar with its layout.  

 

I go into the process in a fair amount of detail here:

In batari Basic a good tool to use for PCG is rand and rand16.  While rand16 is a 16bit process, I got a lot of mileage out of changing each byte separately.  In Dragon's Descent you can pick a level at random, or choose the "seed" you want and revisit any of the initial mazes yourself.  Playing through multiple levels just means I increment one or the other byte, and that "next level" can be randomly controlled, so to speak.  I combine rand16 with other processes, like a "noise" array of bytes to introduce further variety, as well as some other types of data that allow me to control trends like enemy encounters, mazes becoming more difficult as you progress further, boss appearances, etc.

 

The small size of Atari ROMs certainly encourages clever uses of PCG - Pitfall is a classic example, using something very similar to batari Basic's rand to create a 255 screen jungle.

 

Given the 8-bit architecture of the Atari, you are very aware of how pseudorandom numbers work.  256 values in a byte don't seem like much for, say, building a galaxy, but clever applications and layered techniques can help make a variety of experiences.  You become sensitive to quirks and trends in randomly generated values (Pitfall is very careful about what number seed it uses and where it starts the player, so that the beginning of the game has a nice difficulty curve).  Dragon's Descent had a few "bugs" in how I generated the mazes, but since I got a nice difficulty curve in the initial few levels, and the mazes are still able to be completed, I kept in these quirks instead of "fixing" them.  To be honest, my original outlined technique probably would have had the mazes feel a little too big.  The lesson here is that you craft the algorithms to fit what you want, the same way you mix colors or light a photograph - there's an art to the process, as much (if not more) than logic and defined steps.

 

I'll also say that PCG is a large, open-ended discipline, more of a partial design philosophy or possible set of techniques than a specific, solid thing.  For instance. Most Roguelikes are almost defined by the use of PCG, but not all PCG is Roguelike.  It could be as simple as a basic pattern, or could be a simulated universe.  It's also a tool, or set of tools, mattering most in how they're used.  When used poorly, PCG can make a game bland and boring, but when used well it can give a game vitality that would be impossible in any other way.

Edited by Revontuli
  • Like 3

Share this post


Link to post
Share on other sites

Space Cactus Canyon relies heavily on procedural generation.  Each canyon is generated based on a modified version of a random walk (the modification is that the walk can never move to the left; it can only go up, down, or right, and if I recall, right is weighted more heavily).  The enemies are then placed according to the canyon to ensure that their placement is sufficiently fair to the player.  Sometimes that means reducing the number of enemies that are the default (or, in the bonus screens, the number of available pickups).  So in theory there is a nearly infinite number of canyons and enemy placements.

  • Like 1

Share this post


Link to post
Share on other sites

Me and John Hancock relied heavily on procedural generation for [email protected] of Chaos

https://atariage.com/forums/topic/237201-update-sold-out-limited-edition-atari-2600-game-catacombs-of-chaos/?tab=comments#comment-3217349

 

Basically, using various bits from x, y, dungeon floor and world seed variables to determine the current room layout.  The real problem was finding an algorithm that didn't make the dungeon layout repetitive.  Also, shifting bits around enough leads to going over cycle.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...