SSSF --> SnowStorm State Framework
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
SSSF --> SnowStorm State Framework
I don't know where to post this, so I guess it belongs here. I've started on a project called the Ogre Game State Framework (OGSF). This will be a very, very watered down game structure, like badcamels, but w/o alot of features. This is mainly for people who just want a very basic game state structure and then just code the rest. This is based on the ICE (Irrlicht Common Engine Framework, http://www.skyesurfer.net/keless/IrrLicht/ICE/) This is just starting, but i've got the very, very basic structures worked out. I also have one screenshot to show everyone, nothing too much.
http://www.geocities.com/centaurforce/Images/ogsf1.JPG
http://www.geocities.com/centaurforce/Images/ogsf1.JPG
Last edited by Robomaniac on Sat Aug 28, 2004 7:20 am, edited 1 time in total.
-
- Gnoblar
- Posts: 1
- Joined: Tue Oct 22, 2002 1:04 am
- Location: Stevens Point, Wisconsin, USA
Just to let you know, geocities doesn't let you link directly to images, so you'll have to link to a html file.
However, i saw the shot you had of OGRE running with the framework in your gallery, and it looks very impressive. I would like to see what you've done thus far.
I have been trying to get a simple game framework setup for myself (it's going rather slow), so if your looking for a helping hand, i would be glad to help.
However, i saw the shot you had of OGRE running with the framework in your gallery, and it looks very impressive. I would like to see what you've done thus far.
I have been trying to get a simple game framework setup for myself (it's going rather slow), so if your looking for a helping hand, i would be glad to help.
- Jezze
- Halfling
- Posts: 44
- Joined: Wed Apr 09, 2003 12:47 pm
- Location: Uppsala, Sweden
- Contact:
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
The screenshots in the shots page are not using the framework, but i've been having some troubles getting it to work. I can't seem to get it to run, but thats just me not really knowing the engine. If anyone wants to help a bit with some of the structure stuff by giving my some ideas about basic structure, that'd be great. Since there are no tutorials that don't use the ExampleApplication.h file, i've been having trouble getting one to work w/ my program format.
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
Posted my source at http://www.geocities.com/centaurforce/O ... mework.htm . If anyone would take a look at it and point me in the right direction, that would be appreciated
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
Well, i've finally picked this back up, and it is almost to version 0.5. It currently has :
--> Input passing
--> Game States
--> Config Reader (from ogre)
--> basic Game Engine
Still Needs :
--> XML Parser
--> new configuration screen
--> actually useful gamestates (not just test ones)
--> More Stuff
--> Input passing
--> Game States
--> Config Reader (from ogre)
--> basic Game Engine
Still Needs :
--> XML Parser
--> new configuration screen
--> actually useful gamestates (not just test ones)
--> More Stuff
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
Link --> www.centaurftp.web1000.com/OGSF.rar
It should be up by 9 AM Eastern Time (aka. 4 minutes from this post)
Hope you like it.
It currently only has a dev c++ project though, as i am in the middle of converting it to visual c++
It should be up by 9 AM Eastern Time (aka. 4 minutes from this post)
Hope you like it.
It currently only has a dev c++ project though, as i am in the middle of converting it to visual c++
Hi!
We are working on a framework which uses code from here and there (bad_camel framework and the like) and we have a Game State Manager System working.
We are currently porting the GameStates to LUA so new game states can be defined as LUA classes without recompiling the exe.
The test, so far, are working fine and we spect to have something to release in the near future.
See you arround.
We are working on a framework which uses code from here and there (bad_camel framework and the like) and we have a Game State Manager System working.
We are currently porting the GameStates to LUA so new game states can be defined as LUA classes without recompiling the exe.
The test, so far, are working fine and we spect to have something to release in the near future.
See you arround.
- psyclonist
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
- Contact:
Can you provide the file on another host ? Or email it to me ?Robomaniac wrote:Link --> www.centaurftp.web1000.com/OGSF.rar
web1000.com sites are a bit difficult to access from Germany, at least without using certain proxy servers.
-psy
- Antiarc
- Greenskin
- Posts: 120
- Joined: Thu Jan 23, 2003 8:40 am
- Contact:
Psyclonist: I've mirrored it for you at http://ogre.digitalsentience.com/files/OGSF.rar
- psyclonist
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
- Contact:
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
-
- Gnoblar
- Posts: 4
- Joined: Thu May 15, 2003 11:42 am
- Contact:
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
v 2.0 Feature List
v 2.0 Will be coming out tomorrow, its feature set will be:
Optional Modules:
toLua++ Generated Lua Bindings
Tutorial
Documentation Manual
Look back tomorrow for the download!
- Saving and Loading of States from Memory (think Resume Game buttons)
Cleaned Up Interface
Game States now hold their own frame listeners, so one state can used buffered, another, unbuffered input and such
Optional Modules:
toLua++ Generated Lua Bindings
Tutorial
Documentation Manual
Look back tomorrow for the download!
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
NEW VERSION
Well, a new version got done today. It uses the same principles as the 2.0, but much cleaner, and in a spiffier manner.
http://prdownloads.sourceforge.net/cent ... p?download
Since i didn't get the chance to document it (and hardly any code comments ), here is a short tutorial on how to use it.
=============================================
In your main function, create an instance of SSSF::GameEngine;
For each gamestate you would like to create, create a child class of GameState
A test bed game state is included.
in each of your GameState classes, add the following memebers
Does what it says, it updates the game state. Include any parts that need updating here.
Param: time since the last frame
OnKeyEvent(float tslf)
Here you process key events, although you could do it in Update, OnMouseEvent, wherever, this is the function that gets called
Param: time since last frame
OnMouseEvent(float tslf)
Same as above, but w/ mouse events
Create()
Here you create the items needed by the game state. Use this function instead of the constructor, so you can restore states.
See: GS_TestBed
Destroy()
Does nothing as of now
Hide()
Hides the game state items, but keeps them in memory for future reference. If you want to remove the game state from memory, call Destroy right before you switch states.
In your constructor, or after you create an instance of a game state, to register it with the state_handler (GameEngine), call
To switch to a different state, call the GameEngine::ChangeState function with the string handle of the game state you gave to ur state.
ex.
This allows for easy extension using scripts. For example, using python (once bindings are made) (please don't mind any code errors, my python is a bit shakey )
This way, you can effectively create all of your gamestates in scripting, while keeping your ogre init and base code in c++.
Hope you like it, and expect mroe upgrades at random points.
P.S. The reason for the name change is that it is now part of the game engine i'm making, codename SnowStorm.
Enjoy!
http://prdownloads.sourceforge.net/cent ... p?download
Since i didn't get the chance to document it (and hardly any code comments ), here is a short tutorial on how to use it.
=============================================
In your main function, create an instance of SSSF::GameEngine;
Code: Select all
SSSF::GameEngine* engine = new SSSF::GameEngine();
Code: Select all
class GS_Server_Brower : public SSSF::GameState
in each of your GameState classes, add the following memebers
- bool Update(float timeSinceLastFrame);
- bool OnKeyEvent(float tslf);
- bool OnMouseEvent(float tslf);
- bool Create();
- bool Destroy();
- bool Hide();
Does what it says, it updates the game state. Include any parts that need updating here.
Param: time since the last frame
OnKeyEvent(float tslf)
Here you process key events, although you could do it in Update, OnMouseEvent, wherever, this is the function that gets called
Param: time since last frame
OnMouseEvent(float tslf)
Same as above, but w/ mouse events
Create()
Here you create the items needed by the game state. Use this function instead of the constructor, so you can restore states.
See: GS_TestBed
Destroy()
Does nothing as of now
Hide()
Hides the game state items, but keeps them in memory for future reference. If you want to remove the game state from memory, call Destroy right before you switch states.
In your constructor, or after you create an instance of a game state, to register it with the state_handler (GameEngine), call
Code: Select all
GameEngine::AddState(GameState* state);
ex.
States::GS_TestBed* state = new States::GS_TestBed("GS_TestBed", engine);
engine->AddState(state);
ex.
Code: Select all
...GS_TestBed("GS_TestBed", engine)...
engine->ChangeState("GS_TestBed");
Code: Select all
class GS_Main_Menu(GameState):
#Functions go here
GS_Main_Menu menu("Main_Menu", engine);
engine.AddState(menu)
engine.ChangeState("Main_Menu");
Hope you like it, and expect mroe upgrades at random points.
P.S. The reason for the name change is that it is now part of the game engine i'm making, codename SnowStorm.
Enjoy!
Last edited by Robomaniac on Mon Dec 20, 2004 7:00 am, edited 1 time in total.
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
Also, i didn't include a project file as i don't have one. I've been as i said, developing this for my game engine (which may or may not be released)
Just add all files to your project, point to the ogre headers, and point to the ogre lib.
It's been tested using .net2k3 and i'm 90% sure it'll work on all other platforms.
If u get any errors, try to fix them, and if u can't just give em to me, and i'll see what i can do
Just add all files to your project, point to the ogre headers, and point to the ogre lib.
It's been tested using .net2k3 and i'm 90% sure it'll work on all other platforms.
If u get any errors, try to fix them, and if u can't just give em to me, and i'll see what i can do
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
- PeterNewman
- Greenskin
- Posts: 128
- Joined: Mon Jun 21, 2004 2:34 am
- Location: Victoria, Australia
- Contact:
A tip for the setDebugText Robo:
WHat the ExampleApplication does is every frame (or so) it will call mRenderWindow->getDebugText()
It then gets the DebugText (or something similar name) element from the default Ogre overlay, and sets its value to the debug text.
I dont know if in the past the RenderWindow was responsible for this and with the chages to the GUI system its been moved out. But I know you said in the IRC that you weren't using the ExampleApplication, so I'm guessing that the setDebugText will never get displayed if you do do the update-the-overlay step.
WHat the ExampleApplication does is every frame (or so) it will call mRenderWindow->getDebugText()
It then gets the DebugText (or something similar name) element from the default Ogre overlay, and sets its value to the debug text.
I dont know if in the past the RenderWindow was responsible for this and with the chages to the GUI system its been moved out. But I know you said in the IRC that you weren't using the ExampleApplication, so I'm guessing that the setDebugText will never get displayed if you do do the update-the-overlay step.
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am
Ok.
Long time, no work.
I have got SSSF back to its improved state, and it seems to be working. I also generated lua bindings fine (toLua++) so those are included
I will upload another binary whenever i can get the chance (sat or sun most likely)
Btw, is anyone using this and has any suggestions for ways it can be improved?
Long time, no work.
I have got SSSF back to its improved state, and it seems to be working. I also generated lua bindings fine (toLua++) so those are included
I will upload another binary whenever i can get the chance (sat or sun most likely)
Btw, is anyone using this and has any suggestions for ways it can be improved?
-
- Gnoblar
- Posts: 13
- Joined: Fri Mar 05, 2004 6:11 pm
Hi Robo! I decided to test this out today
Here's the code I'm using for my main loop. The demo runs and I see the ninja and can move around. When I hit esc it just hangs on engine->Destroy(). Do you have an example "main.cpp" that shows how to properly set up the loop and/or shut stuff down?
Here's the code I'm using for my main loop. The demo runs and I see the ninja and can move around. When I hit esc it just hangs on engine->Destroy(). Do you have an example "main.cpp" that shows how to properly set up the loop and/or shut stuff down?
Code: Select all
#include "windows.h"
#include "Game_Engine.h"
#include "GS_TestBed.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
{
SSSF::GameEngine* demo1 = new SSSF::GameEngine();
demo1->Initialize();
while (demo1->Update())
{
}
demo1->Destroy();
return 0;
}
- Robomaniac
- Hobgoblin
- Posts: 508
- Joined: Tue Feb 03, 2004 6:39 am