How do I 2D Platformer building floor generator

0 favourites
  • 5 posts
From the Asset Store
Isometric Stategy Roleplay Game Building and Streets Pack.
  • I'm looking for a little guidance on how to best go about this. What I want to do is to make a building generator, that builds each floor with random decorations (based off of hotspots I designate) and all, and stacks them on top of each other to make either a sky scraper or other types of buildings.

    I currently have front and back tilemaps for each building, because as you enter one, the front tiles fade away. This GIF shows an example of what I'm doing: http://giphy.com/gifs/3oEjI6PIzJYyDettRu

    The best way to do this would be the use of something like "Prefabs", just make a bunch and stack them that way. C2 doesn't have anything like that though. All my tilemaps are going to be designed the same way, so they can even be interchangeable, and the windows will be in the same place:

    Is there a way to catalogue each setup so I can just build a bunch in a separate window and "Stack" them? Only thing I can think of is to make a ton of functions, one for each floor type and position each object and hotspot by eyeing it out.

  • there is a tutorial that has what you are trying. Keep in mine it isnt stacking but a random Generator for dungeon crawling but i think it can serve as an idea you can go from there.

    https://www.scirra.com/tutorials/1112/p ... elike-game

    https://www.scirra.com/tutorials/999/ra ... node-based

    Here are two example. What i would do is create multiple tile for the generator to use and then do another generator for the inside thingy such as table n such create a flow such as a limiter for object for each such as if room one can only have three object then for each object placement randomly choose one and then lock it in place and add one. or something like that. Just an idea to start. make sure that when you are doing it document every thing in a notepad and record the result you got. This will help to save you time to see what did work and what effect you like and what effect you achieve but didnt work for you. This will stop you from doing the same shit you just did and wasted stress and time.

    I havent done any thing yet but id would like to in the future. but again this is just to get you an idea and where to start.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Gearworkdragon - thanks! I'll study up and see if I can translate it to platformer/buildings. It's still not necessarily set as though It's taking pre-existing rooms I've created (like pre-fabs), which is what im ultimately going for. I'd like to have structure to my room based off of how I created them, but then just replace the tilemap to give it a different image, and keep spawn points coordinates for items/enemies.

    Is there a way I can choose a specific object to spawn from a family? Like if I gave each pre-defined tilemap build a variable like "Apartment1A", and all the pieces that go with it have the matching variable. Can I then choose to spawn TileMaps with Variable = "Apartment1A"? I dont think you can spawn items from other layouts, so they would all have to be available on the layout I'm working on I think right?

  • you are quite right all you need is the engine to draw it once and it is stored in a memory for the sprite and yes on the layout. I would place all the object you need outside of the game and add behavior destroy if outside of layout. Thus reduce the need to create the event for getting rid of useless sprite hitting performance.

    Another trick you could do is that let say that you have a spot where it could be a table or a lamp or a box. Instead of trying to get contruct two to place one of three sprite there. you could have three frame in a single sprite each frame has their origin point and collision point and animation.

    Thus reduce the need to "pick n draw" to draw and use that chosen frame. and you could do something like if sprite is destroyed and is on frame 2 then do animation for destroyed sprite frame 2. or something like that.

  • for building the rooms, I still don't have a way of doing this properly, because even if I gave each tilemap a "Name" family variable, I can't say Create Object that has name of "ApartmentA". I guess that's still where I'm stuck is trying to find a way to create specific objects in a family, because I can't choose a specific family object based off of a variable.

    as for the lamp or box idea, that's how it's setup currently, each chair has a different animation depending on the style, same for couches, desks etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)