a top-down car game

Show off your games, demos and other (playable) creations.
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

a top-down car game

Post by Alexar » Wed Jun 10, 2015 5:49 am

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.png
screenshot
screenshot.png (35.89 KiB) Viewed 4622 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 108 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]
Attachments
pixelRace0.0.6.love
(62.65 KiB) Downloaded 170 times
Last edited by Alexar on Wed Jun 24, 2015 6:28 am, edited 3 times in total.

User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: a top-down car game

Post by qubodup » Wed Jun 10, 2015 7:13 pm

Quite cool and hard to steer. Would greatly benefit from some juicy oldtimer motor sound :)
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)

User avatar
ArchAngel075
Party member
Posts: 317
Joined: Mon Jun 24, 2013 5:16 am

Re: a top-down car game

Post by ArchAngel075 » Thu Jun 11, 2015 10:14 pm

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....

User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: a top-down car game

Post by s-ol » Sat Jun 13, 2015 8:05 pm

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

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end

User avatar
Rukiri
Citizen
Posts: 68
Joined: Mon Jun 27, 2011 5:52 am

Re: a top-down car game

Post by Rukiri » Mon Jun 15, 2015 7:45 pm

Looks pretty cool. have you tried steering with a racing wheel like a G27?
The car/camera seem to be all over the place...

User avatar
vladgalay
Citizen
Posts: 60
Joined: Sun Jan 29, 2012 4:54 pm
Location: The Motherland

Re: a top-down car game

Post by vladgalay » Tue Jun 16, 2015 6:38 pm

The new version of the game looks very nice, keep working on it! :awesome:

User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: a top-down car game

Post by Alexar » Wed Jun 17, 2015 8:14 am

[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.

User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: a top-down car game

Post by Alexar » Wed Jun 17, 2015 8:16 am

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~~

User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: a top-down car game

Post by Alexar » Wed Jun 17, 2015 8:22 am

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.

User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: a top-down car game

Post by Alexar » Wed Jun 17, 2015 8:34 am

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 8 guests