Ludum Dare 34
Coming December 11th-14th Weekend

Posts Tagged ‘procedural’

Procedural Maps

Posted by (twitter: @Rubikow)
Saturday, July 18th, 2015 9:15 am


While playing Invisible Inc. I suddenly wanted to build procedural maps like the game does. So I wrote a small procedural map generator capable of doing some pretty cool stuff. At the moment It produces maps like these:

vaults talecraft hexo bunker proc5 proc4 proc1 prmap proc10 rnd1 proc9 proc7

The algorithm producing all of these maps is the same. Hovewer I programmed different “map-renders” to get different visual designs. As you can see it is capable of building simple rogue-like maps as well as more complex maps (like the valuts-and-caverns map you see or the hex-field landscapes). The main feature is: (other than using random maps … ) There is always a way from point A to point B!

You can generate some levels here:


“What does this algorithm do?”

Basically you feed my algo with sets of “rooms”. A “room” in Javascript looks like this:


[new JTile(1),new JTile(1),new JTile(1)],
[new JTile(1),new JTile(1),new JTile(1)],
[new JTile(1),new JTile(1),new JTile(1)],


This room looks like this:


As you can see its a simple 3×3 room. JTile(1) in the code above means “JoinTile” (or more simple: a Tile) of type “1”. As you can see in the image my map-viever interprets a “1” as a field of a vault-room. If I change the center tile to 4:


[new JTile(1),new JTile(1),new JTile(1)],
[new JTile(1),new JTile(4),new JTile(1)],
[new JTile(1),new JTile(1),new JTile(1)],


It looks like this:


As you can see, my map-viewer interprets a 4 as a field of dirt.

Now, here comes the main feature!


Lets change our room to this:


[new JTile(1),new JTile(1),new JTile(1)],
[new JTile(1,(1)),new JTile(4),new JTile(1)],
[new JTile(1),new JTile(1),new JTile(1,(1))],


See? I added a “,(1)” to the fields in the west, and south-east. Now lets generate 3 rooms instead of one and let’s have a look:

simple2 simple3

These are two of many possible combinations the generator may produce now. (Some parts of the rooms are hidden behind walls due to my map-viewer).

What happened?

By adding the “,(1)” I told the tile, that it may join with another tile of type 1 in any direction. You can read:

    new JTile(1,(1))

as: “I am a Tile of type 1 and I will join with other tiles of type 1 in any direction!”.

Using only this, we already have a powerfull tool here. Add some more rooms of different types and shapes and give them different “join-partners” such as: “A toilet room always joins with a corridor” or “a vault entry always joins with a cavern” and you can build maps like this:


I’m working on a detailed tutorial at the moment, so if nothing of the above makes sense to you, just be patient 😉


“How can I use it for my games?!?”

If you want to, just go to my website and copy some of the current code under development. I wrote the generator in javascript for web browsers and in c# as a library for unity. Once I have the import/export part done I will publish it for everyone to use. Stay tuned!






Procedural Maps

Posted by (twitter: @Local_Minimum)
Wednesday, October 30th, 2013 3:16 pm

In my personal slow-Jam I’m working on I decided to leave everything to Random and a few parameters.

Still there’s the need for levels, and the very basic requirements that everything should be connected, walled in and have a nice balance between narrow passages and open spaces.

There’s probably well known and better ways to do this, but any case, since I think the end result was more or less exactly what I wanted, I’m gonna outline how I did.

  1. Define an allowed geometry by normal sampling a width and height of the map (in tiles). I used a 2D boolean array as representation when doing the calculations
  2. Randomly seed some few (<1%, but more than ~7) positions so that each has a safety margin to the border of the array
  3. Iteratively connect dots by randomly selecting one not connected to the others and walk towards the closest other true position following Manhattan distance = 1 setting all passed positions to true.
  4. Repeatedly randomly select any edge pixel and randomly select one of its 4-neighbours that are unused and expand there.
  5. When sufficient number of tiles have been placed. For all edge tiles, place a wall in all unused positions with a chessboard distance of one

This is the result of three maps generated after one and other:
Cube Sphere Pyramid Lvl example 1

Cube Sphere Pyramid example lvl 2

Cube Sphere Pyramid example lvl 2

I only need quite small levels as each is only meant to last for maximum of 60s and the game is absolutely way too confusing to allow for larger levels, but in principle it would only require some parameter tweaking to get them too look quite differently.

I also like how one sort of can see where the seeds must have been placed.

Of course if anyone is interested in the code just let me know (it’s C# for Unity, and it’s not super-efficient by any means but since it’s only run at level start I figured it doesn’t matter too much).

I’m back and aiming for the jam

Posted by (twitter: @RawBits)
Sunday, December 16th, 2012 4:51 pm

The weekend wasn’t on my side sadly but I’m here and aiming for the jam.

In the last hour I have made a tree with the pathways in the maze – levels are procedural ofcourse. Here is a picture of the tree visualized.

Visualized paths in tree

Now, on to my first ever legit AI in my life: a simple DFS.

Tinysasters post-mortem

Posted by
Monday, April 23rd, 2012 4:13 pm

Hello everyone !


So this is my post-mortem for Tinysasters, my LD# 23 48h entry made in Flash.



Play and rate Tinysasters


As I said before this was my very first participation. I hadn’t planned to enter the event until about one week ago, and I didn’t prepare. But I work on flash games every day, so this must count as some kind of preparation :)

I was a little anxious, because I had never developped a game in such a short amount of time, and I didn’t know if I could do it. But everything went very smoothly.


The game

Tinysasters is a puzzle/simulation/gestion game. You play on a 8*8 randomly generated tile map and have to build workplaces, shrines and cities in order to collect ressources. The goal is to build a level 4 shrine. Natural disasters happen every now and then. They reconfigure the ground and make your life harder !


Build the level 4 shrine to heal the ground and spare the world from disasters like earthquake !


The idea was to make something between the boardgames Settlers of Catan and Labyrinth ; basically a Settlers of Catan where the tiles move and change of nature.

At first, I was absolutely not happy with the theme. I rated it -1. I liked “Artificial Life” and “Castles in the Sky” a lot better, but I don’t know if I could have made something good out of them. The theme doesn’t matter a lot actually.


As for the nature of the game, to be honest, when it comes to play, my heart usually goes to platformers and adventure games with a good story. But programming is my strongest point, so I thought I should rely on it a lot for my entry.


What went right

– (almost) no time wasted on debugging ! That was a good surprise. I’m used to spending a lot of my time fixing problems that seem to come out from nowhere and make absolutely no sense although they usually end up being all my fault after all. That’s one tremendous benefit of working on a very small project : I just had to see a bug to know where it came from because the entire code of the game was so fresh in my mind.


– I was a little scared at first when I started programming the tile animating sequence that happens when there’s an earthquake or the player generates a land. But it went smoothly and the TweenLite library was very handy.


– I hate building / coding menus and interfaces with so many buttons, and so many textfields, and tabs, and they all have to update, show the right information, show a red color when there aren’t enough ressources, etc., and it’s so overwhelming… It was very tedious but it went ok. There are a lot of ugly duplicates in my code but I guess I can live with that.


One of the many possible states of this interface box…


– About 40 minutes before the deadline, there still were no sounds, and the tiles were still rough colored cubes. I rushed on as3sfxr to generate some sound effects (very useful tool), made a quick music arrangement, added an underground effect to the tiles, some texture and some decorations.

Despite the fatigue (it was about 2 AM and I had worked all day), I found myself inspired so everything went quickly and I finished on time.


– I’m very happy with the result. I enjoy just watching the game playing disasters and reconfigure the map into wild deserts, forests and lakes. The mountains always prevail, eventually.


Invasion of the mountains !


What went wrong

– The firsts hours of coding were the hard part. Sometimes I’d finish coding a new fonctionnality, like the map generation, and had some kind of a mental blockage : I just couldn’t figure out what to do next. What I had in front of me was so far from being a game… it was a little overwhelming.


a depressing early stage of the game


– Like I said, I only had 40 minutes to polish the sounds and graphics. I had great expectations for the animations, I wanted to use beautiful particles effects… I wanted the tiles to explode in a thousand of pixels when they reach the borders of the map instead of those mere alpha fade outs… I wanted the volcanic eruptions to set the map on fire… I wanted the flooded tiles covered with shiny swinging blue water drops… I wanted a little flying god inpersonating the player’s actions react to the disasters and constructions…

Nothing of that was done. I am so sad. Maybe in the enhanced version :)

Also, more types of disasters were initially planned. Disasters that only affect the constructions : plague, civil war, etc.


– 7 hours before the end I was like “Great, 7 hours left, I have PLENTY of time to do everything I want !”. But 7 hours in the end are not like 7 hours in the beginning, especially with the timezone I’m in. I was so tired I was like a zombie and sometimes found myself spending half my time just starring at the disasters do their thing. It’s a good thing the game was already well-advanced at this point.


What went terribly wrong

– But the biggest problem I encountered came from the nature of the game itself.

“Do the game mechanics even work ?”

I couldn’t answer this somewhat significant question before the game was ready to be tested. The disasters had to be coded, same goes for the ressources, the buildings, the upgrades and all the time-consuming interfaces that come with it.

The game was ready to be tested 2 hours before the end.

I had my fiancé test the game. He told me he was troubled by the game even though he knew what he had to do.

At first, I didn’t listen to what he said and continued to blindly code what I could. Coding more interfaces wouldn’t have bothered me that much at this point.

Then, I had to face the reality : the game mechanics didn’t work as they were.

I had to balance the costs and gains of ressources, add difficulty settings to avoid overwhelming the new player or boring the experienced one, write a “how to play”… For that, I had to test the game a lot which takes some time… And the game navigation (title screen, restart…) wasn’t done yet, nor the graphics and sounds, not to mention the fancy particle effects I still hadn’t given up on !


The last minute how to play screen


Damage control was done, but the game ended up being less challenging than I would have wanted. Hopefully a future enhanced version will correct that !


Final thoughts

I’m very glad I participated !

Thank you for reading and don’t forget to rate Tinysasters :)

Play and rate Tinysasters

Link to the to-be-enhanced version on Kongregate

I hope you’ll enjoy the game, I enjoyed making it a lot !



Procedural graphics

Posted by (twitter: @juaxix)
Sunday, April 22nd, 2012 5:24 am

Screenshot from iPad directly with the tool to generate imagemaps 😀

[cache: storing page]