12.3.12

HTML5 + Box2D = Quick’N’Dirty Dakar Rally Sim

I very rarely mess with web development these days, but the power of current JavaScript engines and latest HTML5 features were just too juicy to pass on.

So sometime around early 2011, I took two afternoons and played with these technologies. Just now I remembered the project I had in hands, and decided I could give it a name and publish it on the net for your personal amusement.

Consider it pre-alpha, and expect bugs! 馃檪

qnd_dakar_rally_sim

Features:

  • Infinite landscape, using procedural generation (how else could I squeeze infinity into a few KBs?), and adaptive terrain features based on play style (namely, how fast you like to drive).
  • Somewhat realistic physics (based on Box2dJS library).
  • Incredibly detailed graphics engine based on WebGL. Nah just kidding, it’s the default HTML5聽canvas-based rendering provided by Box2D itself…
  • Physically-modelled rolling stones on the driving surface. Framerate suffers too much so they’re disabled by default. To re-enable, dive in the source code and hack away.
  • Tested on major PC browsers, and on Dolphin Browser Mini on Android.

Controls:

  • right-arrow -> gas
  • left-arrow <- brake

Right now I’m in the middle of a physical home migration so the code is not githubbed yet, but you can access it by clicking the following link:

Quick’N’Dirty Darkar Rally Sim 2011

There’s no purpose as of yet, but you can try to race against the terrain and see how far you last before ending up on your roof or suffering a physics explosion.

License is GPLv3.

05.16.09

Little Big Planet feat. Daft Punk

Hac铆a mucho que no posteaba nada por aqu铆, as铆 que ah铆 va un post facil贸n de m铆tico video empotrao xD

03.8.09

Mad oversteer

Some old vids in which I’m just the wheelman. Thanks to Darth Joules and Geert, the simracers who did the video capturing and editing (my crappy 1k ghz putter couldn’t handle all that stuff, 30 constant FPS was already a great achievement), and of course thanks to Eero Piitulainen for the excelent RBR physics (hope to see another physics engine of yours soon…).

Ahora lo que es en castellano: un par de viejos videos, de cuando sol铆a quemar rueda (virtual) semanalmente, en este caso con RBR. 聽Gracias a Darth Joules y Geert por la captura y edici贸n, y Eero por el brutal motor f铆sico que program贸 a contrarreloj para SCi y que a煤n hace vibrar a la comunidad. Una pena que el c贸digo se haya perdido en el limbo legal gracias a los 6 a帽os de abandono, los Ferraris de dudosa legalidad estrellados, la mierda que salpic贸 a Warthog Studios por sus relaciones con cierta mafia sueca de blanqueo, las detenciones de algunos CEOs y los consiguientes enchironamientos, y weno… mejor no seguir que escribo un libro 馃槅

Richard Alexander Burns

January 17, 1971 – November 25, 2005

R.I.P.

09.22.08

Status of Logitech G25 support under GNU/Linux

Last time I tried the Logitech G25 steering wheel under GNU/Linux, only two of the 7 gears could be used, there was no clutch pedal, gas and brake were in combined axis mode, a couple of buttons didn’t even work, the steering range was severely limited… long story short, there was no way to fix all those problems, so the wheel was definitely not usable for simracing purposes.

Fortunately, a few days ago I stumbled upon a thread discussing the usability of the wheel under GNU/Linux, and someone had kindly posted some links to the VDrift forums (great sim btw), where most of the previous discussions regarding the G25 had been held. It seems that some guy had released a tool that allows to use all the features of this awesome steering wheel.

Skimming through its code (yeah, it was realeased in source code form, under public domain and LGPL!), it seems to send some binary data that initializes the so called extended mode, which is not enabled by default. It looks like someone has spent some serious time sniffing through USB traffic…

Anyway, the thing is that the tool does work, and so the G25 is now much more usable under GNU/Linux! Except for one thing: trying to set the 900潞 rotation mode, a process during which some usb or hid driver seems to freak out and remove the steering wheel device nodes 馃檨

Force feedback is supposed to have been working for some time now, but due to the aforementioned initial problems, I never really bothered to test it much (I did patch the kernel to see if the existing FFB drivers would work for the G25, and the basic effects worked, but there was no point on finding a driving game that used them).

Just in case it disappears from tha interwebs, i’m hosting the tool myself. The usage is pretty simple:

  1. Download the GNU/Linux Logitech G25 extended mode enabler tool (46KB) archive.
  2. Extract its contents anywhere, and cd to it.
  3. Compile: ./build.sh
  4. Run the tool: ./usbtools g25-set-extended-mode

And that’s it. Make sure you run jscalibrator the first time in order to calibrate and remove any nasty deadzones on all axis. For more info, simply run ./usbtools without parameters.

Now i just gotta wait for Wine to properly support forcefeedback so that i can enjoy Live For Speed the way it’s meant to 馃榾

Happy racing!

05.13.06

Realistic Fractal Worlds

As you may or may not know, I’m involved in a pretty ambitious project, named Motorsport. Its purpose is to become the most realistic simulator of vehicles (usually cars), and as such, no ideas are being scrapped (as long as they contribute to the sim realism, that is).

There are a lot of ideas floating around. You can read about a couple of those new ideas here. However, I’m going to talk about something which you won’t find there: generation of real world 3d geometry and textures on the fly, with an unlimited level of detail.

Yeah, sounds gorgeus at first. But it’s not so gorgeus as it’s difficulty to code and get right (i guess).
The idea is to:

  1. Find a free (CC-licensed if possible) source of Earth data. We need both 2d textures and a 3d model, which can usually be found in the form of (unfortunately) freaking low-res textures and freaking low-res heightmaps.
    Possible sources:

    Ok, so that has nothing to do with fractal worlds.

  2. That’s where procedural contents come into play. Take a library such as LibNoise, take the aforementioned freaking low-res contents, mix them all in a bowl on the fly, and you can get 3d meshes and 2d textures with any level of detail you may want, perfectly consistent and reproducible across different computers.
  3. But this is a vehicle sim, so we must add some roads.
    Google Maps provides some road maps (as do many other websites such as Guia Campsa, but their data most probably can’t be used without paying royalties first)
    Then there’re some professionals who work creating landxml-compatible sets, which sometimes are not even possible to buy.
    And then there’s data created by regular people with their GPS-equipped cars, for example Open Street Maps.

    Once we got some good (or bad) road data, we drop it over the heightmap we got from point 1), seamlessly integrating it by using 3d mesh data and blended textures, and add some detail (bumps, side bankings, curbs, dust, camber, variable surface properties, …) in order to make the ride a bit more interesting.

Sounds easy, does it? Of course NOT. But it’s just a rough idea of what could be done in, say 23 years or so.. give or take a day 馃槈

Enough dreaming for now, I should go study something about OSs (Operating Systems, not Open Source Software! 馃檪

See ya!

Ps: yup, I’ve finally decided to write some posts in English, as I find it easier to find the words for technical subjects such as the one in this article. Plus English is a more efficient language when it comes to bandwidth! 馃槢