Page 1 of 1

stk kart controls

PostPosted: 05 May 2010, 16:45
by antonis
Hi,

I attend a computer vision class at university and i was asked as an assignement to implement an optical flow for game control. I succeded the optical flow and i must now add the optical flow to stk. The problem is that i can't fully understand where my code should be placed.

Thank you in advance, i'm waiting for your response.

Re: stk kart controls

PostPosted: 05 May 2010, 16:59
by Auria
Hi antonis,

first of all, it would be important to know whether you want to add the code to SuperTuxKart 0.6 or 0.7 (trunk). Code has changed quite a bit in trunk for 0.7 so your target version will change what you need to do quite a bit.
0.6 has the advantage to be stable; 0.7 has the advantage to be generally cleaner in code terms, and also it's more fresh in my memory so I can help much easier with 0.7 than with 0.6 ;) 0.7 is however not stable yet.

Also, I'm not very familiar with optical flow. If I understand correctly, this would be a different input method, along with keyboards and gamepads?

Re: stk kart controls

PostPosted: 05 May 2010, 17:25
by antonis
Hi Auria,

Thank you for your quick reply. I am using SuperTuxKart 0.6. Yes optical flow will be a different input method. I would be very obliged if you could help me.

Re: stk kart controls

PostPosted: 05 May 2010, 21:19
by Auria
Hi,

unfortunately for you, STK 0.6 is very faint in my memory - the code has changed A LOT in the last year, going towards 0.7 (the 0.7 code is also much cleaner when it comes to input).

From a quicklook at the 0.6.2 tag, it seems to me like the input is mostly handled in file sdldrv.cpp , see :
http://supertuxkart.svn.sourceforge.net ... iew=markup

See method

{l Code}: {l Select All Code}
void SDLDriver::input()


which then invokes

{l Code}: {l Select All Code}
void SDLDriver::input(Input::InputType type, int id0, int id1, int id2, int value)


you would probably need to extend the former to support this new input type, and then call the latter to let the event continue into the internals of the game

Re: stk kart controls

PostPosted: 06 May 2010, 07:51
by antonis
thank you very much... i 'll give it a try.