• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Infinite rooms.....

A

albin andersson

Guest
Hello! i really want to create a top down game with infinite terrain, is it possible to do that in gamemaker without creating a lot of rooms?
 
T

thaaks

Guest
Yes, of course.

Some ideas:

Easy one with limit sized terrain: create a big room and use a view to wander around. But that doesn't give you an infinite terrain.

Second solution: Have a controller object that is responsible for creating the terrain. It should "always know" where the player position is and what the vivisble area inside the room is. The controller object is then responsible to generate or destroy the tiles and instances that are currently visible or move outside the visible area (plus a given border to avoid unnecessary object/tile creation or deletion).

The biggest issue you will have is to "remember" what the player already saw and to generate new terrain with objects fitting to the surroundings of the visible or known area if you enter some "unknown" area of the terrain/map.

One approach would be to generate a "huge" more or less random map of chunks where each chunk has a given structure/terrain type and so on. Crashlands does it like that if I remember correctly.

It's a lot of work but that's not a problem of GameMaker, it's the general solution itself. Would be comparable efforts in other game engines as well. To give you a start you could look up some roguelike examples in the Marketplace or some random cave generators to use as a base. Perlin noise might also help you in getting ideas for terrain generation.

I hope it's not your first game project - otherwise you should start with an easy approach ;-)
 
D

Dobsus

Guest
Most efficient way is to look up how dungeon generators work, and how they effectively create infinite terrains.
 
Top