Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Little Automatic Racing Game in WebGL with Three.js and Oimo.js (lart.no)
37 points by hvidevold on Feb 28, 2019 | hide | past | favorite | 27 comments



You should definitively change (or make change, I don't know if it's possible) "game" to "demo", because it's a bit frustrating when you land on the page and try all keys and even a Game pad (like I did) and nothing happens.

On the other hand, after the frustration, the wrecking ball version is great !


Yeah, sorry about that. I don't know if it's possible to change the title now though.

Glad you like the wrecking ball :)


What is this?! I don't get how it's a racing game.


Well the transparent blue spheres are checkpoints and the units have to pass through them. There is physics for collisions and the pods turn and accelerate towards the checkpoints. They go from one to the next. The race is infinite though in this case. It's inspired by a 2D bot programming contest at https://www.codingame.com/multiplayer/bot-programming/coders... .


Should work at 6 FPS even on iPhone 5C, but if you are on a RTX 2080 Ti try http://emh.lart.no/publish/csb/csb3d/v1/?dupCount=1000&swarm... for 20k units, or more if you're adventurous. I'm getting 100 FPS on that. It's using instanced meshes. I'm getting 6 FPS on a million units (dupCount=1000&swarmCount=500) with ownPhysics=true, which speeds it up with simpler physics for large unit counts.


How do you control it? Firefox on MacBook.


Now you can try http://emh.lart.no/publish/csb/csb3d/vWreckingBall/ it's a slightly interactive version with a wrecking ball you can move with the mouse to mess with the racers :)


You don't. It's automatic :)


Check, clear :)

Pretty cool!


Thanks :)


Hm, I don't see anything besides the blue spheres and some kind of trapezoidal overlay. That said, if I needed some extra warmth and nothing else was available, I could just open this and scoot closer to my workstation...


Hehe.. Any errors in JS console?


What am I looking at? I've pressed pretty much everything and nothing happens.


Ok try http://emh.lart.no/publish/csb/csb3d/vWreckingBall/ it's a quick hack to give you at least a wrecking ball to mess with the racers :)


Well now I just feel bad.


Okay sorry to disappoint but there are no controls (not yet at least). It's automatic as it says in the title. Maybe I should have called it a "demo" instead of a "game" :) . It started as a model viewer and then I added a bit of physics and motion.



I’m confused. I see a giant dragon on top of what looks like goggles, and nothing else? May be an issue with iOS though.


Maybe it's a problem with mesh instancing as it is used for the racers but not the giant ones in the middle. Do you get any errors?


How complex are these meshes? I'm only getting 42 fps average but I feel like it should be way higher


The models have about 1k triangles each. The code is optimized to scale to many units (racers), but the initial rendering cost of instancing with pre-rendered animation skeleton may be high I suspect, so it may be slow for few units on old hardware. I could try to have different rendering paths for small and big number of units to alleviate the problem.


I was getting 60fps in FF on a 2017 15" MBP


Something is wrong, I get 12FPS MacBook Pro (Retina, 15-inch, Mid 2015)


Yes I haven't optimized a lot for older hardware, but I think it could definitely be done, just have to ditch the complex stuff I am using to scale to high number of units when there are not many of them.


It's not old hardware :)


Should the cars and riders be racing independently? :D


Ah hahaha they are just two types of racing pods :) . There is no car/rider classification.

For my personal version I can use all Starcraft 2 units as racing pods, the dragon and the binocular pod are just a couple of free ones I found on Sketchfab and put in there to be able to publish it :)

Here are a couple of screenshots from personal version: http://emh.lart.no/publish/csb/million-mutas2.png http://emh.lart.no/publish/csb/csb3d.png




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: