It has always been my aim to provide as much of a log about creating a racing simulation as I can, including the mathematics of the simulation and other details. I’ve just setup something on the blog to allow. So here we will start be some of the extremely basic math/physics that an average high-schooler would understand. Read the rest of this entry »
Sara cat and Monky bird changed gears from the normal programming on TurtleBrains stuff into starting to move forward on ZoomCarWorld3. Initially some basic art practice in blender working on a small homemade go-kart before deciding the ZCW3 would start out as Read the rest of this entry »
Long ago, now over eight years ago in fact, a couple books; Speed Secrets and A Twist of the Wrist got me thinking about approaching artificial intelligence in a completely different way. I had not much experience writing artificial intelligence, a tiny bit of pathfinding, decision trees, and a few other basic things that were class assignments or the such. Wouldn’t it be cool if the artificial driver had to work with the same knowledge and inputs as the player? You know, instead of directly moving the vehicle to the new location, the accelerator, brake and steering inputs would be used. The books also mentioned how important reference points are, so the driver should also use these!
I started a fairly epic thread on LFSForum that has evolved into my project log, but in the early days there were some difficulties explaining exactly what I wanted from the project, perhaps at the time I didn’t fully know or understand that myself. But over the years it has become more clear; this is a learning project, a brute force method to learning how to write and artificial driver. Is it the fastest driver, oh no- but getting faster. Is it optimized, ho ahahah – not at all. But it has presented me with numerous challenges that I’ve overcome and most of them with little to no research and just good old “thinking”. Which is what keeps this project going.
It has not been 8 years of constant work, there will be months of off time and then an idea pops in my head “what about …. “? and I build it out in my mind, get super excited and start working on a way to test out that idea. In the beginning it was a challenge just to collect the pertinent data. That evolved into a challenge to control the car in the LiveForSpeed racing simulator. The first time I got a car to move and aim at a cone (in a car park with nothing near) I threw my hands in the air with excitement. Unfortunately I don’t have footage or data available from these early days. The replays I had became corrupt over time.
I believe it would be a great exercise to go through the old history, pick out the most difficult challenges and victorious moments and bring them to life here in this blog. It is likely looking back upon this project could inspire new changes, make me reconsider old ideas, or at the very least bring the information to anyone interested. The trick is keeping it cohesive, as I want to write about current challenges as well as those in the past and that could get messy.
If you have ideas on how I should approach this, please let me know on @timbeaudet on twitter, or any other way you have to contact me.
Racetracks have a lot of fencing, and placing each section of fencing section by section would be a daunting task, so I spent the last few hobby development sessions creating a way to edit a spline that could be attached to an object to place the fence. Last year I had my first experience with bezier curves when I Read the rest of this entry »
It was decided, at the end of August, that I would be attempting to make or practice a bit of art each day during September. Hopefully I can make it last a bit longer, but if I can complete some art each day I will have achieved my goal for the year. Art is hard. Read the rest of this entry »
I have started working on the Artificial Intelligence in Racing Simulations project again, still using Live For Speed as the base physics simulation because it is fairly accurate and reasonably accessible. Here is a short recording of the artificial driver, Jared, driving at Fern Bay Club in the XRG. A fantasy car similar to a low powered rear-wheel drive sports car.
The second version/iteration of driving logic was written last year, March 2015, but my PC at the time was getting outdated and overloaded as it tried running everything it needed, plus AIRS logic could use some optimizations. I lost motivation after writing “Driving Logic version 2” (DLv2 for short), since it didn’t behave as well as I had hoped.
The driver got faster than DLv1, and learned Read the rest of this entry »
Not quite started, but tonight work began on Zoom Car World 3, the demo and learning project I will be using as a stepping stone to write a full blown racing simulator. For years this project has been placed on the sidelines, but with the current goal to work towards it for an hour a day every day, I am confident things will keep moving.
Current progress was getting back into the old ZCW3 project that was started last summer just before Sonia and I went off to Peru to hike the Salkantay-Inca trail. The project has some form of very basic track editor in the works, although ultimately a lot more work is still needed. Currently the efforts are being focused on giving the car an engine that is simulated, at least on a basic level, physically.
This means taking several things in consideration, the inertia of the engine. All those rotating parts resist changes to the rotation. If they are not yet rotating, they will fight to remain stationary, and if they are rotating they will fight the urge to slow or speed up. A torque will be applied to the engine to increase, or decrease if needed, the speed of these rotations. However I must have some units wrong or have yet to combine all the parts in the code correctly.
angularAcceleration = outputTorque / engineInertia; angularVelocity = angularVelocity + angularAcceleration * deltaTime; engineSpeedRPM = angularVelocity / tbMath::kTwoPi * 60.0f;
That is essentially what I believe I need to do. angularVelocity should be in radians a second from everything I understand, and outputTorque and engineInertia in Newton-meters (Nm). This would make engineSpeedRPM, in revolutions-per-minute to be 60 times angularVelocity over a full rotation (two-pi). This does make sense to my brain, however the results, rate at which the engine speed increases / decreases is not quite what I was expected with no clutch or drive train. It takes a good 3 seconds to go from 1000rpm to 8000rpm and I would be expecting this to be like a second. Will continue tweaking, so stay tuned for updates.
Looking around here it isn’t hard to see that I have a passion for programming. One may even be able to gather that I am also interested in racing. For years I have been wanting to develop my own racing simulator, much like Live For Speed or iRacing, and have started to Read the rest of this entry »