banner



Infinite Runner Game Design Doc

Search Unity

Unity ID

A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate in the Unity community.

  • workflow
  1. I've been developing games for past four months just to get a good understanding on how Unity works, still a noob though. I want to try creating a Endless runner type game similar to Subway Surfers (how cliche!) for myself, just for practice. My question is what's the best way to set it up? The game has 10 levels, lets just call it sections, that spawn one after the other (in random order) each containing obstacles and other stuff, that are either pooled or manually placed. Do I create each section as new Levels and then load new levels with triggers or should I create a Gameobject that contain all the objects for the particular level?

    If I go with Separate levels for each sections, The game freezes a bit before a new level is loaded and the whole setup way is way complicated for me at this point.

    If I go separate Gameobject for each sections; some section are, lets say, 100 world units and some are just 50 and some even less. How to make each gameobject to spawn at the end (I can use boxcollider to get the collider size) of the section?

    Sorry I've asked a lot questions here, but i've been having sleepless nights trying to figure this.

    Thank you in Advance.

  2. As far as I know, subway surfers levels are built on-the-fly in a straight line. The player stays at (0,0,0) and the level gets moved backward, and the levels are deformed into curves by vertex shaders according to the world z position. I made a runner for fun this way some time ago, so I know it works.

    So you just need to determine the rules that the level is built with, and create only as much as the player can see.

  3. I think the best way to go would be each section is a scene and the UI/player is it's own scene or scenes then you load in the next scene asynchronously ready to be used and delete/hide-recycle the last scene (this would be memory/performance dependent so test on target hardware).

    Using scenes would get around the clunkyness of nested prefabs (e.g. you have streetlight prefabs along a road prefab and want to change some of them).

    You would have to ensure the scene have a single root transform so you could move them easily as I think they would load by default at position 0,0,0?

    Last edited: Apr 14, 2018
  4. That's an awesome sample project, thanks for posting the link.
  5. Yes the default position is at 0,0,0. I did not know about "asynchronous" scene loading. I tried before without it, every time a scene loads, it kinda freezes before it loads the new level.
  6. We developed Top Gear: Race the Stig, a 3-lane infinite runner similar to Subway Surfers.

    All the sections (chunks we called them) are in one scene. Each chunk is a hierarchy of game objects. The chunks are pooled and there are multiple instances of each. The player remained at x=0 z=0 and the chunks were pulled from the pool, moved from beyond the far clip plane towards the player (Z axis) and then returned to the pool once behind the camera. Chunks were moved in the X axis as the player changed lanes. The player could move in the Y axis (jumping, etc).

  7. Definitly try -> https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html

    You could try sub dividing the sections, smaller sections should load faster.

    Last edited: Apr 16, 2018
  8. Thank you. So each "Chunks" contains all the obstacles and stuff in them? and are they placed manually or randomly pooled? Are all the chunks are same size (Z axis)?
    How did you place next chunk at the end of current chunk? This is something I've been working on for a while, but couldn't figure out.

    BTW Race the Stig looks awesome!

    Last edited: Apr 17, 2018
  9. Thanks.

    I just opened the project for the first time in a couple of years to remind myself how it works - it doesn't even run now :-(

    The chunks are variable sized (length). They act as placeholders really. See image below. The squares represent where the scenery props will go (5 left, and 5 right in this example). The scenery props will be picked from a pool at random. The black object are obstacle props - some static, some dynamic. They're not supposed to be black btw, just some sort of bug due to a newer Unity version. The position of the dynamic ones is driven off the chunk's position, e.g. as a chunk moves towards the player at (0,0) a car will move towards the player at a different speed (it's position relative to the chunk is changing). The obstacles are also picked randomly from a pool, but the type is predefined, e.g. it's always a truck, but the appearance of it will change. The yellow boxes are where collectable nuts (like coins) are placed.

    The chunks themselves are randomly picked and spawned. Yes it's all done on the Z axis. If you know the last chunk's position and length, then you know where the next chunk needs to be positioned.

    Chunk.PNG

    Scenery Props. Note that the actual road is part of the left hand props. The left and right props will be picked at random so they won't necessarily pair up like show here.

    Scenery Props.PNG

    Obstacle Props. Various static and dynamic objects that go on the road.

    Obstacle Props.PNG

  10. Thanks for posting this info here, I like the idea of keeping the road attached to the left so that the pairing will not be same everytime. I just downloaded the game from the App Store, nice game. I like how the curve changes from left to right sometimes and not just curved towards the left like other similar games. Do you have any plans for updating the game for iPhone X?
  11. I doubt it will be ever updated again.
  12. Thank you very much for posting. These are very useful information. Any plans to release this In Unity Asset Store?

Infinite Runner Game Design Doc

Source: https://forum.unity.com/threads/how-to-start-infinite-runner-game-development.526649/

Posted by: bellsciewher.blogspot.com

0 Response to "Infinite Runner Game Design Doc"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel