Page 1 of 1

game tweaks

PostPosted: 12 Jul 2011, 19:11
by iliaden
Hi everyone,

I have a strange project in mind, and I'm hoping for some pointers if you can help me.
I'm trying to make a drinking racing game: the idea is that a joystick controls the steering, but the acceleration of a player is determined by the rate at which he consumes a drink.
I already have all the hardware set up, so I can easily read the rate at which a player drinks.

I would like to modify the following things in SuperTuxKart in order for the entire system to work:
1) remove the maxSpeed limitation, or set it to a reasonably high value.
2) read the input for the acceleration(gas) of player characters from a manually written driver.

I've started looking at the source code, and I have a few questions:
1) where is karts.m_max_speed[3] set? (where are the values read/hardcoded)
2) for the user input - I couldn't really figure out the workflow in src/input. Can you please provide a few pointers (say which XML config files are read here)?

Thank you,

Ilia

Re: game tweaks

PostPosted: 13 Jul 2011, 01:02
by Auria
Hi,

m_max_speed is set in void KartProperties::getAllData(const XMLNode * root), line 364 of kart_properties.cpp - which reads from data/stk_config.xml

For input, start in guiengine/event_handler.cpp, from there you can follow the logic in order, or just ignore the internal input logic and inject gamepad events

Re: game tweaks

PostPosted: 13 Jul 2011, 05:46
by Monstertux
There is also data/powerups.xml

It should be pretty self-explanatory.

Re: game tweaks

PostPosted: 13 Jul 2011, 14:07
by iliaden
Thanks a lot!
just a quick double check that I got it right:
data/stk_config.xml:204 has the data for power and max speed (which I will be tweaking) - from this I figure that the values are identical for all karts; am I correct in this assumption?

Re: game tweaks

PostPosted: 13 Jul 2011, 15:00
by Arthur
Correct.

Re: game tweaks

PostPosted: 13 Jul 2011, 20:13
by Funto
Hey, how do you manage to get drinking speed as an input to the game??

BTW, I would like to add wiimote support to STK, maybe this could help, like with sticking the wiimote to the glass :D

Anyway, I'm very curious about your "hardware" ^^

Re: game tweaks

PostPosted: 15 Jul 2011, 03:23
by Kinsu
I'm also pretty curious ! :)
I imagine the acceleration will be weighted by a number that is fetched "reading" the volume of drink that has left the glass.
Some kind of thing ^^