Tinker with physics again
This commit is contained in:
parent
b4aa9cd867
commit
0e694589eb
4 changed files with 52 additions and 23 deletions
22
TODO.txt
22
TODO.txt
|
@ -1,5 +1,7 @@
|
||||||
=========== GENERAL ==============
|
=========== GENERAL ==============
|
||||||
|
|
||||||
|
- when non-rotating, the car is very fast, allowing uberbugs: find out why and
|
||||||
|
fix
|
||||||
- fix the ramp map again due to new physics
|
- fix the ramp map again due to new physics
|
||||||
- should drifting make a sound?
|
- should drifting make a sound?
|
||||||
- keyboard ghosting is an issue, particularly when initiating drift with brake
|
- keyboard ghosting is an issue, particularly when initiating drift with brake
|
||||||
|
@ -51,13 +53,21 @@
|
||||||
- something with multiple finishes DONE
|
- something with multiple finishes DONE
|
||||||
- U-ramp to build speed and jump up to catch a CP (done) DONE
|
- U-ramp to build speed and jump up to catch a CP (done) DONE
|
||||||
- jump through air ring with CP DONE
|
- jump through air ring with CP DONE
|
||||||
- test:
|
- replay validation?
|
||||||
- long replay
|
- final tests:
|
||||||
- replay stretching works
|
- very long replay
|
||||||
|
- different resolutions
|
||||||
|
- different settings (332, POTATO, ...)
|
||||||
|
- crazy shit with physics
|
||||||
- replay with input not occuring for more that LCR_SETTING_GHOST_STEP
|
- replay with input not occuring for more that LCR_SETTING_GHOST_STEP
|
||||||
- replay validation
|
- different platforms
|
||||||
- at the end check error handling, make sure the game handles garbage data in
|
- error handling (bad map format, bad replay format, items in data file, ...)
|
||||||
resource file etc.
|
- valgrind, cppcheck, different compilers, optimization levels, ...
|
||||||
|
- play replay from one platform on another
|
||||||
|
- play all maps a lot
|
||||||
|
- correct saving or replays etc
|
||||||
|
- empty and large data file
|
||||||
|
- FPS on each platform
|
||||||
|
|
||||||
=========== BUGS =================
|
=========== BUGS =================
|
||||||
|
|
||||||
|
|
2
data
2
data
|
@ -144,3 +144,5 @@ details
|
||||||
#RLCtiny4;00LCtiny4;1787f12a 0000267:0221:0093:0091:00b3:0041:0033:0031:0043:0041:0033:0051:0063:01e2:00a3:00d1:0065:0059:0051:0043:0031:0063:00e1:0163:0031
|
#RLCtiny4;00LCtiny4;1787f12a 0000267:0221:0093:0091:00b3:0041:0033:0031:0043:0041:0033:0051:0063:01e2:00a3:00d1:0065:0059:0051:0043:0031:0063:00e1:0163:0031
|
||||||
#BLCtiny4;
|
#BLCtiny4;
|
||||||
#RLCtiny4;00LCtiny4;1787f12a 0000184:0011:00c9:0071:0133:0051:0073:00e1:0033:00f1:0053:00a1:0063:0071:0123:0041
|
#RLCtiny4;00LCtiny4;1787f12a 0000184:0011:00c9:0071:0133:0051:0073:00e1:0033:00f1:0053:00a1:0063:0071:0123:0041
|
||||||
|
#RLCtiny1;00LCtiny1;7e39e006 0000347:0011:0319:0031:0169:0041:0159:00b1:01e3:0071:0073:0021:0043:0051:0095:0033:01a1:0073:0031:0063:0031:0363:0161:00f3:0091:0089:0031
|
||||||
|
#BLCtiny1;
|
||||||
|
|
|
@ -263,6 +263,11 @@ changes to the source code. This is inspired by suckless programs.
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
|
~~~~~ CREDITS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Everything was created by drummyfish. Special thanks goes to my friends Blitz
|
||||||
|
and Ramon for help with testing <3
|
||||||
|
|
||||||
~~~~~ FAQ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~ FAQ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Q: Is this game really free? Do I have to pay for it? What can I legally do with
|
Q: Is this game really free? Do I have to pay for it? What can I legally do with
|
||||||
|
|
46
racing.h
46
racing.h
|
@ -57,8 +57,8 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
|
||||||
|
|
||||||
#define LCR_PHYSICS_UNIT 4096 ///< len. of square for phys. engine
|
#define LCR_PHYSICS_UNIT 4096 ///< len. of square for phys. engine
|
||||||
|
|
||||||
#define TPE_RESHAPE_TENSION_LIMIT 3
|
#define TPE_RESHAPE_TENSION_LIMIT 8
|
||||||
#define TPE_RESHAPE_ITERATIONS 7 /**< Empirically tested, seems to have a
|
#define TPE_RESHAPE_ITERATIONS 16 /**< Empirically tested, seems to have a
|
||||||
big impact on bugs that happen when
|
big impact on bugs that happen when
|
||||||
driving onto a curved ramp under
|
driving onto a curved ramp under
|
||||||
various angles. */
|
various angles. */
|
||||||
|
@ -1128,17 +1128,23 @@ void _LCR_racingWheelAccelerate(unsigned int wheel, TPE_Vec3 dir,
|
||||||
|
|
||||||
int _LCR_racingCarShapeOK(void)
|
int _LCR_racingCarShapeOK(void)
|
||||||
{
|
{
|
||||||
int r = 1;
|
TPE_Unit bodyTension = 0;
|
||||||
|
TPE_Connection *c = LCR_racing.carConnections;
|
||||||
|
|
||||||
for (int i = 0; i < LCR_racing.carBody.jointCount; ++i)
|
for (int i = 0; i < LCR_CAR_CONNECTIONS; ++i) // joint tension
|
||||||
r &= TPE_connectionTension(TPE_dist(
|
{
|
||||||
LCR_racing.carBody.joints[
|
bodyTension += TPE_abs(
|
||||||
LCR_racing.carBody.connections[i].joint1].position,
|
TPE_connectionTension(
|
||||||
LCR_racing.carBody.joints[
|
TPE_LENGTH(
|
||||||
LCR_racing.carBody.connections[i].joint2].position),
|
TPE_vec3Minus(
|
||||||
LCR_racing.carBody.connections[i].length) < TPE_F / 16; // 16: magic con.
|
LCR_racing.carJoints[c->joint1].position,
|
||||||
|
LCR_racing.carJoints[c->joint2].position)),
|
||||||
|
c->length));
|
||||||
|
|
||||||
return r;
|
c++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (bodyTension / LCR_CAR_CONNECTIONS) <= TPE_RESHAPE_TENSION_LIMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1444,12 +1450,10 @@ uint32_t LCR_racingStep(unsigned int input)
|
||||||
|
|
||||||
TPE_Joint joints[LCR_CAR_JOINTS];
|
TPE_Joint joints[LCR_CAR_JOINTS];
|
||||||
|
|
||||||
if (_LCR_racingCarShapeOK()) // in rare cases this may not hold
|
if (!_LCR_racingCarShapeOK())
|
||||||
LCR_racing.carBody.flags |= TPE_BODY_FLAG_NONROTATING;
|
printf("NOT OOOOOOOOOOOK\n");
|
||||||
else
|
|
||||||
{
|
LCR_racing.carBody.flags |= TPE_BODY_FLAG_NONROTATING;
|
||||||
LCR_LOG1("car not OK in non-rotating step");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < LCR_CAR_JOINTS; ++i)
|
for (int i = 0; i < LCR_CAR_JOINTS; ++i)
|
||||||
joints[i] = LCR_racing.carBody.joints[i];
|
joints[i] = LCR_racing.carBody.joints[i];
|
||||||
|
@ -1479,7 +1483,15 @@ uint32_t LCR_racingStep(unsigned int input)
|
||||||
|
|
||||||
if ((LCR_racing.carBody.flags & TPE_BODY_FLAG_UNRESOLVED) ||
|
if ((LCR_racing.carBody.flags & TPE_BODY_FLAG_UNRESOLVED) ||
|
||||||
!_LCR_racingCarShapeOK())
|
!_LCR_racingCarShapeOK())
|
||||||
|
{
|
||||||
|
printf("SASASASSASASASASASASSAS\n");
|
||||||
TPE_bodyStop(&LCR_racing.carBody);
|
TPE_bodyStop(&LCR_racing.carBody);
|
||||||
|
|
||||||
|
for (int k = 0; k < 2 * TPE_RESHAPE_ITERATIONS; ++k)
|
||||||
|
TPE_bodyReshape(&LCR_racing.carBody,_LCR_racingEnvironmentFunction);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue