CobbleStones

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

CobbleStones

Post by Seven »

I have been working on a game engine for quite some time and am glad to announce that it is moving along quite nicely.

details :

OOP style system with the following layout...
CSApplication - initializes, maintains and destroys all sub systems
CSEngine - encapsulates the Irrlicht graphics engine
CSLevelManager - creates, manages and destroys all levels
levels are fully 3d and interactive
menu system is created using CSLevels allowing fully 3d, animated menu scenes
CSLevel - houses an entire 'level' including all game objects
CSObjectFactory - creates, manages and destroys all game objects
this is a unique system I think. All game objects are housed in dll files.
on command, the factory scans the game object directory, building list of available objects
objects can be created via the getObjectFactory()->createObjectByType("CSO_Terrain"); function
once created, objects are added to the object manager and are interactive with the level
CSObject - a single game object
physics are attached to all game objects
object to object communication
unique variable editing system. variables are stored in list by name. when edited, class functions are called to validate data.
CSPhysics - base class for all physics activity
system scans physics folder and creates list of available physics engines
physics engines can be changed during game play
current preference is PhsyX2.84 (bullet, ode available)

CSEditor - MFC application with 4 views (top, left, front and 3d)
full interactivity with game systems. Create, scale, delete, edit etc.. all game obejcts and level variables.

CSO_Editor - game object that provides in game editing experience. Full blown editor.

It is difficult to explain all of the systems, but they all seem to play well together and I have a few demos created for testing.

anyhow, a few videos (sorry for the crappy video)

// in game editor creating a new level
http://www.youtube.com/watch?v=kcpJnl7U ... e=youtu.be

// diablo style demo using newly created level
http://www.youtube.com/watch?v=jLpqAY9Z ... e=youtu.be

// test level
http://www.youtube.com/watch?v=hf--_Lh8_So

If anyone is interested in helping with this project, please let me know.
I have purchased a significant number of game assets (3d models, sounds, etc...), the application is stable, some game objects are created and a few demos are running. I would be interested in someone helping me create an actual game out of it all.

Seven
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: CobbleStones

Post by Seven »

example game object

Code: Select all

 
#pragma once
 
#include "CSO_Generic.h"
 
namespace CS
{
    class CSO_Skybox : public CSObject
    {
    public:
        ADD_VARIABLE_SETGET(ISceneNode*, Node);
 
        // all objects must define this so that the normal CSObject::Frame()
        // call can update the position of the node based on the physicsobject
        virtual ISceneNode* getPrimarySceneNode() { return m_Node; }    
        virtual void removeSceneNodes() { CS_SAFE_REMOVE(m_Node); } 
 
        ADD_PROPERTY_GET2(stringc,m_SkyboxUp,SkyboxUp,stringcToStringc,stringcToStringc);
        virtual void setSkyboxUp(stringc filename) { m_SkyboxUp = filename; createSkybox(); }
        ADD_PROPERTY_GET2(stringc,m_SkyboxDown,SkyboxDown,stringcToStringc,stringcToStringc);
        virtual void setSkyboxDown(stringc filename) { m_SkyboxDown = filename; createSkybox(); }
        ADD_PROPERTY_GET2(stringc,m_SkyboxLeft,SkyboxLeft,stringcToStringc,stringcToStringc);
        virtual void setSkyboxLeft(stringc filename) { m_SkyboxLeft = filename; createSkybox(); }
        ADD_PROPERTY_GET2(stringc,m_SkyboxRight,SkyboxRight,stringcToStringc,stringcToStringc);
        virtual void setSkyboxRight(stringc filename) { m_SkyboxRight = filename; createSkybox(); }
        ADD_PROPERTY_GET2(stringc,m_SkyboxFront,SkyboxFront,stringcToStringc,stringcToStringc);
        virtual void setSkyboxFront(stringc filename) { m_SkyboxFront = filename; createSkybox(); }
        ADD_PROPERTY_GET2(stringc,m_SkyboxBack,SkyboxBack,stringcToStringc,stringcToStringc);
        virtual void setSkyboxBack(stringc filename) { m_SkyboxBack = filename; createSkybox(); }
 
        CSO_Skybox::CSO_Skybox()        {   }
        virtual CSO_Skybox::~CSO_Skybox()   {   }
 
        virtual bool cleanup()  
        { 
            CS_SAFE_REMOVE(m_Node);
            return CSObject::cleanup(); 
        }
 
        virtual void initialize()           
        {   
            CS_LOG(L"CSO_Skybox::Initialize()");
 
            CSObject::initialize();
 
            CS_INIT(m_Node);
        }
 
        virtual bool create(CSLevel* level) 
        {   
            CS_LOG(L"CSO_Skybox::Create()");        
        
            // create the base class
            CS_CHECK_BOOL(CSObject::create(level),L"CSO_Skybox::Create() -- base class create failed"); 
 
            // create the information structure for this object
            getInfo()->create(1,L"CSO_Skybox",L"a skybox",1.00,L"Seven");
 
            // set everythign to a known value
            m_SkyboxUp      = "media/irrlicht2_up.jpg";
            m_SkyboxDown    = "media/irrlicht2_dn.jpg";
            m_SkyboxLeft    = "media/irrlicht2_lf.jpg";
            m_SkyboxRight   = "media/irrlicht2_rt.jpg";
            m_SkyboxFront   = "media/irrlicht2_ft.jpg";
            m_SkyboxBack    = "media/irrlicht2_bk.jpg";
 
            REG_PROPERTY(CSO_Skybox,L"SkyboxUp",&CSO_Skybox::csSetSkyboxUp,&CSO_Skybox::csGetSkyboxUp,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
            REG_PROPERTY(CSO_Skybox,L"SkyboxDown",&CSO_Skybox::csSetSkyboxDown,&CSO_Skybox::csGetSkyboxDown,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
            REG_PROPERTY(CSO_Skybox,L"SkyboxLeft",&CSO_Skybox::csSetSkyboxLeft,&CSO_Skybox::csGetSkyboxLeft,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
            REG_PROPERTY(CSO_Skybox,L"SkyboxRight",&CSO_Skybox::csSetSkyboxRight,&CSO_Skybox::csGetSkyboxRight,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
            REG_PROPERTY(CSO_Skybox,L"SkyboxFront",&CSO_Skybox::csSetSkyboxFront,&CSO_Skybox::csGetSkyboxFront,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
            REG_PROPERTY(CSO_Skybox,L"SkyboxBack",&CSO_Skybox::csSetSkyboxBack,&CSO_Skybox::csGetSkyboxBack,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
 
            // setIsDebugObject(true);
            setObjectType(CS_TYPE_NONE);
 
            return true;            
        }
 
        virtual bool reCreate()     
        {   
            CS_LOG(L"CSO_Skybox::ReCreate()");      
        
            // create the base class
            CS_CHECK_BOOL(CSObject::reCreate(),L"CSO_Skybox::Re:Create() -- base class recreate failed");   
    
            // create an Irrlicht skybox
            createSkybox();
 
            // everything went fine
            return true;    
        }
 
        virtual void createSkybox()
        {
            CS_LOG("CSO_Skybox::createSkybox()");
            CS_SAFE_REMOVE(m_Node);
            m_Node = getLevel()->getSmgr()->addSkyBoxSceneNode(
                    getDriver()->getTexture(getSkyboxUp()),
                    getDriver()->getTexture(getSkyboxDown()),
                    getDriver()->getTexture(getSkyboxLeft()),
                    getDriver()->getTexture(getSkyboxRight()),
                    getDriver()->getTexture(getSkyboxFront()),
                    getDriver()->getTexture(getSkyboxBack())
                );
            if (m_Node) m_Node->setIsDebugObject(true);
        }
 
        virtual void setUseFog(bool value)      {}
        virtual void setUseLight(bool value)    {}
 
                // irrlich exchanging capability
        virtual void serializeAttributes(IAttributes* out, SAttributeReadWriteOptions* options=0)
        {
            CS_LOG("CSO_Character::serializeAttributes()");
 
            // call the base class
            CSObject::serializeAttributes(out, options);
 
            out->addString("UP",getSkyboxUp().c_str());
            out->addString("DOWN",getSkyboxDown().c_str());
            out->addString("LEFT",getSkyboxLeft().c_str());
            out->addString("RIGHT",getSkyboxRight().c_str());
            out->addString("FRONT",getSkyboxFront().c_str());
            out->addString("BACK",getSkyboxBack().c_str());
        }
 
        virtual void deserializeAttributes(IAttributes* in, SAttributeReadWriteOptions* options=0)
        {
            CS_LOG("CSO_Character::deserializeAttributes()");
 
            // call the base class
            CSObject::deserializeAttributes(in, options);
 
            m_SkyboxUp      = in->getAttributeAsString("UP");
            m_SkyboxDown    = in->getAttributeAsString("DOWN");
            m_SkyboxLeft    = in->getAttributeAsString("LEFT");
            m_SkyboxRight   = in->getAttributeAsString("RIGHT");
            m_SkyboxFront   = in->getAttributeAsString("FRONT");
            m_SkyboxBack    = in->getAttributeAsString("BACK");
        }
    };
 
} // end namespace
 

example use

Code: Select all

 
   int id = getObjectFactory()->createObjectByType("CSO_Skybox");
   CSObject* obj = getObjectFactory()->getObjectPointer(id);
   if (obj)
   {
        obj->setVariable(L"SkyboxFront",L"some filename");
        obj->setVariable(L"SkyboxBack",L"some filename");
        obj->setVariable(L"SkyboxLeft",L"some filename");
        obj->setVariable(L"SkyboxUp",L"some filename");
        obj->setVariable(L"SkyboxDown",L"some filename");
   }
 
when setVariable() is called, it finds the right function and passes the params to it. That function is then called and updates accordingly. In this case,
REG_PROPERTY(CSO_Skybox,L"SkyboxUp",&CSO_Skybox::csSetSkyboxUp,&CSO_Skybox::csGetSkyboxUp,L"CS_FILENAME_ASN",L"Load up a nice graphic file");
allows us to set the filename of the up graphic, and it will call csSetSkyboxUp(filename).
which in turn loads the graphic and rebuilds the skybox with it using
virtual void setSkyboxUp(stringc filename) { m_SkyboxUp = filename; createSkybox(); }

the CS_FILENAME_ASN tells the editor what type of variable it is and top open a fileseelct dialog when editing.
it also has some helpful text that is displayed when the variable is selected in the editor, so that the user knows what he is changing.
strelkin7
Posts: 9
Joined: Mon Apr 20, 2009 3:20 pm

Re: CobbleStones

Post by strelkin7 »

Hi, Seven!
Is it closed-source project?
Do you need some help with programming?
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: CobbleStones

Post by Seven »

strelkin7 wrote:Hi, Seven!
Is it closed-source project?
Do you need some help with programming?

check your private messages.
Post Reply