Everyday Unity
UI Toolkit with Unity ECS - The Hot Path Show Ep. 3 In a free time I develop a pet project using Entities and I've already mentioned The Hot Path Show here a few times promising to share my notes with insights from it. Even thought the videos are pretty long…
Data-Oriented Damage System - The Hot Path Show Ep. 4
Continuing the series of sharing my notes from The Hot Path Show for everyone who uses DOTS and/or wants to learn more about it. Here are the notes for the video on implementing the damage system in ECS. Of course, it is not the one and only way to design and implement such a system, but it is a good starting point to learn how experienced developers use ECS.
- How to use the dynamic buffer buffer with the example of DamageElementBuffer to store multiple damage sources in one frame.
- 01:00:00 - You should create the entity and pass needed components instead of adding them in a separate method, because it leads to the entity being placed in one archetype and immediately moved to another.
- 01:01:00 - Since v1.2 you can use:
state.EntityManager.CreateEntity(stackalloc ComponentType[] { ComponentType.ReadOnly<T>(), ... })
This code is burstable. The old approach with using typeof(T) in CreateEntity was not burstable.
- 01:16:00 - Use [WriteGroup] to override groups with other systems.
- 01:18:00 - If you create your own ECB, use state.WorldUpdateAllocator instead of Temp or any other because this one is rewindable—it’s preallocated and clears every two frames.
- 01:38:00 - Example of ECB usage when you need to add a component not every frame and only in small quantities. ECB has a cost when doing a lot of operations.
Watch the episode: https://www.youtube.com/watch?v=SWXYpWtJZ5k
The sample project: https://github.com/TheHotPathShow/Episode-4
#ecs #dots
Continuing the series of sharing my notes from The Hot Path Show for everyone who uses DOTS and/or wants to learn more about it. Here are the notes for the video on implementing the damage system in ECS. Of course, it is not the one and only way to design and implement such a system, but it is a good starting point to learn how experienced developers use ECS.
- How to use the dynamic buffer buffer with the example of DamageElementBuffer to store multiple damage sources in one frame.
- 01:00:00 - You should create the entity and pass needed components instead of adding them in a separate method, because it leads to the entity being placed in one archetype and immediately moved to another.
- 01:01:00 - Since v1.2 you can use:
state.EntityManager.CreateEntity(stackalloc ComponentType[] { ComponentType.ReadOnly<T>(), ... })
This code is burstable. The old approach with using typeof(T) in CreateEntity was not burstable.
- 01:16:00 - Use [WriteGroup] to override groups with other systems.
- 01:18:00 - If you create your own ECB, use state.WorldUpdateAllocator instead of Temp or any other because this one is rewindable—it’s preallocated and clears every two frames.
- 01:38:00 - Example of ECB usage when you need to add a component not every frame and only in small quantities. ECB has a cost when doing a lot of operations.
Watch the episode: https://www.youtube.com/watch?v=SWXYpWtJZ5k
The sample project: https://github.com/TheHotPathShow/Episode-4
#ecs #dots
YouTube
Data-Oriented Damage System - The Hot Path Show Ep. 4
The Hot Path Show is a weekly livestream focused on showcasing different ways to solve problems in game development through data-oriented design.
Support The Hot Path Show and get extra bonuses: https://patreon.com/TurboMakesGames
Episode Sample Project…
Support The Hot Path Show and get extra bonuses: https://patreon.com/TurboMakesGames
Episode Sample Project…
🔥7
This media is not supported in your browser
VIEW IN TELEGRAM
🌊 Uber Stylized Water
A highly customizable open-source stylized water shader for Unity 6.
URP
Rendering Path: Forward, Forward+, Deferred
I love that the author even provided documentation on how to use it, as well as multiple templates with various water styles.
I checked it myself, and it has tons of options to tune and adjust for your visual style. Definitely recommend checking it out.
https://github.com/MatrixRex/Uber-Stylized-Water
#water #shader #urp
A highly customizable open-source stylized water shader for Unity 6.
URP
Rendering Path: Forward, Forward+, Deferred
I love that the author even provided documentation on how to use it, as well as multiple templates with various water styles.
I checked it myself, and it has tons of options to tune and adjust for your visual style. Definitely recommend checking it out.
https://github.com/MatrixRex/Uber-Stylized-Water
#water #shader #urp
🔥9👍1
imkoi/sparse-inject: DI Container forged for game development
The fastest DI container developed by a friend of mine. I like his engineering approach and the overall high quality of the solution, which you can verify even by checking the benchmarks in the repo, as these are one of the most thorough benches for unity DI containers available online. They are conducted with a deep understanding of how a DI container is used in real games and how to measure performance correctly.
For example, benchmarks that prewarm the code in JIT-compiled environments don’t reflect real use cases, as in your game the registering stage is executed only once—unlike benchmarks where the building stage is run multiple times before measurements are taken.
Moreover, the results vary significantly between Mono and IL2CPP. I recommend checking the benchmarks and results to remind yourself how crucial it is to profile your code and not blindly trust every claim made online (yes, I’m looking at you, benchmarks in Reflex and VContainer repos).
Of course, the same applies to the benchmarks by the Sparse Inject author—if you're considering replacing your current DI container with this one, profile your code on the target platform with your existing DI container first. Then, after converting to Sparse Inject, compare the results. Ideally, test on multiple devices—the minimum supported, an average one, and a top-tier one—as performance gains may vary.
I’ve started porting my pet project from VContainer to Sparse Inject. While I love the minimal API of Sparse Inject, it also means that everything VContainer provided for Unity integration needs to be redone manually. On one hand, VContainer’s Unity integration allows you to kick-start a project quickly, but on the other, it makes switching to another DI container more difficult later as you must redo all of that.
A minimal API of sparse inject requires additional steps now to implement integration features of VContainer I used, but in the future it also makes porting to another DI much easier since you gain complete control and understanding.
Nevertheless, I’ve shared my notes with the author so he can create a migration and quick-start guides. I believe that, sooner or later, a repository with add-ons for quicker Unity integration will be created — avoiding repetitive tasks while maintaining a clean API by keeping these additions separate from the main repo.
https://github.com/imkoi/sparse-inject
#di #container #dod
The fastest DI container developed by a friend of mine. I like his engineering approach and the overall high quality of the solution, which you can verify even by checking the benchmarks in the repo, as these are one of the most thorough benches for unity DI containers available online. They are conducted with a deep understanding of how a DI container is used in real games and how to measure performance correctly.
For example, benchmarks that prewarm the code in JIT-compiled environments don’t reflect real use cases, as in your game the registering stage is executed only once—unlike benchmarks where the building stage is run multiple times before measurements are taken.
Moreover, the results vary significantly between Mono and IL2CPP. I recommend checking the benchmarks and results to remind yourself how crucial it is to profile your code and not blindly trust every claim made online (yes, I’m looking at you, benchmarks in Reflex and VContainer repos).
Of course, the same applies to the benchmarks by the Sparse Inject author—if you're considering replacing your current DI container with this one, profile your code on the target platform with your existing DI container first. Then, after converting to Sparse Inject, compare the results. Ideally, test on multiple devices—the minimum supported, an average one, and a top-tier one—as performance gains may vary.
I’ve started porting my pet project from VContainer to Sparse Inject. While I love the minimal API of Sparse Inject, it also means that everything VContainer provided for Unity integration needs to be redone manually. On one hand, VContainer’s Unity integration allows you to kick-start a project quickly, but on the other, it makes switching to another DI container more difficult later as you must redo all of that.
A minimal API of sparse inject requires additional steps now to implement integration features of VContainer I used, but in the future it also makes porting to another DI much easier since you gain complete control and understanding.
Nevertheless, I’ve shared my notes with the author so he can create a migration and quick-start guides. I believe that, sooner or later, a repository with add-ons for quicker Unity integration will be created — avoiding repetitive tasks while maintaining a clean API by keeping these additions separate from the main repo.
https://github.com/imkoi/sparse-inject
#di #container #dod
GitHub
GitHub - imkoi/sparse-inject: DI Container forged for game development
DI Container forged for game development. Contribute to imkoi/sparse-inject development by creating an account on GitHub.
🔥24
With Android 15, Google introduced support for 16 KB memory page sizes in the OS. It is expected that device manufacturers will start bringing out devices with these capabilities to the market. Google’s testing suggests that there are noticeable performance gains in apps and games launching on 16 KB-capable devices, with up to a 10% improvement.
Support for 16 KB sizes is now available in the following Unity versions:
- Unity 6000.1.0b5 (expected release: February 9, 2025)
- Unity 6000.0.38f1 (expected release: February 14, 2025)
- Unity 2022.3.56f1 (released: January 15, 2025)
- Unity 2021.3.48f1 (released: January 22, 2025)
All native libraries in your project must be 16 KB compatible. Currently, the page size is 4 KB, and larger pages bring the following benefits:
- Lower app launch times under memory pressure: 3.16% lower on average, with more significant improvements (up to 30%) for some apps tested by Google.
- Theoretically reduced page table overhead: Since there are fewer pages to manage.
- Improved I/O performance: Larger pages require fewer read and write operations for data spanning multiple pages.
- Cache efficiency: Larger pages can lead to better cache usage, reducing the number of cache misses if your app has good data locality.
https://discussions.unity.com/t/info-unity-engine-support-for-16-kb-memory-page-sizes-android-15/1589588
#native #pagesize
Support for 16 KB sizes is now available in the following Unity versions:
- Unity 6000.1.0b5 (expected release: February 9, 2025)
- Unity 6000.0.38f1 (expected release: February 14, 2025)
- Unity 2022.3.56f1 (released: January 15, 2025)
- Unity 2021.3.48f1 (released: January 22, 2025)
All native libraries in your project must be 16 KB compatible. Currently, the page size is 4 KB, and larger pages bring the following benefits:
- Lower app launch times under memory pressure: 3.16% lower on average, with more significant improvements (up to 30%) for some apps tested by Google.
- Theoretically reduced page table overhead: Since there are fewer pages to manage.
- Improved I/O performance: Larger pages require fewer read and write operations for data spanning multiple pages.
- Cache efficiency: Larger pages can lead to better cache usage, reducing the number of cache misses if your app has good data locality.
https://discussions.unity.com/t/info-unity-engine-support-for-16-kb-memory-page-sizes-android-15/1589588
#native #pagesize
🔥13👍2
Misconceptions about DOTS and Entities
Not every Unity developer has had a chance to work with the Entities package. So this is a good read to clear misconceptions surrounding DOTS. You should not be surprisied that you can use DOTS even without the Entities package in your project.
https://docs.google.com/document/d/18hFIQipNxTsKsWk9eRroRwkGgswWs6m40X8N4Kkjhy4/edit
#dots #ecs
Not every Unity developer has had a chance to work with the Entities package. So this is a good read to clear misconceptions surrounding DOTS. You should not be surprisied that you can use DOTS even without the Entities package in your project.
https://docs.google.com/document/d/18hFIQipNxTsKsWk9eRroRwkGgswWs6m40X8N4Kkjhy4/edit
#dots #ecs
Google Docs
Misconceptions about DOTS and Entities
Misconceptions about DOTS and Entities False: DOTS, ECS, Unity Entities, and Data-oriented Design are all the same thing Entity Component System (ECS): an architectural pattern that originated in some games of the 2000’s. There are at least several variants…
👍7🔥2
Use Multiplayer Play Mode to test multiplayer functionality within the Unity Editor.
It was released almost a year ago, but I missed the announcement back then. Now that I've decided to work on a small co-op prototype, I find this tool amazing—it saves a lot of time. I remember how inconvenient it was to test a multiplayer game when I was working on my first multiplayer project around the time UNet was still relevant (8–9 years ago, if I'm not mistaken). To test it, I had to build a standalone version first, which took some time. Now, running multiple windows in Play Mode makes the process much faster.
Unreal Engine has had this functionality out of the box for a while, and I really liked it when I was creating another prototype to get acquainted with Unreal some time ago. So I'm very happy that Unity now offers the same functionality. Definitely recommend it if you're working on a multiplayer game.
https://docs-multiplayer.unity3d.com/mppm/current/about/
#netcode #multiplayer
It was released almost a year ago, but I missed the announcement back then. Now that I've decided to work on a small co-op prototype, I find this tool amazing—it saves a lot of time. I remember how inconvenient it was to test a multiplayer game when I was working on my first multiplayer project around the time UNet was still relevant (8–9 years ago, if I'm not mistaken). To test it, I had to build a standalone version first, which took some time. Now, running multiple windows in Play Mode makes the process much faster.
Unreal Engine has had this functionality out of the box for a while, and I really liked it when I was creating another prototype to get acquainted with Unreal some time ago. So I'm very happy that Unity now offers the same functionality. Definitely recommend it if you're working on a multiplayer game.
https://docs-multiplayer.unity3d.com/mppm/current/about/
#netcode #multiplayer
👍10🔥7
Sampling vs. Instrumentation Profilers in Unity: When to Use Each for Better Performance
New Blog Post Alert!
It’s been a while since the last post on my website gamedev.center — lately, I’ve been deep into working on my pet project instead of writing. But finally, a new post is up!
I keep seeing Superluminal mentioned more and more—so is it time to take another look? 🤔
In this post, I break down sampling vs. instrumentation profilers, when to use each, and why a hybrid approach gives the best results. Plus, I share real-world profiling strategies that helped optimize Unity projects.
https://gamedev.center/sampling-vs-instrumentation-profilers-in-unity-when-to-use-each-for-better-performance/
#profiling #sampling
New Blog Post Alert!
It’s been a while since the last post on my website gamedev.center — lately, I’ve been deep into working on my pet project instead of writing. But finally, a new post is up!
I keep seeing Superluminal mentioned more and more—so is it time to take another look? 🤔
In this post, I break down sampling vs. instrumentation profilers, when to use each, and why a hybrid approach gives the best results. Plus, I share real-world profiling strategies that helped optimize Unity projects.
https://gamedev.center/sampling-vs-instrumentation-profilers-in-unity-when-to-use-each-for-better-performance/
#profiling #sampling
🔥7👍5
Easy Text Effects for Unity
An open-source Unity package for animating TextMeshPro text with customizable effects. Includes ready-to-use samples, real-time previews, and per-vertex animation capabilities.
https://github.com/LeiQiaoZhi/Easy-Text-Effects-for-Unity
#text #vfx
An open-source Unity package for animating TextMeshPro text with customizable effects. Includes ready-to-use samples, real-time previews, and per-vertex animation capabilities.
https://github.com/LeiQiaoZhi/Easy-Text-Effects-for-Unity
#text #vfx
👍13🔥5
Everyday Unity
Easy Text Effects for Unity An open-source Unity package for animating TextMeshPro text with customizable effects. Includes ready-to-use samples, real-time previews, and per-vertex animation capabilities. https://github.com/LeiQiaoZhi/Easy-Text-Effects…
TMPEffects
Easily animate Unity text and apply other effects with custom tags
One more asset to animate TMP text. I briefly tried both and noticed they have different approaches to setup.
TMPEffects uses the tag system. While the previous one "Easy Text Effects" allows to combine effects by using presets and referencing them via the inspector.
I found this one more convenient for prototypes with the handy <tag> system (check the 2nd attached video). It looks ideal for quick prototyping.
The previous asset, EasyTextEffects, seems easier to customize, allowing you to tweak effects however you like. Both assets are solid and open source, so I am grateful the authors shared them with the community. I'd recommend checking out both, as some may find one setup more convenient than the other.
https://github.com/Luca3317/TMPEffects
#text #vfx
Easily animate Unity text and apply other effects with custom tags
One more asset to animate TMP text. I briefly tried both and noticed they have different approaches to setup.
TMPEffects uses the tag system. While the previous one "Easy Text Effects" allows to combine effects by using presets and referencing them via the inspector.
I found this one more convenient for prototypes with the handy <tag> system (check the 2nd attached video). It looks ideal for quick prototyping.
The previous asset, EasyTextEffects, seems easier to customize, allowing you to tweak effects however you like. Both assets are solid and open source, so I am grateful the authors shared them with the community. I'd recommend checking out both, as some may find one setup more convenient than the other.
https://github.com/Luca3317/TMPEffects
#text #vfx
👍11🔥3
GitHub - ruccho/WaterRW: WaterRW is 2D interactive water system for Unity.
https://github.com/ruccho/WaterRW
#water
https://github.com/ruccho/WaterRW
#water
GitHub
GitHub - ruccho/WaterRW: WaterRW is 2D interactive water system for Unity.
WaterRW is 2D interactive water system for Unity. Contribute to ruccho/WaterRW development by creating an account on GitHub.
🔥10👍2
Performance checklist provided by Unity in their ECS samples repo covers both regular projects and DOTS.
It gives you a clear plan of what to check after identifying slow parts of your game through profiling. While the list may seem trivial to developers experienced in optimization, it's beneficial to have it formalized and written down somewhere to optimize your optimization workflow. And of course it’s very helpful for less experienced devs.
https://docs.google.com/document/d/1QQZz6xzmWpe6NMdL3t2o7RXmya6UFyl_Xgo3KPfGxzQ/
#performance #profiling
It gives you a clear plan of what to check after identifying slow parts of your game through profiling. While the list may seem trivial to developers experienced in optimization, it's beneficial to have it formalized and written down somewhere to optimize your optimization workflow. And of course it’s very helpful for less experienced devs.
https://docs.google.com/document/d/1QQZz6xzmWpe6NMdL3t2o7RXmya6UFyl_Xgo3KPfGxzQ/
#performance #profiling
Google Docs
Performance checklist
Performance checklist Things to consider when your code is slow. Have you profiled? Where are the bottlenecks? The first rule of performance is always: Don’t guess! Profile! Is your code slow? How slow? Where is it slow? Until you measure the actual…
🔥13
Stencil Debugger for Unity's Universal URP
Stencil Debugger is a utility for visualizing the stencil buffer in Unity URP. This is especially useful for debugging rendering effects that rely on the stencil buffer.
It's been a while since I last debugged a shader, and it was far from trivial—I had to write shader code just to render the debug info into a texture. So this tool is incredibly helpful, as it eliminates the need for custom debug code at least for the stencil buffer.
https://github.com/alexanderameye/stencil-debugger
#stencil #debug
Stencil Debugger is a utility for visualizing the stencil buffer in Unity URP. This is especially useful for debugging rendering effects that rely on the stencil buffer.
It's been a while since I last debugged a shader, and it was far from trivial—I had to write shader code just to render the debug info into a texture. So this tool is incredibly helpful, as it eliminates the need for custom debug code at least for the stencil buffer.
https://github.com/alexanderameye/stencil-debugger
#stencil #debug
🔥17👍1
Reveal-By-Progress-Shader-For-Unity: A custom shader for Unity that reveals an object based on a progress value.
This effect is based on an old tutorial by Alan Zucconi. It's great to see a complete implementation that can be easily used for prototyping. Currently, it supports only the Built-in Render Pipeline.
I have seen this revealing effect in a lot of hyper casual games. Moreover, it can be modified for other purposes—for example, cutting off dark vertices entirely to imitate a 3D printing mechanic.
https://github.com/AnhPham/Reveal-By-Progress-Shader-For-Unity
#shader #reveal #builtin
This effect is based on an old tutorial by Alan Zucconi. It's great to see a complete implementation that can be easily used for prototyping. Currently, it supports only the Built-in Render Pipeline.
I have seen this revealing effect in a lot of hyper casual games. Moreover, it can be modified for other purposes—for example, cutting off dark vertices entirely to imitate a 3D printing mechanic.
https://github.com/AnhPham/Reveal-By-Progress-Shader-For-Unity
#shader #reveal #builtin
GitHub
GitHub - AnhPham/Reveal-By-Progress-Shader-For-Unity: A custom shader for Unity that reveals an object based on a progress value.
A custom shader for Unity that reveals an object based on a progress value. - AnhPham/Reveal-By-Progress-Shader-For-Unity
👍7🔥4
Unity_StarRail_CRP_Sample
An example of a custom rendering pipeline that recreates the rendering of HSR
https://github.com/ChillyHub/Unity_StarRail_CRP_Sample
Custom rendering pipeline doc: https://github.com/ChillyHub/Unity_StarRail_CRP_Sample/blob/main/Documents~/RenderPipeline.md
#render #urp
An example of a custom rendering pipeline that recreates the rendering of HSR
https://github.com/ChillyHub/Unity_StarRail_CRP_Sample
Custom rendering pipeline doc: https://github.com/ChillyHub/Unity_StarRail_CRP_Sample/blob/main/Documents~/RenderPipeline.md
#render #urp
👍11🔥6