Roguelike map System untiled

Forum Home Forum Home > Construct 2 General > How do I....?
 Post Reply Post Reply
Author
1,566 Rep
Post Options Post Options   Quote LemonDROP Quote  Post ReplyReply Direct Link To This Post Topic: Roguelike map System untiled
    Posted: 09 May 2012 at 2:13pm
Hey guys, what's up?

I was wondering. Latelly I've been studying Game Design and the possibility of creating interesting mechanics. I've came to the realization that games are more interesting when they have either (or both) Customization and Randomic maps. Makes players think their tale in that little world is unique. I'm Okay with the movement mechanics, shoting, bombs and everything else. Although I must say one thing really troubles me.

How would a rogue map generator work in C2? (Not tiled, I mean.)

Say I have 300 layers, each of them with one template of map with enemies, chests, obstacles, etc. [The items out of the chests would be chosen by a random number generating event that triggers once you open it (with a key) and drop out a pre-defined "pack" of items.] Once you reach a door you'd get send to the map "below" (would acord to the minimap), meaning on the start of each floor the program would have to create a simple logic to put together adjacent maps (layers) so that the door A leads to B and B leads back to A in a chain of many other rooms.

This is what I'm using as a reference (If you've ever played Binding of Isaac, it's become one of my favorite games)

So, could someone that understands more of programming than me enlighten me about this system inside the Construct2 Event system logic ? :{
Back to Top
1,566 Rep
Post Options Post Options   Quote LemonDROP Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2012 at 5:05pm
Bump for help please ? :{ I don't need the final thought, sugestions would already help alot, I'm just stuck and I can't think of anything else than templates of maps in diferent layers that connect eachother through door events...
Back to Top
7,061 Rep
Post Options Post Options   Quote R0J0hound Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2012 at 10:49pm
That is an interesting idea. Get a map generator going first. Each room only needs to know in what direction the doors are. For simplicity the doors could always be at the same locations. Then have it pick a random designed room with the same exits.

Instead of having each designed room on a separate layer, put them on a separate layout, it makes it a bit simpler for designing. In my example the first thing the game does is run each room layout and save each objects position and size into a global array per room. I did this so that I can pick at runtime a room according to the directions of it's exits.

I didn't do this in my example but having the room data stored in an array makes it easy to implement loading/unloading of rooms all in the same layout, so you can have massive layouts and not have to worry about high object counts bogging down the framerate.

Here is an implementation of my ideas:
http://dl.dropbox.com/u/5426011/examples11/rooms2.capx
The bare minimum amount of rooms is 15, I used 30 so that each possible room has 2 variations.
Back to Top
1,611 Rep
Post Options Post Options   Quote rdephillip Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2012 at 2:32pm
I use a simple random generator for my room maps that literally generates an array that represents the tiles int he room. This doesn't have to be limited to tiles necessarily as random generation isn't overly complicated.

Your chest example would be something like Chest Clicked -> Rand Number 1-10 -> Load Array(#) value. If you have a sprite labeled reward with an animation strip (but no actual animation set) then you can use that instead of an array and reference the frame with the reward. If the chest is supposed to carry multiple objects just throw in another thing to randomly determine how many rewards from 1 to chest max size. So if the chest holds 4 things max the player will have the chance of opening it and getting 1-4 items from a pack of 1-# of frames. After that the tricky part is simply determining what those are exactly.

This is just a suggestion as I'm new to C2 still (bout a week) and I haven't toyed with how the sprite frames work when multiple instances are loaded etc, but I imagine it would produce something like what you want. It would be ideal if you could get the particular instances current frame (again this can be there) and reference it to a dictionary that holds the identities of the particular item in that frame.
Back to Top
3,012 Rep
Post Options Post Options   Quote aridale Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2012 at 5:55pm
Ive done mine in a tiered generator.

I start on the left side of the map then randomly gen a new space either right up or down and continue til I hit the edge of the layout or run outta rooms to add (a global I set on start)

Then I have a basic shape for the level. Then I loop thru the rooms and check for rooms around it and use that to determine the bounds of the level (open space inside completely surrounded by walls).

Then I loop thru each room AGAIN and based on what kinda room it became in the last step I replace it with a random room designed to fit in that section (if its a top left corner its replaced with a room with walls on the top and left)

After thats done Ive basically created a random level MAP. Its not playable cause its just graphics of how the level looks. Then I use the rooms everything got assigned in the last step to actual generate playable rooms.

It sounds overly complex but it makes it finely tuned to control exactly how I generate the finished level.

I made this room editor to help me make the rooms I want and get the layout of the objects to be used to make the playable areas.
http://anb.mooo.com/layouteditor/

I use the screenshot of it to make my visual layout (the objects the player collides with arent visible) and the string it generates to create the objects when that rooms generated.

The project Im usin it for is a platformer with 160 different rooms it uses to generate the levels
Back to Top
3,330 Rep
Post Options Post Options   Quote Wrangler Quote  Post ReplyReply Direct Link To This Post Posted: 26 Oct 2012 at 5:10pm
-Snip-

My browser was being retarded.

Edited by Wrangler - 26 Oct 2012 at 5:21pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down