Well i've been working on this for a week or so now, its in pretty good
shape to, the editor is more or less done(with a horendous amount of
bugs O_O), the base of the engine is also complete, the resource system
is quite nice to as it packs everything up into pack files of my own
format which can be loaded incredably quickly (only takes 1 ms to load a
pack file with 1000 odd files in it, when loaded a file all you need to
do is incase the url in a Res() call(im thinking of implementing a
res:: protocal sort of like the incbin:: protocal for ease of use), when
it grabs the data of the file it only has a very small overhead. Ive
also done a few other functions like ResImage(), ResAudio() and such to
cast the data into the right type for use). The audio system is also
done, at the moment it only has drivers for FreeAudio and Fmod to be
used but im thinking of expanding it into a few others, and graphics
driver is only avalible at the moment for OpenGL as i have no idea how
to do some of the things ive been doing in DirectX(such as dynamic
Z-Ordering))
The engine is similar in implementation to the
Unreal engine, being that it revolves around a OOP scripting language,
in fact the Unreal engine is where i got my idea from. The other nice
thing about the engine/editor/compiler/..etc is its all incased in the
same exe; you start up different tools by using the command line, this
not only cuts down size of any downloads but it means changes in the
source of one will effect the others (great or things like the
audio/graphics drivers).
The scripting language that it runs on
is now finished (few things to touch up though) and runs as a full
precompiled stack based language, with support for threading, full
selection of operaters, and a very nice(if i do say so my self :P)
save/restore system which allows you to save scripts and restore them to
the exact state they were saved at (It also does thins such as reloaded
resources that are stored in variables...etc). The only thing i
currently dont like about it is there no dynamic memory allocation so it
all pretty static but non the less it does the job in hand, heres an
example script i was using to test it.....
//=============================================================================
// Compiler test
// Copyright (C) 2005 Binary phoenix
//=============================================================================
Class NPC extends NPCBase;
//-----------------------------------------------------------------------------
// Global variables
// Path to the image used by this entity, editable by the editor.
Var ImagePath Editable;
//-----------------------------------------------------------------------------
// Functions
Event OnCreate() {
// Setup image
SetEntityImage(Self,LoadAnimImage(ImagePath,32,48));
// Movement test
// ~~~ BAD PRACTICE, dont add code like this in the create event
// do it in the map start event.
While(True) {
MoveInBox(Rand(-100,100),Rand(-100,100));
Wander(Rand(1,2));
}
}
// Special version of OnCreate called by the editor when an entity is created
// this is best used to load the image to draw in the editor.
Event OnEditorCreate() {
// Setup image
SetEntityImage(Self,LoadAnimImage(ImagePath,32,48));
}
// Used by the editor when it resets the editable properties of this object
Event OnEditorValueReset() {
ImagePath = "EngineDemo\\Images\\Entitys\\NPC.png";
}
And heres the base object that i extended the above object from to test inheretence.
//=============================================================================
// NPC Base, the npcs in this demo inheret from this.
// Copyright (C) 2005 Binary phoenix
//=============================================================================
Class NPCBase;
Function MoveInBox(Width,Height) {
If (Width == 0 || Height == 0) Return;
MoveEntity(Self, Width, 0, 1); SetEntityFrame(Self,1); WaitEntityMove(Self);
MoveEntity(Self, 0, -Height, 1); SetEntityFrame(Self,0); WaitEntityMove(Self);
MoveEntity(Self, -Width, 0, 1); SetEntityFrame(Self,2); WaitEntityMove(Self);
MoveEntity(Self, 0, Height, 1); SetEntityFrame(Self,3); WaitEntityMove(Self);
}
Function Wander(Speed) {
// Create a random direction to move in
Var X, Y;
While (X == 0 && Y == 0) {
X = Rand(-100,100);
Y = Rand(-100,100);
}
// Set the entitys frame depdning on direction
If (X < 0 && Abs(Y) < Abs(X)) SetEntityFrame(Self,1);
If (X > 0 && Abs(Y) < Abs(X)) SetEntityFrame(Self,2);
If (Y < 0 && Abs(Y) > Abs(X)) SetEntityFrame(Self,3);
If (Y > 0 && Abs(Y) > Abs(X)) SetEntityFrame(Self,0);
// Move the entity :P
MoveEntity(Self, X, Y, Speed);
WaitEntityMove(Self);
}
And heres a nice pic of the editor in case your intrested, ive tryed to fit the sub-editors into it aswell.

Anyway
i could go on for a long time about the nice features i've implemented
but I only have so long, ill update this worklog soon, I hope you
enjoyed reading it as its my first one :).
|