#Endless Universe - can I do it in GM?

25 messages · Page 1 of 1 (latest)

ocean dove
#

Hello, I have kind of a high-level question, in the sense that I am more looking for some general direction rather than specific help.

I am looking to make a Space RPG, I made this simple prototype with Javascript and HTML5 (with some Claude AI help) and I had two questions.

https://spaceman.krets.com/escape_velocity/

  1. How might I go about making a "level" that has coordinates and object placement near the origin but allow for it to procedurally continue indefinitely as I've done here, but in GM?
  2. How might I go about creating these procedural stars with parallax effect, also continuing indefinitely, within GM?

Some general guidance and direction for my research would be greatly appreciated.

viral jolt
#

There is no real infinity, just to begin with, regardless of the program/PC you want to use. For parallax effect in GM there should be plenty of tutorials on YT available. I guess what you'd want to use is storing all tha data in the array and just repeating the parallax bg over and over as you move.

  • I'd say create the stars as you move (just outside screen edge) and then move them with speed depending on which layer they are
  • Planets can be stored and created/destroyed as you come near them as objects/sprites, otherwise stored only in the storing array
  • So basically you check the array each game step and see what is near 🙂

Hope this helps a bit 🐭

#

Cool prototype btw!

ocean dove
#

Thanks for the tips and direction!

dawn sable
# ocean dove Hello, I have kind of a high-level question, in the sense that I am more looking...

for 1, it depends on if you actually want to keep that data later in some world file. if you don't, just create objects when you travel far enough and then delete them when they go off screen. if you want it to actually save try something like minecraft where you have chunks with a set size that contain all the data for a space. these chunks should unload when you leave their vicinity

ocean dove
#

Coming back to this again, as I'm trying to figure out how to implement it finally, I want to rephrase my question...

  1. Is a "room" the only way of making a game space within Gamemaker? From my research it seems there are hard limits on a rooms size, for purposes of editing and playing and considering performance.

  2. In my little prototype and in the game aim to make, most of the interesting celestial objects and gameplay will take place 5 or so screens in any direction from the origin of the room, but space battles could go well beyond that and I wouldn't like the player to fly into barriers as they fly away from the origin. There doesn't need to be anything placed out there, but the player should be able to travel indefinitely. Would it be possible to make it that way?

Thanks for any help!

compact nebula
#

I don't think size of the room really matters. When it comes to performance - number of objects and what they are doing may be important, but not size of the room.

Also you can put things outside of the room, making initial size inconsequential. (tiles put in room editor may be an exception, but you can still put them outside with code)

If you plan to place all the objects in the room editor manually (and not with code), it may slow down IDE, but number of stuff you put will be main factor, not size of the room.

ocean dove
#

So you can generate a room exclusively with code? I would prefer that as my game is not require a lot of level making more placing a handful of celestial bodies, procedurally created asteroids and my tiling parallax stars.

compact nebula
#

You can, but what I meant is that you don't have to worry about room size. You can put objects and move camera outside of room anyway

If you prefer to place objects manually, that's fine.
How much area do you need for manually placed things?
Biggest number you can put in room width/height box is 16_777_216 - is this enough?

ocean dove
#

It’s fine to place it manually or programmatically, I’m also not concerned about the room size in regards to the objects I intend to place but I have two concerns.

  1. if I make an absolutely enormous room will it be unwieldy to work with in the editor.

  2. will it feel indefinite to the player? I want the player to be able to fly into the nothingness of space and never find an edge (whether it’s a hacky illusion or not).

I’m not sure if you tried my little prototype in the first post, in that you can fly for an hour in any direction then fly an hour right back to the center of the system, not that anyone wants to do such a thing, but if a player hits the edge of the room it’s going to really break the fiction of the game. It’s exactly that prototype that I want to replicate within GM.

Or I want to know if GM is potentially not the right tool, which would also be fine.

compact nebula
#
  1. Depends on what you find as enormous, but yeah, at certain point it probably will affect IDE

  2. I've never done something like that, but it's certainly possible

There is no "hitting the edge of the room" unless you specifically code it that way - you can move player/objects/camera outside of the room freely. I don't know how big x,y have to be for things to start to break, but reaching these values can be avoided

You can also design parts of your map in separate rooms and load their content at runtime when needed with GMRoomLoader:
https://github.com/glebtsereteli/GMRoomLoader

GitHub

Runtime room loading for GameMaker 2024.2+. Contribute to glebtsereteli/GMRoomLoader development by creating an account on GitHub.

tardy abyss
#

Going to confirm here

#

Room size does not matter

#

I’m working on an entire game where it’s a 2D infinite sandbox

#

Room size is literally an illusion

#

You can 100% ignore it and it would still be fine

#

So the player could keep on moving in one direction, effectively forever. Not feeling or noticing a thing. (Until they hit the PC limitations…. Cause yes, those exist everywhere).

#

(And what I mean by that is, you’re limited to the float value limitation. Gamemakers x/y values are 32 bit floats)

wild briar
#

^which i believe would be 34028234663852885981170418348451692544​0 pixels wide and 34028234663852885981170418348451692544​0 high. or something else ridiculously unfathomable for human brains.

tardy abyss
#

I actually do have rough numbers

#

But lemme just say, the slower you move, the earlier you'll hit the limit

#

Because precision

wild briar
#

340.28235 Thousand Decillion lol, what a number

tardy abyss
#

I've made it to I believe about 16 million pixels, before the game just straight up gave up moving my character