-
Making a racing car skid
Hi all,
About a week ago I started making an engine for a top-down racing car game(one that I'm also using for an Isometric version in the lines of Rock N' Roll Racer). I've got the player car and 3 AI cars going around the track, but I've just realised something is missing: the cars don't skid or drift a little when turning corners.
It's the first time I've attempted making a car game, but I'm guessing I somehow have to change the centre of gravity on the cars. So I've made an invisible car(controlled by the player) that's slightly in front of the visible player car. I'm then trying to get the visible car to float towards or follow the invisible one - so it creates a drift/skid effect. I've had some success, but the cars(visible and invisible) don't always line up correctly when they come to a stop.
Could someone provide a method - or example - on how to do something like the above. Thanks.
-
1 Attachment(s)
This may make things a little more clear:
Attachment 11247
Really it's not that much of a problem - as it doesn't interfere with the gameplay - but I'd have liked to have solved it.
Does anyone have any different methods or examples that I could use to make a car seem as though it's skidding/sliding on the track. THX.
-
Well, MMF2.5's physics movements might be able to do it easily, so, if you don't mind waiting until tomorrow, then someone might be able to whip up something for you then in MMF2.5. As for MMF2, however, I personally don't know how to do it.
-
Thanks for the reply happygreenfrog. If nobody posts anything, I'll wait to see what 2.5 brings (I'm hoping the physics in 2.5 can handle stuff like that. Also hoping it's easy to rotate the screen. If it is, then should be able to make some sweet racing type games.)
-
I can't help sorry but I like the art style
-
Thanks for the comment on the art, Zem. The background was easy enough to do, but the 32 directions on the iso placeholder cars was a pain. Anyway, I still haven't solved the "problem", but the engine is coming along nicely :)
-
Thought I'd post this here.
I have my cars going around the track and, when they pass the chequered flag, it sets their current lap. But what I can't get my head around is identifying which car came first, second, third and fourth on each lap.
Ideally, I'd like to be able to check which car is in the lead, and so on, throughout the game play; so if the red car overtakes the blue car or the blue car overtakes the green, state which position the cars are in.
On the face of it, it seems easy(and it probably is), but I just can't get my head around what to do. Anyone solutions to this?
-
You could place checkpoint detectors all around the track, when the car hits the checkpoint it sets a value then targets the next checkpoint in a linear fashion.
You could then check which lap+which checkpoint each car is up to, then if 2 or more cars are on the same lap and targeting the same checkpoint, you could calculate the distance from each car to the checkpoint to see who is closest (who is in front)
-
Thanks DaveC. Today I tried something similar to your first suggestion where I have the cars adding a value to the detectors(same detectors I use to count the laps and prevent the player cheating).
As the car passes over the detector, I'm adding a value of 1 to the detector - and the detector value is then given to the car; so the first car to pass gets a value of one and the second car gets a value of two and so on. Once the fourth car passes, the detector value is reset ready for the next time the cars pass. But then I ran into a problem: if I go in the opposite direction over a detector, it gives me 1st place when I was 4th. So I end up with two cars in 1st place.
Any suggestions or examples welcome.
-
Are you making a race game? wooow....that is amazing....I wish to know how to build the opponents cars AI....seems to be very complex...
-
The AI on the cars is easy: http://youtu.be/NIv286EZ7jQ (short video of it in action). It's getting their positions during gameplay that's difficult.
-
-
Finally. Cheers Stephen. Any ideas on how to solve the other problem: getting the positions of the cars: 1st, 2nd, 3rd, 4th during gameplay? I've tried to follow what DaveC suggested but implementing it is frying my brain.
-
To get the position of a car, we had a similar discussion on the french forum. Try this (572.zip), it is really easy to implement without additional active objects:
http://community.clickteam.com/threads/77050-Course-de-voiture-places-du-joueur
The green dots are just here to let you know where the checkpoints are (for an editor for example) but you do not need them for the algorithm.
-
Yes it was the idea. Most of the time, the circuit are known. If the circuit is procedurally generated, the checkpoint can also be generated. The advantage of this method is that there is no problem with collision events, it handles driving the wrong way and the car can go outside of the main way (grass,sand,...) and you can have many ways on the same circuit.
-
That's given me something to work on. Cheers cg.
-
Caesar, could you please post an example file of the cars AI? That would be great!
-
Give me a few days and I'll make a commented example file :)
-
Here you go: https://www.dropbox.com/s/k42yw1xsj5...ai_example.mfa
If you can make improvements, please upload again.