Idea to prevent multiple 'same purpose' classes in your custom Game Engine

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Idea to prevent multiple 'same purpose' classes in your custom Game Engine

Post by 123iamking »

According to The best reasons NOT to use the Tombstone Engine:
Every engine should use four different string classes and at least seven 3D vector types, right?
Of course, this article is trying to point out it's PITA to have four different string classes and at least seven 3D vector types :)
So that's what happen right now with Ogre and others open source library.
+For example, Bob uses Ogre, Bullet, CEGUI
-Ogre has Ogre::String, Ogre::Vector3,...
-Bullet has btVector3,...
-CEGUI has CEGUI::String, CEGUI::Vector3,...

So I want to discuss about the idea to prevent multiple different: string classes,3D vector types,.... For example: create/find a standard General Utilities library (refer the high-level overview of the Tombstone Engine architecture) and convince the developers of these open source engine use it. I think it really a waste that the C++ Standard Library is not used off.
User avatar
EricB
Bronze Sponsor
Bronze Sponsor
Posts: 358
Joined: Fri Apr 09, 2010 5:28 am
Location: Florida
x 212
Contact:

Re: Idea to prevent multiple 'same purpose' classes in your custom Game Engine

Post by EricB »

I wouldn't use Tombstone simply for the fact that the only reason it exists is because the Eric (the Author) rage quit C4 Linux support. Due to the very bad publicity (in my opinion) he renamed his engine to Tombstone, shut down the forums, closed everything off, and switched to game making instead (proper move as the engine business is dead). TE was only sold after C4 owners protested this movement. *Note, this is how I view it from outside the project.

+For example, Bob uses Ogre, Bullet, CEGUI
-Ogre has Ogre::String, Ogre::Vector3,...
-Bullet has btVector3,...
-CEGUI has CEGUI::String, CEGUI::Vector3,...
I think it really a waste that the C++ Standard Library is not used off.
For the most part, unless you change it when you built Ogre, Ogre::String = Std::String, Ogre::List = Std::List, Ogre::Vector = Std::Vector, etc. This is done so you can replace std with boost or something else easily in one line instead of something like replacing std::string throughout your code.

Not sure about CEGUI, but it's probably the same.

Personally I just use Ogre::String since it is std::string. it works for pretty much everything. Occasionally I will have to use the .asUTF8() function to get it to work properly with windows utf's though.
Image
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: Idea to prevent multiple 'same purpose' classes in your custom Game Engine

Post by 123iamking »

EricB wrote: For the most part, unless you change it when you built Ogre, Ogre::String = Std::String, Ogre::List = Std::List, Ogre::Vector = Std::Vector, etc. This is done so you can replace std with boost or something else easily in one line instead of something like replacing std::string throughout your code.
That's pretty cool :) but if only there is Vector3 class in std library. I see that
+Ogre define the Vector3 class
+Bullet define the btVector3 class
Then when you map Graphic with Physic, you have to work with 2 Vector3 class :cry:
Come to think of it, I truly curious about the reason std library didn't provide Vector3 class (if there is a solid reason, then I won't have to wait for Vector3 class in std library)
Post Reply