The safest way to use DOTS in your MonoBehaviour project

Before I begin with the article, I would like to let you know I'm giving away a free game by subscribing to my mailing list. With that out of the way, let's get it on! The problem is that if you want to leverage the speed of Burst, you have to use a subset of … Continue reading The safest way to use DOTS in your MonoBehaviour project

Some DOTS Utilities: NativeCounter and NativeSum

I haven't shared some utility scripts for a while now. It's about time I do so again. We've been making a game in pure ECS and we have created lots of utilities along the way. Allow me to share to you NativeCounter and NativeSum. We are making a game called City Hall Simulator. It's a … Continue reading Some DOTS Utilities: NativeCounter and NativeSum

About coming up with game code architecture

I ran into a Reddit thread in r/gamedev (can't find it anymore) about a teacher asking what topics are important but least talked about or have few resources so he can make instructional videos about them. Majority of the responses is about code architecture or how to structure code. This got me thinking "maybe I … Continue reading About coming up with game code architecture

Accessing struct fields using reflection without producing garbage

One of the good things we've made in Academia is its serialization or also known as saving/loading. We were able to create a generic writer and reader that can write/read any type of instance. Such framework has not changed much from introduction until release. This is possible using reflection. The following is the gist of … Continue reading Accessing struct fields using reflection without producing garbage

How to run jobs using BufferFromEntity in parallel: Children entities in a hash map

In my previous post, I talked about how to run jobs with ComponentDataFromEntity (CDFE) that writes to a list or a set of values in parallel. This is useful for parent-child relationships where the child entities are maintained in a list on the parent. In this post, I want to share with you a different … Continue reading How to run jobs using BufferFromEntity in parallel: Children entities in a hash map

How to run jobs using ComponentDataFromEntity in parallel

ComponentDataFromEntity<T> is one of the most commonly used API in Unity's Entities package (ECS). At least in our case. It's basically like Dictionary<Entity, T> where T is an IComponentData. You can lookup any component as long as you have the entity owner. You can get a ComponentDataFromEntity<T> for any T in any sytem. The most … Continue reading How to run jobs using ComponentDataFromEntity in parallel

How to add subscribers to Mailchimp within your Unity game

Mailing list is one of the powerful marketing tools for indie devs. You can read Chris Zukowski's posts here and here. One of my favorite books, Perennial Seller by Ryan Holiday, also talked about why a mailing list is important to have if you're a creator that wants to sell. There's a story that when … Continue reading How to add subscribers to Mailchimp within your Unity game

How we did the tutorial system in Academia: School Simulator, Part 3: Putting them all together

In part 2, I discussed how we made the tutorial actions that will be available on the editor. Now we're on the last part (I promise). I'm going to discuss how we put them all together from the SSM framework discussed in part 1 and the actions in part 2. Editor Let me show you … Continue reading How we did the tutorial system in Academia: School Simulator, Part 3: Putting them all together

How we did the tutorial system in Academia: School Simulator, Part 2: Actions

In part 1 of this post, I discussed about the underlying framework used for our tutorial system for Academia. I'll continue it here on how we made the tutorial actions. Locking or unlocking an interaction UI In Unity, there's a base class for all components that makes a UI interactable. It's called Selectable. The components … Continue reading How we did the tutorial system in Academia: School Simulator, Part 2: Actions