SSSF --> SnowStorm State Framework

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

SSSF --> SnowStorm State Framework

Post by Robomaniac »

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

:-P
Last edited by Robomaniac on Sat Aug 28, 2004 7:20 am, edited 1 time in total.
phear hingo

My Webpage
mashadar
Gnoblar
Posts: 1
Joined: Tue Oct 22, 2002 1:04 am
Location: Stevens Point, Wisconsin, USA

Post by mashadar »

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.
User avatar
Jezze
Halfling
Posts: 44
Joined: Wed Apr 09, 2003 12:47 pm
Location: Uppsala, Sweden
Contact:

Post by Jezze »

To be able to see the picture you have to make a new browser window and enter the text in it instead of just pressing the link...
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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.
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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++
phear hingo

My Webpage
Spoke_not_loged

Post by Spoke_not_loged »

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.
User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

Robomaniac wrote:Link --> www.centaurftp.web1000.com/OGSF.rar
Can you provide the file on another host ? Or email it to me ?
web1000.com sites are a bit difficult to access from Germany, at least without using certain proxy servers.

-psy
User avatar
Antiarc
Greenskin
Posts: 120
Joined: Thu Jan 23, 2003 8:40 am
Contact:

Post by Antiarc »

Psyclonist: I've mirrored it for you at http://ogre.digitalsentience.com/files/OGSF.rar
User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

Thanks a lot, Antiarc! :D

-psy
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Well, i'm picking this back up again for my upcoming game. Expect a refactor/rewrite and source posts every now and then :)

And Visual C++ Projects :)

If there is a demand for a dev c++ project, i'll add one, but if noone tells me, i'm not gonna go through the effort ;)

-- The Robomaniac
phear hingo

My Webpage
User avatar
toastie
Gnoblar
Posts: 17
Joined: Fri Mar 07, 2003 3:49 am
Location: Gotham City

Post by toastie »

Robo, you're up there with wolfman8k, as far as geniouses under 15 go :)
Rest well this night. For tomorrow you sail for the kingdom of Daggerfall.
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Why thank you :)
phear hingo

My Webpage
wolfman8k
Gnoblar
Posts: 4
Joined: Thu May 15, 2003 11:42 am
Contact:

Post by wolfman8k »

toastie wrote:Robo, you're up there with wolfman8k, as far as geniouses under 15 go :)
I'm not under 15.

I feel old :cry:
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

v 2.0 Feature List

Post by Robomaniac »

v 2.0 Will be coming out tomorrow, its feature set will be:
  • 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
More features will be posted tomorrow (when I add them)

Optional Modules:
toLua++ Generated Lua Bindings
Tutorial
Documentation Manual

Look back tomorrow for the download!
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

NEW VERSION

Post by Robomaniac »

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;

Code: Select all

SSSF::GameEngine* engine = new SSSF::GameEngine();
For each gamestate you would like to create, create a child class of GameState

Code: Select all

class GS_Server_Brower : public SSSF::GameState
A test bed game state is included.

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();
Update(float tslf)
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);
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.

Code: Select all

...GS_TestBed("GS_TestBed", engine)...
engine->ChangeState("GS_TestBed");
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 ;))

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");
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!
Last edited by Robomaniac on Mon Dec 20, 2004 7:00 am, edited 1 time in total.
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Ok, some errors reared their ugly ugly heads.

1) m_RenderWindow->setDebugText(); does not work for some strange reason :\

2) I added a static Get function to the GameEngine class which acts as a getSingletonPtr() in ogre classes

I'll update the release in a few hours
phear hingo

My Webpage
User avatar
PeterNewman
Greenskin
Posts: 128
Joined: Mon Jun 21, 2004 2:34 am
Location: Victoria, Australia
Contact:

Post by PeterNewman »

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.
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Stupid, Stupid Me. :oops:

I switched this time writing this from using for loops to while loops for doing iterators.

I seem to have forgoten an i++; in each loop though :(

I'll post an updated version tonight, with a few enhancements.
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Grrrr....

Errors, lots of unexplainable ones happened yesterday, i don't know what set them off. I'm rolling back to the old version and going from there.

Luckily, theres not too much of a difference
phear hingo

My Webpage
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

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?
phear hingo

My Webpage
Chev
Gnoblar
Posts: 13
Joined: Fri Mar 05, 2004 6:11 pm

Post by Chev »

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?

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;
}
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

Sorry for the absense, i do, but not on my hands right now.

If it is running in debug, it'll take 10+ seconds to shut down due to ogre doing a mem leak check. If you in release, it should shut down pretty fast.

I'll check my main.cpp either tonight or tomorrow, depending on when i get my comp back
phear hingo

My Webpage
Post Reply