NGF - nikki's Game Framework (new: serialisation, python)

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!

NGF - nikki's Game Framework (new: serialisation, python)

Postby nikki » Tue Dec 09, 2008 5:43 pm

Image

What is it?
NGF (nikki's Game Framework) is a set of framework classes in C++ that help write software, especially games, using Ogre. It helps you manage your GameObjects (Players, Monsters etc.), and Worlds (Menu Screens, Levels etc.), and provides a format to hold GameObjects' positions, orientations and properties. It also includes an exporter for Blender to the '.ngf' format, and means to connect to OgreODE or OgreBullet to allow GameObjects to receive collision events. You can easly write exporters for other applications, or code connecting NGF to other physics engines.

What does it require?
It requires Ogre and boost. Optionally, you may also need OgreODE or OgreBullet for the respective physics features, and Blender to use the Blender to '.ngf' exporter.

Is it big and complicated?
No, it isn't. The core is just 2 files: A .h and .cpp file. The 'plugins' (Python scripting, serialisation, state machine, Bullet events etc.) are more '.h'/'.cpp' pairs. You also get a manual, a tutorial, and a demo application (the result of the tutorial) to get you started off using it quick. I can't handle big and complicated projects. ;)

The demo application uses premake for its build mechanism, so you can easily make project files for whichever IDE you use, or makefiles for gcc. You simply have to edit the premake.lua file to suit your system (if you're on Linux, pkg-config helps).

Why would I use it?
Sure you don't have to use it, but I've seen a lot of questions about GameObject-management frameworks on the forums and I thought it would help. I also made it because I myself need something like this. GraLL uses an older version of NGF.

What does it look like?
Its a framework, so there's nothing much to see besides a bunch of code. However, you can drop your jaw in awe at the sheer beauty of the demo application 8) :-

Image

(I used 'scrot' for the above screenshot, and it seems to have messed up the Overlays)

Where can I get it?
The NGF github repository is here. It also provides an option to download an archive as a zip or a tarball.

ps. Thanks to betajaen for the 'Q&A post-layout idea'. :wink:
Last edited by nikki on Fri Dec 11, 2009 10:16 pm, edited 20 times in total.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Ragath » Tue Dec 09, 2008 6:22 pm

Now this I have to try :D Sounds like a great way for a beginner like me to get started.
Ragath
Gnoblar
 
Posts: 18
Kudos: 0
Joined: 19 Oct 2008

Postby nikki » Tue Dec 09, 2008 6:48 pm

Ragath wrote:Now this I have to try :D Sounds like a great way for a beginner like me to get started.

Sure, hope it helps! :)
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Kaldrick » Tue Dec 09, 2008 8:34 pm

Any chance for making solution under VSE9?


EDIT:
After my lonely shot to compile it under VSE 9 I've hit a wall:
Code: Select all
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall NGF::GameObjectManager::tick(bool,struct Ogre::FrameEvent const &)" (?tick@GameObjectManager@NGF@@QAEX_NABUFrameEvent@Ogre@@@Z) referenced in function "public: virtual bool __thiscall NGFExampleFrameListener::frameStarted(struct Ogre::FrameEvent const &)" (?frameStarted@NGFExampleFrameListener@@UAE_NABUFrameEvent@Ogre@@@Z)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall NGF::Loading::Loader::Loader(class fastdelegate::FastDelegate5<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class Ogre::Vector3,class Ogre::Quaternion,class NGF::PropertyList,void>)" (??0Loader@Loading@NGF@@QAE@V?$FastDelegate5@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@VVector3@Ogre@@VQuaternion@4@VPropertyList@NGF@@X@fastdelegate@@@Z) referenced in function "protected: virtual void __thiscall NGFExampleApplication::setupResources(void)" (?setupResources@NGFExampleApplication@@MAEXXZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall NGF::WorldManager::WorldManager(void)" (??0WorldManager@NGF@@QAE@XZ) referenced in function "protected: virtual void __thiscall NGFExampleApplication::setupResources(void)" (?setupResources@NGFExampleApplication@@MAEXXZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall NGF::GameObjectManager::GameObjectManager(void)" (??0GameObjectManager@NGF@@QAE@XZ) referenced in function "protected: virtual void __thiscall NGFExampleApplication::setupResources(void)" (?setupResources@NGFExampleApplication@@MAEXXZ)
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

Any help?
Kaldrick
Gnoblar
 
Posts: 14
Kudos: 0
Joined: 12 Feb 2008

Postby nikki » Wed Dec 10, 2008 12:38 am

You have to also compile and link 'Ngf.cpp' and 'ConfigScript.cpp', both found in the root Ngf directory.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Nauk » Wed Dec 10, 2008 2:44 am

Looks very useful, definately will have a closer look, thanks for sharing :)
User avatar
Nauk
Gnoll
 
Posts: 647
Kudos: 25
Joined: 11 May 2006
Location: Bavaria

Postby Kaldrick » Wed Dec 10, 2008 9:43 am

nikki wrote:You have to also compile and link 'Ngf.cpp' and 'ConfigScript.cpp', both found in the root Ngf directory.

Now it gives me:
Code: Select all
d:\ngf\ngf.cpp(100) : error C2888: 'NGF::GameObjectManager *Ogre::Singleton<T>::ms_Singleton' : symbol cannot be defined within namespace 'NGF'
        with
        [
            T=NGF::GameObjectManager
        ]
Kaldrick
Gnoblar
 
Posts: 14
Kudos: 0
Joined: 12 Feb 2008

Postby alpha2 » Wed Dec 10, 2008 10:18 am

Seems interesting, especially the connectivity with blender.
I'll give it a try :D
User avatar
alpha2
Gnoblar
 
Posts: 16
Kudos: 0
Joined: 14 Jul 2006

Postby nikki » Wed Dec 10, 2008 10:22 am

Kaldrick wrote:
nikki wrote:You have to also compile and link 'Ngf.cpp' and 'ConfigScript.cpp', both found in the root Ngf directory.

Now it gives me:
Code: Select all
d:\ngf\ngf.cpp(100) : error C2888: 'NGF::GameObjectManager *Ogre::Singleton<T>::ms_Singleton' : symbol cannot be defined within namespace 'NGF'
        with
        [
            T=NGF::GameObjectManager
        ]


Hmm... It seems that's a problem only with the Microsoft compiler. Even Ogre::Root has its ms_Singleton defined within the 'Ogre' namespace though. Probably, defining it outside with additional 'NGF::'s should do the trick.

I've uploaded a new version, try it (look back at first post).
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Kaldrick » Wed Dec 10, 2008 10:44 am

nikki wrote:I've uploaded a new version, try it (look back at first post).

This time it's:
Code: Select all
d:\ngf\ngf.cpp(72) : error C4716: 'NGF::GameObject::addFlag' : must return a value
Kaldrick
Gnoblar
 
Posts: 14
Kudos: 0
Joined: 12 Feb 2008

Postby nikki » Wed Dec 10, 2008 11:02 am

Kaldrick wrote:
nikki wrote:I've uploaded a new version, try it (look back at first post).

This time it's:
Code: Select all
d:\ngf\ngf.cpp(72) : error C4716: 'NGF::GameObject::addFlag' : must return a value

Hehe... That's a stupid mistake on my part. :oops: And gcc didn't tell me about it. I'm uploading the new version now, just hold on.

EDIT: Ok, its updated (same version number though, this ain't a 'new version deserving' change). I also tried building it on Windows (albeit with Visual C++ Express 2005), and it works.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Kaldrick » Wed Dec 10, 2008 11:45 am

Code: Select all
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
Kaldrick
Gnoblar
 
Posts: 14
Kudos: 0
Joined: 12 Feb 2008

Postby nikki » Wed Dec 10, 2008 11:48 am

Kaldrick wrote:
Code: Select all
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

You seem to have made a 'Subsystem:Windows' solution. Change it to 'Subsystem:Console'. Its somewhere in the properties.

After checking out the premake site, I found that they also have an experimental 'Visual C++ 2009' solution feature. You could use that to make your projects (with the given premake.lua). I chose to use premake because it allows people to easily make projects for whichever way they want to compile it (make-g++, Code::Blocks, Visual C++ etc.)

Just run 'premake.exe --target vs2008' from the 'ngftutorial/ngftutorialbase' or 'ngftutorial/ngftutorialfinal' directory.

Do check out the tutorial and readmes.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby Kaldrick » Wed Dec 10, 2008 11:56 am

It was a problem with solution. Sorry for all the problems, and thanks for help ;]
Kaldrick
Gnoblar
 
Posts: 14
Kudos: 0
Joined: 12 Feb 2008

Postby nikki » Wed Dec 10, 2008 11:58 am

Kaldrick wrote:It was a problem with solution. Sorry for all the problems, and thanks for help ;]

You're welcome! Also, I must thank you because you helped me find that stupid bug. :wink:
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby hangchon18 » Wed Dec 10, 2008 3:20 pm

Good work!
hangchon18
Halfling
 
Posts: 80
Kudos: 0
Joined: 24 Jul 2005

Postby nikki » Wed Dec 10, 2008 4:04 pm

@hangchon18: Heh, thanks.

I found a small error in the documentation. It says you only need to compile and link 'Ngf.cpp'. This is wrong, you have to compile and link 'ConfigScript.cpp' too. I'll fix it soon, there's a problem with my 'development computer's monitor and I'll have to fix that first, because though I can do stuff on the computer, I can't see what I'm doing. :roll:
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (Latest: 09.01.01)

Postby nikki » Thu Jan 01, 2009 5:46 pm

Small update (09.01.01). Just fixed the documentation error, and added an option to use 'plain Bullet' with the collision detection and GameObject-physics association features. Works good with BtOgre. ;)
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (Latest: 09.01.01)

Postby Spoonfork » Sun Feb 08, 2009 3:00 pm

Hey there Nikki. Just wanted to say thanks for making this awesome framework, it's a really good design and it gave me a lot of good snippets to implement in my own "project". However, the site you uploaded the framework to seems to have deleted the file, so is there any chance you could upload it again?
User avatar
Spoonfork
Gnoblar
 
Posts: 6
Kudos: 0
Joined: 18 Jan 2009

Re: NGF - nikki's Game Framework (Latest: 09.01.01)

Postby nikki » Sun Feb 08, 2009 9:08 pm

Spoonfork wrote:Hey there Nikki. Just wanted to say thanks for making this awesome framework, it's a really good design and it gave me a lot of good snippets to implement in my own "project". However, the site you uploaded the framework to seems to have deleted the file, so is there any chance you could upload it again?

Yeah, seems it happened to BtOgre too. I have to sleep right now, it's very late right now. I'll sure reupload somewhere else first thing in the morning.

Thanks for the compliments! :D
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (9.2.9)

Postby nikki » Mon Feb 09, 2009 6:18 am

Update (9.2.9): Fixed a few documentation and build file errors, uploaded to a new place.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (9.2.9)

Postby dnchattan » Tue Feb 10, 2009 5:29 am

Well, this looked interesting enough for me to register to comment ;)

Nice work. The implementation looks very effective, and I definitely like the ties to blender.

Up until now I've been to lazy to do much with Ogre short of tinkering with the engine, perhaps this will encourage me to get off my ass :)

Cheers,
Daniel
dnchattan
Gnoblar
 
Posts: 1
Kudos: 0
Joined: 10 Feb 2009
Location: Beverly, MA

Re: NGF - nikki's Game Framework (9.2.9)

Postby nikki » Tue Feb 10, 2009 1:53 pm

@dnchattan: Glad you like it, hope it helps! ;)
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (9.2.9) (now on git!)

Postby nikki » Sun Mar 15, 2009 5:19 pm

Update (9.2.15): I've created a git repository for NGF, hosted at github, which you can find here. I haven't yet updated the archive download though, I couldn't find any reliable free file host yet. :( If you can suggest something, do tell me.

To the core NGF, I've added a 'GameObjectFactory', removing the need for a LevelLoaderCallback. You can now just do NGF_REGISTER_OBJECT_TYPE(MyClass), and any entry in a level of type "MyClass" will automatically be loaded. You still have the callback mechanism for total control though. You can also create objects with a string as a type now.

And apart from the core, you can see some stuff in include/ngfplugins/ and plugins/ that might interest you. :wink:
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 13
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Re: NGF - nikki's Game Framework (9.2.9) (now on git!)

Postby altren » Sun Mar 15, 2009 5:48 pm

nikki wrote:Update (9.2.15): I've created a git repository for NGF, hosted at github, which you can find here. I haven't yet updated the archive download though, I couldn't find any reliable free file host yet. :( If you can suggest something, do tell me.
Why not sourceforge? It have git, file host and many, many, many more things...
Image
User avatar
altren
Gnome
 
Posts: 309
Kudos: 15
Joined: 24 Oct 2006
Location: Moscow, Russa

Next

Return to Showcase

Who is online

Users browsing this forum: No registered users and 8 guests