Click here to Skip to main content
Click here to Skip to main content

Game Engine

, 20 Nov 2009 CPL
Rate this:
Please Sign up or sign in to vote.
A game engine first prototype

Introduction

Engine is codenamed wg3dfx and works in an environment DirectX API, which means that it is adaptable to all versions of Windows (from version 2000 to Windows 7). Engine uses Truevision SDK 6.5, and to ensure the proper functioning of Truevision, you'll need to download the SDK 6.5 and MTV3D65.dll set as a reference. For audio support, wg3dfx used irrKlang and you will need to download and install the same. You can find more about it at woodgamesfx.

I call the code collection as game engine because it has almost all elements of game engine. You can use it as is or you can improve some parts of code.

Background

These are some screen shots:

Using the Code

The project is separated in three code sections: unit, scene and game engine section.

For example, this is the main game engine loop:

public void GameLoop()
{
    while (bLoop)
    {
        fTime = TV.AccurateTimeElapsed();

        if (SimuLatePhysics)
        {
            Fizika.PhysX.Simulate(TV.TimeElapsed() * 0.0025f);
        }
        if (Teren.Land == null)
        {
            Kamera2.Update(TV.TimeElapsed());
        }
        else
        {
            Kamera2.UpdateTerrainCamera(ref TV,  Teren.Land  );
        }
        GetMouseLandPosition = Teren.GetTerreinPosition(ref Scene, 
                               Kamera2.tmpMouseX1 ,Kamera2.tmpMouseY1 );
        UpdateScene();
        TV.Clear(false);
        Teren.DrawTerrain();
        if (SkyBoxs.Atmos != null)
        {
            SkyBoxs.DrawSkyBox();
        }
        Svijetlo.RenderLight();
        XActor.CrtajJedinice("Sve",ref Text2D,ref Globals );
        XModel.CrtajJedinice("Sve");
        Scene.FinalizeShadows();
        Partikali.DrawParticles("All");
        if (PodlogaTest != null)
        {
            PodlogaTest.DrawFlor();
        }

        if (Oblaci.Atmos != null )
        {
            Oblaci.DrawClouds();
        }

        if (Magla.Enabled)
        {
            Magla.DrawFog();
        }

        if (Voda != null)
        {
            Voda.DrawWatter();
        }       

        if (bDrawCoordinateSystem)
        {
            DrawCoordinateSystem();
        }
        VMannager.DrawVehicale();
        VMannager.CheckInputs(Kamera2._inputs, ref Fizika.PhysX);

        Dekoli.RemoveDecals(TV);
        Dekoli.DrawDecals();
        Scene.RenderAllMeshes(true);
        Scene.RenderAllActors(true);
        if (Kamera2.tmpMouseB1)
        {
            XActor.DeselectUnits();
        }

        if (Kamera2.tmpMouseB1)
        {
            Screen.Action_Begin2D();
            Screen.Draw_Box(XActor.Mouse1Coor.x,
            XActor.Mouse1Coor.y, XActor.Mouse2Coor.x,
            XActor.Mouse2Coor.y, Globals.RGBA(0, 1, 0, 1));

            Screen.Action_End2D();
        }
        XActor.UpdateActors(Kamera2.tmpMouseX1, Kamera2.tmpMouseY1, 
                            Kamera2.tmpMouseB1, Scene, Kamera2._inputs);
        TV.RenderToScreen();
        Application.DoEvents();
    }
}

In total, there are about 12,000 lines of code in all three sections.

Points of Interest

I will be publishing the first version of the open source engine very soon. Engine is in the development stage and some parts of code are not fully documented. I prohibit the use of parts of code, distributed library and executables for insulting the religious, racial, ethnic and gender level, causing damage to other parts of the code or using the files that come with WoodGamesFX. Software code and supporting files can be used for educational, commercial and noncommercial purposes as long as they meet the above-mentioned conditions. I will not be responsible for the use of code by the above conditions.

I hope that the information and content will benefit individuals or groups interested in creating computer games, simulations or other forms. We suggest you use this information for fun and learning.

History

I was developing this code for several months. If you have any questions about how to use the code, please send me an email at info@woodgamesfx.com.

License

This article, along with any associated source code and files, is licensed under The Common Public License Version 1.0 (CPL)

Share

About the Author

Member 3873633
Software Developer
Croatia Croatia
Programer

Comments and Discussions

 
QuestionDebugging PinmemberJacob van Eijk25-Nov-11 22:00 
QuestionWhere are dlls? Pinmemberaliaaa21-Nov-09 8:49 
AnswerRe: Where are dlls? PinmemberMember 387363321-Nov-09 9:10 
GeneralRe: Where are dlls? Pinmemberblackboardx12-Aug-10 11:16 
I need just gefx.dll,gefxem.dll bu i seach web site but not found.
I need help.
AnswerRe: Where are dlls? PinmemberJacob van Eijk25-Nov-11 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141216.1 | Last Updated 20 Nov 2009
Article Copyright 2009 by Member 3873633
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid