• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Copy instances from another room

I'm lost

Member
Good day, Im trying to make an endless level generator for my shooting platform game and I just dont know how can I do it, or how to do it corectly without thousands useless lines of code.

The idea is, that I want the player to start the game and as the camera will keep going left, the player will have to move left and then there will be generating complex obstacles with enemies, jumping stuff etc, but gosh I dont know how.

My first thought was that I create each obstacle seperately in another room and then I could copy that part of room to the room with player, but that would require some command like room_copy_part or something like that.

I mean, theres always an option to do something like instance_create(blahblah..) thousand times and sooner or later ill have the obstacle I want, but that would take years to make every obstacle to generate in code and even with tiles (thats the second part of problem).

Any ideas?
(sorry for my stupid english)
 
Sounds like you’ve got a few options (list is not exhaustive):
  • Procedurally generate levels with a fixed (or variable) size
  • Create scripts which generate level segments, which you can pass coordinate parameters to (among other things), then string together invocations to build levels
  • Hand-make every level from scratch
As you go down the list, the sophistication of the programming will decrease, but the amount of time spent level designing will increase.

Before you jump into development, maybe it would be worth checking out some YouTube tutorials on infinite runners or the like? There are also loads of resources on procedural generation in general.

Personally I would base the decision on how large I expected the game to grow, and how resource-consuming it would be to run the IDE with my desired number of instances/rooms (GameMaker is a bit of a memory-hog in my experience).

If you have any more specific questions, don’t hesitate to ask.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
I made an extension that's pretty much this; RoomDog is an older system of similar kind, but has a few limitations as it can only scrap information by going over rooms on game start.
 
Top