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!
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

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.
Ragath
Gnoblar
Posts: 18
Joined: Sun Oct 19, 2008 4:55 pm

Post by Ragath »

Now this I have to try :D Sounds like a great way for a beginner like me to get started.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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! :)
Kaldrick
Gnoblar
Posts: 14
Joined: Tue Feb 12, 2008 12:45 pm

Post by Kaldrick »

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?
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

You have to also compile and link 'Ngf.cpp' and 'ConfigScript.cpp', both found in the root Ngf directory.
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36
Contact:

Post by Nauk »

Looks very useful, definately will have a closer look, thanks for sharing :)
Kaldrick
Gnoblar
Posts: 14
Joined: Tue Feb 12, 2008 12:45 pm

Post by Kaldrick »

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
        ]
User avatar
alpha2
Gnoblar
Posts: 16
Joined: Fri Jul 14, 2006 6:15 pm

Post by alpha2 »

Seems interesting, especially the connectivity with blender.
I'll give it a try :D
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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).
Kaldrick
Gnoblar
Posts: 14
Joined: Tue Feb 12, 2008 12:45 pm

Post by Kaldrick »

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
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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.
Kaldrick
Gnoblar
Posts: 14
Joined: Tue Feb 12, 2008 12:45 pm

Post by Kaldrick »

Code: Select all

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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.
Kaldrick
Gnoblar
Posts: 14
Joined: Tue Feb 12, 2008 12:45 pm

Post by Kaldrick »

It was a problem with solution. Sorry for all the problems, and thanks for help ;]
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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:
hangchon18
Halfling
Posts: 80
Joined: Sun Jul 24, 2005 9:03 am

Post by hangchon18 »

Good work!
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

@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
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

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
Spoonfork
Gnoblar
Posts: 6
Joined: Sun Jan 18, 2009 6:27 pm

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

Post by Spoonfork »

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
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

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
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

Update (9.2.9): Fixed a few documentation and build file errors, uploaded to a new place.
dnchattan
Gnoblar
Posts: 1
Joined: Tue Feb 10, 2009 5:23 am
Location: Beverly, MA
Contact:

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

Post by dnchattan »

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
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

@dnchattan: Glad you like it, hope it helps! ;)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

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

Post by nikki »

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
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

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

Post by altren »

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
Post Reply