This repository contains sample projects for the Atomic Framework — an architectural framework for building core gameplay features in Unity and C#.
Each sample demonstrates a different level of complexity and use case of the framework, from a simple 2-player mini-game to a large-scale RTS simulation with thousands of entities.
Want to learn more about the framework itself? Visit the main Atomic repository.
All examples are available inside Assets/Examples.
- Beginner Sample — a simple 2-player mini-game showcasing the core principles of the framework.
- Top-Down Shooter Sample — a more advanced, modular game architecture suitable for mid-sized projects.
- RTS Sample — a large-scale simulation demonstrating high-performance entity management with thousands of units.
- Turn-Based Sample — a turn-based tactics sample demonstrating event-driven gameplay, entity systems, and UI presenters.
A simple 2-player mini-game designed to introduce the fundamental ideas behind the Atomic framework. Link to the sample.
This sample represents the most basic foundation of the Atomic framework with Unity. It demonstrates how to build
gameplay using a universal MonoEntity, showing three minimal entities:
GameContextCharacterCoin
Everything here is intentionally kept as simple and transparent as possible, focusing on the core idea of the atomic approach — how logic can emerge from the composition of small, modular elements.
The project uses code generation in Unity and serves as a minimal example for rapid prototyping within the Atomic ecosystem.
- Players: Two players share a single arena.
- Goal: Collect more coins than your opponent within a limited time.
- Controls:
- Player (Blue): Arrow keys
- Player (Red):
W,A,S,D
- Creating and configuring Entity objects in Unity.
- Structuring a project using the Entity–State–Behaviour pattern.
- Using atomic elements to drive logic and interaction.
- Applying code generation for fast and clean iteration.
The Top-Down Shooter demonstrates a more sophisticated and scalable game architecture, suitable for mid-size projects. Link to the sample.
- Players: Two players in a shared arena.
- Objective: Eliminate your opponent more times than they eliminate you, within a time limit.
- Controls:
- Player (Blue): Arrow keys to move,
Spaceto shoot - Player (Red):
W,A,S,Dto move,Qto shoot
- Player (Blue): Arrow keys to move,
- Mechanics:
- Movement: Kinematic character movement with
Rigidbody.SweepTestcollision handling. - Combat: Independent weapon entities firing physical projectiles.
- Projectile: Kinematic object with trigger collisions and limited lifetime.
- Respawn: Units reappear at random points after death.
- Time Limit: The match ends when the timer expires.
- Movement: Kinematic character movement with
- Visualization:
- Animated characters with sound and VFX.
- UI displays kills and time remaining.
- Scenes:
Bootstrap— initializes and loads the game.Menu— the main navigation scene.- Levels: three stages featuring player and enemy spawning.
- Save System: Remembers the last completed level.
- Loading Tree: Hierarchical scene-loading sequence for structured bootstrapping.
- Designing a complete, scalable game architecture.
- Implementing an application context using the Entity–State–Behaviour pattern.
- Building procedural menu systems.
- Managing complex loading flows with a Loading Tree.
- Saving and restoring persistent game data.
- Turning entities into fully featured game objects with animation, VFX, and audio.
- Managing projectile pools efficiently.
- Structuring a modular project file system.
The RTS Sample showcases high-performance entity management — running thousands of active units in real time with minimal overhead. Link to the sample.
- Armies: Two large armies automatically engage in battle — each consisting of infantry, tanks, and buildings.
- Buildings: Have health points and serve as static defense or production units.
- Infantry: Possesses health, performs melee attacks, and seeks the nearest enemy.
- Tanks: Fire projectiles and detect enemies within range.
- Projectiles: Travel toward targets with limited lifetime and cause impact damage.
- CameraControls:
- Movement: WASD
- Zoom: Mouse Scroll
- 5000 Units Scene — 5,000 visualized GameObjects for real-time simulation.
- 10000 Units Scene — 10,000 entities simulated without visualization for performance benchmarking.
- Entity Baking Scene — demonstrates converting Unity scene objects into pure C# entities for simulation.
- Running complete game logic in pure C#, using Unity solely for visualization.
- Employing
EntityWorld,EntityFactory,EntityPool,EntityFilter, andEntityTriggers. - Using
EntityView,EntityViewPool, andEntityCollectionViewfor rendering and synchronization. - Managing 5,000–10,000 active objects efficiently on a single thread.
- Baking Unity objects into a pure data-driven simulation architecture.
The Turn-Based Sample demonstrates an event-driven, turn-based tactics game built with Atomic. It covers character turns, combat, movement, and UI presenters wired to entity state. Link to the sample.
- Turn order: Player and enemy characters take turns one at a time.
- Actions: Each character can move within a range and perform a melee or ranged attack.
- Combat: Attacks deal damage, push characters back, and trigger death and spawn events.
- Win/Lose: The battle ends when all player or all enemy characters are defeated.
- Game Scene — the main battle arena with characters, grid, and UI.
- Driving gameplay through an event bus with
[GenerateEventExtensionsAPI]source-generated extension methods. - Separating game logic (use cases), presentation (presenters), and view (UI components).
- Using entity systems and filters to update characters and resolve turns.
- Implementing movement, damage, push, spawn, and death mechanics with atomic behaviours.
- Combining
MonoEntity,MonoEntityInstaller, andScriptableEntityBootstrapperin a Unity scene.
This project is licensed under the MIT License.
MIT License
Copyright (c) 2025 Igor Gulkin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Author: Igor Gulkin
Telegram: t.me/starkre22
Email: gulkin.igor.developer@gmail.com
Back to top • Back to main framework • Report Issue • Join Discussion
