Taxi - Demo and Source

Started by zabnat, Thu 08/01/2009 16:44:27

Previous topic - Next topic

zabnat

TAXI - Grand Touring Auto

I see some top-down car games have emerged so I decided to share my little piece of sh...program. This was inspired by Roccos Super Pitstop Racing and was supposed to be part of a minigames MAGS game. I spend about a week doing this and then realised that the physics involved were way beyond my understanding. This demo shows how far I got. Driving is really flimsy and there are lots of glitches and bugs, but it might give you some inspiration or ideas for car games.



Download demo
Keys are WASD or arrows for driving and R to change radio channel.

Download source
This source is mainly for educational purposes, but you can use it for anything you like. Some assets are copyrighted (as you can see it has placeholder graphics from GTA) so it could be risky to use them as your own ;). But the code is free as free beer. I won't provide any official support for the code as it's been a while and don't remember anymore why I did something the way I did. I will try to answer questions however. As I said, this was going to be a minigame in an adventure game, so all the code is in the room script.

This will be in production probably for a long time, I might never finish this, just wanted to share.

Joe

This is cool thanks. Maybe the car turns faster than it should, anyway cool!!:)
Copinstar © Oficial Site

neon

Yes, driving needs a lot of luck, maybe the turning should depend on the speed (the faster you are, the slower it turns). But the graphics and sound effects are really nice. Maybe it would be a good program to be included into another game. Or you might build a story around it.

bicilotti

I'm speechless!

It feels really smooth, and would be a awesome base for something more elaborate (a la GTA for example).

This + the raycasting thing on the other thread make me say: keep scripting! It is sure a pleasure to see these little creations of yours! :)

Also, thanks for the "source". I'm sure it'll be fun to go through!

Shane 'ProgZmax' Stevens

The controls are actually pretty good, though it seems you're using an exponential increase in turn speed which makes the handling a bit difficult.  The collisions are pretty accurate as well (maybe you're using SSH's pixelperfect module) though I think for racing games collisions with objects could be scaled back a bit inside the object so you can glance along their edges without bouncing back and such.  All it looks like you need is to spend some time on tweaking the handling and collisions, really!

TheJBurger

This is very impressive. After five minutes, I was able to get the handling semi-well. This seems like it would be really fun when combined with more features.
My only suggestions are:
1) Sometimes it was hard to distinguish which buildings I would crash into and which I would not. Maybe make a more distinct barrier visible.
2) Driving on grass has the same effect as driving on pavement. Maybe it should slightly slow down?

Great work!

zabnat

There are no modules used (I almost never use modules, it serves as good exercise to write everything myself).
Control tweaking is really tiresome. When I tweaked the controls the way it was good for "normal" driving, then all the "drifting" and playing around felt awkward.
The real problem is the physics that I don't understand :). Accelerating and braking (deaccelerating) are pretty trivial even with skidding. But when it comes to cornering the problems begin. At one point I tried to use the "real physics" using one tutorial, but when even the example program on the tutorial didn't work well I was discouraged to continue on that path. The real physics are also pretty easy until you come to the point where tires lose their lateral grip. And what's the point having a car game where you can't powerslide ;D. This is The car physics tutorial I'm talking about.

Actually when I played GTA1 it seemed to have pretty similiar physics to this (ofcourse with handling tweaked to somewhat usable).

Quote from: TheJBurger on Thu 08/01/2009 21:41:00
1) Sometimes it was hard to distinguish which buildings I would crash into and which I would not. Maybe make a more distinct barrier visible.
I actually had an idea to make the buildings 3D, but never got that far. Walls would have been flat shaded or even textured with raycasting. Even had the pretty decent plans how to program it.

Quote from: TheJBurger on Thu 08/01/2009 21:41:00
2) Driving on grass has the same effect as driving on pavement. Maybe it should slightly slow down?
You skid more on grass. The surface check is already there, so it would probably be trivial to use it to affect speed too.

Ryan Timothy B

Hmm..
Some very interesting programming you have there, although haven't looked at the scripts yet.
This is very close to how I pictured Road Racer 2 to be.  Except with better physics and driving control.
I'm not exactly sure what was wrong with it, but sometimes it seemed to have super grip tires on the front and extremely bald tires on the rear.  Anyway, it was a fun 40,000 loops just playing around with it.

I'm curious to see how you did the fading tire marks when going at slower speeds.  I'm not too familiar with RGB scaling and whatnot, so perhaps I'll check that part of your script out or I'll just play around with the scripting in my own whenever I decide to start RR2.

Anyway, good stuff.  All in all it could use some fine tuning and tweaking to get the controls....... more controllable? lol

Darth Mandarb

What everybody else has said ... the steering needs some fine-tuning.  But it was very fun to play!  The skid-tracks and the physics (aside from the steering) were really cool!  The screen scrolling is very smooth too!

I like the idea of the 3D buildings!  So long as they have a perspective like Zelda ... I mean where the car is in-line (above) with the vanishing point (if this is possible) and the buildings all come up and away from that point.  So that the buildings would never interfere with the view of the car (I hate when games do that!)  It's hard to explain what I mean!

Either way this is a very cool demo and I think you should continue with it!

Ryan Timothy B

I realize it's been several months since this thread was last responded to and I'm totally going against the rules here.
But seeing as this was a tech demo I will pretend the rules don't apply here. I could always post this in a PM, but then I wouldn't get the luxuries of multiple responses -- and whatever responses this thread gets would work for anyone attempting to make a game with Zabs source. (Although I am not, but these answers could still be useful for anyone else)

Since my Road Racer game was dug up from the completed games section it made me realize I should get around to making Road Racer 2.  I had been searching google for tutorials on ray casting, perhaps I'm just over looking things but just can't seem to find anything useful for this programming scenario.  I have a basic idea how I'd do it, but perhaps I should ask before attempting?

So here it goes:
Zabnat you mentioned you had a pretty good idea how you'd go about making the ray casting for the 3d perspective of the buildings.  How would you do it, especially in AGS?
I realize your rooftops would have to be placed on a background frame (like how the burnt rubber on pavement is), and you'd place them accordingly to the center of the screen and the 'height' of the buildings to give them that 3d look.  Obviously having the rooftops move around individually (just the ones in eyesight of the gamer) each frame.

That's the easy part.  The hard part for me is figuring out the ray casting for each wall.  How one would go about doing that. One way could be to have the corners of each building saved as a xy point, perhaps in a text file, so you can check if they are on the screen.  But I can't think of how to approach the ray casting part.

So.. anyway, I'm just rambling.  Let me know what you'd do, if you can think of how you'd do it.
Perhaps I just need more time to think about this.

zabnat

Well, I'm not sure if I was lying when I said I had decent plans for those walls, because plans were only in my head are now gone. ;)
Actually I was thinking rooftops would have to be sprites since they are a little bigger than the bases of the buildings would be, right? An then the rooftops would float with some incrementing offset depending how far off the center of the screen they would be. Then the space between rooftop and base could be filled with some color to create flat shading feel. As for the textures, that's a bit more difficult. First of all you would have to raycast the walls two times (one horizontally and one vertically) and secondly I don't know if you could even have different textures for buildings. Anyway the raycasting itself should be pretty easy, since you don't have to be able to rotate the camera for raycasting (as you would have to when making a fps). And since at least in this demo the map is made of same sized blocks, the raycasting to be used could be the basic one like in wolfenstein (only maps made of blocks supported). Well, I'm just rambling too, so I don't know if this of any help. :)

ps. So I would probably go about first making the rooftops "float" and then draw flatshaded walls. And while making the rooftops float at the proper place, I would have better understanding about the 3D nature of the scene. Then go back to the raycasting code and think how to combine them. And also think about why am I doing this. Only to amuse myself and teach myself programming or to make a game to the public. I mean my previous computer could not handle a Wolfstein clone made with AGS, it was running less than 10fps with 320x200 resolution. And it the computer was Athlon XP 3000+. So rendering the textures for the walls in a top view car game might not be worth it.

Darth Mandarb

So ... you knew you were breaking the rules, but you dug up a 6 month old thread anyway to ask a question about your game?  The next time you get inspired to break the rules send a PM.

Zabnat - are you still working on this game?  If you are not I'm going to lock it (and will unlock it later if you pick it back up).  There's no sense leaving it open (so it can be dug up again) if you're not working on it.  Thanks :)

zabnat

Go ahead and lock it Darth. And if someone has questions, send me a PM. :)

m0ds

Last post then I guess, hehe! I didn't try this the first time you posted zabnat, so I'm glad it got dragged up again :P I had a  go yesterday - great stuff, good to see this possible in AGS. I'm a total idiot with WASD controls though so it was very hard to drive properly anywhere! Are the arrow key combinations easy to put into your source code? It's definitely something I'd like to tinker with in the future, and try something without GTA graphics. In the meantime I can only hope you go ahead and make a few demo missions & maybe try some alternative graphics. Yay!

SMF spam blocked by CleanTalk