This is a showcase project that I spent a week of my free time creating! Using Unity 2022.2.0b16 & ECS package v1.0 to realize the unique visual experience of the boss battle scene.
Note:
- Due to the high quantity of simulated particles in this project, it would not have been possible without ECS.
- For some unknow error, this project Cannot be built by Unity 2022.2.0b16 with windows 10 + il2cpp, so all the videos are recored inside the unity editor playmode.
Overall the system works as follow:
-
Voxelize given skinned mesh to small dark cubes, i.e dots.
(In the video, the dots count are 150,000+, where 142,667 dots driven by ECS, others created by using unity particle system) -
Calculate the data needed for each dot, e.g Assigin each dot to closest bone.
(Not by parenting but calculate local to world matrix, since we need control each dot precisely, due to the update order in Job System parenting is not suitable in our case) -
Initialize all systems:
-
Bone entity system (Copied from skeleton of the skinned mesh to ECS Scene)
-
Bullet shooter (MonoBehaviour)
-
Boss(Ghost) controller (MonoBehaviour)
-
In the core update system, we run updates in parallel through the Unity Job System:
-
Update bullet entities movement.
-
Update bone entities movement by copy the transform from the original Skeletal Animation, and calculate local to world matrix for assigned dots.
-
Update dot entities movement:
- Follow the bone entities local transform ->
been hit fly away ->
wait for a while ->
bcak to follow the bone entities local transform.
- Follow the bone entities local transform ->
-
-
Other visual & sound effects triggered by event, e.g begin to attack and foot land on ground.
- Character model and its animations
- Old West Shotgun
- Heavy Stomp Free Sound Effect
- Voxelization modified from: unity-voxel
- FPS Controller Modified from: Demo FPS Controller