Follow us by email to recieve updates about WHY Games!

Gravity Ark's Procedural Generation: Efficiency

Gravity Ark's Procedural Generation: Efficiency

This article is building off of last week's article: Gravity Ark's Procedural Generation: Biomes and Gravity Ark's Procedural Generation: Chunks

In Gravity Ark, if you go into a new area and suddenly the computer has to create 100 new rocks, it can cause some problems. The computer could start to slow down, or the player could see the rocks pop in/out of existence.

This can be avoided simply by loading everything at once at the very beginning, in other words a loading screen, but we here at WHY Games Studio like to jump into mobile games immediately. So, loading things at the beginning just wouldn't work.

Loading as little as possible at a time (getting smart):

Initially Gravity Ark created an entire chunk at a time, but this caused the game to stop for a second every few kilometers you progress. That's not much of a delay, but more then enough to mess up the flow of the experience. As such, we changed the generation to create an empty room and then create one obstacle in the room at a time.

Literally, the game is constantly creating things just on the edge of what the player can see. To demonstrate this, we pulled the camera back a bit.


For those interested in more technical detail, we're using Unity's Coroutines to pull this off.

Why bother loading at all (getting smarter):

All this loading and unloading seems to be creating a lot of problems, which begs the question: why bother with it?

We simply don't delete asteroids in Gravity Ark when we're done with them. They're deactivated, so that the player can't see them, but they still exist. Then when the game needs a "new" asteroid, it grabs one of the old ones and reactivates it.



For those interested in more technical detail, we're using Object Pooling.

This is Chris Ross with WHY Games Studio, hoping your day is out of this world! 

-WHY Games Studio
Previous PostOlder Post Home

0 comments:

Post a Comment