PDA

View Full Version : Machina Engine - Game Engine



FelipeFS
18-05-2012, 11:06 AM
The project Machina Engine aims to develop electronic games, of any genre, with the support of an IDE to make the development process easier and faster. However, unlike other IDE, Machina engine is being projected to be highly customizable, allowing the developer to make deep changes in Game Engine. Most of the current work is focused in the game engine, but some parts of the IDE are already working, and while developing the IDE, I focused to assign good features from others IDEs(like RPG Maker, Game Maker, and Blender) excluding the bad ones.

The game engine has the following features:

[Ok] Object-oriented;
[Completed] Can use a script language(with one is not needed to learn);
[Completed] File stream management, with also can use the script language, and can be encrypted;
[Only 2D as far] Can use 2D, 3D, and vectorial sprites;
[Uncompleted] A system of rooms/maps with can use tilesets;


This is a screenshot of a animated sprite(result of the last days of work):
https://lh6.googleusercontent.com/-fD5YjD9uYbc/T7YikL9LxmI/AAAAAAAABLs/sZBWEXIJdhg/s800/MEScreenshot.png

Also, some old screenshots from the IDE:

[Screenshot 1 - with a project open] (https://lh4.googleusercontent.com/-I89zWKtMo0E/T0haWJQz4vI/AAAAAAAABB4/xy44smiZuto/s1024/001.PNG)
[Screenshot 2 - editing a class] (https://lh5.googleusercontent.com/-nE2-j0q-UeA/T0hxMnzm3TI/AAAAAAAABCA/bXFs8isG0Y0/s1024/002.PNG)
[Screenshot 3 - editing a room/map] (https://lh6.googleusercontent.com/-VhVxF8bZNEA/T0hxMdX0IpI/AAAAAAAABCE/JIj4ckNqSxc/s1024/003.PNG)

You can find updates on my blog: PixelDeveloper.blogspot (http://pixeldeveloper.blogspot.com.br/)

Thank you, for your attention!

FelipeFS
19-05-2012, 08:41 PM
Updates:
-The main class can dispatch interpreted application messages for each object in the game.
-Keyboard messages are completed. Objects has pointers for procedures which recieve keydown, keypress and keyup messages.

FelipeFS
19-05-2012, 08:48 PM
Here is a video:
http://youtu.be/YDKMPhkKHgM

de_jean_7777
20-05-2012, 10:53 AM
Looks interesting. I see you have your own development environment for the engine, which could be an advantage over other engines. It has an unfamiliar UI, which I guess you made yourself? The scripting language used, is it something of your own or an existing one (like PascalScript)?

FelipeFS
20-05-2012, 12:14 PM
All by my own. The UI and the script language. But I'm thinking about left this UI aside, and use the standard UI(Windows/Linux UI), the current user interface just gave me troubles.

The script language is still a sketch. In the beggining of the concept, my idea was to make the developer use the script language in the IDE, then the IDE would convert the spript language to Pascal and compile the project with FPC.
But, after make some posts and recieve few(or negative) points about use Pascal as language, I'm thinking about use the script language as a "mask", so the developer would choose the language syntax which it likes(C++ or Pascal), and then the IDE would convert to Pascal(if the choice was C++ as "mask".

It is a idea to conquer more users =D

FelipeFS
12-06-2012, 04:44 PM
Here are some news:
First of all, now I'm using XML as language for data-files(which can be encrypted). The engine is faster and more flexible because of this.

Second, part of the physics engine is already working:


Force;
Velocity;
Acceleration;
Friction;


Sprites can be used already. Also, they can be rotated, and be animated.

The next step is to implement the physics with different types of collision:


Option to use multiple masks of collision for a same sprite;
With different masks of collision in the same sprite, the collision can be treat differently according with the part collided;
Default masks like rectangle mask, circle mask, etc;


...and implement the Momentum(Conservation of Linear Momentum).

This small video show these features:

http://www.youtube.com/watch?v=tcJlSJyhNa8&feature=plcp

And you can see the code of the game-using the game engine- here:


type
TBaseMainChar = class(TBaseObject)
public
procedure OnKeyPress(BSender: TBase; var BKeyBoard : TMsgKeyBoard);
constructor Create; override;
end;

procedure TBaseMainChar.OnKeyPress(BSender: TBase; var BKeyBoard : TMsgKeyBoard);
var
BBaseObject : TBaseObject;
begin
BBaseObject := TBaseObject(BSender);
if VK_Up in BKeyBoard then
begin
BBaseObject.ApplyForce(0.6, BBaseObject.FRotationZ);
end;
if VK_DOWN in BKeyBoard then
begin
BBaseObject.FAcceleration := 0;
end;
if VK_Left in BKeyBoard then
begin
BBaseObject.FRotationZ := BBaseObject.FRotationZ - 2;
end;
if VK_RIGHT in BKeyBoard then
begin
BBaseObject.FRotationZ := BBaseObject.FRotationZ + 2;
end;
end;

constructor TBaseMainChar.Create;
begin
inherited Create;
FOnKeyDown := nil;
Self.FOnKeyPress := OnKeyPress;
Self.FOnKeyUp := nil;
end;

begin
FApplicationGame := TApplicationGame.Create;
FApplicationGame.FFrameProcessType := FPT_CONSTANT; // There are 3 kinds of loops;
FApplicationGame.CreateForm('FFormName', 'Form Title', True);

//---------------------------------------------\\
//Register TBaseObject class into memory:
//---------------------------------------------\\
New(FClassRegistry);
FClassRegistry.FClassName := 'TBaseObject';
FClassRegistry.FClassReference := TBaseObject;
FApplicationGame.FManagerClassReference.Add(FClass Registry);
//---------------------------------------------\\
//Register TBaseMainChar class into memory:
//---------------------------------------------\\
New(FClassRegistry);
FClassRegistry.FClassName := 'TBaseMainChar';
FClassRegistry.FClassReference := TBaseMainChar;
FApplicationGame.FManagerClassReference.Add(FClass Registry);
FApplicationGame.LoadDataFile('\MainData.dat');
FApplicationGame.LoadAllResourceFiles;
FApplicationGame.LoadAllSprites;
FApplicationGame.Run;
end.

Small, i'snt?:)

FelipeFS
10-08-2012, 07:49 PM
Finally, the collision detection was finished.
And, most of the code to display the maps(multi-layered by the way) is completed.

I'm implementing a code to delivery alarms(like in game maker).

FelipeFS
24-08-2012, 05:11 PM
I have made a fluxogram explaining how the data-files and resource-files work::

https://lh6.googleusercontent.com/-_aUGX9TAA5o/UDevKaVVkUI/AAAAAAAABSc/rq75kU2scOQ/s800/GameEngineStream.png

Features:


A data-file can point to more than one resource-file, also can point to a resource-file already pointed by another data-file;
A data file can point to another data-file, this way, the game engine can also load into memory the pointed data-file;
The previous feature allows the use of many data-files. A main data-file is created, and it point to the others data-files;
While data-files store information, the resource-files store files itself;
Data-files can be created and loaded at run-time. So, they can be used as *.sav files. You cound store information of an object, or a entire may, for example.



Screenshot of MEMaker(The previous game editor was discarded) loading a picture:
https://lh6.googleusercontent.com/-utA_hRJXuek/UDevQt8kTGI/AAAAAAAABSk/bFGhWfDCCRg/s800/MEMaker_DevPicture.png
Look that in the field "Stored In" the developer can tell in which resource-file("ResFile" in this case) the picture will be stored. But, as you can see, the picture("PTileset001") information is inside the data-file "MainData".

... Now I'm working on the room-editor(the most important part of this game editor, of course).

FelipeFS
24-08-2012, 05:14 PM
Also, I'm using FreeGLUT. I wasn't before, but FreeGLUT provides me a easy way to make this game engine cross-platform.