Best way to use ogre in a game?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
vgmdev
Greenskin
Posts: 110
Joined: Tue Feb 08, 2005 2:58 am
Location: MI, USA

Best way to use ogre in a game?

Post by vgmdev »

What is the best way to use ogre in a game?
Game engine, Using it directly, Some abstraction or what?!

EDIT: I have readed "Managing Game States", is this the best way?

Thank You! :D
User avatar
Julius
Kobold
Posts: 35
Joined: Tue Mar 22, 2005 10:53 pm
Location: Germany

Post by Julius »

maybe this:

www.yake.org

?
FreeGameArts<-back online!
User avatar
Raven
Goblin
Posts: 203
Joined: Wed Mar 23, 2005 1:07 pm
Location: Melbourne, Australia

Post by Raven »

'Managing game states' is great if you need to change scenes (or scene managers) for different parts of your game
(i.e going from outdoors to indoors like in an adventure game)

But if your game is more like a simple application like the chess game or YAT(yet another Tetris Clone) were there is only one active window for the duration of the game, you will not need to bother with the whole State managment :)
I used up all my sick days, so I'm calling in dead.
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark

Post by DWORD »

Raven wrote:But if your game is more like a simple application like the chess game or YAT(yet another Tetris Clone) were there is only one active window for the duration of the game, you will not need to bother with the whole State managment :)
Just for correctness, both YAT and Chess make extensive use of state management. They just don't switch scene managers through it. I never really looked at 'Managing game states', but I suspect it's the same concept.

For developing simple games like these, I think it's fine to go with this approach and using Ogre directly.
User avatar
Walley
Greenskin
Posts: 120
Joined: Fri Dec 03, 2004 4:37 am
Location: Victoria, Australia

Post by Walley »

There is no 'best' way. It all depends on what you're aiming to achieve.

If you want to make a small game quickly, without much focus on future modification, it's probably best to avoid being abstract and just use everything directly.

However, if you plan on either a big project, or one that is easily extendable and a pleasure to work with, then you'd want some abstractness.

A state system isn't *needed*, but it's very nice to have one. Personally I'm turning into a bit of a design freak as time goes by, so sadly even for a small project I find I can't help but go abstracting it all anyway.

Anyway, I suppose it all comes down to resources - how much time and effort are you willing to put in for results?
User avatar
vgmdev
Greenskin
Posts: 110
Joined: Tue Feb 08, 2005 2:58 am
Location: MI, USA

Post by vgmdev »

ok, thinks. :wink:
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

Post by psyclonist »

Walley wrote:There is no 'best' way. It all depends on what you're aiming to achieve.
Agreed!
Walley wrote:If you want to make a small game quickly, without much focus on future modification, it's probably best to avoid being abstract and just use everything directly.

However, if you plan on either a big project, or one that is easily extendable and a pleasure to work with, then you'd want some abstractness.
I'd say it depends how much time you need to get going with the "abstract" approach. If an engine provides you tools and frameworks which get you towards your goal (the game) faster then that might be worth a try rather building everything from scratch and, even more importantly, test and bugfix it yourself.

-psy
User avatar
vgmdev
Greenskin
Posts: 110
Joined: Tue Feb 08, 2005 2:58 am
Location: MI, USA

Post by vgmdev »

One more thing. This is about a game loop,
What about Frame Listeners? Have one per state?
Tyn
Gremlin
Posts: 195
Joined: Mon Jul 19, 2004 11:40 pm
Location: England

Post by Tyn »

I find it easiest to have one frame listener that passes the events to the active state. That's the way it's done in the tutorial as well I think.
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams

http://www.spacecolonization.net
2080: Space Colonization
User avatar
vgmdev
Greenskin
Posts: 110
Joined: Tue Feb 08, 2005 2:58 am
Location: MI, USA

Post by vgmdev »

Well I’m trying to get a game loop together but I don’t understand how to do in ogre. I understand ogre from main() to initialize() but that’s about it.
User avatar
Raven
Goblin
Posts: 203
Joined: Wed Mar 23, 2005 1:07 pm
Location: Melbourne, Australia

Post by Raven »

The frame started and frame ended will be called every frame.
You only need put your code in here and it will loop :wink:
I used up all my sick days, so I'm calling in dead.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3

Post by Praetor »

Ogre is extremely object oriented. This means that the engine is already very abstract. I started out using Ogre in my engine in a very abstract way, and then scrapped it and started to use the API directly. Works fine, is very readable. In general I think Ogre is well enough designed from an OO standpoint that there is no need to build in extra abstraction. That is, of course, unless you plan on supporting more than one engine or something