1 (edited by lamefun 2012-07-12 07:37:14)

Topic: Code questions

What the hell TicksPerSecond is doing here?

From: game/tuning.h

MACRO_TUNING_PARAM(GroundControlSpeed, ground_control_speed, 10.0f)
MACRO_TUNING_PARAM(GroundControlAccel, ground_control_accel, 100.0f / TicksPerSecond)
...
MACRO_TUNING_PARAM(AirJumpImpulse, air_jump_impulse, 12.0f)
MACRO_TUNING_PARAM(AirControlSpeed, air_control_speed, 250.0f / TicksPerSecond)

What is 50 here? Is it TicksPerSecond? And what is velocity ramp for?

From: game/gamecore.cpp

float RampValue = VelocityRamp(length(m_Vel)*50, m_pWorld->m_Tuning.m_VelrampStart, m_pWorld->m_Tuning.m_VelrampRange, m_pWorld->m_Tuning.m_VelrampCurvature);

2 (edited by Nitro 2012-07-12 11:50:22)

Re: Code questions

OMFG THE TROLL AGAIN!!

If you don't want to play this game, or just have to comment something bad.... LEAVE!

3

Re: Code questions

Nitro wrote:

OMFG THE TROLL AGAIN!!

If you don't want to play this game, or just have to comment something bad.... LEAVE!

Dude. He's just asking questions about the code.

Not Luck, Just Magic.

4 (edited by theanomaly 2012-07-12 17:52:37)

Re: Code questions

Ticks per second there is to help calculate the air control, like how long you should stay in the air and stuff. Simple enough if you understand physics and game mechanics.

I am not sure about velramp and stuff. Why don't you look into it? Look for other calls of the function, look for the function itself, look for when the floating variable is used in code. It could be the acceleration ramping up, but I doubt that. seems acceleration changes instantaneously in teeworlds.