You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -189,7 +189,7 @@ Now we've got a mapping of player Entity IDs -> their nicknames and weapons. We
189
189
190
190
I call this type of data _runtime sparse data_.
191
191
192
-
### Avoiding Unity software patents & improving performance while doing it
192
+
### Improving performance
193
193
194
194
Consider our player storage as it stands right now:
195
195
@@ -205,9 +205,7 @@ const Player = struct {
205
205
var players: ArrayList(Player) = .{}; // all players
206
206
```
207
207
208
-
In a perfect world, software patents wouldn't exist. But, in our world, however, Unity makes 20 claims in their software patent covering ECS, including all code we've written above to this point. Luckily, [as the Bevy authors suggest here](https://www.reddit.com/r/rust/comments/pjtpkj/unity_files_patent_for_ecs_in_game_engines_that/hbzaz61/) entity component systems which store components in separate arrays are not affected by this (this is not legal advice)
209
-
210
-
Additionally, because of the way structs get laid out in memory with padding, our players array above would end up having a larger memory footprint than needed. So we actually benefit from using a separate array for every type of data (thanks, Unity!):
208
+
Because of the way structs get laid out in memory with padding, our players array above would end up having a larger memory footprint than needed. So we actually benefit from using a separate array for every type of data (thanks, Unity!):
211
209
212
210
```zig
213
211
var player_names: ArrayList([]const u8) = .{};
@@ -290,9 +288,8 @@ We now start to see _some_ of the things our ECS architecture should solve:
290
288
291
289
Additionally, these are the design principles I've come up with:
292
290
293
-
* Clean-room implementation (I've not read any other ECS implementation code.)
291
+
* Clean-room implementation (I've not read any other ECS implementation code), just working from first-principles as an engineer
294
292
* Solve the problems ECS solves, in a way that is natural to Zig and leverages Zig comptime.
295
-
* Avoid patent infringement upon Unity ECS patent claims.
296
293
* Fast. Optimal for CPU caches, multi-threaded, leverage comptime as much as is reasonable.
297
294
* Simple. Small API footprint, should be natural and fun - not like you're writing boilerplate.
298
295
* Enable other libraries to provide tracing, editors, visualizers, profilers, etc.
0 commit comments