User input

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Dan Forever
Gnoblar
Posts: 3
Joined: Thu Jul 07, 2005 9:05 pm
Contact:

User input

Post by Dan Forever »

I'm new to ogre, and looking through the tutorials, it mentions that Ogre is intended to only be a graphics engine, nothing more, if thats the case, is it a better or worse to write your own code for getting input via a keyboard/mouse then using what ogre already has, assuming you know what you're doing and could make it well?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

We are happily using Ogre's input system and have had no real problems so far.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: User input

Post by jacmoe »

Dan Forever wrote: is it a better or worse to write your own code for getting input via a keyboard/mouse then using what ogre already has, assuming you know what you're doing and could make it well?
Definately.
Whilst the Ogre input works well, it is limited to mouse and keyboard.
It doesn't support joysticks, gamepads, etc. Hasn't got action mapping, force feedback, etc.
If you know what you are doing - and you are doing it well - writing your own input module is better! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Action mapping is not really a responsibility of the low level input system. We built it on top of Ogre's input system. And since you only want mouse/keyboard input Ogre's system should be just fine.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

i thought ogres input system wasnt meant to be that good?

you could use SDL's input system, the wiki has been recently updated with the SDL dlls that actually works, well, they do so far, ive only tested them on debug etc
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

How is "good" defined? If good is good enough Ogre's own system is..well.. good enough. As long as you only want Mouse/keyboard input that is.
team-pantheon programmer
creators of Rastullahs Lockenpracht
Dan Forever
Gnoblar
Posts: 3
Joined: Thu Jul 07, 2005 9:05 pm
Contact:

Post by Dan Forever »

Whats action mapping?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

What in-game action is mapped to what key/mouse-action.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

i thought Ogres input system was made just for the tutorials etc, and not built to be used in proper game projects?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

As I said: We use it without problems so far.
team-pantheon programmer
creators of Rastullahs Lockenpracht
CrimsonShadow
Gnoblar
Posts: 23
Joined: Sat May 28, 2005 7:40 pm

Post by CrimsonShadow »

One of the things I find isn't great about Ogre's input system is there doesn't seem to be a way to release the mouse. (ie. If I want to let the mouse go outside the rendering window in windowed mode.) I haven't found a way to do this and it seems like it was never intended to.

If I'm wrong please let me know as that is one of the main reasons I'm trying to find another cross-platform input system and if it's easy to get around this limitation I'll probably stick with the Ogre system until I need joystick support.

-CrimsonShadow
Dan Forever
Gnoblar
Posts: 3
Joined: Thu Jul 07, 2005 9:05 pm
Contact:

Post by Dan Forever »

I think thats typical of most game engines, you generally need to alt tab out or somehow bring into focus a different window.
CrimsonShadow
Gnoblar
Posts: 23
Joined: Sat May 28, 2005 7:40 pm

Post by CrimsonShadow »

Well in full-screen mode then of course you want to capture the mouse and if your game/application wants the ability for the user to just keep moving the mouse in a direction without leaving the window then that makes sense too but there are cases where you don't want this. A good example of what I'd like to do for mouse input is the way Star Wars Galaxies handled it.

They basically had a key that would toggle the mouse between two modes. In one mode the mouse could only move within a certain rectangle in the middle of the screen (user preferences) and then it would start moving the view. In the other mode the mouse was a mouse cursor that moved around the screen. If you were in the mouse cursor mode and were running windowed then (I believe it's been a while now.. :) ) that you could move your mouse outside the window of the game and back in.

I think in any interface where the mouse is being used for menu-type interactions like in a 2D application then it would be nice if it left the application in windowed mode. Of course in full screen mode or when the mouse is being used to rotate the view then it doesn't make sense for it to leave the application. In some interfaces the mouse only rotates the view when a certain key/mouse button is held down.

Just my $0.02,
-CrimsonShadow
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
Contact:

Post by Praetor »

As sinbad has said, the input system is meant to be used for demos, and was never meant as a "production system." That said, it works alright for most things. I quickly abandoned it and made my own system from the ground up (built on DirectInput) with my own custom "action mapping" type of system. Right now mouse and keyboard are supported. Well, just to toot my own horn I think it is my engine's greatest strength thus far in development (yeah, not very far yet...)

Input is the type of thing that can be as complex or as easy as you need it to be. At the same time, it probably is one of the easier systems to set up. So, for something simple you can use ogre's built in one, but if you had to go custom it isn't going to be too bad.
Post Reply