stk kart controls

stk kart controls

Postby antonis » 05 May 2010, 16:45

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.
antonis
 
Posts: 4
Joined: 05 May 2010, 16:12

Re: stk kart controls

Postby Auria » 05 May 2010, 16:59

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?
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: stk kart controls

Postby antonis » 05 May 2010, 17:25

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.
antonis
 
Posts: 4
Joined: 05 May 2010, 16:12

Re: stk kart controls

Postby Auria » 05 May 2010, 21:19

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
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: stk kart controls

Postby antonis » 06 May 2010, 07:51

thank you very much... i 'll give it a try.
antonis
 
Posts: 4
Joined: 05 May 2010, 16:12

Who is online

Users browsing this forum: No registered users and 1 guest