SFML community forums
General => SFML projects => Topic started by: Groogy on June 21, 2011, 08:20:56 pm
-
GG Engine - Groogy's Game Engine
Groogy's Game Engine is a multi-threaded 3D game engine I have been working on for the past year. I don't got much of imagination when it comes to names so I named it to Groogy's Game Engine but lucky enough it's acronym results into GG Engine, GG which is also an acronym for Good Game.
So what's so good about it? Well I've tried to make the complex and hard things to be simple to work with. For instance threading in the SDK is non-existent for the user and does not need to concern himself about it at all. Most of the 3D math for rendering is also handled internally by the engine and most optimisations that needs to be done will be hidden behind the public API. What will be in focus is to make a game and not a decent frame rate or how things are culled by a frustum.
The Users
Who is this aimed at? Well I made it for use by myself but who knows there might be someone else that want to jump straight into game making without having to worry about multi threading, model loading, skeleton animation, efficient culling and the like.
Features
Here's a list of the features that it currently support:
- Seamless multi-threaded input, logic, rendering. The user only need to define the logics.
- Nice wrap around OpenGL for 3D rendering.
- Nice wrap around SFML for Windowing, Input and 2D Rendering.
- Object-oriented interface to rendering.
- Instance-Model Graphs.
- Wavefront Object and Material file parsing.
- Helper Design Patterns like Singleton, Component-based Objects, Observer Objects, etc. etc. (These are added overtime, not all have been made yet)
- Resource Management.
- Flexible post master system(though I call it signals)
- Vector and Matrix classes for 3D uses.
- An Orientation class that makes Matrixes and Vector's easier to use for newcommers to 3D math.
- Automatic Frustrum against Oct-tree culling for rendering thread.
- Easy to implement and use debug information at runtime.
And a list for things that is planned to be implemented:
- Generate bounding boxes when loading a model.
- A modifiable origin for 3D objects.(Kind of like sprites in SFML)
- Skeleton Animations.
- An interface that is easier to work against
- System to handle configurations and parsing from a file or maybe the OS.
- State stack with some predefined states.
- Properly pass material parameters to OpenGL for use in shaders.
- Lighting interface to the rendering thread.
- Allow object-specific shaders.
- Shader function library for common used things.
What I am thinking about but is not my highest priority:
- Encapsulate SFML entirely so the user don't even need to know that SFML is used.
- Bindings to ruby, since only one thread is exposed to the user it's perfect.
- Base GUI system.
- Plugin system.
- Rendering Optimization, currently everything is rendered intermediate.
- Dynamical Destructible Objects(Won't look good but can be disabled)
Example
An example that will render a sprite and a rotating 3D model on screen. Will handle the even that the window closes and also let's you move around in the 3D world.
#include <GGE/Application/Application.hpp>
#include <GGE/Application/ApplicationLogics.hpp>
#include <GGE/Application/Sprite.hpp>
#include <GGE/Application/Text.hpp>
#include <GGE/Application/Object.hpp>
#include <GGE/Application/Camera.hpp>
#include <GGE/Application/BasicCameraController.hpp>
class MyApplication : public GGE::ApplicationLogics, GGE::Signals::Receiver
{
public:
MyApplication()
{
myRotation = 0;
GetSignalSender().SubscribeReceiver( this, "Signal.Window.Quit" );
GetSignalSender().SubscribeReceiver( &myPlayer, "Signal.Mouse.Moved" );
GetSignalSender().SubscribeReceiver( &myPlayer, "Signal.Keyboard.Pressed" );
GetSignalSender().SubscribeReceiver( &myPlayer, "Signal.Keyboard.Released" );
}
~MyApplication()
{
GetSignalSender().UnsubscribeReceiver( this, "Signal.Window.Quit" );
}
void Initiate()
{
GGE::Graphics::TextureHandle texture = GGE::Graphics::TextureManager::Instance().Get( "resources/hal-9000-eye.jpg" );
GGE::Graphics::ModelHandle model = GGE::Graphics::ModelManager::Instance().Get( "resources/TexturedCube.obj" );
myTestText = GGE::Interface::Text( "test.text" );
myTestText.SetString( "Hello World!" );
myTestText.EnableRender();
myTestSprite = GGE::Interface::Sprite( "test.sprite" );
myTestSprite.SetTexture( texture );
myTestSprite.SetScale( 0.5f, 0.5f );
myTestSprite.SetPosition( 100, 100 );
myTestSprite.EnableRender();
myTestObject = GGE::Interface::Object( "test.object" );
myTestObject.SetModel( model );
myTestObject.EnableRender();
GetContext().GetCamera().SetPosition( 0, 0, 10 );
myPlayer.SetCamera( GetContext().GetCamera() );
}
void Update( const sf::Uint32 aDelta )
{
myRotation += aDelta / 1000.f;
myTestObject.SetRotation( 0, myRotation, 0 );
myPlayer.Update( aDelta );
}
private:
bool ReceiveSignal(const GGE::Signals::Base &aSignal)
{
if( aSignal.GetType() == "Signal.Window.Quit" )
{
GGE::Application::Instance().Exit();
return true;
}
return false;
}
GGE::Interface::Text myTestText;
GGE::Interface::Sprite myTestSprite;
GGE::Interface::Object myTestObject;
GGE::Utilities::BasicCameraController myPlayer;
float myRotation;
};
int main()
{
GGE::Application::Create( new MyApplication() );
GGE::Application::Instance().MainLoop();
GGE::Application::Release();
return 0;
}
The SDK
Alright I would say an alpha version has been released now: https://github.com/Groogy/GGE
So far everything to my knowledge works and it's stable.
A lot of more features will be implemented. If you feel "I need this thing now" then just give me a message about it and I'll implement it as fast as I can.
Documentation
Groogy's Game Engine Tutorial 1 - Introduction: Youtube (http://youtu.be/pZHVzeUqrHM), Download (https://legacy.sfmluploads.org/getfile.php?id=27)
Groogy's Game Engine Tutorial 2 - Getting Started Part 1: Youtube (http://youtu.be/WmcuiWiK3oY), Download (https://legacy.sfmluploads.org/getfile.php?id=28)
Groogy's Game Engine Tutorial 2 - Getting Started Part 2: Youtube (http://youtu.be/jzs4YXXiF_4), Download part 1 (https://legacy.sfmluploads.org/getfile.php?id=29), Download part 2 (https://legacy.sfmluploads.org/getfile.php?id=30)
Groogy's Game Engine Tutorial 3 - Drawing 3D: Youtube (http://youtu.be/I9lhjvXZe7c), Download part 1 (https://legacy.sfmluploads.org/getfile.php?id=34), Download part 2 (https://legacy.sfmluploads.org/getfile.php?id=35)
Questions & Suggestions
I am very happy to answer any questions or listen to suggestions you might have. You can ask/suggest privately or here in the thread. Of course you can also send me a message on Github or use any of the great tools Github provides for communication.
-
Cool project! It seems like game engines are the most recent trend :D
Nice wrap around OpenGL for 3D rendering.
Of which abstraction level do you speak here? And isn't this a giant effort, especially when such wrappers have already been written again and again? ;)
By the way, which libraries do you use internally?
-
Cool project! It seems like game engines are the most recent trend :D
Yeh but I started this project because of the second year in my University we will be developing 3D games and it would be nice to have a complete engine by that time.
Nice wrap around OpenGL for 3D rendering.
Of which abstraction level do you speak here? And isn't this a giant effort, especially when such wrappers have already been written again and again? ;)
Well don't know really, since all OpenGL calls are handled in the rendering thread which is completely hidden from the user. The interface consists of a couple of classes which are probably not complete. The Context class which represents a render target/context, like Window or Image. A Renderer class that handles actual rendering to a Context. ShaderProgram class and associated VertexShader and FragmentShader class for writing shaders. And then there is the Object and Model classes for actually representing the 3D Geometrics. Though most of these things are handled trough interface classes in the logic thread so you don't directly affect opengl.
To give a better example, for instance to set opengl to only render lines between vertexes instead of fill you don't say that directly but does instead a call of "context.ShowWireframe()".
So actually it doesn't need to be OpenGL behind it all, it's pretty abstracted from OpenGL so it can be changed.
By the way, which libraries do you use internally?
SFML, OpenGL and GLEW I guess... That's the only ones.
Like I said it was intended for my school project and it's a requirement from the school that the games are done with no middleware so I try to keep away as many libraries I can.
-
Alright the interface is shaping up, got something I need to look over at the signal module as it's pretty clumsy to add a new type of signal at the moment. Though I have no idea on how to improve it.
All that is left after that is to put everything in GGE namespace and maybe move around the classes a little to organize the chaos better.
Thinking about using Cmake depending on how hard it is to learn and how you actually use it on the developer side. Laurent got any special tutorial sites to recommend or their main-site give enough information?
Updated the example to also show how to listen for signals and a pre-made controller class for the camera.
-
Laurent got any special tutorial sites to recommend or their main-site give enough information?
Copy-n-paste from other projects is the best way to get something working :D
The basics are easy to learn, but then you need a lot of tweaking to get what you want.
-
Will it be possible to use only parts (modules) of the engine, without having to initialize everything else?
For example I would want to use your 3D rendering procedures as I haven't found something that would work with SFML in an easy way. Could I just initialize the renderer, define the object which I want to render and just put the rendering line between my 2D rendering code in SFML?
I am very happy with the input and other logic in SFML, just want to be able to kick in some 3D drawings, without having to learn how to use a new framework for things that are already implemented in SFML.
-
Hmm yes you would. Actually no initialization would be needed you would only need to do this I think:
#include <SFML/Graphics.hpp>
#include <GGE/Graphics/Context.hpp>
int main()
{
sf::RenderWindow window( sf::VideoMode( 800, 600 ), "My GGE Project" );
GGE::Graphics::WindowContext context( window );
/* All done for rendering now */
return 0;
}
There is also GGE::Graphics::ImageContext for sf::RenderImage.
I am not sure but I think that should be enough. The Graphics module only dependency should be the Utility module because of the core class for resource management.
For example I would want to use your 3D rendering procedures as I haven't found something that would work with SFML in an easy way. Could I just initialize the renderer, define the object which I want to render and just put the rendering line between my 2D rendering code in SFML?
You should do all the 2D rendering trough the context provided through the library as it handles SFML sf::Drawables too and it makes sure that all settings are properly set for the 2D to be drawn(SFML misses to set and reset some states)
-
Thank you for the quick and accurate answer. In this case I will have to wait a little more before writing any library dependent code for my project as I hope I will become one of the first users of your engine :)
-
Thank you for the quick and accurate answer. In this case I will have to wait a little more before writing any library dependent code for my project as I hope I will become one of the first users of your engine :)
Glad to hear it, but just so you know what I will be releasing is the developing version. I am not quite done yet :P Things that is not complete yet are more advanced stuff like materials and so on. I'm still learning how this works and tries to figure out how I am supposed to link a Wavefront material to a shader? There are so many values there that I have no clue about!
But if you only want to render 3D models and apply a texture to them at this point of time, then this engine will be more than enough :)
Anyway the public interface won't change much, for instance material values I don't know what to do with I silently ignore but still parse. So when those values are supported properly you won't notice a thing :)
When you start and you got any special requests then feel free to give them to me and I'll try and fix it. Since I'll create a github repo for it you could use the issue tracker.
-
At the current point of development for me it will be more than enough to be able to load a 3D model and render it with textures. By the time I need skeletal animation (which will also probably support attached objects to the model; if not I doubt it will be hard to code, since the joints' position could be known) it would have been implemented a thousand times over :D and I will only need to change a few lines of code to implement it.
My current aim is to link all the libraries I will be using in the project from the beginning so that once I have started dealing with logic, networking, input, rendering and whatnot I won't have to worry about things like incompatible libraries with my compiler or having to drastically change the way I manage everything in the game.
-
Of course for the skeletal animation there will be an application that will let you define the hierarchy and assign joints between meshes and so on. Though that might take some time before I get that one done so the skeletal animation system will be available before that.
-
I have new found respect for you Laurent... Tried with just stealing your Cmake config files right off and it still felt like I went trough hell and back. Can't imagine how it must have been making those for hand. Or maybe it's just me that has a problem with it :P
Anyway just finished the Cmake build system for GGE and it works even though it feels a bit inflexible for how it finds the SFML library to link with.
Also it has only been tested out on Windows using Visual Studio 2010 so far so don't know if it will be able to generate properly to any other system.
Yet again, Laurent I tip my hat for you.
-
Hmm having some problem with my template classes. Can't import them properly into my example application or something I don't know. Anyway it's my singleton class that looks like this:
template< class Class >
class Singleton
{
public:
static void Create();
static void Release();
static Class &Instance();
protected:
static Class *ourInstance;
Singleton();
virtual ~Singleton();
};
template< class Class >
void GGE::Utilities::Singleton< Class >::Create()
{
SAFE_DELETE( ourInstance );
ourInstance = new Class();
}
template< class Class >
void GGE::Utilities::Singleton< Class >::Release()
{
SAFE_DELETE( ourInstance );
}
template< class Class >
Class &GGE::Utilities::Singleton< Class >::Instance()
{
return *ourInstance;
}
template< class Class >
GGE::Utilities::Singleton< Class >::Singleton()
{
}
template< class Class >
GGE::Utilities::Singleton< Class >::~Singleton()
{
}
template< class Class >
Class *GGE::Utilities::Singleton< Class >::ourInstance = NULL;
The error's I'm getting are:
Error 2 error LNK2001: unresolved external symbol "protected: static class GGE::Application * GGE::Utilities::Singleton<class GGE::Application>::ourInstance" (?ourInstance@?$Singleton@VApplication@GGE@@@Utilities@GGE@@1PAVApplication@3@A) C:\Users\Groogy\Documents\Work\GGE\VS2010\examples\helloworld\HelloWorld.obj
The thing is that the frameworks Application class inherits from the Singleton class, how do I get that static member variable to be linked with the DLL? Gaaah these Windows specific things are driving me crazy.
The definition of Application looks like this:
class GGE_API Application : public Utilities::Singleton< GGE::Application >
Why does Windows have such a problem with keeping things simple....
Anyone out there that could lend me a helping hand?
UPDATE: I have a few other classes inheriting from Singleton that is also used in the example(resource managers) and they work perfectly without complaint. So checked what the difference is, and it's this function I added before to give a simple way for the user to hijack the logic class.
template< class LogicsClass >
static void Create()
{
SAFE_DELETE( ourInstance );
ourInstance = new GGE::Application( new LogicsClass() );
}
Don't know how this would make the linker freak out.
-
Got it to work in a non-optimal way so would still like to have the previous post solved.
Anyway this new post is to announce that I will release the engine on Sunday(3rd July) and until then I will just add some more stuff like allowing the user to change rendering context on the run, change title on the window, set fullscreen and so on trough the logic thread.
These changes are will add a new interface class so I would like to squeeze them in before releasing my Alpha version.
-
Why does Windows have such a problem with keeping things simple....
I don't think this is a Windows-specific problem. Defining static variables in templates works perfectly, you don't have to export them since templates are header-only. Of course, the variable definition must be located in a header file.
By the way, why don't you use a proper smart pointer instead of that ugly SAFE_DELETE? And why can't the singleton initialize and destroy itself?
-
By the way, why don't you use a proper smart pointer instead of that ugly SAFE_DELETE?
Because I don't want a smart pointer :P
I use reference counting where reference counting is needed. For example I reference count resources, not singletons. I reference count... well that is about it :)
Everything else is RAII based.
NOTE: Even my resources is half loosed on reference counting. They are not removed if they hit 0 references. They are removed only if the memory is needed.
-
I use reference counting where reference counting is needed. For example I reference count resources, not singletons. I reference count... well that is about it :)
I didn't mean you should use a reference counted smart pointer. But something like std::auto_ptr, boost::scoped_ptr or std::unique_ptr. Everything is better than such an unsafe and ugly macro, even plain delete.
Everything else is RAII based.
Well, I see no reason why you can't use RAII here. Manually initializing and destroying something before/after it is used is quite annoying and reminds me of C libraries ;)
-
I use reference counting where reference counting is needed. For example I reference count resources, not singletons. I reference count... well that is about it :)
I didn't mean you should use a reference counted smart pointer. But something like std::auto_ptr, boost::scoped_ptr or std::unique_ptr. Everything is better than such an unsafe and ugly macro, even plain delete.
How would you do it then? The pointer exists in a global scope because of it being static. So no matter what smart pointer class I use, that object will never be destroyed. If I manually destroy the smart pointer then I'm back to square one but with an even uglier indirection.
I want there to be a Create and Release functionality as it's defined in the actual pattern. Though you are not forced to call Create as it will be called trough the Instance() function(just saw I forgot to add that).
-
Can't you use the Meyers singleton? Then you don't even need dynamic memory.
template <typename T>
class Singleton
{
public:
static Singleton& Instance()
{
static Singleton instance;
return instance;
}
private:
...
};
If you absolutely do need a Release() function, you can do it like this, but of course the code becomes slightly more complicated:
#include <memory>
template <typename T>
class Singleton
{
public:
static Singleton& Instance()
{
if (!instance.get())
instance.reset(new Singleton);
return *instance;
}
static void Release()
{
instance.reset();
}
private:
// auto_ptr needs access to our destructor
template <typename T>
friend class std::auto_ptr;
static std::auto_ptr<Singleton> instance;
...
};
-
Hmm I could provide both Meyers and a normal one. These are just design patterns that are provided together with the library.
NOTE: There must be a Create function on the normal so that you can control the allocation in a nice way. Calling Instance() just to allocate the singleton is not very informative.
And of course I do not necessarily NEED the functions but I am just implementing the design pattern for use by others. So someone might expect a Create-Release function pair but if it then don't exist he will get grumpy on me, and then we have someone else that complains on that there is a Create-Release function pair and he get's grumpy. The difference is that the one that don't want the pair I can just tell him to ignore them as they are not needed to actually use the class.
For the actual application in GGE I would only use the normal singleton for one class and the rest would work perfectly(maybe even optimal) with Meyers Singleton.
-
I've used a singleton derived pattern for me (that support polymorphism i think, not tried), because i need a perfect control on what i singlelise :
Obj singleton;
SharedInstance(singleton);
SharedInstance<Obj>()->DoThat();
Obj singletwo;
SharedInstance(singletwo);
...
I agree with Groogy. although it's a C-like behavior, you need external memory management, because devs could need it and could be stopped by this leak.
But i don't manage it itself, I prefer let the user destroy it, or use a GTK-like Garbage, but with more semantics :
template<typename T>
class Garbage
{
public:
virtual ~Garbage();
T& Manage(T*); // I use reference, because the other code use reference, not a Qt like system
private:
std::vector<T*> m_Objects;
};
class GuiHandle : public Garbage<Widget> // GuiHandle can manage memory destruction for widgets object
{
};
I hope you understand me :oops:
-
Understood you perfectly danman. Unfortunately this is a subject there is a grey zone of right.
Anyway as I am reaching my own set deadline I am about to write some documentation and tutorials for use of the engine. Since the engine will eventually contain tools for like skeletal animations, shader/model previewers and so on it would be nice to have video tutorials too.
So am just asking if anyone got a screen capture application to recommend?
-
camstudio works decent.
-
Thanks Pete, now I need a video editing tool to put the different clips together.
-
Introduction tutorial is up on youtube now ^^
http://www.youtube.com/watch?v=pZHVzeUqrHM
Sorry though for my English.
-
I love your soft and sexy voice :D *gets out*.
Actually your English is quite better than mine.. and really easy to understand thus you shouldn't worry.
-
The thing that worries me are all the "Örhm" because I hesitate to think about what I am about to say... and that's even with me practising several times before XD
I actually like doing this. Was quite fun to "vlog" or whatever it's called ^^
Anyway the next tutorial will be up tonight with me showing how to implement the "hello world" application.
Anyway thanks Ceylo for the remark on my voice :wink: *kisses*
-
If you have trouble coming up with names for a project, my tactic is to just keep clicking random on wikipedia until something catches my eye ^^ My latest project is called "Zander (http://en.wikipedia.org/wiki/Zander)" xD
I've found rather easy to create a singleton pattern which decides at compile-time whether it is gamma or meyers, or something the user defines.
Anyway looks interesting ^^
-
The new tutorial is out where we actually do something with the engine:
Groogy's Game Engine Tutorial 2 - Getting Started Part 1 (http://youtu.be/WmcuiWiK3oY)
Groogy's Game Engine Tutorial 2 - Getting Started Part 2 (http://youtu.be/jzs4YXXiF_4)
It became pretty long so had to divide it into two parts.
-
Aaah aaah aaaaaah got a kiss from the guy-with-a-sexy-voice *faints*.
Apart from that, I think you should increase the sound's volume because we can't hear you without setting the volume close to maximum.
As for the "erm" thing, maybe you should write down what you want to say so that you do no more hesitate?
-
Hmmm didn't notice, sounds perfect in my headset. I'll see if I can boost the mic somehow.
And actually I do know what I am going to say, I do the clips in several takes divided into several parts. So I have probably said the same thing over 10 times before moving on. But it feels like it's loosening up, I guess it's just that I am not used to speak English but only write and read it.
-
The sound is good in a quiet environment, but with a few noises or some wind or whatever it becomes harder to hear.
So I suppose your spoken English will improve over the different video tutorials :) . Would be interesting to notice the difference between your first tutorial and your latest.
-
Aight so I am writing the licensing now for the engine and will take the same one as SFML, zlib/png license. I feel that it seems to be the easiest, most minimal and non intrusive license but still retain my right to say "Hey dudes! I made this!" which is more or less only thing I want. Correct me if I'm wrong.
Anyway taking the SFML one as an example:
SFML - Simple and Fast Multimedia Library
Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
I'm interested in the bold part, the years written. What does this exactly mean? Can I just write 2011 there or do I have to apply somewhere for the copyright?
NOTE: Also added download links to the videos for offline use. Thanks to http://www.sfmluploads.org
-
I'm interested in the bold part, the years written. What does this exactly mean? Can I just write 2011 there or do I have to apply somewhere for the copyright?
According to http://www.copyright.gov/circs/circ03.pdf , © 2011 YourName is good.
-
Allright the project repo on Github has been created: https://github.com/Groogy/GGE (Also available in the main post under SDK)
I will create a Youtube tutorial on how to create a 3D scene as soon as I get time but right now I have to prepare for an exam tomorrow.
-
Allright new tutorial available and yes have improved the sound quality :)
Groogy's Game Engine Tutorial 3 - Drawing 3D: Youtube (http://youtu.be/I9lhjvXZe7c), Download part 1 (https://legacy.sfmluploads.org/getfile.php?id=34), Download part 2 (https://legacy.sfmluploads.org/getfile.php?id=35)
Can also be found on the original post of this thread.
-
Updated with a debug module which comes with some helpful debug functions and logging. Now to just use it where needed in the other modules ^^
-
Your engine is amazing and awesome :o . but why a ( const sf::Uint32 aDelta) in void Update in you 2nd video ? a ( const sf::Uint32& ) or a (sf::Uint32) is enought no ?
(no parameter name, because you don't use it)
-
Your engine is amazing and awesome :o .
Thanks :D
And it will get better ;)
but why a ( const sf::Uint32 aDelta) in void Update in you 2nd video ? a ( const sf::Uint32& ) or a (sf::Uint32) is enought no ?
Well I make all arguments const for good practice. It's not an reference because a reference is also 32 bits big so there is no optimization there.
Any variable that does not need to be modified is made const so that no accidental modification is done. If you need to modify the delta time then just copy it to a new variable that is not constant. I think that the overhead from that is worth the extra security ;)
Also it's the code standard on the place I work/study at.
-
Well I make all arguments const for good practice.
I wouldn't do it for copied parameters, only for references and pointers. It is an implementation detail whether the function internally changes the copy, the caller isn't affected. I consider it better not to confuse him with irrelevant information.
You can still write the const in the function definition to make sure you don't accidentally change the parameter. The functions void Fn(int i) and void Fn(const int i) are identical.
In this thread (http://www.sfml-dev.org/forum/viewtopic.php?t=2767), I explain the problem of overusing const in detail.
-
Hmm okay makes sense. I could make the function declaration for Update comply with that so you can choose if you want it to be const or not yourself. Does it work the same with abstract methods?
-
Sorry to bother you on the main thread with compilation problems, but after countless battles vs cmake I finally got to compile sfml2 and tried to compile the engine.
Most of the path variables for cmake were easy to find, but to get the sfml dir path right I had to rename the config.cmake file in the sfml cmake dir to SFMLconfig.cmake, so that cmake would accept the directory sfml2/cmake as nothing else seemed to work (sfml2 ; sfml2/src/SFML ; sfml2/src etc.)
After that cmake finally configured the project and I tried to build it using the command "mingw32-make all" and after about 21% completion I got the current log
[ 6%] Built target gge-utilities
[ 9%] Built target gge-system
[ 20%] Built target gge-threading
[ 21%] Building CXX object src/GGE/Graphics/CMakeFiles/gge-graphics.dir/Camera.cpp.obj
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/TextureManager.hpp:30,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Material.hpp:32,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Renderer.hpp:30,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Camera.hpp:30,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\src\GGE\Grap
hics\Camera.cpp:25:
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp: In destructor 'GGE::Utilities::ResourceManager<Type, Identifier, MaxNum
>::~ResourceManager()':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:83: error: expected ';' before 'it'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:83: error: 'it' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:83: error: 'end' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp: In member function 'GGE::Utilities::Resource<Type, Identifier, MaxNum>
GGE::Utilities::ResourceManager<Type, Identifier, MaxNum>::Get(const Identifier&
)':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:111: error: expected ';' before 'it'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:112: error: 'it' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp: In member function 'Type* GGE::Utilities::ResourceManager<Type, Identif
ier, MaxNum>::GetResource(const Identifier&) const':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:145: error: expected ';' before 'it'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:146: error: 'it' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:150: error: 'it' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp: In member function 'void* GGE::Utilities::ResourceManager<Type, Identif
ier, MaxNum>::GetMemory()':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:217: error: expected ';' before 'resourceEnd'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:218: error: expected ';' before 'it'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:218: error: 'it' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:218: error: 'end' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:220: error: expected ';' before 'resourceIterator'
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:221: error: 'resourceIterator' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Utilities/ResourceMana
ger.hpp:221: error: 'resourceEnd' was not declared in this scope
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/VertexShaderManager.hpp:28,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/ShaderProgram.hpp:29,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/ShaderProgramManager.hpp:28,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Renderer.hpp:31,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Camera.hpp:30,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\src\GGE\Grap
hics\Camera.cpp:25:
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Graphics/Shader.hpp: I
n destructor 'GGE::Graphics::Shader<ShaderType>::~Shader()':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Graphics/Shader.hpp:12
0: error: there are no arguments to 'SHADER_DELETE' that depend on a template pa
rameter, so a declaration of 'SHADER_DELETE' must be available
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Graphics/Shader.hpp:12
0: note: (if you use '-fpermissive', G++ will accept your code, but allowing the
use of an undeclared name is deprecated)
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/VertexShaderManager.hpp:28,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/ShaderProgram.hpp:29,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/ShaderProgramManager.hpp:28,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Renderer.hpp:31,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/
Graphics/Camera.hpp:30,
from E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\src\GGE\Grap
hics\Camera.cpp:25:
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Graphics/Shader.hpp: I
n member function 'void GGE::Graphics::Shader<ShaderType>::UpdateSource()':
E:\Users\Alejandro\Desktop\Groogy-GGE-e586583\include/GGE/Graphics/Shader.hpp:22
8: error: there are no arguments to 'memcpy' that depend on a template parameter
, so a declaration of 'memcpy' must be available
mingw32-make[2]: *** [src/GGE/Graphics/CMakeFiles/gge-graphics.dir/Camera.cpp.ob
j] Error 1
mingw32-make[1]: *** [src/GGE/Graphics/CMakeFiles/gge-graphics.dir/all] Error 2
mingw32-make: *** [all] Error 2
-
Hmm weird you are having problem with cmake and sfml2. For me it worked straight out of the box.
Think I found a solution to the error but I am currently testing so we'll see. I'll let you know when there's a commit up.
UPDATE: This is gonna take a while. MinGW is complaining on a lot of things that VS10 didn't complain on. Everything is on my template classes though.... tricky bastards...
UPDATE: Compiles just fine now. Didn't link for me as I don't have a MinGW installation of SFML2. But it should work fine for you. If not let me know and I'll compile a MinGW version of SFML2 to test against.
-
Progress bar went to 57% before getting these errors:
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Sign
als\JoystickMoved.cpp:1:
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:39: error: 'sf::Joystick' has not been declared
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:39: error: ISO C++ forbids declaration of 'Axis' with no type
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:39: error: typedef name may not be a nested-name-specifier
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:39: error: expected ';' before 'Axis'
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: 'Axis' has not been declared
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Sign
als\JoystickMoved.cpp:1:
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:45: error: 'Axis' does not name a type
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:54: error: 'Axis' does not name a type
In file included from E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Sign
als\JoystickMoved.cpp:1:
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: expected type-specifier before 'Axis'
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: expected '>' before 'Axis'
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: expected '(' before 'Axis'
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: 'Axis' was not declared in this scope
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\include/GGE/Signals/JoystickMoved.
hpp:41: error: expected ')' at end of input
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Signals\JoystickMoved.cpp:
3: error: 'Axis' has not been declared
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Signals\JoystickMoved.cpp:
In constructor 'GGE::Signals::JoystickMoved::JoystickMoved(unsigned int, int, f
loat, sf::Window*)':
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Signals\JoystickMoved.cpp:
8: error: 'class GGE::Signals::JoystickMoved::JoyMoveResource' has no member nam
ed 'axis'
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Signals\JoystickMoved.cpp:
At global scope:
E:\Users\Alejandro\Desktop\Groogy-GGE-64de575\src\GGE\Signals\JoystickMoved.cpp:
22: error: 'Axis' in class 'GGE::Signals::JoystickMoved' does not name a type
mingw32-make[2]: *** [src/GGE/Signals/CMakeFiles/gge-signals.dir/JoystickMoved.c
pp.obj] Error 1
mingw32-make[1]: *** [src/GGE/Signals/CMakeFiles/gge-signals.dir/all] Error 2
mingw32-make: *** [all] Error 2
Edit1: I think that these error might be there because my sfml2 isn't from the latest snapshot, I'll download it and tell you what has happened.
Edit2: After downloading the latest snapshot of sfml2 and building it, everything linked correctly :) Now I'll finally be able to use your engine ^^
-
Good to hear ^^
Though I haven't documented the graphics module yet. As I gathered you were only interested in that? I can get right on documenting that so it will be easier to use for you. If you got questions how things work don't be afraid to ask.
-
After changing the include and lib files for my Qt project to the newly compiled sfml2 static libs I'm getting some weird errors:
:-1: error: D:\GameLibs\SFML2\build-static\lib\libsfml-graphics-s.a(RenderWindow.cpp.obj): warning: duplicate section `.rdata$_ZTIN2sf6WindowE[typeinfo for sf::Window]' has different size
:-1: error: D:\GameLibs\SFML2\build-static\lib\libsfml-window-s.a(Window.cpp.obj): warning: duplicate section `.rdata$_ZTIN2sf6WindowE[typeinfo for sf::Window]' has different size
Unless something has changed from about a month ago that made the Qt SFML tutorial incompatible with the current branch I guess I won't be able to use the engine any time soon after all :/
Edit1: Got it working, seems like you need to clean and rebuild everything in your project when you use something new ...
-
Alright some more changes has been committed, check out the repo for details.
Next on my schedule is to add a heap structure to the utilities library, create a common rendering queue and use this for the rendering queue and add a mechanism for the developer to specify the graphics priority for drawing.
Some time in the future I will also allow the developer to create separate layers with their own rendering queues. And of course with this changes to the context class will be made so that they can turn on and of z-buffer and etc. to get appropriate effects.
-
On the rendering queue priority.... I'm thinking... Should I use z for that? So that for 3D objects the priority will be: camera.z - object.z and for 2D objects I also add a Z value that don't affect rendering but only it's order in the heap?
Or should I separate this entirely from positioning?
Anyone interested that can give me their opinion?
Issue: https://github.com/Groogy/GGE/issues/17
-
WARNING! Latest changes to SFML2 regarding mouse input has the engine freaking out. Will take me some time to sort it out. Will be fixed soon I hope.
Seems to be an error on SFML2's side so will just have to sit and wait until Laurent sorts it out.
-
Okay mouse input is working normally again and also the engine had some problems with MinGW, something about templates, static variables and DLL's. Apparently these 3 don't play nice together. But now it works =)
Thanks Alejandro for bearing with me. Hope you'll enjoy using the engine. As I've said, if something is missing tell me and I'll implement it as fast as I can. If I already have it planned then I will prioritize it if possible.
-
Been up all night working on the engine. Got finally in Frustum and OOBB cull testing. Though the Frustum vs OOBB test can be optimized. Right now a new rotation matrix is created every time we do a call to BoxInside.
Not used yet by the engine but the classes are there to be used manually if you want to. I am first going to implement an octree for spatial partitioning to magically cull away so many objects as possible without actually doing any tests. Then both classes will be used on the graphical side of the engine so the user won't even need to do anything. All he has to do is enable a 3D object to be rendered and then the engine will handle the rest.
UPDATE: Also added an example now that shows how frustum works and how to cull objects. Though this will of course later on be handled internally in the engine. But those that want to do it in logics for some reason should use this as a reference point.
-
Alright working on the Spatial partitioning optimization(Octree to be exact) for the engine. Though need a way to determine how big a model/an object is in order to put them in the right node. I'm interested in opinions if anyone are willing to give that.
I can't do per-vertex collision test for this as it must allow remove and adding of objects dynamically as the game world changes. What I can come up with that's reasonable is using a sphere or a bounding box. The bounding box would let us get the models as deep down as possible in the hierarchy letting us cut more objects away when doing an "in view" test or even collision tests. The other hand sphere's are simpler and faster and would let us add and remove objects much easier though an object might be on a level too high compared to the bounding box.
Also thinking that there might be possible to add a functionality where the developer can "attach" a collision test object themselves but that would remove a lot of optimizations I can do if it would be just simply spheres.
So I am torn between optimizing the actual partitioning or the dynamic change of the partitioning. Any suggestions or ideas are appreciated ^^
-
Spheres and bounding boxes are both great ways to make the collision detections simpler, but the thing is that some objects might be suited for one rather than the other and if only one system is implemented, some objects might suffer from it.
Another option might be using ellipsoids as the combine the best parts of both primitives, if used for organic models, but for static scenery, which in most cases is constructed of blocks, it would be a waste of performance.
Allowing the developer to attach their own collision model is the best way in my opinion, but it would cut on the possible optimizations. Maybe you could add all options and use the specific optimizations for the different objects, making the performance cost lower a bit, if it isn't too much work to do.
What I would do in such a case (if I had the knowledge for optimizations and 3D drawing) is make 2 separate objects: 1 for scenery and 1 for moving objects. The scenery would use bounding box collision making it easy to do collision vs moving objects, since most of the time you won't want to do such smooth motions and paths, which can be achieved with pathfinding algorithms anyway. Objects which aren't static could use any of the 3 possible collision models, making it easier to make accurate collisions, but increasing the performance cost. Maybe you can give the objects which have used defined collision models, a simpler model, which will be used, when frame rate lowers drastically.
Hopefully I haven't confused you entirely and made nonsense offers :lol:
-
Just some background. Octree is made for optimizing a lot of stuff. The basic idea is to let us divide the world into several nodes which will let us cut away objects that are so far away that it would make no sense to do any test between them whatsoever. Let's say we do a frustum test to only call render to the objects in view. It is unnecessary to do the frustum check against every object, in fact it can turn out to actually hurt the performance instead. So instead we do a frustum test against the octree to find what nodes are in view and only do a frustum check against the objects inside those nodes. But don't worry you actually gave me some insight.
Spheres and bounding boxes are both great ways to make the collision detections simpler, but the thing is that some objects might be suited for one rather than the other and if only one system is implemented, some objects might suffer from it.
That's what I am afraid of but it might be hard to support several different ones in the same system.
Allowing the developer to attach their own collision model is the best way in my opinion, but it would cut on the possible optimizations. Maybe you could add all options and use the specific optimizations for the, making the performance cost lower a bit, if it isn't too much work to do.
So the default would be a sphere with the radius equal to the distance of the farthest vertex. Which is as simple as possible. But this means I must implement a generic collision system that still supports the sphere optimized for octree addition and removal.
Aight will soon be working on this. But thinking how would the developer describe the collision model? Should every model/object have it's own configuration file for stuff like this?
-
I don't have a lot of time to get to know this piece of work better, but it absolutely looks fantastic :D
Great work, this is to give all support so you continue to invest your time in such a great way, keep going friend!
-
Alright Spatial Partitioning system is in now and is pretty modular so that others can use it in logics to limit search algorithms and so on. The ManualCulling example has been updated to show how to use frustum together with the octree to cull away huge amounts of graphics that is not in view.
Next step is to add this to the graphics thread so that it works by itself without the user actually having to do any cull logic. Also there might be more stuff to add to the frustum and octree classes in the future but the basics are in now.
-
Alright the Octree class is now expandable. If an object is inserted outside the extents of the octree it will try and expand it until it covers that object entirely. The function that does this is public so can also be done manually.
With that I've replaced the render queue for 3D objects in the graphics thread with an octree. So even though logically you have a million graphical objects placed out in the world the graphical thread will efficiently find those in view and render only those.
I've updated the original post and next up on my schedule is probably configuration and the like. The question is if a scripting language should be used for configuration or just something simple from a text file.
I will probably be starting working on my own game as soon I figure out some more details in the game play.
-
Hello,
Is this project still active? I was wanting to use it for a game I've been wanting to make, but it hasn't been updated for a while. If it's not I could always build off of it for my own use, though.
By the way, I love the design of the interface. It's very elegant!
-
Thanks, well this version is not really active no. I'm more or less doing a remake on Github under a private repo called Ymir(The norse giant which was slained by the norse gods to create the world)
The new remake will take a lot of time and this time not released until I reach a certain milestone. So when I have my own game working in it. :wink:
The new one will be more clean, especially at letting the developer both have it as a framework or just as a barestrap interface against 3D. Currently I use the engine to fake 3D with sprites and shapes but is going to change soon. It already support more stuff than GGE does. For instance it comes with a scripting language where you even can modify the rendering pipeline. Even the threading and interface against it is better.
But until it is released, you are free to use whatever part of GGE that you want. It's zlib licence so you are not limited in any way.