Quantum Survivor
![Level 4](/v2/img/docs/levels/level01-beginner_1.5x.png)
Available in the Gaming Circle and Industries Circle
![Circle](/v2/img/docs/circles/icon-gaming_1x.png)
Overview
This sample is provided with full source code and demonstrates how Quantum can be used to create a co-op survivor game with hundreds of enemies.
Screenshots
![](/docs/img/quantum/v2/game-samples/survivor/survivor-1.png)
![](/docs/img/quantum/v2/game-samples/survivor/survivor-2.png)
![](/docs/img/quantum/v2/game-samples/survivor/survivor-3.gif)
Download
Version | Release Date | Download | |
---|---|---|---|
2.1.7 | Feb 02, 2024 | Quantum Survivor 2.1.7 Build 329 |
Before You Start
To run the sample in online multiplayer mode, first create a Quantum AppId in the PhotonEngine Dashboard and paste it into the AppId
field in PhotonServerSettings
asset.
Then load the Menu
scene in the Scenes menu and press Play
.
Technical Info
- Unity: 2020.3.37f1.
- Platforms: PC (Windows / Mac), Mobile.
Highlights
Technical
- Scheduling routine for collectible entitites.
- Usage of a multithreaded system for Characters Movement.
- EntityView object pool.
- Usage of physics queries injection Broadphase Queries.
Gameplay
- Basic wave system.
- Synced character powerup selection.
- Quantum Command to add more time for powerups selection
- Basic Bot players.
Useful Patterns
Scheduling routine for collectible entitites
This is a good approach to prevent iterating over all the collectibles every frame, thus distributing the CPU load.
C#
int schedulePeriod = 10;
foreach (var (entity, c) in f.Unsafe.GetComponentBlockIterator<Collectible>())
{
if (entity.Index % schedulePeriod == f.Number % schedulePeriod)
{
CheckCollectDistance(f, entity, c);
if (c->TTL <= FP._0)
{
f.Destroy(entity);
}
c->TTL -= timeMultiplier * schedulePeriod;
}
}
3rd Party Assets
The Sample includes several assets provided courtesy of their respective creators (CC-0). The full packages can be acquired for your own projects at their respective site:
- DungeonTilesetII by Robert