Skip to main content
  1. Quick Notes & Explanations/

10. MessagePipe vs. UnityEvent

·1 min· loading · loading ·

In our games, we use structures like delegates, events, UnityEvent, etc., for instant communication in rapidly changing scenarios. However, because these occur and disappear “instantly,” they cause “instant” Garbage Allocation followed by Garbage Collection.

Such sudden spikes and drops in GC directly impact our game’s FPS, as discussed before.

MessagePipe is a high-performance in-memory/distributed messaging framework for .NET and Unity.

It supports all Pub/Sub use cases, mediator patterns for CQRS, Prism EventAggregator (V-VM separation), IPC (Inter-Process Communication)-RPC, and other scenarios.

It also works in accordance with the following principles:

  • Dependency Injection
  • Async/Await
  • Singleton/Scoped
  • In-memory/Inter-process/Distributed
  • Filter pipeline
  • Better events
  • Keyed/Keyless
  • Buffered/Bufferless
  • Broadcast/Response (+many)

Please take a look:

https://github.com/Cysharp/MessagePipe

Reply by Email

Related

9. What is UniTask, and What Is It Not?
·1 min· loading · loading
UniTask is a framework specifically developed for Unity. Like VContainer, it’s a system that preemptively solves potential issues we might encounter in Unity. It is not a new architecture or a newly discovered technology.
8. Synchronous and Asynchronous Concepts
·2 mins· loading · loading
Synchronous Programming Most of the programs we write execute the code from top to bottom in the order it was written. Everything is done sequentially. For example, this code illustrates this:
7. What Are Zenject and VContainer Not?
·3 mins· loading · loading
All of the systems mentioned above are frameworks. While I’ve provided examples specific to Unity, we could also include native C# frameworks like AutoFac, but these are systems adapted and optimized specifically for Unity.
6. What is SOLID, and What is It Not?
·1 min· loading · loading
The following five principles, which we have previously explained, form our SOLID principles: Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle I won’t redefine these terms.
5. Choosing the Appropriate Architecture
·4 mins· loading · loading
After the reminders about optimization in the first three sections, we can bring together the principles from the fourth section to develop an architecture that can be applied to our project.
4. Design Pattern Examples
·10 mins· loading · loading
We can categorize Design Patterns under 3 main headings: Architectural Patterns Examples: MVC (Model-View-Controller), SOLID, MVVM… Design Patterns It is a specific Architectural Pattern, such as Singleton. Using it alone in a project is not sufficient, and optimization with several different patterns is necessary.