Mercurial > games > semicongine
annotate README.md @ 755:8817b99ae16e
add: some reminders
author | Sam <sam@basx.dev> |
---|---|
date | Sat, 24 Jun 2023 21:04:13 +0700 |
parents | 8a1c04f64f3d |
children | b0810305e5d2 |
rev | line source |
---|---|
750 | 1 # Semicongine |
502 | 2 |
469 | 3 Hi there |
4 | |
674
496b328faa43
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
663
diff
changeset
|
5 This is a little game engine, mainly trying to wrap around vulkan and the |
496b328faa43
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
663
diff
changeset
|
6 operating system's windowing, input and audio system. I am using the last |
496b328faa43
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
663
diff
changeset
|
7 programming language you will ever need, [Nim](https://nim-lang.org/) |
502 | 8 |
750 | 9 ## Building |
509 | 10 |
750 | 11 Requires Nim to be installed and `glslangValidator` to be downloaded to the |
12 directory of the main compilation file (e.g. into `examples/` in order to | |
556
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
13 compile the examples). It can be downloaded at |
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
14 https://github.com/KhronosGroup/glslang/releases/. |
506
b159fcdd36b9
add: some build instructions for windows
Sam <sam@basx.dev>
parents:
502
diff
changeset
|
15 |
750 | 16 Run `nim help` to see a list of available build commands. |
509 | 17 |
750 | 18 ## Roadmap |
502 | 19 |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
20 Here a bit to see what has been planed and what is done already. Is being |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
21 updated frequently (marking those checkboxes just feels to good to stop working). |
502 | 22 |
23 Rendering: | |
24 | |
25 - [x] Vertex attributes, vertex data | |
26 - [x] Shaders (allow for predefined and custom shaders) | |
27 - [x] Uniforms | |
28 - [x] Per-instance vertex attributes (required to be able to draw scene graph) | |
580 | 29 - [x] Fixed framerate |
591 | 30 - [x] Instanced drawing (currently can use instance attributes, but we only support a single instance per draw call) |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
31 - [x] Textures |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
32 - [x] Materials (vertices with material indices) |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
33 - [ ] Allow different shaders (ie pipelines) for different meshes |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
34 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
35 Required for 3D rendering: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
36 |
502 | 37 - [ ] Depth buffering |
750 | 38 - [ ] Mipmaps |
502 | 39 |
40 Asset handling: | |
750 | 41 |
42 - [x] Resource loading - [x] Mod/resource-pack concept - [x] Load from directory - [x] Load from zip - [x] Load from exe-embeded | |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
43 - [x] Mesh/material files (glTF, but incomplete, not all features supported) |
682
9767dec81193
did: update progress, change roadmap to use glTF instead of OBJ (this seems to be super cool!)
Sam <sam@basx.dev>
parents:
677
diff
changeset
|
44 - [x] Image files (BMP RGBA) |
9767dec81193
did: update progress, change roadmap to use glTF instead of OBJ (this seems to be super cool!)
Sam <sam@basx.dev>
parents:
677
diff
changeset
|
45 - [x] Audio files (AU) |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
46 - [x] API to transform/recalculate mesh data |
502 | 47 |
580 | 48 Other (required for alpha release): |
750 | 49 |
580 | 50 - [x] Config files ala \*.ini files (use std/parsecfg) |
502 | 51 - [x] Mouse/Keyboard input handling |
52 - [x] X11 | |
53 - [x] Win32 | |
631 | 54 - [x] Enable/disable hardware cursor |
750 | 55 - [x] Fullscreen mode + switch between modes - [x] Linux - [x] Window |
56 - [x] Audio playing - [x] Linux - [x] Windows Waveform API | |
648 | 57 - [ ] Generic configuration concept (engine defaults, per-user, etc) |
502 | 58 - [ ] Input-mapping configuration |
562
bfb75f2cd493
add: really need telemetry at some point
Sam <sam@basx.dev>
parents:
556
diff
changeset
|
59 - [ ] Telemetry |
750 | 60 - [x] Add simple event logging service |
61 - [ ] Add exception reporting | |
502 | 62 |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
63 Other important features: |
750 | 64 |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
65 - [ ] Multisampling |
735
acd53dbe1247
this: feels sooooo good, font rendering working great (for a novice at least)
Sam <sam@basx.dev>
parents:
693
diff
changeset
|
66 - [x] Text rendering |
750 | 67 - [x] Animation system |
502 | 68 - [ ] Sprite system |
69 - [ ] Particle system | |
755 | 70 - [ ] Sound fading |
71 - [ ] Named entity components | |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
72 |
750 | 73 Other less important features: |
74 | |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
75 - [ ] Viewport scaling (e.g. framebuffer resolution != window resolution) |
643 | 76 - [ ] Query and display rendering information from Vulkan? |
693
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
77 - [ ] Game controller input handling |
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
78 - [ ] Allow multipel Uniform blocks |
86048c6ed6fd
did: restructure roadmap a bit, update progress
Sam <sam@basx.dev>
parents:
684
diff
changeset
|
79 - [ ] Documentation |
580 | 80 |
81 Quality improvments: | |
82 | |
83 - [x] Better scenegraph API | |
84 - [x] Better rendering pipeline API | |
85 | |
86 Build-system: | |
750 | 87 |
580 | 88 - [x] move all of Makefile to config.nims |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
89 |
750 | 90 # Documentation |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
91 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
92 Okay, here is first quick-n-dirty documentation, the only purpose to organize my thoughts a bit. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
93 |
750 | 94 ## Engine parts |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
95 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
96 Currently we have at least the following: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
97 |
750 | 98 - Rendering: rendering.nim vulkan/\* |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
99 - Scene graph: entity.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
100 - Audio: audio.nim audiotypes.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
101 - Input: events.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
102 - Settings: settings.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
103 - Meshes: mesh.nim |
684 | 104 - Math: math/\* |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
105 - Telemetry: telemetry.nim (wip) |
684 | 106 - Resources (loading, mods): resources.nim |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
107 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
108 Got you: Everything is wip, but (wip) here means work has not started yet. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
109 |
750 | 110 ## Handling of assets |
663 | 111 |
112 A short description how I want to handle assets. | |
113 | |
114 Support for file formats (super limited, no external dependencies, uses quite a bit of space, hoping for zip): | |
115 | |
116 - Images: BMP | |
117 - Audio: AU | |
684 | 118 - Mesh: glTF (\*.gld) |
663 | 119 |
120 In-memory layout of assets (everything needs to be converted to those while loading): | |
121 | |
122 - Images: 4 channel with each uint8 = 32 bit RGBA, little endian (R is low bits, A is high bits) | |
123 - Audio: 2 Channel 16 bit signed little endian, 44100Hz | |
124 - Meshes: non-interleaved, lists of values for each vertex, one list per attribute | |
125 | |
750 | 126 ## Configuration |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
127 |
684 | 128 Or: How to organize s\*\*t that is not code |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
129 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
130 Not sure why, but this feels super important to get done right. The engine is |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
131 being designed with a library-mindset, not a framework mindset. And with that, |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
132 ensuring the configuration of the build, runtime and settings in general |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
133 becomes a bit less straight-forward. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
134 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
135 So here is the idea: There are three to four different kinds of configurations |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
136 that the engine should be able to handle: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
137 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
138 1. Build configuration: Engine version, project name, log level, etc. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
139 2. Runtime engine/project settings: Video/audio settings, telemetry, log-output, etc. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
140 3. Mods: Different sets of assets and configuration to allow easy testing of different scenarios |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
141 4. Save data: Saving world state of the game |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
142 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
143 Okay, let's look at each of those and how I plan to implement them: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
144 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
145 **1. Build configuration** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
146 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
147 **2. Runtime settings** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
148 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
149 This is mostly implemented already. I am using the Nim module std/parsecfg. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
150 There is also the option to watch the filesystem and update values at runtime, |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
151 mostly usefull for development. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
152 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
153 The engine scans all files in the settings-root directory and builds a |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
154 settings tree that can be access via a setting-hierarchy like this: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
155 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
156 setting("a.b.c.d.e") |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
157 |
750 | 158 `a.b` refers to the settings directory `./a/b/` (from the settings-root) |
159 `c` refers to the file `c.ini` inside `./a/b/` | |
160 `d` refers to the ini-section inside the file `./a/b/c.ini` | |
161 `e` refers to the key inside section `d` inside the file `./a/b/c.ini` | |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
162 |
750 | 163 `a.b` are optional, they just allow larger configuration trees. |
164 `d` is optional, if it is not give, `e` refers to the top-level section | |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
165 of the ini-file. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
166 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
167 **3. Mods** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
168 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
169 A mod is just a collection of resources for a game. Can maybe switched from |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
170 inside a game. Current mod can be defined via "2. Runtime settings" |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
171 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
172 I want to support mods from: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
173 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
174 a) a directory on the filesystem |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
175 b) a zip-file on the filesystem |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
176 c) a zip-file that is embeded in the executable |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
177 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
178 The reasoning is simple: a) is helpfull for development, testing of |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
179 new/replaced assets, b) is the default deployment with mod-support and c) is |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
180 deployment without mod-support, demo-versions and similar. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
181 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
182 Should not be that difficult but give us everything we ever need in terms of |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
183 resource packaging. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
184 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
185 **4. Save data** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
186 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
187 Not too much thought here yet. Maybe we can use Nim's std/marshal module. It |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
188 produces JSON from nim objects. Pretty dope, but maybe pretty slow. However, we |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
189 are indie-JSON here, not 10M of GTA Online JSON: |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
190 https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/ |