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
</br>All platforms require a functioning Swift toolchain. Click a platform above for setup information.
18
18
</br>¹Windows support for Swift and Swift Package Manager is in development. Latest Swift toolchain recommended.
19
-
</br>²Developed and tested using Ubuntu (debian). Fedora compatibility is unknown.
19
+
</br>²Developed and tested using Ubuntu (Debian). Fedora compatibility is unknown.
20
20
</br>³Targeting recent versions of Safari, FireFox, Edge, and Chrome.
21
21
</sub>
22
22
23
23
## About
24
-
GateEngine is designed to give game developers access to approachable and intitive APIs to build a game.
24
+
GateEngine is designed to give game developers access to approachable and intuitive APIs to build a game.
25
25
26
26
### Math
27
27
GateEngine has a custom math library completely coded in Swift. GameMath allows developers to write math functions using a spoken language style API. GameMath uses context aware types like `Position3`, `Direction3`, and `Size3` instead of a catch all `vector` type. This adds an addition layer of understanding to APIs because arguments have inherent context.
@@ -36,15 +36,15 @@ let halfway = source.interpolated(to: destination, .linear(0.5))
36
36
```
37
37
38
38
### Resources
39
-
GateEngine has a simple and intuitive resource loading and caching API. Resources can be constructed instantly and are non-blocking. The reference returned is a cache handle and creating multiplke instance of the same resource will return the same cache handle. This allows you to not have to worry about managing your resources; you can simply create one whenever you need.
39
+
GateEngine has a simple and intuitive resource loading and caching API. Resources can be constructed instantly and are non-blocking. The reference returned is a cache handle and creating multiple instance of the same resource will return the same cache handle. This allows you to not have to worry about managing your resources; you can simply create one whenever you need.
40
40
```swift
41
41
// Load geometry
42
-
letgemomtry=Geometry(path: "model.obj")
42
+
letgeometry=Geometry(path: "model.obj")
43
43
44
44
// Reused the same cache as above. No load required.
45
45
let theSameGeometry =Geometry(path: "model.obj")
46
46
```
47
-
A resource state lets you know when a reosurce is ready to be accessed. In many places the resource state check is handled automatically, like when rendering. The renderer will simply skip resources that arent available.
47
+
A resource state lets you know when a resource is ready to be accessed. In many places the resource state check is handled automatically, like when rendering. The renderer will simply skip resources that aren't available.
48
48
```swift
49
49
if resource.state == .ready {
50
50
// ready to be accessed
@@ -53,15 +53,15 @@ if resource.state == .ready {
53
53
54
54
Error handling is tucked away. A resource failing to load is usually a development error in games, not a runtime error. As such writing do-try-catch for every resource becomes tedious. GateEngine places errors in the resource state which allows you to simply code the game as if the resource was simply a value type.
55
55
56
-
But if you would like to design a failable resource handling you can do so by checking for the error:
56
+
But if you would like to design a fail-able resource handling you can do so by checking for the error:
57
57
```swift
58
-
ifcase .failed(let error) =resoruce.state {
58
+
ifcase .failed(let error) =resource.state {
59
59
// This error was already output as a warning
60
60
}
61
61
```
62
62
63
63
### Rendering
64
-
GatEngine supports native rendering backends like DirectX, Metal, and OpenGL. But you will not need to interact with them directly becuase GateEngine uses a high level rendering API designed to be flexible and customizable. Rendering is done in the order things are added allowing you to easily reason about the outcome.
64
+
GatEngine supports native rendering backends like DirectX, Metal, and OpenGL. But you will not need to interact with them directly because GateEngine uses a high level rendering API designed to be flexible and customizable. Rendering is done in the order things are added allowing you to easily reason about the outcome.
65
65
66
66
67
67
```swift
@@ -81,14 +81,14 @@ GateEngine uses a custom designed Swift based shader language. This shader langu
81
81
82
82
For high level rendering, shaders are handled automatically and there's no need to make any.
83
83
```swift
84
-
// "Vertex Colors" vertex shader writen in Swift
84
+
// "Vertex Colors" vertex shader written in Swift
85
85
let vsh =VertexShader()
86
86
let mvp = vsh.modelViewProjectionMatrix
87
87
let vertexPosition = vsh.input.geometry(0).position
88
88
vsh.output.position= mvp *Vec4(vertexPosition, 1)
89
89
vsh.output["color"] = vsh.input.geometry(0).color
90
90
91
-
// "Tinted Texture" fragment shader writen in Swift
91
+
// "Tinted Texture" fragment shader written in Swift
92
92
let fsh =FragmentShader()
93
93
let sample = fsh.channel(0).texture.sample(
94
94
at: fsh.input["texCoord0"],
@@ -141,29 +141,44 @@ Discord is also a great place to ask questions or show off your creations.
GateEngine started it's life in 2016 as a "for fun" project that used the typical strategy, for hobby game engine projects, of high performance and small footprint. It used a basic scene graph and only worked on Apple devices.
144
+
GateEngine started its life in 2016 as a "for fun" project that used the typical strategy, for hobby game engine projects, of high performance and small footprint. It used a scene graph and only worked on Apple devices.
After years of frustration over the amount of time spent building games using "optimal" code, I decided to try making an engine that focused on making the process of building a game more intuitive. This lead to a custom math library that uses spoken language APIs instead like:
147
-
```swift
148
-
let newPosition = position.moved(units, toward: direction)
149
-
```
150
-
A high level renderer which allows loading content with a single initializer:
151
-
```swift
152
-
let gpuReadyMesh =Geometry(path: "model.obj")
153
-
let gpuReadyTexture =Texture(path: "image.png")
154
-
```
155
-
A rendering API that uses containers that allow layering style that's easy to reason about:
156
-
```swift
157
-
var canvas =Canvas()
148
+
I eventually created a deferred renderer, which is a technique that can reduce work for extremely complicated triple-A games. At the time I thought this was the greatest thing ever...
After several years of slowly adding and replacing more and more APIs with approachable and fun ones, GateEngine was born. This repository is a fresh project and I'm slowly moving over features from my private engine, while fixing things that are less polished along the way.
160
+
I eventually added skinning and UI. I created a 3D model of myself as a test and found some old game characters online as well.
At this point the engine was just a graphics simulation. And it's here where I started the re-writes...
165
+
166
+
I needed to actually build the "engine" part. Drawing stuff is actually a fairly small portion of what a game engine does.
167
+
I eventually learned about collision and different data techniques like Entity, Component, System.
168
+
169
+
Developing an engine is a large learning process. Every time you come up with a good way to do things, you will come up with a better way before you're done implementing the previous way. The process can be very demotivating, especially if you're on a schedule, such as trying to make money from it. But for me this was still just for fun.
170
+
171
+
Slowly, my skill at making engines caught up to the designs I was creating and GateEngine began to stabilize. But it was at this point that I realized I wasn't making any games. I was just building tech demos.
172
+
173
+
So I decided on my first 3D game. Espionage is a 3D stealth action game that I'm still working on today. It's inspired by the games I grew up with, and it's the kind of game I always wanted to make.
0 commit comments