Procedural Generation?

This forum is currently in read-only mode.
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • Okay, I am working on a game (which is still in the writing stage), now it requires some procedural generation for starfields and some of the special effects. So is there a module or something, or is is it a planned feature?

    Note: I am halfway done with the project information. Expect to see a recruitment thread soon.

  • *tunes in*

    I am interested in how to create a realistic starfield as well (with the nebulae, gas clouds, distant galaxies and whatsnot to boot!). Particles would be the most suitable for this purpose, with some creative customization. Just for the background for space games.

  • You can just do it with events I guess. As you move along, create stuff just outside the screen in the direction the play is moving, and destroy the ones theyve gone past to save memory.

  • you can do procedural generation in construct, but you can't just make a module that does that, that'd be kinda like asking them to put premade sprites in construct. the procedures that generate stuff are going to be different in every game.

    that being said -

    here's a quick example with beautiful art collected from actual nasa photographs

    click here for example cap

    move mouse away from center of screen to scroll, center in screen to stop

    I'm not sure how much of construct you've learned, so this may or may not make sense. (i wrote this before I just changed my mind and decided to make it, took about as much time as it took to write it as to actually make it, cuz construct is cool like that) but a good start would be to make a few different basic star sprites, make them as large as the largest one you want and scale down from there. set them to not disappear when they leave the screen, and make an event at the start of layout that loops to a given number (you'll probably want to change this over and over until it looks good). for each iteration of the loop, have it create a star object, picked from the pool of stars (you can also set it so certain common looking stars have a greater chance of being picked), have it choose a random size to scale to, and make it create that star at a random location. with random brightness and angle.

    this isn't in the example, but if you really want to make it look awesome you make multiple layers and make them generate random stars that are smaller on slower scrolling layers so it looks 3d, if you need some help with that it'll have to be after the easter egg hunt.

    edit: as ashley said, you can save memory by creating stars as you're going along, not sure what type of game you're making and whether or not that'll ruin the effect you're going for

  • new version with multiscrolling

    click here

    also, in the first version you see a whichstar variable with random on it to choose the star, and then it never gets checked, that was supposed to be the variable temp. it's fixed on this version...not that it made much of a difference in the first

    EDIT: Now with actual nasa photography...not joking this time (3 stars extracted from this photo (http://www.universe-cluster.de/fileadmi ... _stars.jpg))

  • The multiscrolling version is quite choppy for me. Only 10 fps. The first one however is fine.

    Also, seeing as how I've already gone through making starfields and got quite annoyed with it, I'm going to let you know that you're probably going to hit a wall with this current method.

    Larger layouts = more stars which takes a long time to create on startup and more resources used in general.

    Edit:

    This is what I came up with (with some help from the guys in chat). It's not pretty because I was just working on the theory of it, nor does it have multiple scroll layers though they should be fairly easy to add.

    http://dl.getdropbox.com/u/646325/ProtoType0-2-9.cap

    Eventually I just gave up with it and opted for a scrolling background.

    http://dl.getdropbox.com/u/646325/Gibbous%20Panoply.exe

  • lucid

    Even though I have not learned much yet. It's still quite understandable. I'll look at the cap's later. I'm not at my computer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The multiscrolling version is quite choppy for me. Only 10 fps. The first one however is fine.

    Also, seeing as how I've already gone through making starfields and got quite annoyed with it, I'm going to let you know that you're probably going to hit a wall with this current method.

    Larger layouts = more stars which takes a long time to create on startup and more resources used in general.

    I'll probably make a new version just barely larger than the screen later to keep the resources down.

    I wonder if there's an easy way to emulate a slower system, other than bogging down your system though, because I get the "that runs like crap on my system" thing alot with my caps for things that run silky smooth. I guess it's a good problem to have, as opposed to the other way around.

    lucid

    Even though I have not learned much yet. It's still quite understandable. I'll look at the cap's later. I'm not at my computer.

    true,

    hope it runs well

  • *tunes in*

    I am interested in how to create a realistic starfield as well (with the nebulae, gas clouds, distant galaxies and whatsnot to boot!). Particles would be the most suitable for this purpose, with some creative customization. Just for the background for space games.

    Hi Mipey,

    You can try this out "Universe Image Creator"

    http://www.diardsoftware.com/index.html

    I use this and it works very well. Its been around for a long time.

    You can create REALISTIC images of space in just minutes. Create Nebula, Gas Clouds, Stars, Galaxies, Planets, and More....

  • procedural generation is about as simple as using Random(X) in your creation events, never using sprites for explosions and stuff like that.

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