C# Journey into struct equality comparison, deep dive
A great post that dives into reasoning behind implementing IEquatable<>: where exactly allocations happen and that default ValueType Equals implementation uses structural comparison only for tightly packed structs, otherwise field-by-field comparison is used which utilizes reflection.
For us it means that we must implement IEquatable<> in our structs in case they are compared, which is common case when used in collections (dictionary, list, array, etc).
https://medium.com/@semuserable/c-journey-into-struct-equality-comparison-deep-dive-9693f74562f1
#performance #equals
A great post that dives into reasoning behind implementing IEquatable<>: where exactly allocations happen and that default ValueType Equals implementation uses structural comparison only for tightly packed structs, otherwise field-by-field comparison is used which utilizes reflection.
For us it means that we must implement IEquatable<> in our structs in case they are compared, which is common case when used in collections (dictionary, list, array, etc).
https://medium.com/@semuserable/c-journey-into-struct-equality-comparison-deep-dive-9693f74562f1
#performance #equals
Medium
C# Journey into struct equality comparison, deep dive
Deep dive on struct equality comparison, stepping into .NET internals and C++ land
👍6
Unity HDRP & ShaderGraph: Nodes that Bloat Shaders
It's nothing new that Shader Graph generates less-than-ideal code, but it's still interesting to examine in detail and see which more optimal solutions the author proposes.
https://justlukass.hashnode.dev/shadergraph-can-bloat-your-shaders-and-here-is-when
#performance #shader
It's nothing new that Shader Graph generates less-than-ideal code, but it's still interesting to examine in detail and see which more optimal solutions the author proposes.
https://justlukass.hashnode.dev/shadergraph-can-bloat-your-shaders-and-here-is-when
#performance #shader
JL's blog about graphics
Unity HDRP & ShaderGraph: Nodes that Bloat Shaders
Explore Unity's HDRP ShaderGraph's impact on shader efficiency. Learn how certain nodes can generate redundant code with code samples & ISA disassembly.
👍3
Unity Assembly Definitions Explained: How to Organize and Control Your Code
This is definitely a good post that provides an overview of assembly definition settings and the benefits they bring. However, it's important to remember that any approach can backfire when taken to extremes. Having too many asm defs can significantly slow down your iterations. Even if compilation takes only seconds when your project is split into tiny assemblies, the domain reload would take much longer than compiling bigger assemblies, but in smaller quantities. Additionally, Rider needs to process all the assemblies, which also takes a lot of time, and this processing time seems to increase non-linearly as the number of assemblies grows.
Of course, the impact varies, and you should profile on your current hardware with your specific project. For me, 'too many assemblies' starts at around 500-600.
https://marcomignano.com/posts/unity-assembly-definitions-explained-how-to-organize-and-control-your-code
#asmdef
This is definitely a good post that provides an overview of assembly definition settings and the benefits they bring. However, it's important to remember that any approach can backfire when taken to extremes. Having too many asm defs can significantly slow down your iterations. Even if compilation takes only seconds when your project is split into tiny assemblies, the domain reload would take much longer than compiling bigger assemblies, but in smaller quantities. Additionally, Rider needs to process all the assemblies, which also takes a lot of time, and this processing time seems to increase non-linearly as the number of assemblies grows.
Of course, the impact varies, and you should profile on your current hardware with your specific project. For me, 'too many assemblies' starts at around 500-600.
https://marcomignano.com/posts/unity-assembly-definitions-explained-how-to-organize-and-control-your-code
#asmdef
👍3
Estimating Early Access success
Analysis of steam reviews amount during early access.
Based on stats:
- if your game has less than 10 reviews in the first month of EA, then it's a miss.
- more than 200 it's a potential hit.
But in the end 200 is an arbitrary number the author has chosen, so don't make any targets or KPIs of reaching 200 reviews.
https://howtomarketagame.com/2023/08/21/estimating-early-access-success/
#marketing
Analysis of steam reviews amount during early access.
Based on stats:
- if your game has less than 10 reviews in the first month of EA, then it's a miss.
- more than 200 it's a potential hit.
But in the end 200 is an arbitrary number the author has chosen, so don't make any targets or KPIs of reaching 200 reviews.
https://howtomarketagame.com/2023/08/21/estimating-early-access-success/
#marketing
👍3
niwatly/SectorLayoutGroup: Align children along the custom sector shape in Unity.
https://github.com/niwatly/SectorLayoutGroup
#layout
https://github.com/niwatly/SectorLayoutGroup
#layout
GitHub
GitHub - niwatly/SectorLayoutGroup: Align children along the custom sector shape in Unity.
Align children along the custom sector shape in Unity. - niwatly/SectorLayoutGroup
👍7🔥1
Migrating built-in shaders to the Universal Render Pipeline
Just in case you still have a built-in pipeline and decided to move to URP your whole project or some shaders this post must be helpful and should be added to the bookmarks.
https://blog.unity.com/engine-platform/migrating-built-in-shaders-to-the-universal-render-pipeline
#shader #urp
Just in case you still have a built-in pipeline and decided to move to URP your whole project or some shaders this post must be helpful and should be added to the bookmarks.
https://blog.unity.com/engine-platform/migrating-built-in-shaders-to-the-universal-render-pipeline
#shader #urp
Unity Blog
Migrating built-in shaders to the Universal Render Pipeline | Unity Blog
This blog was created in collaboration with Roberto Lopez Mendez from Arm. Our partners at Arm recently ported a project based on Unity’s Built-in Render Pipeline to the Universal Render Pipeline (URP) and decided to share their experience with the Unity…
👍2
How to Make a Good 2D Camera
Here is a list of camera tricks and games where it's used. It's a good starting point for drawing inspiration for your game camera.
https://youtu.be/TdWFzpgnljs
#camera
Here is a list of camera tricks and games where it's used. It's a good starting point for drawing inspiration for your game camera.
https://youtu.be/TdWFzpgnljs
#camera
YouTube
How to Make a Good 2D Camera
🔴 Get my premium monthly newsletter - https://gamemakerstoolkit.com/digest/ 🔴
Making a 2D game? Then you'll need to code a camera. But there's more to it than just following the main character. Here are five tips for making a better camera.
=== Sources…
Making a 2D game? Then you'll need to code a camera. But there's more to it than just following the main character. Here are five tips for making a better camera.
=== Sources…
👍4
Magic Tween
Extremely fast tween library implemented in Unity ECS
https://github.com/AnnulusGames/MagicTween
#tween #ecs
Extremely fast tween library implemented in Unity ECS
https://github.com/AnnulusGames/MagicTween
#tween #ecs
GitHub
GitHub - annulusgames/MagicTween: Extremely fast, GC-free and customizable tween library implemented with Unity ECS
Extremely fast, GC-free and customizable tween library implemented with Unity ECS - annulusgames/MagicTween
👍6
The reddit post with the recommendations list of Unity to Unreal tutorials
https://reddit.com/r/Unity3D/s/kPbZCC7Kdc
#unreal
https://reddit.com/r/Unity3D/s/kPbZCC7Kdc
#unreal
Reddit
[deleted by user] : r/Unity3D
676 votes, 255 comments. 387K subscribers in the Unity3D community. A subreddit for News, Help, Resources, and Conversation regarding Unity, the game…
🔥8👍3💩1
The Weak Event pattern
Events in C# are a powerful mechanism for decoupling components and enabling a publisher/subscriber model. However, they have a significant drawback: the publisher holds a strong reference to the subscriber, and this can cause memory leaks. This article describes a pattern for implementing weak events in C#.
https://steven-giesel.com/blogPost/675b75fc-2c1b-43da-9ff8-42962ca8159b
#weakevent #observer
Events in C# are a powerful mechanism for decoupling components and enabling a publisher/subscriber model. However, they have a significant drawback: the publisher holds a strong reference to the subscriber, and this can cause memory leaks. This article describes a pattern for implementing weak events in C#.
https://steven-giesel.com/blogPost/675b75fc-2c1b-43da-9ff8-42962ca8159b
#weakevent #observer
Steven-Giesel
The "Weak Event" Pattern in C#
Events in C# are a powerful mechanism for decoupling components and enabling a publisher/subscriber model. However, they have a significant drawback: the publisher holds a strong reference to the subscriber, and this can cause memory leaks. This article describes…
🔥3👍1
Godot is not the new Unity - The anatomy of a Godot API call
A very long, but very interesting read about calling unmanaged code in Unity and Godot.
Tbf Idk if the removal of Unity noscript language back in 2017 was a result of a similar issue Godot has now, but anyway Godot has a long road to achieve what the Unity team has done for noscripting performance and working with unmanaged code.
https://sampruden.github.io/posts/godot-is-not-the-new-unity/
#godot #performance
A very long, but very interesting read about calling unmanaged code in Unity and Godot.
Tbf Idk if the removal of Unity noscript language back in 2017 was a result of a similar issue Godot has now, but anyway Godot has a long road to achieve what the Unity team has done for noscripting performance and working with unmanaged code.
https://sampruden.github.io/posts/godot-is-not-the-new-unity/
#godot #performance
Sam Pruden Does Stuff
Godot is not the new Unity - The anatomy of a Godot API call
UPDATE: This article has started an ongoing conversation with the Godot devs. They care about the issues raised, and would like to improve things. Significant improvements will almost certainly be made, although it’s still early days and it’s unclear what…
👍2
Clean up your code: How to create your own C# code style
https://blog.unity.com/engine-platform/clean-up-your-code-how-to-create-your-own-c-code-style
#cleancode #codestyle
https://blog.unity.com/engine-platform/clean-up-your-code-how-to-create-your-own-c-code-style
#cleancode #codestyle
Unity Blog
Clean up your code: How to create your own C# code style | Unity Blog
While there’s more than one way to format Unity C# code, agreeing on a consistent code style for your project enables your team to develop a clean, readable, and scalable codebase. In this blog, we provide some guidelines and examples you can use to develop…
👍2
10 minutes to review the quality of any Unity project
A good read, and I've never seen a post regarding this topic before. It doesn't seem to come in handy for most developers in terms of real reviews of many projects, but it's definitely helpful to establish your own rules and guidelines for your projects.
https://medium.com/@wondrous_aqua_toad_341/10-minutes-to-review-the-quality-of-any-unity-project-6f7ce78f26fd
#review
A good read, and I've never seen a post regarding this topic before. It doesn't seem to come in handy for most developers in terms of real reviews of many projects, but it's definitely helpful to establish your own rules and guidelines for your projects.
https://medium.com/@wondrous_aqua_toad_341/10-minutes-to-review-the-quality-of-any-unity-project-6f7ce78f26fd
#review
Medium
10 minutes to review the quality of any Unity project
I will share my approach to get a high-level overview of the quality of any Unity project.
👍6
Premature Optimization
The main point which I also always repeat in my own blog posts: profile first. Optimization might not even be needed in the first place. And without the baseline you can't even tell whether changes improved the performance or not.
https://youtu.be/tKbV6BpH-C8
#optimization
The main point which I also always repeat in my own blog posts: profile first. Optimization might not even be needed in the first place. And without the baseline you can't even tell whether changes improved the performance or not.
https://youtu.be/tKbV6BpH-C8
#optimization
YouTube
Premature Optimization
When should you optimize your code?
Access to code examples, deleted scenes, song names and more at https://www.patreon.com/codeaesthetic
Access to code examples, deleted scenes, song names and more at https://www.patreon.com/codeaesthetic
👍5
Everyday Unity
The Cost Of async/await On The Build Size Knowing how async/await works under the hood, I was interested in understanding the impact on the build size, as the compiler does its magic and for each async method generates the state machine consisting of hundreds…
In my blog post about the build size I used the build option Faster(smaller) builds to greatly reduce the size of code generation with IL2CPP.
In our company we had a chance to have a meeting with Unity engineers. At that time I asked what does this build option do under the hood and what drawbacks it has. But got no answer. Now the answer is in the docs:
When the “Faster (smaller) builds” setting is enabled only the single fully sharable version of generic code is compiled. This reduces the number of methods generated, reducing compile time and build size, but comes at the expense of runtime performance.
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
#generic #genericsharing
In our company we had a chance to have a meeting with Unity engineers. At that time I asked what does this build option do under the hood and what drawbacks it has. But got no answer. Now the answer is in the docs:
When the “Faster (smaller) builds” setting is enabled only the single fully sharable version of generic code is compiled. This reduces the number of methods generated, reducing compile time and build size, but comes at the expense of runtime performance.
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
#generic #genericsharing
Unity3D
Unity - Manual: Scripting restrictions
👍8
Leveraging SerializeReference for Flexible Commands in Unity Game Development
There commands are bound via the inspector. In one of our previous projects, we employed a similar approach, but the commands were bound to events in the code within the composition root through a DI container.
https://medium.com/@gbrosgames/leveraging-serializereference-for-flexible-commands-in-unity-game-development-614e336b03b9
#command
There commands are bound via the inspector. In one of our previous projects, we employed a similar approach, but the commands were bound to events in the code within the composition root through a DI container.
https://medium.com/@gbrosgames/leveraging-serializereference-for-flexible-commands-in-unity-game-development-614e336b03b9
#command
Medium
Leveraging SerializeReference for Flexible Commands in Unity Game Development
The Power of SerializeReference, Command Patterns, and Conditions
👍2🔥2
YetAnotherHttpHandler: YetAnotherHttpHandler brings the power of HTTP/2 (and gRPC) to Unity and .NET Standard.
From the developers of UniTask
https://github.com/Cysharp/YetAnotherHttpHandler
#http #networking
From the developers of UniTask
https://github.com/Cysharp/YetAnotherHttpHandler
#http #networking
GitHub
GitHub - Cysharp/YetAnotherHttpHandler: YetAnotherHttpHandler brings the power of HTTP/2 (and gRPC) to Unity and .NET Standard.
YetAnotherHttpHandler brings the power of HTTP/2 (and gRPC) to Unity and .NET Standard. - Cysharp/YetAnotherHttpHandler
👍6👎1
Everyday Unity
Trying out new Unity API: BatchRendererGroup The goal of this post is to look at the new BatchRendererGroup API (BRG) and implement the minimal BRG example, so it is easier to understand how to work with it. Then gradually add more complex functionality.…
BatchRendererGroup sample: Achieve high frame rate even on budget devices
I wrote my own post about BRG and creating a sample year and a half ago when the documentation page was still empty. It took quite a while to figure out how to work with BRG by experimenting with code.
After some time, they filled up the documentation, but I still found it insufficient to get started with BRG without much effort. It's great to see a better sample and a very detailed blog post about it, even with such a significant delay after the initial announcement of BRG.
You can also check my blog post if you haven't yet, but the new one by Unity is more relevant now with more details and a bigger sample.
https://blog.unity.com/engine-platform/batchrenderergroup-sample-high-frame-rate-on-budget-devices
Repo: https://github.com/Unity-Technologies/brg-shooter
My sample: https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids/
My post: https://gamedev.center/trying-out-new-unity-api-batchrenderergroup/
#brg #instancing
I wrote my own post about BRG and creating a sample year and a half ago when the documentation page was still empty. It took quite a while to figure out how to work with BRG by experimenting with code.
After some time, they filled up the documentation, but I still found it insufficient to get started with BRG without much effort. It's great to see a better sample and a very detailed blog post about it, even with such a significant delay after the initial announcement of BRG.
You can also check my blog post if you haven't yet, but the new one by Unity is more relevant now with more details and a bigger sample.
https://blog.unity.com/engine-platform/batchrenderergroup-sample-high-frame-rate-on-budget-devices
Repo: https://github.com/Unity-Technologies/brg-shooter
My sample: https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids/
My post: https://gamedev.center/trying-out-new-unity-api-batchrenderergroup/
#brg #instancing
Unity
BatchRendererGroup sample: Achieve high frame rate even on budget devices
Achieve a high frame rate on a budget phone using GLES 3.0 with BatchRendererGroup, C# Job System, and the Burst compiler.
👍4
Is .NET 8 performant enough?
Comparison of .NET 8 and Burst performance
https://meetemq.com/2023/09/18/is-net-8-performant-enough/
#performance
Comparison of .NET 8 and Burst performance
https://meetemq.com/2023/09/18/is-net-8-performant-enough/
#performance
Meetemq
Is .NET 8 performant enough?
While I’m experementing on making my execution environment for C++/C# interop I became curious about the performance of .NET 8 (under CoreCLR, not Mono). Maybe I can use it without Burst and transition via P/Invoke at all? Test suite Thankfully there’s already…
👍2