Making a large Battle Simulator game with Bevy and Rust

  Рет қаралды 4,977

Biped Potato

Biped Potato

Күн бұрын

#gamedev #rustlang #bevy
Have you ever wondered how games like Ultimate Epic Battle Simulator are able to have millions of units on screen while running at a relatively fine FPS? Well in this video, I built on one of my previous videos "Remaking my game from scratch in an ECS with Rust and Bevy" where I attempted to create a battle simulator like UEBS. I wasn't very successful in the previous video but by the end of the video, using my newly learned skills in Bevy and Rust, I was able to develop a project that runs at a steady 100+ FPS when having 20k tanks duking it out on the big field. In this video I show you some useful optimizations when attempting to make a battle simulator game such as spatial partitioning through Quadtrees and rendering optimizations using custom render pipeline Shader Instancing with WebGPU and wgsl. I was no where near getting millions of units on screen but I'm pretty happy with this project as a whole! If you like the video make sure to drop a like and subscribe.
Making a large Battle Simulator game with Bevy and Rust
Join my discord!:
/ discord
Time Stamps:
Intro - 0:00
Where we left off... - 1:30
Spatial Partitioning through Quadtrees - 2:30
Explanation of Shader Instancing and tank 3d Model Timelapse - 4:30
How to actually perform Shader instancing - 5:30
Intro to unit combat implementation - 7:41
How to partition quadtree to find potential Combatants - 8:53
Glossing over how much I struggled to implement Combat - 10:58
Outro - 11:07
Music Used:
Chill Wave by Kevin MacLeod
Heroic Age by Kevin Macleod
♪ Marshmellow (Prod. by Lukrembo)
Link : • lukrembo - marshmallow...
♪ Biscuit (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Onion (Prod. by Lukrembo)
Link : • (no copyright music) l...

Пікірлер: 19
@bipedpotato
@bipedpotato 4 ай бұрын
Subscribe for a "consistent" upload schedule, also I'm aware that this video doesn't have the most elegant explanations, and I guess youtube compression really dislikes this video as well I just wanted to get it out as soon as possible so we don't reach 4 months without uploading.
@vitasartemiev
@vitasartemiev 2 ай бұрын
There is a crate called bevy-spatial. It provides kd-trees that track marked entities as a resource. It supports fast lookups within a radius, nearest neighbor lookups and axis-aligned rectangle lookups (see pull request). It may help you outright or inspire you for your own version.
@itzhakeretzkdosha6875
@itzhakeretzkdosha6875 4 ай бұрын
Great video! It would be nice if you explained the last part where you add shooting with some code and drawings
@bipedpotato
@bipedpotato 4 ай бұрын
Yeah you are right but the video was getting a bit long, perhaps in another video further down the line?
@peterhayman
@peterhayman 2 ай бұрын
thanks for sharing! traversing quad trees sounds super interesting
@bonesai-dev
@bonesai-dev 4 ай бұрын
This is really awesome
@morkallearns781
@morkallearns781 4 ай бұрын
I've been making grass and am hitting a hard performance bottleneck, so I was thinking about trying a custom render pipeline to implement instancing as well. Fixed update might also be useful. Really cool stuff! Definitely relate to the "messy and inefficient" part, probably will have to rewrite it once I get all the pieces of my game working (gameplay tbd, but building a huge procedurally generated open world).
@darknetworld
@darknetworld 4 ай бұрын
That so cool. I bet it not easy to run smooth for many units in game.
@bipedpotato
@bipedpotato 4 ай бұрын
yeah it was pretty complicated and I’ve only reached the surface of full potential battle simulators like UEBS that can simulate millions of units ON TERRAIN AND WITH ANIMATION without that much lag.
@thedevblog5916
@thedevblog5916 2 ай бұрын
Super cool! Sorry if I missed it, but are you using a custom physics engine? Or are you using a crate?
@bipedpotato
@bipedpotato 2 ай бұрын
its just a simple separation check which is made more performant through a spatial partitioning system through a quadtree. I didn’t use any crates.
@GonziHere
@GonziHere 4 ай бұрын
Nice, btw is it fully deterministic?
@bipedpotato
@bipedpotato 4 ай бұрын
So i would like it to be but as you can probably tell from the last segment of the video, one side should not win by so much with equal units. The combat system is a really hacky system that I whipped up last minute so I didn’t really expect much either. Other than that the rest of the game should be completely deterministic as Its run on a fixed update.
@JoMaFjErynMaLaZOr
@JoMaFjErynMaLaZOr 4 ай бұрын
I like
@bipedpotato
@bipedpotato 4 ай бұрын
same
@nihil75
@nihil75 4 ай бұрын
umm.. I think Bevy 0.12 already does batching & instancing for you without a custom shader? I can render 6.5 million blades of grass with: var model = mesh_functions::get_model_matrix(vertex.instance_index); (I did not define instance_index myself. it's built in to the vertex input)
@bipedpotato
@bipedpotato 4 ай бұрын
this way i have more control and can remove features that I deem to be useless to my project, also I did not know that instancing was already built into bevy and didn’t want to test it out.
@spindlywebs
@spindlywebs 2 ай бұрын
always happy to see non ai gamedev vids :D
@LivanariLivanari
@LivanariLivanari Ай бұрын
video is too hard to understand
ChatGPT makes Voxel Engine with Rust
12:20
Tantan
Рет қаралды 92 М.
Remaking My First Game 3 Years Later
8:49
Biped Potato
Рет қаралды 1,4 М.
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 18 МЛН
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН
Making an FPS game with Bevy and Rust!
9:32
Biped Potato
Рет қаралды 30 М.
Procedual Voxel Tree Generation - Rust Game
7:26
Tantan
Рет қаралды 33 М.
Much bigger simulation, AIs learn Phalanx
29:13
Pezzza's Work
Рет қаралды 2,7 МЛН
Pathfinding and Async Tasks in Bevy
7:39
Logic Projects
Рет қаралды 8 М.
I Added RAYTRACING To My Voxel Engine ! ( From SCRATCH )
13:39
MaxMakesGames
Рет қаралды 8 М.
Rapier Physics Engine Showcase: Rust Physics Engine for Bevy
10:13
Logic Projects
Рет қаралды 15 М.
Blazingly Fast Greedy Mesher - Voxel Engine Optimizations
23:35
Unity DOTS vs Bevy - A Performance Comparison #rust #bevyengine #unity
6:00
Battery  low 🔋 🪫
0:10
dednahype
Рет қаралды 6 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 23 МЛН
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 14 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 29 МЛН
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Кинг Комп Shorts
Рет қаралды 1,8 МЛН