Any ideas on parallel computing?

Discuss game development design and post your game ideas

Post » Tue Aug 30, 2016 3:56 pm

Hi!

I'm working on a game which has randomly generated levels. After the generation those leves go through another loops of optimisation and adding random stuff.
Sometimes it takes more than 1,5 seconds to build a complete level which is not good for a continious and seamless gameplay.

So I want to know if there is a way to do that generation on the background? Player will spend more than 1,5 seconds to beat that level which will be enough to generate the next one.
B
5
Posts: 13
Reputation: 243

Post » Tue Aug 30, 2016 4:35 pm

Do you use a array for the random generating.

If so you can set a Global Variable with in it, the array "as json".
Then you can carry that info over to the next level.
So at the new level you can load the random level instantly by loading the variable back into the array as json.
Then do your optimizing stuff and your set.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Tue Aug 30, 2016 5:14 pm

I'd say don't generate the whole level at once. Generate what's immediately on screen and then progressively generate the rest of it. The idea is to make it so the impact on the framerate is negligible. You could also generate the next level when the current level is done loading. There's probable a lot of ways to go about it.

Actually doing parallel coding will require using javascript and even then it's not so simple.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Tue Aug 30, 2016 5:30 pm

R0J0hound wrote:I'd say don't generate the whole level at once. Generate what's immediately on screen and then progressively generate the rest of it.


What a nice idea! Thank you )
B
5
Posts: 13
Reputation: 243


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: mammothe and 0 guests