Page 1 of 1

Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Posted: Sat Oct 13, 2012 3:11 am
by substitute541
This page is under construction. This is not a game yet, it's just a test

Hi I'm substitute541(obviously) and I'm going to show you my (under construction) 2 player racing game. Currently, it has a test background image (I got it from dropbox's pictures)

Progress : 45% completed.

Downloads :
Turnspeed fix. This has the turnspeed fix, credits to micha. Drag and drop the game.lua and main.lua to the game.

2PR Test V1. This is the first version.

Screenshots :
Image
A note on the gif quality : Slow net, and trying to save my Dropbox space.

You are free to check the code out. I didn't optimize the code (especially in game.lua) so it has lots of lines.

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Posted: Sat Oct 13, 2012 11:55 am
by T-Bone
It works! And bonus points to you for not using vsync :neko:

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Posted: Sat Oct 13, 2012 12:50 pm
by micha
Hi, very nice. I like it. Especially that you already included a menu.

One advice for the driving physics: At the moment the cars are turning with a constant speed when I press left or right. This is good, because it means, if I go fast, the car drives in a large bend, while the bend is smaller, if I drive slowly. On the other hand that way I can steer while standing. And also the steering is reversed when the car goes backwards.

Here is my suggestion to fix this:
1) To determine the angular velocity (the amount the car rotates in one frame) multiply some constant number with the car's speed (instead of using a constant only).
Instead of

Code: Select all

p1car.radians = p1car.radians - 3 * dt
try this:

Code: Select all

angularVelocity = p1car.speed * 3 
p1car.radians = p1car.radians - angularVelocity * dt
Of course the number 3 has to be changed to an appropriate value.
2) Then you will have the problem that the car turns with a constant bend radius, independently of the cars speed. To avoid that, now add the following:

Code: Select all

angularVelocity = math.min(p1car.speed * 3, 3) 
p1car.radians = p1car.radians - angularVelocity * dt

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Posted: Sun Oct 14, 2012 1:12 am
by substitute541
micha wrote:Hi, very nice. I like it. Especially that you already included a menu.

One advice for the driving physics: At the moment the cars are turning with a constant speed when I press left or right. This is good, because it means, if I go fast, the car drives in a large bend, while the bend is smaller, if I drive slowly. On the other hand that way I can steer while standing. And also the steering is reversed when the car goes backwards.

Here is my suggestion to fix this:
1) To determine the angular velocity (the amount the car rotates in one frame) multiply some constant number with the car's speed (instead of using a constant only).
Instead of

Code: Select all

p1car.radians = p1car.radians - 3 * dt
try this:

Code: Select all

angularVelocity = p1car.speed * 3 
p1car.radians = p1car.radians - angularVelocity * dt
Of course the number 3 has to be changed to an appropriate value.
2) Then you will have the problem that the car turns with a constant bend radius, independently of the cars speed. To avoid that, now add the following:

Code: Select all

angularVelocity = math.min(p1car.speed * 3, 3) 
p1car.radians = p1car.radians - angularVelocity * dt
Um yeah, I tried to do different techniques to make it more realistic, then I gived up saying "This makes the game hard". I haven't thought of that yet, maybe I'll try (in my way).

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Posted: Fri Oct 19, 2012 6:42 pm
by qaisjp
substitute541 wrote:then I gived up saying
1. never give up
2. "then I gave up saying"
3. looks nice, looking forward to something with this.