# Best Method To Make 3rd Person Car Race Game?

**URL:** <https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810>\
**Category:** Questions\
**Created:** [July 17, 2018, 9:12pm UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810 "2018-07-17T21:12:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessepalser](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jessepalser/32/9250_2.png) [@jessepalser](https://forum.defold.com/u/jessepalser)\
**Post date:** [July 17, 2018, 9:12pm UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/1 "2018-07-17T21:12:46Z")

</div>

Hi,

Been a while…  
I would like to make a 3rd person car racing game but am unsure how to implement it properly.  
Is there a tutorial floating around somewhere for such a project?  
Target platforms are HTML5/Android/iOS.

Let me know, thanks!

J.

---

<div class="post-metadata">

**Author:** ![benjames171](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/benjames171/32/34759_2.png) [@benjames171](https://forum.defold.com/u/benjames171)\
**Post date:** [July 17, 2018, 9:52pm UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/2 "2018-07-17T21:52:03Z")

</div>

I wrote a simple overhead racing game called _Victory Lane_ using Defold a couple of years ago.

The dev dairy thread is [here](https://forum.defold.com/t/victory-lane-overhead-car-racing-game/2847) and the source project can be downloaded [here](https://drive.google.com/open?id=17w-l_CbZpC92A43ywHbtOvEp_dn9pFP8).

Hope it helps.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [July 17, 2018, 10:56pm UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/3 "2018-07-17T22:56:22Z")

</div>

Instead of trying to implement everything at once break it down into one thing at a time.

Do you want a 2d game like the Sega game Out Run or Mario Kart for the SNES or a 3d game with a third person camera?

There are many physics tutorials online for cars and some here which could be learned from. For example [https://www.reddit.com/r/gamedev/comments/30vvsu/simple\_2d\_car\_physics/](https://www.reddit.com/r/gamedev/comments/30vvsu/simple_2d_car_physics/)

---

<div class="post-metadata">

**Author:** ![jessepalser](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jessepalser/32/9250_2.png) [@jessepalser](https://forum.defold.com/u/jessepalser)\
**Post date:** [July 17, 2018, 11:08pm UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/4 "2018-07-17T23:08:56Z")

</div>

Yes, something like Sega’s “Outrun” would be fine.  
3rd person racing game(camera behind player’s car).  
The biggest hurdle is rendering the road.  
Other stuff is simple sprite scaling.  
I’ll google some more, but if there is something I could look at that would be helpful.

J.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 18, 2018, 8:01am UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/5 "2018-07-18T08:01:54Z")

</div>

There are different ways of doing this.  
E.g. skewing 2d sprites to create arbitrary polygons, to get a 3D perspective.  
You can also rasterize the polygons yourself.

As usual, google has some good resources on making games:

> **[Lou's Pseudo 3D Page](https://www.extentofthejam.com/pseudo/)**

> **[How does Pico Racer work?](http://kometbomb.net/2016/04/03/how-does-pico-racer-work/)**
>
> After I released Pico Racer, lots of people have thought it looks nice and is an achievement. I don't think it does anything special or pushes the

> **[How to build a racing game - straight roads](https://codeincomplete.com/posts/javascript-racer-v1-straight/)**
>
> Personal Website for Jake Gordon

The first link helped me a lot when I did a racer a couple of months back. I chose to rasterize the image myself.  
It’s not terribly complicated, but in the end I also got performance issues, since I modified a buffer, and set a texture every frame, pixel-by-pixel from Lua ^^

Next time, I’ll move that code to C++ and do the rendering there instead.

As for physics, the game logic is in 2d (top down), with each object (car/bonus) represented as a box.  
With so very few obstacles, it’s easy to do a box-box check yourself.

The background, sun+mountains (made by @Axel), and the objects are made of sprites so it’s only the road and the sides of the road that is rasterized.

 ![13](https://forum-defold-uploads.b-cdn.net/original/2X/2/20931cb6689a68a4b75e3cdd02a05508108bf851.png)

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [July 18, 2018, 9:03am UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/6 "2018-07-18T09:03:24Z")

</div>

Ahah lovely. I was wondering how Lua and Defold would perform on something like that. I guess, on mobile is out of the question but desktop is ok?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 18, 2018, 9:23am UTC](https://forum.defold.com/t/best-method-to-make-3rd-person-car-race-game/24810/7 "2018-07-18T09:23:42Z")

</div>

This was for a mobile app, and it ran well on modern devices, and ok on some older androids/iPhones 4S.
