Randomising Planet Spawns

In order to make my game infinite, I had to implement randomised spawns to the planets which allows the player to jump from planet to planet without any levels.

 

ItemSpawnerBox.JPGTo do this I created a collision box on a actor blueprint which allows me to give the boundaries for the spawn location.

Spawner box in level.JPGI then put the Spawner Box into the level.

Get component bounds.JPGThen I got the component bounds which will allow me to get the box bounds for the planet to spawn in.

Break and subtract.JPGHere are the vectors for the X axis of the box.

Random Float.JPGBy connecting it to a Random float in range it allows for the coordinates to be randomised.

Capture.JPGThen I repeated this step for the Y axis.

Make vector.JPGBy adding a vector is allows me to connect the Z axis to the break vector Z, which makes the planet spawn on the centre level of the box.

Spawn actor planet.JPGI then added a spawn actor and classed it to Planet1. I do need to link other planets however.

Set timer and creating custom event.JPGI then added a timer which gives me control over how often the planet spawns. I also need to consider randomising this however to make it more difficult.

Here is a gif of the planet spawning –

planet-spawn-gif

What I need to do now is experiment with randomising the planets spawn timer in order to increase difficulty. Another thing I could consider is making the planets smaller up to a certain percentage as the player gets further, making it harder as time goes on. Also putting a variation of planets in the spawner is essential.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s