Page 1 of 3

a top-down car game

Posted: Wed Jun 10, 2015 5:49 am
by Alexar
Hi everyone!
i am Alex, and i am working on a project about top-down car game. but I have no experience in the subject. I need really some advice.
with help of http://www.iforce2d.net/b2dtut/top-down-car, this is what i have done.
The attachment screenshot.png is no longer available
and here is the .love file


i have some questions that i need help with:
1. it seems that the collision against walls are not so real. for that i used a circle as the box for tires, but still not so good.
2. how to generate the random map? i am not very satisfied with what i've done. because the shapes of blocks of road are not uniformed and not verticle to the road heading direction.
Thank you for any advice~
Please forgive my poor English and i hope you can understand what i mentioned.

Thanks for all your advices and encouragement. here comes the new version.
screenshot
screenshot
screenshot.png (35.89 KiB) Viewed 9588 times
and now we have
1. one nice trace with only three types of blocks.
2. some npcs with simple AI
3. lap checking stuff
4. an AI interface, you can edit the car AI by modifing then AI.lua file. mine is just one of the simplest.
i will keep on updating this game. if you wanna have a car race fight with the car ai ? tell me and fight, i will post the result in the page.



And new version released ^_^
here is some new feature:
1. a shiney random map , i am very glad with the new one. how about you ?
2. a mini map on the main screen.
3. added a bounding box to the car. i thing rect with filleted corners will be better. todo in next version
4. allow laps cross. only ojbs near the car are actived. so you can see the cars go like going through overpasses.
5. some other bugs fixed.
so what else feature we should add to the game?
1. a cool hud ? euh...i am really not very good at it.
2. items ? for exemple n2o missiles traps? and drift to gain n2o?
3. online ?
4. tuning the car?
5. different road conditions?
we will see...
uh, here is the .love file.
pixelRace0.0.4.love
(18.81 KiB) Downloaded 255 times
version 0.0.6 and new features
1. added an interface.
2. added some sparks when objs collide.
3. added explosion effect. press 1 to feel.
[attachment=0]pixelRace0.0.6.love[/attachment]

Re: a top-down car game

Posted: Wed Jun 10, 2015 7:13 pm
by qubodup
Quite cool and hard to steer. Would greatly benefit from some juicy oldtimer motor sound :)

Re: a top-down car game

Posted: Thu Jun 11, 2015 10:14 pm
by ArchAngel075
One method i think could work for road gen,

If you were to produce a line that "walks" in known/stored segments that contain segment length and heading to create a course and then later insert road segments that build from those lengths and headings. The "walk" is a case of pick a heading, and then move to a point that is in that heading by dx amount, then pick a new heading. But for smooth turns, a bezier curve can be used, using points on it as points inserted in between the curves' start and end to ensure it is smooth. Additionally i think making it so that the new projected point(s) are atleast a certin distance x away from other points ensures that wide roads don't overlap, or 4 way crosses don't occur (unless desired, though im unsure on how to tackle such)

This is simply a speculation based on past experience making a graph tool i used to build a danmaku game where AI and projectiles used nodes constructed out of bezier/linear lines.

About the game :
Good luck!
Reminds me of a simple car game a friend showed me...I was terrible at it....

Re: a top-down car game

Posted: Sat Jun 13, 2015 8:05 pm
by s-ol
One problem is that your cars dont seem to have any traction at all; in real cars steering happens not by applying more forces (for rotation) but by "modifying" the old forces (not really, but you know what I mean).

When i had to implement this for my own car game, I followed this guide (which is meant for C++, but still applies): http://www.iforce2d.net/b2dtut/top-down-car

Re: a top-down car game

Posted: Mon Jun 15, 2015 7:45 pm
by Rukiri
Looks pretty cool. have you tried steering with a racing wheel like a G27?
The car/camera seem to be all over the place...

Re: a top-down car game

Posted: Tue Jun 16, 2015 6:38 pm
by vladgalay
The new version of the game looks very nice, keep working on it! :awesome:

Re: a top-down car game

Posted: Wed Jun 17, 2015 8:14 am
by Alexar
[quote="qubodup"]Quite cool and hard to steer. Would greatly benefit from some juicy oldtimer motor sound :)
[quote]
thanks man, i will add some sound and music later.

Re: a top-down car game

Posted: Wed Jun 17, 2015 8:16 am
by Alexar
qubodup wrote:Quite cool and hard to steer. Would greatly benefit from some juicy oldtimer motor sound :)
thanks , i will add some musics and sounds later~~

Re: a top-down car game

Posted: Wed Jun 17, 2015 8:22 am
by Alexar
ArchAngel075 wrote:One method i think could work for road gen,

...

About the game :
Good luck!
Reminds me of a simple car game a friend showed me...I was terrible at it....
thank you for your advice! and i selected a method like building blocks. with 1 normal block,2 left or right 15 deg block, 3 trans-size block,4 connect the end and start block, 4 types. it seems to work well. but to build the lap, it use only local positions and we can only build it one after another, it is hard to use normal path points to build laps.

Re: a top-down car game

Posted: Wed Jun 17, 2015 8:34 am
by Alexar
S0lll0s wrote:One problem is that your cars dont seem to have any traction at all; in real cars steering happens not by applying more forces (for rotation) but by "modifying" the old forces (not really, but you know what I mean).

When i had to implement this for my own car game, I followed this guide (which is meant for C++, but still applies): http://www.iforce2d.net/b2dtut/top-down-car
agreed with that, actually the car in my game is built by the code translated from c++ to lua that posted in the page you as you say. but the world metering is different. so i tuned all the parameters little by little. but still not so satisfying.