Mercurial > games > semicongine
annotate README.md @ 660:c6414ade79f0
add: new test file to test to do future test with materials etc.
author | Sam <sam@basx.dev> |
---|---|
date | Sun, 07 May 2023 17:42:53 +0700 |
parents | 8599b84f0563 |
children | 9bb3fdbecc52 |
rev | line source |
---|---|
502 | 1 Semicongine |
2 =========== | |
3 | |
469 | 4 Hi there |
5 | |
502 | 6 This is a very simplistic little game engine, mainly trying to wrap around vulkan and the operating system's windowing, input and audio system. |
556
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
7 I am using the last programming language you will ever need, [Nim](https://nim-lang.org/) |
502 | 8 |
509 | 9 Building |
10 -------- | |
11 | |
556
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
12 Requires Nim to be installed and ```glslangValidator``` to be downloaded to the |
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
13 directory of the main compilation file (e.g. into ```examples/``` in order to |
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
14 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
|
15 https://github.com/KhronosGroup/glslang/releases/. |
506
b159fcdd36b9
add: some build instructions for windows
Sam <sam@basx.dev>
parents:
502
diff
changeset
|
16 |
556
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
17 Run ```nim help``` to see a list of available build commands. |
509 | 18 |
502 | 19 Roadmap |
20 ------- | |
21 | |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
22 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
|
23 updated frequently (marking those checkboxes just feels to good to stop working). |
502 | 24 |
25 Rendering: | |
26 | |
27 - [x] Vertex attributes, vertex data | |
28 - [x] Shaders (allow for predefined and custom shaders) | |
29 - [x] Uniforms | |
30 - [x] Per-instance vertex attributes (required to be able to draw scene graph) | |
580 | 31 - [x] Fixed framerate |
591 | 32 - [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
|
33 - [x] Textures |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
34 - [ ] Multisampling |
659 | 35 - [ ] Viewport scaling (e.g. framebuffer resolution != window resolution |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
36 - [ ] 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
|
37 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
38 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
|
39 |
502 | 40 - [ ] Depth buffering |
41 - [ ] Mipmaps | |
42 | |
43 Asset handling: | |
631 | 44 - [ ] Resource concept: load from directory, zip or in-memory-zip, select "mod" as root |
502 | 45 - [ ] Mesh files (Wavefront OBJ, MTL) (use something from sketchfab for testing, https://sketchfab.com/) |
46 - [ ] Image files (BMP RGB + BMP Graysscale for transparency) | |
556
21f15523fda0
add: consistent way to define platform-specific code
Sam <sam@basx.dev>
parents:
534
diff
changeset
|
47 - [ ] Audio files (AU) |
502 | 48 |
580 | 49 Other (required for alpha release): |
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 |
648 | 55 - [x] Fullscreen mode + switch between modes |
56 - [x] Linux | |
57 - [x] Window | |
643 | 58 - [x] Audio playing |
648 | 59 - [x] Linux |
60 - [x] Windows Waveform API | |
61 - [ ] Generic configuration concept (engine defaults, per-user, etc) | |
502 | 62 - [ ] Input-mapping configuration |
562
bfb75f2cd493
add: really need telemetry at some point
Sam <sam@basx.dev>
parents:
556
diff
changeset
|
63 - [ ] Telemetry |
655
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
64 - [x] Add simple event logging service |
648 | 65 - [ ] Add exception reporting |
66 - [ ] Documentation? | |
502 | 67 |
580 | 68 Advanced features (very low priority): |
502 | 69 - [ ] Text rendering |
70 - [ ] Animation system | |
71 - [ ] Sprite system | |
72 - [ ] Particle system | |
643 | 73 - [ ] Query and display rendering information from Vulkan? |
74 - [ ] Game controller input handling? | |
75 - [ ] Allow multipel Uniform blocks? | |
580 | 76 |
77 Quality improvments: | |
78 | |
79 - [x] Better scenegraph API | |
80 - [x] Better rendering pipeline API | |
81 | |
82 Build-system: | |
83 - [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
|
84 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
85 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
86 Documentation |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
87 ============= |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
88 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
89 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
|
90 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
91 Engine parts |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
92 ------------ |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
93 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
94 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
|
95 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
96 - Rendering: rendering.nim vulkan/* |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
97 - 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
|
98 - 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
|
99 - Input: events.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
100 - Settings: settings.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
101 - Meshes: mesh.nim |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
102 - Math: math/* |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
103 - Telemetry: telemetry.nim (wip) |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
104 - Resources/mods: resources.nim (wip) |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
105 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
106 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
|
107 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
108 Configuration |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
109 ------------- |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
110 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
111 Or: How to organize s**t that is not code |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
112 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
113 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
|
114 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
|
115 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
|
116 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
|
117 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
118 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
|
119 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
|
120 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
121 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
|
122 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
|
123 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
|
124 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
|
125 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
126 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
|
127 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
128 **1. Build configuration** |
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 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
131 **2. Runtime settings** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
132 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
133 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
|
134 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
|
135 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
|
136 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
137 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
|
138 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
|
139 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
140 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
|
141 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
142 ```a.b``` refers to the settings directory ```./a/b/``` (from the settings-root) |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
143 ```c``` refers to the file ```c.ini``` inside ```./a/b/``` |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
144 ```d``` refers to the ini-section inside the file ```./a/b/c.ini``` |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
145 ```e``` refers to the key inside section ```d``` inside the file ```./a/b/c.ini``` |
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 ```a.b``` are optional, they just allow larger configuration trees. |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
148 ```d``` is optional, if it is not give, ```e``` refers to the top-level section |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
149 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
|
150 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
151 **3. Mods** |
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 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
|
154 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
|
155 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
156 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
|
157 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
158 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
|
159 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
|
160 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
|
161 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
162 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
|
163 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
|
164 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
|
165 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
166 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
|
167 resource packaging. |
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 **4. Save data** |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
170 |
53e08e6c5ae6
did: a bit of cleanup with the config, also add some documentation
Sam <sam@basx.dev>
parents:
648
diff
changeset
|
171 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
|
172 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
|
173 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
|
174 https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/ |