Game Engine Logic ECS but not really?

Started by
14 comments, last by Fulcrum.013 5 years, 10 months ago
2 hours ago, Jemme said:

But now I'm doing everything  and I want it to be reuseable, I'm going the route of having a game logic system which initialises all the logic systems and using lua for behaviour scripts and JSON for components initialisation on entities.

If you want really reusable code, decleaning of inheritance-based model is wery wery bad idea. inheritance-based model is key feature to creation of self-managed objects that can be just added to world simulation and than do anything else himself, including desigin about deletion from model.

First that you need is a persistent object model. And use json or other human readable format is wery bad idea for storing and editinf object properties becouse it give no waranty of data correctness. It can be given only by especially made property editor. So human-readability not make a human writeability, and only makes a parsing expenses and difficulties in comparsion with binary data formats, expecially when used with static typed languages.

 

#define if(a) if((a) && rand()%100)

Advertisement

The storage method for component data is kind of free choice, XML, Json, LUA are fine tbh, i do have a custom BinaryIO class in the low-level engine to read and write binary, i haven't set up endian flip or anything though. A previous project of mine had an asset pipeline tool that dynamically displayed the "import" templates when you selected assets of different types so you could change there settings liek compile as DXT1 etc. It used xml for that, but yeah serializing and deserting in binary is a possible route for the component data, but for now i will probably do it in lua or JSON so i can quickly edit things until i get an editor and automate it. Like Kylotan said i need to just get on with it and refactor and improve things as i go, that's probably the main thing a "junior" needs to learn to do otherwise you get caught up with the thousands of different possibilities and limitations of every possible implementation that you never start.

14 minutes ago, Jemme said:

but for now i will probably do it in lua or JSON so i can quickly edit things until i get an editor and automate it

Main difficulty is not a data format. Main difficulty  is automade presistent object system. And most difficult part of it - generating of full reflection data. With reflection data on hand, storage format generation, property editor interface generation and care about big/little endian can be done automatically. 

#define if(a) if((a) && rand()%100)

Do you mean like this:

Reflection

Lumberyard had a talk about reflection I think I'd have to try find it again.

20 minutes ago, Jemme said:

but for now i will probably do it in lua or JSON so i can quickly edit things until i get an editor and automate it

Main difficulty is not a data format. Main difficulty  is automade presistent object system. And most difficult part of it - generating of full reflection data. With reflection data on hand, storage format generation, property editor interface generation and care about big/little endian can be done automatically. 

Also key for real date driving and code reuse is a high level abstractions, but not a data formats. And this abstractions require a deep knowledge of subject field. For examle about any AI aiming, including homing missiles, cannons etc., and most parts of autopilots including nawpoints processing and following of other object, with given accuracy and response delay, can be realised using a set of PID regulators. And each regulator behavior described only by 3 coefficients on his formula. So making those regulators and system of binding it to sensors and actuators allow to avoid tons of scripting and give powerfull oportunities for data driving behavior modeling. Also gives a additional realism, becouse all autoaim sysems, autopilots  and many things on real word aviation and other authomatic works on PID sets. Computers on real world only set tasks to regulators.

13 minutes ago, Jemme said:

Do you mean like this:

Yes something like this. Something like it realized into C++ Builder, but wih opportunity of custom reflection format generation. unfortunately C++ Builder generates reflection info in format good for using/accesing from VCL/firemonkey frameworks. only

#define if(a) if((a) && rand()%100)

3 hours ago, Jemme said:

Lumberyard had a talk about reflection I think I'd have to try find it again.

i guess best way to obtain reflection info is to make a code analisis utility that works like preprocessor/transpiller. Reflection info is a parsers dictionry by his nature. unfortunately most compilers just trown it away after buit ASG, instead to place it to data segment tables.

#define if(a) if((a) && rand()%100)

This topic is closed to new replies.

Advertisement