Toy Cars Screenshot Physics-based 2D racing game

Toy Cars is a physics based 2-D racer. The graphics and the interface use SDL and OpenGL.

Toy Cars is partly inspired by Micromachines and partly by the old Atari ST game called Jupiter's Masterdrive.

License: free
Requirements: Most graphics cards should be sufficient. 64 Megs VRAM minimum is preferable.

Sound:Play in X:Play in Console:Multiplayer:Network Play:3D Acceleration:Source Available:
yesyesnoyesnoyesyes
Suggest an update

Comments

I think this game may indeed allow one to play in X and have 3d acceleration. Just a heads up.
Re: I think something's wrong posted by rubenz on Nov 13 2005 9:48 PM
Yep, thanks for the note. I've submitted an update to fix that now.
Re: I think something's wrong posted by anonymous on Aug 5 2006 2:51 AM
when trying to run ./configure.ac I get this:

./configure.ac line 1: dnl:command not found ./configure.ac line 2: syntax error near unexpected token `src/main.cpp' ./configure.ac line 2: `AC_INIT(src/main.cpp)

I have ubuntu dapper drake

Re: I think something's wrong posted by rubenz on Aug 15 2006 3:47 PM
Your not supposed to type ./configure.ac. Instead try running ./autogen.sh. Then run ./configure. Then run make.
Re: I think something's wrong posted by rubenz on Oct 16 2006 9:31 PM
From now on simply running ./configure should be all that is necessary.
Re: I think something's wrong posted by anonymous on Nov 2 2006 6:08 AM
F'ing piece of shit,when running ./configure everything seems to be going just fine,but then in the en it gives me this checking for sdl-config... no checking for SDL - version >= 1.2.10... no *** The sdl-config script installed by SDL could not be found *** If SDL was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the SDL_CONFIG environment variable to the *** full path to sdl-config. configure: error: *** SDL version 1.2.10 not found! so then i do sudo apt-get install libsdl1.2debian andit just says I have the newest version!
Compilations stops here: (translated from French)

g++ -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -g -g -O2 -c -o ScSprite.o `test -f 'ScSprite.cpp' || echo './'`ScSprite.cpp
ScSprite.cpp: In member function ‘void ScSprite::load(int, int, short int, const ScPixelData&)’:
ScSprite.cpp:113: error: the array's bounds prevent what is following after the type-id between round brackets
ScSprite.cpp:113: note: try to remove round brackets around the type-id

My distro is Ubuntu Breezy.
Re: compilation error posted by anonymous on Nov 15 2005 8:53 AM
The same problem here... I just removed the parentheses as suggested and it compiled ok (there is also the same problem in main.cpp).
Re: compilation error posted by Tuxmym on Dec 7 2005 9:30 AM
thx it works now
The game looks promising!
My suggestion would be that the view should be a little higher so bigger part of the track would be visible.
What makes MicroMachines extremely fun is the NON-split screen. If this mode could be added this could make the game so more fun.
Re: feature suggestion posted by rubenz on Dec 13 2005 11:59 PM
Added to the todo list.
Re: feature suggestion posted by Tuxmym on Dec 14 2005 2:35 AM
thx :-)
Re: feature suggestion posted by Tuxmym on Aug 3 2006 6:04 AM
Many thx ! I see you have added such a game mode :D
However, currently I need to find 3 friends to test it :-S
Keep up the good work.
I have this message when compiling with gcc 4.0:

g++ -DHAVE_CONFIG_H -I. -I. -I..  -I ../src/glf -I ../src/MyFisix -I ../src/Scoobie -I ../src/tinyxml  -Wall -I/usr/include/SDL -D_REENTRANT -pthread -g -O2 -c -o main.o `test -f 'main.cpp' || echo './'`main.cpp
Dans le fichier inclus à partir de /usr/include/c++/4.0.2/backward/list.h:59,
          à partir de ../src/Scoobie/ScAnimation.h:25,
          à partir de ../src/Scoobie/ScView.h:29,
          à partir de CarGame.h:27,
          à partir de main.cpp:41:
/usr/include/c++/4.0.2/backward/backward_warning.h:32:2: attention : #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the  header for the  header for C++ includes, or  instead of the deprecated header . To disable this warning use -Wno-deprecated.
../src/Scoobie/ScTilemap.h: In member function ‘unsigned char& ScTilemap::operator()(short unsigned int, short unsigned int) const’:
../src/Scoobie/ScTilemap.h:49: attention : minimum/maximum operators are deprecated
../src/Scoobie/ScTilemap.h:49: attention : minimum/maximum operators are deprecated
main.cpp: In function ‘void readPointsFromString(const char*, Tuple*, short int&)’:
main.cpp:250: erreur: invalid conversion from ‘const char*’ to ‘char*’
main.cpp:250: erreur:   initializing argument 1 of ‘char* strtok_r(char*, const char*, char**)’
main.cpp: In function ‘ToyCar* loadNewToyCar(char*, const Tuple&, double)’:
main.cpp:397: erreur: invalid conversion from ‘const char*’ to ‘char*’
[...]

The same with gcc 3.4:

g++-3.4 -DHAVE_CONFIG_H -I. -I. -I..  -I ../src/glf -I ../src/MyFisix -I ../src/Scoobie -I ../src/tinyxml  -Wall -I/usr/include/SDL -D_REENTRANT -pthread -g -O2 -c -o main.o `test -f 'main.cpp' || echo './'`main.cpp
Dans le fichier inclus à partir de /usr/include/c++/3.4/backward/list.h:59,
          à partir de ../src/Scoobie/ScAnimation.h:25,
          à partir de ../src/Scoobie/ScView.h:29,
          à partir de CarGame.h:27,
          à partir de main.cpp:41:
/usr/include/c++/3.4/backward/backward_warning.h:32:2: attention : #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the  header for the  header for C++ includes, or  instead of the deprecated header . To disable this warning use -Wno-deprecated.
main.cpp: In function `void readPointsFromString(const char*, Tuple*, short int&)':
main.cpp:250: erreur: conversion invalide de « const char* » vers « char* »
main.cpp:250: erreur:   initialisation de l'argument 1 de « char* strtok_r(char*, const char*, char**) »
main.cpp: In function `ToyCar* loadNewToyCar(char*, const Tuple&, double)':
main.cpp:397: erreur: conversion invalide de « const char* » vers « char* »
main.cpp:397: erreur:   initialisation de l'argument 1 de « char* strtok_r(char*, const char*, char**) »
main.cpp:410: erreur: conversion invalide de « const char* » vers « char* »
[...]

PS: sorry for the French messages :-/

Re: 0.2.4 doesn't compile posted by Tuxmym on Dec 14 2005 2:35 AM
Using a cast "(char*)" before the first argument of each strtok_r functions in main.cpp, it works.

PS: forgot to give my Linux config: Ubuntu Breezy
Re: 0.2.4 doesn't compile posted by anonymous on Dec 17 2005 3:27 PM
The proper way to handle this is with strdup(), not with a cast. This will preserve the meaning of "const".
unable to compile with gcc 4 first error :
main.cpp: In function 'void readPointsFromString(const char*, Tuple*, short int&
)':
main.cpp:250: error: invalid conversion from 'const char*' to 'char*'
main.cpp:250: error:   initializing argument 1 of 'char* strtok_r(char*, const c
har*, char**)'
Re: Toy Cars posted by anonymous on Dec 14 2005 12:41 PM
sorry forget the previous post. the compilation issue reported is the same as below
Version 0.2.5 has now been released. It contains bug fixes for the problems mentioned in the previous two posts.
Re: bug fixes posted by Tuxmym on Dec 18 2005 12:59 PM
Thx, it compiles fine now.
nice game, ty guys. Are there any plans for ai? (Sorry, i got not much time atm, so i can't check your todo plan ;))
For now, nice graphics, realistic physics (at least everything one could expect from a that tiny car ;)), respect!

If you add some computer controlled opponents and maybe a simple soundtrack i'll vote you 4 or 5 for this game, i really like it ;)
The bases of this game are very good I think, maybe except for the car control which seems odd, once you have reached a high speed, it's very difficult to turn. I'm not sure it's realistic.
Is it what you intended to do ?
Re: weird control posted by rubenz on Aug 3 2006 9:54 AM
Well the physics may need to be adjusted to get the balance right so it is more realistic or just more playable. On the other hand though - it is perfectly ok that one has difficulty turning at high speeds. That's what happens in reality.
Re: weird control posted by Tuxmym on Aug 6 2006 3:20 AM
Ok, I understand
However, one of the things that make MicroMachines very fun is the possibility to have a second chance to overtake our opponent when we hit a wall (which stops the car) thanks to the quick acceleration and the fast reach of the maximal speed.
With the current system of your game, each time you hit a wall, you loose a score.
I don't think it's more realistic but I'm sure it funnier.
Re: weird control posted by anonymous on May 3 2007 9:27 AM
No. I'm pretty sure steering is more sensitive at high speeds in real life.
Re: weird control posted by draeath on Nov 8 2007 1:15 PM
It is, but it's also harder to turn, as there is more inertia for your tires' grip to fight. Sure, you can yank the wheel over, but you're going to spin.

If you can find a huge empty parking lot sometime without a lot of lights, you may want to try it sometime. Just be extremely careful not to flip your car...
Re: weird control posted by draeath on Nov 8 2007 1:16 PM
Speaking as someone who has accidentally spun their car by turning too sharp too fast...
Re: weird control posted by anonymous on Nov 8 2007 8:15 PM
Street vehicles are tuned to understeer. Racing vehicles are not, and are much more sensitive, because you don't want the driver to have to yank on the wheel to turn at high speeds -- but he has to be careful because the car is now much more touchy.
Re: weird control posted by anonymous on Dec 15 2007 11:58 PM
On road or on dirt? This game seems to be on dirt. At high speeds the tires are probably going to slip.
It's quite weird, it says just above that most graphics cards should suffice.

I have just tried running this on my Intel Core Duo laptop with an Intel 950.
Perhaps the problem is Aiglx/Compiz though, I did try running it with that turned off and it was no better.

What happens when you link your GPL-licensed program with a proprietary library?

Re: FMOD Ex? posted by anonymous on Nov 6 2007 10:56 PM
The author can and should give formal permission to link with that library in the package's documentation. Even so, it may still only be legally kosher to distribute as source. Binary distribution is probably right out.
Re: FMOD Ex? posted by anonymous on Nov 7 2007 4:39 AM
ZOMG FMOD IS KEWL! FOSS IS FOR LAMERS GO MICROSOFT!!!!111!!!111!!!!ONE!!!! Just kidding, of course.

But in all seriousness, why do you need 3D audio in a 2D game anyway? You can use SDL_mixer to get enough directional audio for this game, why not use that? It allows "interaction between music and sfx," what's the need for a proprietary library? Why are so many games nowadays using FMOD, is there some sort of mind hypnosis on their site that makes people think that FMOD is god? There's my rant.

Re: FMOD Ex? posted by anonymous on Nov 8 2007 6:43 PM
Apparently FMOD is guaranteeing many virgins to believers. I think the GNU GPL v3 needs amending.
Re: FMOD Ex? posted by anonymous on Nov 10 2007 1:42 AM
unfortunately SDL_mixer's format detection is a bit broken among other quirks. it doesn't properly detect MP3s in RIFF containers, which was a showstopper for the game I help maintain. not sure what the problem with OpenAL is, though, since that's what I decided to use. 64+ sounds at once with bgm no problem.

in b4 y not fix sdl_mixer. Sorry. tried. was easier to write my own lib.

Re: FMOD Ex? posted by draeath on Jul 8 2008 8:47 PM
I would ask why you were putting MP3 data into RIFF chunks, but I'm not sure I want to know.
Re: FMOD Ex? posted by rubenz on Dec 4 2007 2:52 AM
I'll change the license for the next release of the game to resolve the FMOD license problem. As for FMOD compared with other sound libraries, FMOD is easily the most programmer friendly sound library I've come across. All the others are much more low level than FMOD and therefore more difficult to use. So that's why I decided to go with FMOD, even if it is closed source (but free for non-profit uses).
Its a good simple game with an editor. The editor isn't polished but it's simple enough for younger children to create tracks with. Ruben incorporated some of my suggestions in this release and added the track I created - Hairpin.
Running FC10, gcc-c++-4.3.2-7.i386, not sure what all else you'd need.

g++ -DHAVE_CONFIG_H -I. -I.. -I ../src/glf -I ../src/MyFisix -I ../src/Scoobie -I ../src/tinyxml -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -pthread -g -O2 -MT Startline.o -MD -MP -MF .deps/Startline.Tpo -c -o Startline.o Startline.cpp Startline.cpp: In constructor ‘Startline::Startline(Tuple, Tuple, double, bool)’: Startline.cpp:55: error: ‘sprintf’ was not declared in this scope make[3]: *** [Startline.o] Error 1

I added the following to Startline.cpp - I have no idea which of the two fixed it - it was just a guess:

#include <cstdio> #include <cstring>

I've played once so far, but its a blast! A bit choppy on my PC, but I'll tweak some options to see if I can smooth it out.

CAB

Re: 0.3.8 compile error/fix posted by rubenz on Mar 23 2009 12:22 PM
You may find that the choppiness disappears if you make all the players have the same type of vehicle in the game. This occurs for some older graphics cards it seems.
This game looks fun but playing even just 2 minutes with the camera made me feel weird.
Re: the camera makes me dizzy posted by rubenz on Mar 24 2009 1:05 PM
Yeah. I know what you mean. I'll make the camera mode possible to change for the next version.
I did a standard "./configure && make && sudo make install", everything went well, but as soon as I type "toycars" I get a segmentation fault...
$ toycars 
Default Data Dir: /usr/local/share/toycars
Changing to directory: /usr/local/share/toycars
User data dir: /home/xxx/.toycars/
Segmentation fault
Quick GDB:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb78b68e0 (LWP 25433)]
TiXmlAttributeSet::Find (this=0x2c, name=0x80780b5 "enabled") at tinyxml.cpp:1559
1559		for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
Other Infos:
Toycars version 0.3.9
OS: Ubuntu Hardy

Could someone help me? :-)
Re: segmentation fault posted by rubenz on Mar 25 2009 6:17 AM
Can you ask gdb for a backtrace? Give me the backtrace and I might have some idea how to help... nb: just type backtrace at the gdb prompt once the program crashes.
Re: segmentation fault posted by mym on Mar 25 2009 11:22 PM
Thx for your answer!
Here you are:
#0  TiXmlAttributeSet::Find (this=0x2c, name=0x80780b5 "enabled")
    at tinyxml.cpp:1559
#1  0x0806f62b in TiXmlElement::Attribute (this=0x0, name=0x80780b5 "enabled")
    at tinyxml.cpp:543
#2  0x0805f686 in TcPreferences (this=0x8082418, 
    inFilename=0xbf94c144 "/home/xxx/.toycars//preferences.xml")
    at TcPreferences.cpp:75
#3  0x08059058 in main (argc=1, argv=0xbf94c2f4) at main.cpp:1839
Re: segmentation fault posted by rubenz on Mar 26 2009 2:25 AM
Well I think it's my fault for not putting enough checking in my own code. That still doesn't explain the cause of the problem you're having though. Maybe your preferences file is corrupt. Try removing it (rm ~/.toycars/preferences.xml) and then run the game again. If that still fails then email me the contents of the preferences file.
Re: segmentation fault posted by mym on Mar 27 2009 7:09 PM
Removing my ~/.toycars directory solved the problem :) thx

Log in or register to rate this game or post a comment.