Her I'm again. I'm developing a Game Engine(Screenshots
) inspired in Blender, Game Maker, and RPG Maker.
I want to give total freedom to the end user, and for for that, I'm paying total attention to the details of design. My new dilema(See here the previous one
, already solved) is how the Engine will make objects:-With a "Universal Class", with a list of properties
For example, the base class of Blender objects, KX_GameObject
. The end-user dont create true variables when it create a new object, the class have a dynamic List(TList in Free Pascal or Delphi). Using this method it will be easy to make save files and load them(the end user will be able to choose with properties and objects will be saved in file).
TPropertie = class-Keep the actual way I'm doing this
FPropertieName : String;
FPropertieType : TypesClass; // Integer, String, Float, Char, Boolean... etc;
FPropertieValue : Value acording to the FPropertieType;
KX_GameObject = class
FListProperties : TList; // each element is a TPropertie;
procedure LoadFromFile(filename : String);
// This way, the end user will be able to add properties to the FListProperties;
procedure KX_GameObject.LoadFromFile(filename: string);
Index : Integer;
for Index := 0 to NumberOfPropertiesInFile - 1 do
Self.FListProperties.Items[BIndex].FPropertieValue := PropertieInFile[BIndex].FPropertieValue;
My game engine will not really compile a script language, it will create a ObjectPascal project, and compile it. So, the end user will have a base class TGameBaseClass
, and it will be able to create other classes from that base class. There will be not a Variable FListProperties with the properties inside, the properties will be true variables. This way, load objects from saved files will be a headache, because there is no "Item Index" like in FListProperties.
So, these are two way I can do, and I really would appreciate your opinion.
"Life finds a way." - Ian MalcolmMy WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.