Skip to content

Commit 66ad9a3

Browse files
committed
Create 2025-07-27-why-i-write-my-own-engine.md
1 parent 07c5772 commit 66ad9a3

File tree

1 file changed

+171
-0
lines changed

1 file changed

+171
-0
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
title: "Why I Write My Own Engine"
3+
description: "A deep dive into the motivations, structure, and philosophy behind building a custom engine from scratch. Why not Unity, Godot, or Bevy?"
4+
date: 2025-07-26 23:50:00 +0200
5+
categories: [devlog, terravox]
6+
tags: [custom-engine, rust, godot, bevy, modding, indie-dev, architecture]
7+
toc: true
8+
---
9+
10+
This is not a tutorial. It's not a guide. It's a reflection.
11+
12+
Why would someone choose to write their own engine in 2025 - when Unity, Godot, Unreal, and Bevy already exist? Here's my answer, based on experience and intent.
13+
14+
---
15+
16+
## The Real Reason: Understanding
17+
18+
I want to know **how everything works**.
19+
Not just call `move_and_collide()` or use high-level physics magic - I want to understand what happens under the hood:
20+
21+
- How collisions are resolved.
22+
- How rendering works.
23+
- How ECS should actually behave.
24+
- How memory is used in real-time.
25+
- Why certain things break.
26+
27+
The deeper I go, the more I enjoy it. It's not about reinventing the wheel - it's about **knowing how to shape it**.
28+
29+
---
30+
31+
## The Journey So Far
32+
33+
My project started like many others - one big monolithic codebase where **game and engine were the same**. It worked... until it didn't.
34+
35+
When I tried to add **modding support**, I realized the architecture was wrong. I couldn't build flexible systems without splitting it all up.
36+
37+
So I started over. From zero. Not because I failed, but because I **learned what I really needed**.
38+
39+
---
40+
41+
## Starting Over - But Smarter
42+
43+
I created a new clean structure:
44+
45+
- `engine_core`: the engine internals (some parts currently use Bevy).
46+
- `engine_api`: a clean interface for modding (no Bevy dependency).
47+
- `game`: basic game (like main menu), loads code-based mods.
48+
- `game_creative`: the main creative game mode, written *on top* of my own API - just like a mod.
49+
50+
Now, the API evolves **as I need it**:
51+
52+
- Need logging? Add logging to the engine and expose it in the API.
53+
- Need blocks? Same.
54+
- Need mod registry? Done.
55+
56+
The result: the engine grows *with the game*, and the API always reflects real usage.
57+
58+
---
59+
60+
## The Game is a Mod
61+
62+
In my system, the game itself is written as a mod using my API.
63+
This approach makes the API better, because I'm its main user.
64+
65+
Yes, the engine still knows about the player, network, etc. - this isn't a general-purpose engine. But these built-in features are exposed via API, so they can be extended by mods too.
66+
67+
And yes - I plan to eventually **replace all Bevy parts** (ECS, rendering, etc.) with my own. Step by step. No rush.
68+
69+
---
70+
71+
## Not Everything Is Mine (Yet)
72+
73+
I don't rewrite everything from scratch immediately - because I want to **release playable builds** sooner, not in 10 years.
74+
75+
That's why:
76+
77+
- I use parts of Bevy (ECS, renderer) **as temporary layers**.
78+
- My API doesn't depend on Bevy - it depends on the engine.
79+
- So when I replace Bevy internals, the API stays stable.
80+
81+
Moral of the story: **I use what's practical**, but I design for control and long-term evolution.
82+
83+
---
84+
85+
## Why Not Just Use Godot?
86+
87+
I've used **Godot for 3000+ hours**.
88+
89+
I still think it's the best choice for solo devs and indie teams. It's better than Unity (IMO) in every way that matters: open source, lightweight, no corporate bloat.
90+
91+
I even used GDExt (Rust + Godot) to avoid GDScript's slowness.
92+
93+
But eventually... I wanted to go lower. Understand more.
94+
I stopped using editors entirely. No visual scripting. No scenes.
95+
96+
Just Rust. Just code. Just logic.
97+
98+
---
99+
100+
## But Why Care About Others Understanding Your Code?
101+
102+
Because I want to build a team - even a small one.
103+
104+
I want other devs to look at my project and say:
105+
**“I get it. I can help. Let's build this.”**
106+
107+
So I write cleanly, I comment key parts, I document the API, and I think in terms of:
108+
109+
- Future-proofing.
110+
- Mod support.
111+
- Making it extensible.
112+
113+
And if no one joins? That's fine too. As long as *I* can return in a few months and still understand what I wrote.
114+
115+
---
116+
117+
## API Philosophy
118+
119+
- The engine is closed-source.
120+
- The API is open-source.
121+
- The mods use only the API - not internal engine details.
122+
123+
That means: **modders get powerful tools**, but I still control core logic and stability.
124+
And since I write the creative mode using the same API, I know it works.
125+
126+
This isn't theoretical. It's real. I'm using it daily.
127+
128+
---
129+
130+
## My Goal
131+
132+
I want to release builds. Real ones.
133+
With survival systems, world simulation, thousands of blocks, creatures, and player-driven evolution.
134+
135+
But I also want this to be a platform. A world where:
136+
137+
- Mods thrive.
138+
- Everything is deeply customizable.
139+
- There's freedom - but within solid structure.
140+
141+
---
142+
143+
## Final Note: I'm Not Preaching
144+
145+
I'm not telling you to abandon Unity or Godot.
146+
I'm not saying you *must* build your own engine.
147+
148+
If your goal is to finish a game - **use the tools that help you do that**.
149+
150+
But if your goal is to understand the foundations -
151+
To go deeper -
152+
To remove the magic -
153+
154+
Then hey, welcome to the deep end. Bring snacks.
155+
156+
---
157+
158+
## Need Help? Want to Collaborate?
159+
160+
If you're into low-level systems, modding, voxel engines, or weird simulation stuff -
161+
Feel free to reach out. I'm always open to good conversation and code.
162+
163+
---
164+
165+
## Contacts
166+
167+
- **GitHub:** [@ogyrec-o](https://github.com/ogyrec-o)
168+
- **Signal:** `0546e47e337a19217a59d92043be4433d93a23946a8d171dccfdab393781e9f77a`
169+
- **Discord:** `ogyrec_`
170+
- **TerraVox Discord:** [https://discord.gg/zKY3Tkk837](https://discord.gg/zKY3Tkk837)
171+
- **Email:** [email protected]

0 commit comments

Comments
 (0)