game tweaks

game tweaks

Postby iliaden » 12 Jul 2011, 19:11

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
iliaden
 
Posts: 2
Joined: 12 Jul 2011, 18:54

Re: game tweaks

Postby Auria » 13 Jul 2011, 01:02

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

Re: game tweaks

Postby Monstertux » 13 Jul 2011, 05:46

There is also data/powerups.xml

It should be pretty self-explanatory.
Monstertux
 
Posts: 32
Joined: 18 Jun 2011, 16:40

Re: game tweaks

Postby iliaden » 13 Jul 2011, 14:07

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?
iliaden
 
Posts: 2
Joined: 12 Jul 2011, 18:54

Re: game tweaks

Postby Arthur » 13 Jul 2011, 15:00

Correct.
Hey pal, I took an oath for justice! "In happy days or tightest tights..." or something like that.
User avatar
Arthur
 
Posts: 1073
Joined: 06 Dec 2009, 00:49

Re: game tweaks

Postby Funto » 13 Jul 2011, 20:13

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" ^^
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: game tweaks

Postby Kinsu » 15 Jul 2011, 03:23

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 ^^
User avatar
Kinsu
 
Posts: 476
Joined: 15 Mar 2011, 14:28

Who is online

Users browsing this forum: No registered users and 1 guest