5 ms·
Show HN: Little Automatic Racing Game in WebGL with Three.js and Oimo.js
- hvidevold 8y agoShould 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&swarmCount=10&unitScale=0.1&ownPhysics=false 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.
- cerberusss 8y agoHow do you control it? Firefox on MacBook.
- hvidevold 8y agoYou don't. It's automatic :)
- cerberusss 8y agoCheck, clear :) Pretty cool!
- hvidevold 8y agoThanks :)
- hvidevold 8y agoNow you can try http://emh.lart.no/publish/csb/csb3d/vWreckingBall/ 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 :)
- westmeal 8y agoHow complex are these meshes? I'm only getting 42 fps average but I feel like it should be way higher
- dylan604 8y agoI was getting 60fps in FF on a 2017 15" MBP
- hvidevold 8y agoThe 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.
- quickthrower2 8y agoYou can change the params e.g.: http://emh.lart.no/publish/csb/csb3d/v1/?dupCount=1000&swarmCount=20&unitScale=0.2&ownPhysics=false http://emh.lart.no/publish/csb/csb3d/v1/?dupCount=1000&swarm...
- walski 8y agoWhat is this?! I don't get how it's a racing game.
- hvidevold 8y agoWell 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-strike-back https://www.codingame.com/multiplayer/bot-programming/coders... .
- geoah 8y agoShould the cars and riders be racing independently? :D
- hvidevold 8y agoAh 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/million-mutas2.png http://emh.lart.no/publish/csb/csb3d.png http://emh.lart.no/publish/csb/csb3d.png
- tomhoad 8y agoWhat am I looking at? I've pressed pretty much everything and nothing happens.
- hvidevold 8y agoOkay 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.
- hvidevold 8y agoOk try http://emh.lart.no/publish/csb/csb3d/vWreckingBall/ 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 :)
- SketchySeaBeast 8y agoWell now I just feel bad.
- JeanMarcS 8y agoYou 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 !
- hvidevold 8y agoYeah, sorry about that. I don't know if it's possible to change the title now though. Glad you like the wrecking ball :)
- kowdermeister 8y agoSomething is wrong, I get 12FPS MacBook Pro (Retina, 15-inch, Mid 2015)
- hvidevold 8y agoYes 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.
- kowdermeister 8y agoIt's not old hardware :)
- twodave 8y agoHm, 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...
- hvidevold 8y agoHehe.. Any errors in JS console?
- dgellow 8y agoI’m confused. I see a giant dragon on top of what looks like goggles, and nothing else? May be an issue with iOS though.
- hvidevold 8y agoMaybe 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?