Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 12:05 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat Jan 30, 2010 11:12 am 
Offline

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69
Hi,

MyGlut has sets of 'special keys' such as:

GLUT_KEY_LEFT
GLUT_KEY_UP
GLUT_KEY_RIGHT
GLUT_KEY_DOWN

these return states of down or up...
whereas 'normal keys' only have a 'press' return... meaning if you press two at the same time: you only get one key 'pressed'..

now for a "FPS" style game, you could use say up and left to move "foward + a little to the left"
but if you are using a FPS style game where the camera is tied to the mouse... then you have to use left hand for the arrow keys
and right hand for mouse.

It becomes VERY uncomfortable using it this way, and just feels awkward like you are playing some dumb game. :(
Could it be possible that MyGlut adds JUST 4 more 'special keys' to allow a normal style like this:
'W' : move foward
'A' : move left
'S' : move back
'D' : move right

I ask this because this is one very very very very veEEEErrrry big missing feature for me :/

I've been researching in the key.c and key.h and also myglut.c/myglut.h to find a way to add this...
it looks like I need to find the raydium_key[] array but alas It's in neither files :/
it seems I'm lost here and if it is a little simple could someone add this? :roll:


Top
 Profile  
 
PostPosted: Mon Feb 01, 2010 10:41 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Hi,

This is a real issue, as reported quite a few times now. Raydium is currently "faking" GLUT (with MyGlut), including its drawbacks, so it's unable to report status (up/down) for anything else than special keys, as you've seen.

It's very hard to include WASD controls directly into the engine, since many keyboard layouts are different on this point (here, on a french keyboard, it's ZQSD) ... It would require some sort of big "table" in Raydium with all known keyboard layouts and some sort of auto-detection. Almost impossible, I think.

Another option would be to report all keys in raydium_keys[] array, special or not. Applications should then deal with this giant array, full of strange keycodes :) It would be a real trouble, I think, since it would probably require to code a "key mapping configuration screen" in every application, so the final user can change its settings and use WASD style controls ...

Or perhaps can we provide such a configuration screen directly into the engine ...

If anyone have any idea on this subject, let me know, since I see all this as an important topic, but with no "easy solution".


Top
 Profile  
 
PostPosted: Tue Feb 02, 2010 4:44 am 
Offline

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69
Ok!

What about this idea:

Raydium has command line option: "--keyset" (--keyset would bring open a menu with three little boxes, resembling the "WASD/ZQSD" key pattern, similer to an arrow key look..)

then you could click one, say the "up" key (which on english keyboard is W, french Z(?))
and then press whatever the actual key may be, for instance I would press W, but if I had french keyboard I would press Z(?)
raydium would then set the "WASD/ZQSD" "foward" key to whatever I pressed.

now question is.. is my idea feasible? :lol:

doing it that way would allow support for WASD/ZQSD keys... and future support for other keys possibly, and you could "set" them to whatever they really are on your keyboard.
(I could even, set my "enter" key to the "WASD/ZQSD" "foward" key, if I wanted..)

can MyGlut read hardware at that level? am I dreaming? :D


Xfennec wrote:
Hi,

This is a real issue, as reported quite a few times now. Raydium is currently "faking" GLUT (with MyGlut), including its drawbacks, so it's unable to report status (up/down) for anything else than special keys, as you've seen.

It's very hard to include WASD controls directly into the engine, since many keyboard layouts are different on this point (here, on a french keyboard, it's ZQSD) ... It would require some sort of big "table" in Raydium with all known keyboard layouts and some sort of auto-detection. Almost impossible, I think.

Another option would be to report all keys in raydium_keys[] array, special or not. Applications should then deal with this giant array, full of strange keycodes :) It would be a real trouble, I think, since it would probably require to code a "key mapping configuration screen" in every application, so the final user can change its settings and use WASD style controls ...

Or perhaps can we provide such a configuration screen directly into the engine ...

If anyone have any idea on this subject, let me know, since I see all this as an important topic, but with no "easy solution".


Top
 Profile  
 
PostPosted: Sat Feb 06, 2010 11:00 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
I had the same problem (multiplayer games on a pc) and I resolved by changing Raydium I have a great table in it I memorize every key position in the table is their ASCII code + 1000 and its
I walk converted uppercase to lowercase to avoid problems if CapsLock is on
If you want I can send you my version of Raydium. Unfortunately this table does not work with special keys. I'll watch for it to change but it will not for any of the following
In the games can configure the buttons desired.

Native support in Raydium interest me

Has a machine translation

J'avais le même problème (jeux multiplayer sur un pc) et je l'ai résolut en modifiant raydium j'ai un grand tableau dans le qu'elle je mémorise tout les touches leur position dans le tableau est leur code ascii+1000 et sa marche je convertie les majuscules en minuscule pour éviter des problèmes si CapsLock est activé
Si vous le souhaiter je peux vous envoyer ma version de raydium malheureusement ce tableau ne marche pas avec les touches spéciales. je vais regarder pour y modifier mais ça ne sera pas pour tout de suit

Ensuite dans le jeux on peut configurer les touches désirer

Un support natif dans raydium m'intéresserait

S'est une traduction automatique si s'est incompréhensible ça serait sympa de traduire


Top
 Profile  
 
PostPosted: Sun Feb 07, 2010 12:20 am 
Offline

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69
Hi, sifourquier.
I am interested to see that!

I would greatly appreciate it, if you can! :D


Top
 Profile  
 
PostPosted: Mon Feb 08, 2010 12:12 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
I just saw that I have a bug in my code I must correct.
I forgot to specify I only tested on linux


Top
 Profile  
 
PostPosted: Tue Feb 09, 2010 12:39 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I'm afraid it would require quite a lot of code to properly integrate such a feature in the engine. But I'm currently thinking about this seriously, since I want to provide a control configuration screen in "ManiaDrive 2".

It will probably look like this :
- The Raydium user (coder, in other words) will be able to declare "button" controls and "axis" controls. For instance :
Code:
raydium_input_control_add("throttle",RAYDIUM_INPUT_AXE);
raydium_input_control_add("brake",RAYDIUM_INPUT_AXE);
raydium_input_control_add("horn",RAYDIUM_INPUT_BUTTON);


And will be able to get values for each controls, like this :
Code:
float brake = raydium_input_get("brake");
that will return something in the [0..1] interval.

Then, a last function would allow to generate a configuration screen when the final user could enter any key or joystick/joypad axe (or "half-axe") for each control, and would save it to a configuration file (in the "home path" of the application).

At least, it's the way I see all this currently.


Top
 Profile  
 
PostPosted: Tue Feb 09, 2010 4:46 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
Here is my game with the amended version of Raydium to see the changes must be sought Raydium / / / modif infiles Raydium and uses a diff program (KDiff)

To configure the keys in the game must be called reset_key function void () (see touche.c) loop is wellcalls get_key () has previously had a return of -1 and differ in the games to see if the key is down we doonly if (raydium_key ( "button found with get_key"))attention to other duties in touche.c use my library for managing multiple joystique was normal if you donot include any
to see how I made the menu (I do not use the menu Raydium) see menu.c option_control you can see that

I created a function osd_print_key that displays the button click instead of its numerical valuevoila wants to test if the games you can compile with CarRcWeapon.sh or DebugCarRcWeapon.sh (to start with gdbif there is a problem) to compile dependencies must

libglut3-dev freeglut3-dev libalut0 libalut-dev libvorbis0a libvorbis-dev libogg0 libogg-dev bison flex libcurl4-openssl-dev libxml2-dev libglew-dev libjpeg*-dev libjpeg62-dev libxinerama-dev libasound2-dev libpng-dev

Here is where you to question not a problem I do not know if you speak French but if you at that particular problem no interest on he forum you can send me an email

Voila mon jeux avec la version modifier de raydium pour voir les modifications de raydium il faut chercher ///modif dans les fichiers de raydium et utilise un programme de diff (kdiff)

Pour configurer les touches dans le jeux il faut appelé la fonction void reset_key() (voir touche.c) puits en boucle on appelle get_key() jusque a avoir un retour diffèrent de -1 puis dans le jeux pour regarder si la touche est down on fait simplement if(raydium_key(« touche trouver avec get_key »))
attention les autre fonction dans touche.c utilise ma librairie pour la gestion de plusieurs joystique s'est normal si tu ne comprend pas tout

pour voir comment j'ai fait le menu (je n'utilise pas les menu de raydium) voir menu.c option_control tu peux voir que j'ai crée une fonction osd_print_key qui permet d'afficher la touche cliquer à la place de sa valeur numérique

voila si veut tester le jeux tu peut le compiler avec CarRcWeapon.sh ou DebugCarRcWeapon.sh (pour le lancer avec gdb si il y a un problème) pour le compiler il faut des dépendances

libglut3-dev freeglut3-dev libalut0 libalut-dev libvorbis0a libvorbis-dev libogg0 libogg-dev bison flex libcurl4-openssl-dev libxml2-dev libglew-dev libjpeg*-dev libjpeg62-dev libxinerama-dev libasound2-dev libpng-dev

Voila si tu à des question pas de problème je sais pas si tu parle français mais si tu à des problème particulier qui n'ont aucun intérêt sur e forum tu peut m'envoyer un mail

361MB
http://cortexet.free.fr/CarRcWeapon/CarRcWeapon.tar.gz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group