Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: action mapping & binding  (Read 1884 times)

Anonymous

  • Guest
action mapping & binding
« on: November 08, 2005, 10:30:17 AM »

Fastest delegates possible on all platform using one headers without license problem
I use this in PLSM2 so that user can bind anything (any class, any method (virtual, static,etc), any function to plsm2 events :
http://www.codeproject.com/cpp/FastDelegate.asp

Action Mapping :
2 user files (main and secondary) where user maps his key to action (Fire=A)
n files that translates user keymaps to OS base keymap using keyboard detection mechanism (hard work tough => http://www.wpuniverse.com/vb/showthread.php?postid=76947 )
1 dev File where developpers declares all Action bindable (Fire, etc.. ) against which user binding will be checked. (does FIRE action mapping specified by user exists in dev action binding ??)

user stroke a key, we get action using "localkey->basekey->action"
an we avoir the action.h map include dependency
Logged

tuan kuranes

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
action mapping & binding
« Reply #1 on: November 08, 2005, 10:32:25 AM »

post above is from me...
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
action mapping & binding
« Reply #2 on: November 08, 2005, 11:25:07 AM »

Thanks for your post & info :)

Function Binding:
Yes, I definately agree that some more flexibility is needed, only binding regular member functions may be a bit too binding (no pun intended). Though, the binding template is made to allow for other types of method binding, and I plan to add more.. I will look at your link about this too. And perhaps just use that header file.

Action Mapping:
Currently, the action mapping stuff is not really in the core lib so that it is obvious that a user should alter the Configuring part to suit there needs and used Graphics/Gui system. Not exactly sure what you are asking for in terms of two user files? One file has the action map layed out in code? and the other for language translation?

As far as language detection.. Yeah, not a walk in the park.. But, definately can be worked on.
Logged

tuan kuranes

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
action mapping & binding
« Reply #3 on: November 08, 2005, 11:52:48 AM »

Thanks for your work. Theora plugin and now OIS :)

Idea is mainly to avoid that sort of hard code in headers
Code: [Select]

const int A_JUMP = 1; //All
const int A_FIRE = 2; //All
...


And move that into a CFG file, for developpers using ois.
then user maps against those action (using 1 or 2 files, games usually provides a secondary mapping.)
and in middle of that, we do the localisation translation.

It may results in several std::maps access cost but gives really great flexibility.

And in this way,  it does not implies a  header containing those A_JUMP .
Developper just  add a new ACTION to his config file. Using  scripting (lua, gamemonkey or angelscript), game developpers would'nt even have to recompiles its application to use it directly.

If mapping process is in core, it really helps the high-level orientation of library. It could also go to a 'oisut' library too, with all other contributions i've planned in the ogre forums previously...
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
action mapping & binding
« Reply #4 on: November 08, 2005, 12:20:25 PM »

I agree about having no hard code defines/const like that. That was really only part of the demo. As, for an actual implementation, there should be an action map file format (either binary or text, but probably not XML... as I do not want to add an XML parser to this lib). As far as localisaztion.. well, Action Map really (from my current thought) doesn't really need to much localisation (that really only comes into play when entering strings - text into GUI for example)...

As, ActionMap only cares about KeyScan Codes, and not really on the basis of what exact character that is. And, if you find that in <enter country here> the key combination is awkward, or extremely unusable.. you can remap the keys to whatever you want. And/Or, the client app can load different ActionMap.CFG files based on local too.

And, while I said it is not core right now, I do plan to add it to core when it is more complete (method binding, etc). But, there will be a config flag (via ./configure on linux or OISConfig.h on windows) that disables it's inclusion.
Logged

Anonymous

  • Guest
History
« Reply #5 on: November 13, 2005, 11:24:16 AM »

Quote
Thanks for your work. Theora plugin and now OIS

 I believe that this is an event that should be noted in the history books.
Logged