Best Game Input Method

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
tngcto
Gnoblar
Posts: 10
Joined: Sun Sep 28, 2003 3:13 pm

Best Game Input Method

Post by tngcto »

Hello everyone. After I got my newly bought Athlon 64 2800+ and wresled through some distros and OGRE installation, I finally got it working on my Mandriva 2005 box. It's too bad that I had to force my OGRE development on a 32-bit OS instead of a 64-bit version because a lot of issues came about. I'll talk about that on another thread.

As for my concern, there are two libraries for general input and graphics available that can be used with OGRE. One is of course, SDL,http://www.libsdl.org the native input library used for the demos and the other one is GGI (http://www.ggi-project.org). I've never heard of GGI but I think it has a great potential to become a good input library if I'm to make OGRE-based applications.

According to OGRE's Wiki, there are some special stuff that needs to be done when interfacing direct SDL into OGRE unlike in GGI. The two windows dilemma or some sort. Haven't studied that much yet. GGI on the other hand can merge itself directly to OGRE's GLX so there's no trouble on using it along the engine.

You see, SDL is mature while GGI is somewhat of a newcomer (correct me if I'm wrong. I just read about it today) but both can be useful in OGRE. But which one will you people recommend when making a game based on OGRE? SDL or GGI?

Advance thanks for the upcoming advice from the gurus. :wink:
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

I'm not sure people have been succesful in attaching SDL to GLX yet, SDL has some very weird environment variable hack to attach to an existing window in windows.
User avatar
bal
Greenskin
Posts: 100
Joined: Thu Dec 09, 2004 7:29 pm
Location: Geluwe, Belgium

Post by bal »

I'd like to know how to use GGI in Windows. This is what their site says (Download section):

"Due to the variation in Windows compilation environments, we do not support binary packages for Windows platforms. However, we are attempting to enter GGI into the Cygwin[->] distribution. If you wish to try building from source, please ensure you review our guide for setting up GGI on windows."

Unfortunately I can't find that guide anywhere on the site :).

Edit: Platform Section of the site says this: MSYS/MinGW or Cygwin environments are required. Meuh :(.
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 use SDL for my input for my game engine im writing. when i first tried to use it, i got the 2 windows and couldnt work out y when i had all the correct code. it turned out its how the SDL dlls are compiled. because SDL used an environment variable to specify an external window, instead of it creating its own, it needed to be using the same runtime (or something like that) as OGRE etc

as soon as i got new dlls (which are available for download from the wiki) it worked perfectly. i have no problems now.

there is a C++ port of SDL being made, but im not sure how far into development it is or if it will be easier to use than SDL, its called SDLmm

EDIT:

the environment variable hack isnt too hard to get working, so its not really much of a bother
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Chris Jones wrote: the environment variable hack isnt too hard to get working, so its not really much of a bother
Under linux/glx? How?
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 »

:shock: oh, nah i was on about windows and ogre window etc
i dont have linux. sorry, didnt read all the info thouroughly.

surly its not that hard? :D
the 2 windows problem that i had was just cos of the dlls were compiled differently compared with the program, try using the dlls in the wiki

i have no idea about environment variables in linux tho
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

Chris Jones wrote:surly its not that hard? :D
Surely. Environment variables is not the problem. SDL + GLX = sqrt(-1);

tngcto: libgii works (I use it on GLX), but it has it's problems. There is another libary being developed called libsinp. Makob here is doing it, and intending to make it cross platform. Right now he's released code for working under linux. I have not yet used it yet, although I've compiled and installed it. I'm a few days away from giving it a shot.
Here's some good reading material (which searching would have pulled up):
sdl+glx
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
libgii problems
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
input options, makob's library libsinp
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

friend_of_ACCU wrote:Making input library is not hard anyway, at least simple one.
Then show us! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
tngcto
Gnoblar
Posts: 10
Joined: Sun Sep 28, 2003 3:13 pm

Post by tngcto »

I see that there are advantages and disadvantages to the different approaches as advised by everybody. I did check the links provided by discipline and it gave me additional insight on the available game input libraries. friend_of_ACCU might be suggesting the old-fashioned ch=getch() or something like that I think. :?:

From my research, SDL is really a good choice if not for the GLX merge problem. libGGI is rather young and full support of game input is limited to Linux. Winbees are left out in case I do use libGGI in my game because in order for them to maximize it, they'll have to go through Cygwin and other compilation methods. You know, the average user won't compile an app to use it but depend on the double-click method.

Chris Jones did a good job on making SDL talk to OGRE but his technique is rather limited to windows and leaving out the rest in case I concentrate on it.

makob is doing a good job on making a cross-platform input library wrapper. I'll go check it during my additional research.

Allright now, I hope I'm not stepping on anybody's foot but from what I can see, there is no definite answer yet for this dilemma. In case people would develop games using OGRE, they'll have to stick with its native input code and use other libraries for other aspects such as sounds and physics.

I'm not saying that the default input system of OGRE is awful but like the rest say on it, it is limited for the demos. For me, the library can also do input and other game-oriented tasks. OGRE is excellent for graphics but in case if we plan to make heavy-interactive apps with it, an excellent input/sound/accessories library must be used.

Oh, this post http://www.ogre3d.org/phpBB2/viewtopic.php?t=11870 mentions yake. Is it a good candidate for making games with OGRE? :)
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 »

tngcto wrote:Oh, this post http://www.ogre3d.org/phpBB2/viewtopic.php?t=11870 mentions yake. Is it a good candidate for making games with OGRE? :)
Have a look at its features (list is in flux) for a start.

Btw (and to stay at least partly on topic), it features an input system (with pluggable backends) with action maps and a few other little things which can make input handling simpler and easier to manage, imho.

Is it a good candidate? It probably depends on your exact requirements. People use it for very different kind of projects, from games to submarine ROV simulators. It's still quite young but I think, we're making a good job working on a data-driven engine and essential tools. Especially, the latter part will probably show good progress in the near future.

Feel free to drop questions via e-mail, irc or forum. Developers and users are usually very fast to answer them (or at least try to) :)

-psy
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 »

Chris Jones did a good job on making SDL talk to OGRE but his technique is rather limited to windows and leaving out the rest in case I concentrate on it.
well it wasnt all my work really, my main problem i had was the fact the sdl dlls were running in a different enviroment, therefore when i added the enviroment variable for the window handle, the dll couldnt find it

i havent really looked into environment variables, i only know vaguely about windows, hardly anything about linux (if i ever get a fast enough connection, i will download linux). so is the adding of environment variables just for windows? (not the variables that appear if u go into My Computer->Advanced-> etc etc and view windows environment variables (i think)
its just for the application/dlls used

so does GLX take a window handle using environment variables? or how/y isnt it working?
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

psyclonist wrote:Btw (and to stay at least partly on topic), it features an input system (with pluggable backends) with action maps and a few other little things which can make input handling simpler and easier to manage, imho.
From what I've seen, the only implemented plugin is ogre's native input system. So it really isn't an input library, it is only an input wrapper. Is my analisys correct, psyclonist?

I also have this, a pluggable wrapper around libgii, libsdl, ogre and soon to be libsinp in my framework (which I'm putting out my second release tonight, hopefully).

chris: environment variables are not the problem. Both linux and windows use them. http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
discipline wrote:I'm getting my ogre window to open but it is blank. Works mostly with libgii or ogre's input. SDL seems to be initializing, but I get zero events, neither mouse nor keyboard.