Analysis update

This commit is contained in:
2026-05-14 13:10:00 +01:00
parent 14e5ccafd5
commit 8ddc31427e
+45 -34
View File
@@ -2,13 +2,13 @@
# Analysis
##
## What is a game engine?
The goal of this project is to build a high performance cross-desktop game engine for 2d games,
When a developer wishes to build a game they generally have 2 options, either they can code the entire game themselves by using a pure rendering library and handling all teh assets etc. themselves, this gives them a lot of control over how the game behaves and can usually also allow them to do a lot of optimizations specific to their idea, but it means they will have to make the coordinate systems and data store, asset management systems etc. all by themselves, on the other hand they could use a game engine.
**What is a game engine?**, the most significant advantage of using game engines when building a game is simplifying development process.
the most significant advantage of using game engines when building a game is simplifying development process.
They do this by allowing the developer to do a lot more out of teh box without having to reinvent the wheel themselves:
@@ -18,13 +18,13 @@ They do this by allowing the developer to do a lot more out of teh box without h
The engine is expected to be built in a low level context (for high performance), but allow using it from a high level simpler environment without losing any of the performance. It should also make the development process of a game easy with any common parts for games implemented and reusable.
^ Kin, W. (2024). Game Engines: Revolutionizing Digital Creativity Across Industries. International Journal of Advancements in Technology, [online] 15(6), pp.12. doi:https://doi.org/10.35841/0976-4860.24.15.318.
^ Kin, Wong (2024). Game Engines: Revolutionizing Digital Creativity Across Industries. International Journal of Advancements in Technology, [online] Available at: https://www.longdom.org/open-access/game-engines-revolutionizing-digital-creativity-across-industries-1100970.html [Accessed 13 May 2026].
##
## Why use computational methods
The same fifty-two cards in a deck can be used to play a bunch of different games by slapping on a new set of rules each time, it is a platform for making and playing games on, similar to what a game engine does. But unlike the standard deck the digital game engine can be used to make much more complex games with way more rules as it doesn't require for the human to keep track of all the different things and how they change every round. This involves maintaining states of hundreds of objects every frame and running tens of such frames every second to give a real time continous input and output. They are still used in a similar manner where the same game engine can be used to make many games by slapping on a new set of rules (systems) & assets. This problem is therefore much more useful if done by using a computational aproach because the engine handles way more entities and objects and their movements, rendering, collision, other custom logic etc. continously. Making it perfect to express such a system algorithmically. Also similar systems exist like godot, unity etc. that use a computational approach to give much more interactiveness to games.
##
## Pre-existing solutions
Here we look into other similar systems (godot, unity) and a framework gosu
@@ -93,40 +93,29 @@ Comparisions of architectures:
- While in a more simple framework like gosu these are all dependant on teh developers implementation.
^ Gosu. (n.d.). Gosu Homepage. [online] Available at: https://www.libgosu.org/ [Accessed 13 May 2026].
^ Unity Docs. (n.d.). Unity Entity Component System concepts. \[online] Available at: https://docs.unity3d.com/Packages/com.unity.entities@6.5/manual/concepts-intro.html [Accessed 13 May 2026]. See sub-links.
^ Godot Engine documentation. (n.d.). Overview of Godots key concepts. \[online] Available at: https://docs.godotengine.org/en/stable/getting_started/introduction/key_concepts_overview.html [Accessed 13 May 2026].
^ Godot Engine documentation. (2026). Godots architecture overview. \[online] Available at: https://docs.godotengine.org/en/stable/engine_details/architecture/godot_architecture_diagram.html [Accessed 13 May 2026].
^ Unity Docs. (n.d.). Unity Entity Component System concepts. [online] Available at: https://docs.unity3d.com/Packages/com.unity.entities@6.5/manual/concepts-intro.html [Accessed 13 May 2026]. See sub-links.
^ Godot Engine documentation. (n.d.). Overview of Godots key concepts. [online] Available at: https://docs.godotengine.org/en/stable/getting_started/introduction/key_concepts_overview.html [Accessed 13 May 2026].
^ Godot Engine documentation. (2026). Godots architecture overview. [online] Available at: https://docs.godotengine.org/en/stable/engine_details/architecture/godot_architecture_diagram.html [Accessed 13 May 2026].
##
## Embedded scripting
Why ruby is great for rapid development for the runtime of this engine:
This engine does not use a UI builder. And so all gameplay logic, entity behaviour, definitions etc. must be implemented directly through code.
Because of this it is important to use a well established language in which teh developer can write their code.
- Dynamic typing. it has almost no type declarations on variables, and duck typing means any object with particular behaviour can be treated the same.
- Expressive syntax. ruby has one of the most expressive syntax that improves code readability by a lot, it allows operator overloading, very clean dsl structures, minimal puntuation neccessary, and a lot of syntactic shortcuts.
- Very rich standard library. teh ruby std lib has a lot of helpers for json, sockets, networking, file management, multithreading, regex etc.
- It also has a lot of inbuilt datatypes with helper methods that allow doing a lot of stuff. it has integers with no hard maximum, floating point numbers, strings and arrays, but it also has symbols, hashmaps and regex etc. for much faster development.
Embedded scripting languages are programming lanaguges that are designed to be embedded in a host programming language. The embedded language is often an interpreted language which teh host is a compiled static typed language. They allow adding code to teh program that can be modified and interpreted at runtime. They are often used to extend on teh functionality of teh host language. And they also allow using functions defined in the host language which are usually much more performance optimized.
And as its official website itself states, ruby is easy to write, easy to read with natural syntax like spoken language.
They are usually very lightweight (so that teh final binary doesn't get bloated and runs fast enough). They are very useful for cuztom DSL/syntax.
> Ruby's expressive syntax allows you to write complex logic concisely. By leveraging powerful features like metaprogramming and blocks, you can reduce repetition and focus on solving core problems. With rich testing frameworks, you can maintain quality while achieving rapid development cycles.
And according to [this technical aticle](https://caiorss.github.io/C-Cpp-Notes/embedded_scripting_languages.html) they are particularly useful for game engines.
> Ruby has a simple and intuitive syntax that reads like natural language. By eliminating complex symbols and verbose constructs, Ruby's design philosophy allows you to express what you want directly. With minimal boilerplate and high readability, it's friendly to beginners and maintainable for experienced developers.
We can also see a list [list](https://dbohdan.github.io/embedded-scripting-languages/) of embedded scripting languages that exist, common ones being Lua, javascript variants, squirrel, and ruby variants (mruby in particular).
For these reasons and my personal familiarity with the languge i've planned to use ruby as the languge in which the game engine is written code for.
More specifically we will use the `mruby` version as it allows for embedding a ruby VM into our engine that can run the scripts without needing an external interpreter.
Mruby is a very lightwieght impleemntation of teh ruby runtime and also supports semi-compiled bytecodes.
The engine could compile the developers scripts into mruby bytecode when building the application and when it is to be used the teh mruby vm can run these bytecodes.
Other popular options for embedded languages include Lua (used by neovim & factorio), which is very commonly used in similar systems, but mruby seems to do the job well enough.
This [list](https://dbohdan.github.io/embedded-scripting-languages/) also shows other options we could have chosen for embedded languages.
These all have a C-ABI, meaning they can be used by almost any compiled language.
^ Rordrigues, C. (2023). Embedded Scripting Languages. [online] caiorss.github.io. Available at: https://caiorss.github.io/C-Cpp-Notes/embedded_scripting_languages.html [Accessed 13 May 2026].
^ Github. (2022). Embedded scripting languages. [online] Available at: https://dbohdan.github.io/embedded-scripting-languages/ [Accessed 13 May 2026].
^ Mruby.org. (2026). mruby - Lightweight Ruby. [online] Available at: https://mruby.org/ [Accessed 13 May 2026].
^ Ruby (2019). Ruby Programming Language. [online] Ruby-lang.org. Available at: https://www.ruby-lang.org/en/ [Accessed 13 May 2026].
##
## Target users
The target users for this project could be one of 2 categories:
@@ -143,7 +132,7 @@ The target users for this project could be one of 2 categories:
- Using such an engine means that the students could be taught about paradigms like ecs and OOP in a simple environment.
- They would also be learning ruby, which is an arguably very good for rapid prototyping due to its forgiving and highly readable syntax.
##
## Survey
Survey:
@@ -183,13 +172,11 @@ how important is it to make underlying architectures like ECS, OOP, etc. obvious
what systems are very important to be inbuilt in a game engine to give the students some support?
##
Summarization of survey results and its limitations
##
## What more is needed?
Other features that a game engine should have (need to go in depth)
Other features that a game engine should have/has (need to go in depth)
- physics (forces, mass, movement and collisions)
- Localization
@@ -202,6 +189,30 @@ Other features that a game engine should have (need to go in depth)
- network interface
- persistence store
## Embedded scripting language choice.
Why ruby is great for development for the runtime of this engine:
- Dynamic typing. it has almost no type declarations on variables, and duck typing means any object with particular behaviour can be treated the same.
- Expressive syntax. ruby has one of the most expressive syntax that improves code readability by a lot, it allows operator overloading, very clean dsl structures, minimal puntuation neccessary, and a lot of syntactic shortcuts.
- Very rich standard library. teh ruby std lib has a lot of helpers for json, sockets, networking, file management, multithreading, regex etc.
- It also has a lot of inbuilt datatypes with helper methods that allow doing a lot of stuff. it has integers with no hard maximum, floating point numbers, strings and arrays, but it also has symbols, hashmaps and regex etc. for much faster development.
And as its official website itself states, ruby is easy to write, easy to read with natural syntax like spoken language.
> Ruby's expressive syntax allows you to write complex logic concisely. By leveraging powerful features like metaprogramming and blocks, you can reduce repetition and focus on solving core problems. With rich testing frameworks, you can maintain quality while achieving rapid development cycles.
> Ruby has a simple and intuitive syntax that reads like natural language. By eliminating complex symbols and verbose constructs, Ruby's design philosophy allows you to express what you want directly. With minimal boilerplate and high readability, it's friendly to beginners and maintainable for experienced developers.
For these reasons and my personal familiarity with the languge i've planned to use ruby as the languge in which the game engine is written code for.
More specifically we will use the `mruby` version as it allows for embedding a lightweight ruby VM into our engine that can run the scripts without needing an external interpreter.
`Mruby` is a very lightwieght impleemntation of teh ruby runtime and also supports semi-compiled bytecodes.
The engine could compile the developers scripts into mruby bytecode when building the application and when it is to be used the teh mruby vm can run these bytecodes.
^ Mruby.org. (2026). mruby - Lightweight Ruby. [online] Available at: https://mruby.org/ [Accessed 13 May 2026].
^ Ruby (2019). Ruby Programming Language. [online] Ruby-lang.org. Available at: https://www.ruby-lang.org/en/ [Accessed 13 May 2026].
##
- then a draft one of teh requirements with justification of each based on the previous sections