Idea for using Automation in an Assetto Corsa racing league

Hi there,

New here; I posted this in the Automation subreddit but this forum seems to have a more technical auidence on first glance so thought I would share this here to see if it piques any interest.

I’ve recently discovered Automation after watching Jimmy Broadbent doing a few YouTube streams where he created a car and then tried to get the highest top-speed or the quickest 1/4 mile time with it in BeamNG. I’d first like to acknowledge how frickin awesome it is that you can create a car from scratch, tweaking every detail of it, and then use that car in a racing game (BeamNG) - fantastic work by the Automation team on this.
Minor fanboy moment aside I couldn’t help letting my imagination run away with this idea.

I’m a lifelong racing fan and I’ve recently got into sim-racing on the PC - I’ve been impressed with how you can pretty much take any real-life car and track combination and replicate the experience from the comfort of your own home thanks in no small part to a wide community of modders who do some incredible work. This got me thinking about the type of content that gets modded into games and, for the most part, it is replicating real-life cars and tracks. This makes a lot sense as this is generally “what the people want” - you see real-life racing and you want to be able to replicate it. Though there are a few notable exceptions there doesn’t seem to be much emphasis on creating “original” content.

This is where I feel Automation potentially opens up a world of possibilities with respect to this original content; you have to make cars within the bounds of a simulation of real-life. I was a huge fan of the British Touring Car Championship (BTCC) in the 90’s when I was growing up and I can’t help but think how awesome it would be to be able have fictional Automation companies creating cars that could be used to race against each other in a similar sort of competition online. You could mandate some specifications that the cars had to adhere to e.g. Engines must be 1.6L Turbo or 2.0L N/A with some kind of budget cap much like the challenges on this forum. You’d then have another dimension to sim-racing, it wouldn’t just be about the best drivers, it would also be about the best teams and car/engine designers. I can imagine a car with a peaky turbo engine with a narrow-power band competing against another car with lower peak power but more drivability - some drivers will be able to extract more out of the turbo but some would be faster in the more consistent car.

Before I get completely carried away I’ll consider the current state of play with regards to what we can currently do with the cars created in Automation. We can currently export to BeamNG which, while amazing, isn’t yet ready for multiple cars racing against each other online. I know there is a challenge on the forums that seems to use the BeamMP mod but I’m not sure BeamNG is ready for true sim-racing (I’m no expert here so feel free to correct me on this). The Automation development team have mentioned that they were looking into exporting cars to “another sim racing game” prior to getting their BeamNG export working but had to abandon those plans because they didn’t get enough support from the developers of this mystery game. The team now appear to be fully focused on making Automation a more complete stand-alone game (through their campaign mode) which I fully respect as I think they have something here that is more than good enough to stand on it’s own two feet.

I’ve started looking at what sort of sim-racing coud be thrown together with what we currently have available.
The first thought is hill-climb type competitions in BeamNG a-la Jimmy Broadbent - I suspect people are already doing this sort of thing and I imagine it’s pretty fun but it doesn’t quite capture my imagination in the same way as having cars racing against each other directly. There is also the fact that BeamNG doesn’t look like it is quite there yet in terms of driving physics - don’t get me wrong it looks like it may not be far off but I think there are still a couple of iterations needed.

My next idea was to look into how mods are made for other sim racing games. Assetto Corsa seems to have the biggest modding scene so that got my attention. I spent a few days fishing through the files that represent cars in Assetto Corsa and Automation and decided to try and get a proof-of-concept together. My first aim was to be able to take an engine created in Automation and put it into a car in Assetto Corsa. I think this has been done by various people in the past but I couldn’t find anything about this process outside of changing a few files manually. I thought I’d have a go at creating a python script to do it. A bunch of learning about car engines and a few “I have no idea what I’m doing” memes later I’ve managed to get something working - the maths needs some double checking but think it roughly models the key specifications. I’ve stored my code in a GitHub repo here - the calculations I’ve used can be found on this page

I was thinking this work could form the basis for setting up a sim-racing races/league in Assetto Corsa which uses a single chassis and teams enter a car with their own Automation designed engine. There’s a number of finer points that would needing working out to bring this into reality but before going down that road is there anyone here would be interested in something along these lines? Would be pretty cool to have to Automation manufacturers become the next online Ferrari or Mercedes; engine designs winning races as well as a drivers.

2 Likes

Interesting idea and great that you published it :slight_smile:

I agree that multiplayer in BeamNG is not working. I mean yes, technically you can connect with others and see others cars doing something, that is vaguely related to what others are seeing on their screens, but all the time there are some desync problems. Like on my screen someone rear ended me and totaled my car, while on his screen he never came close to me. Regarding driving physics, with the recent updates BeamNG is working really well IMO. Even when exporting cars from Automation to BeamNG I can tweak/tune and recreate feeling of the car too match what I would be expecting from an Assetto Corsa mod.

If someone would organize such an event that you are describing, I would be up to participating. Keep in mind that it’s quite a bit of work to make the rules, validate the entries, and run the event.

Regarding your exporter. After reading the docs I couldn’t find an answer to some questions.

  1. What bout the engine sound? Is it taken from the Automation, or from the “donor car” from Assetto Corsa?
  2. What about the engine weight and as a consequence, the car’s weight distribution?
  3. What about gearing? I presume it stays unchanged? If so, I could see problems if the “donor car” has vastly different RPM range and/or vastly different power output.

Thanks, it’s good to hear that you’re interested.

Yeah, you raise a good point. I’m aware it would require some significant planning and tweaking which is why I wanted to gauge how much interest there is in the idea before fully commiting to anything. I’d love to get something running and would be happy to learn the ins and outs of running such an event. My plan for entry validation was to write a script that could take a spec sheet of min, max or matching values and verify that a created engine fits the required specification - the more I can automate the easier things should be in the long run and the easier it will be for people to use.

At the moment the script doesn’t touch the engine sounds from Automation and it will, by default, use the sound of the donor car. There is the Content Manager tool for AC which allows you to select pretty much any suitable engine sound though. I briefly looked into FMod, which is what AC uses for sounds, and found the .wav files in the exported BeamNG mod that I think could be used to create a .bank file in FMod but I’d need to spend some time learning the process for creating this - audio engineering is not something I have any skills in :slight_smile:

The overall AC car weight can be adjusted based on the weight of the engine created by Automation but it requires that you provide a value for existing engine that will be swapped out; I’ve found it tricky to find weights for engines but this value can be approximated and in an event scenario as long as everyone works off of the same value then that shouldn’t matter too much. At the moment the weight distribution of the car is left unchanged - I need to look into how this is modelled in AC before this can be automated.

At the moment the gearbox of the donor car is used but I’d like to be able to swap gearboxes in and out of cars, I don’t think this would be hard to implement, ideally then configurable gearboxes can be used (like this) so that different types of engines can be made to work. This is something that would be defined in the rules of any competition up front

I’ve done the process of taking an Automation car to Assetto Corsa myself, and sadly I’ll have to say you this is a very long and painstaking process. An Automation car is simply put, very very far off from what an Assetto mod needs.

First of all there’s the physics, if that’s what we’re most interested in. An Automation car isn’t simple at all, but the thing is an Assetto Corsa takes what the previous one had, and adds all the physics simulations for tyres, suspensions (going from spring stiffness to damper resistance while compressing/extending). It’s not hard to do if you know what you’re doing, but you’ll be checking back on documents to know what you actually are tweaking, and that takes a lot of time.

Then the aesthetics. An Automation car takes all its breakable fixtures and puts it in the world origin (“coordinates” x0,y0,z0 in the 3d space). Chances are a lot of the fixtures of the car are breakable, such as the wings, number plates, modular headlights and whatnot.
You can put them back on their place though, but again, it’s a very tedious process that usually takes quite a bit of time.

And last but not least, optimisation. Assetto Corsa’s graphical engine gets loaded quite easily by objects and materials. That means that you want to keep object and material counts as low as possible, so the engine makes the least draw calls. This is where you have to make compromises, as an object can’t have over iirc 65535 triangles (usually a fully detailed car takes about 200k, automation cars end up from 120k to well over 400k).
There’s a lot more things considering objects and materials, such as an object can only have one material, what kind of format and compression the texture bound to that material is using, if we need a separate object have an axis as its parent (to let the game know whether it’s a wheel, an arrow or what).

Idea doesn’t sound bad, but it’s very tedious and imo not worth it. BeamNG does just good enough.

2 Likes

Thaks for your inputs; my first thought when approaching this drew me to a similar conclusion in that it would be a long process - your experiences confirm that. I’m nothing if not beligerent so I’m happy to delve a little deeper into it :slight_smile:

This is definitely my starting point as I have no experience with 3D modelling - though I’m no math wizard it’s at least something I have a grounding in. I’m yet to look into what data I can extract from Automation on the physics side so any information or resources you have to share on this would be really helpful and appreciated. The goal is to automate as much of the conversion process as possible based on data - manual conversion is far too tedious - even if this only creates a rough approximation it will at least be a decent starting point. At the very least I’ll be able to document what I find which may help others in future.

This is the area (along with optimisation) I anticipated being super-hard and would need to be done manually. My rough plan here was to hopefully gather enough interest to attract existing AC modders into the fold which would allow the individual teams to create a car for a specific league. My current understanding of AC is that the looks of the car are just eye-candy and have no impact on the performance of the car; all of the stuff that the physics engine works with is in the data files (the wheel-base and track width may be the exception to this but I’ve not looked into it). The high-level view being that all (or at least a subset) of the performance characteristics of the car could be generated from the data and then the visual look of the car would be the “icing on the cake” so to speak; allowing engineering lovers to geek out over the performance and then designers with creative flair can create the car based off the 3D model we have available.

I think your view of it being super-tedious is 100% valid and, on an individual level, I think I’d also agree that it’s not worth going through the whole process for a one-off car. I am an eternal optimist, however, and I do think that if you could get a community of teams together each creating their own car, splitting the challenges up could make it viable. Don’t get me wrong, we are a long, long way from that point and we’d need a group of people who care enough about motorsport and want to emulate that world to ever get there.

2 Likes

You would be right in saying that the car is just graphical (other than the hitbox)
All the physics are located in the data folder / data.acd
Obviously if you change the size of the tyres, the model isn’t going to update the tyres so there are some things that need to be… planned. otherwise you have floating cars etc.

Having a big poly count isn’t too bad, under 300k total is “fine” but if you end up with more than, maybe 10-15 cars on a grid at that count it can get laggy quite fast. Lower is better, AC recommends 150k for exterior, and another 150k for interior as a max.

As to your weight distribution, its just a number. Found in the suspensions.ini

Having played around with this myself, its better to try and stay close to .50 otherwise you’re going to be doing a lot of balancing work, which is just change, test, change, test.

Another thing which is super important is the inertia of the car, once its setup though you don’t have to touch it.

Standard dimensions can work but i find for the actual feel that comes out of the wheel, this is a big factor. You’ll also want your steer ratios and rod ratios to be correct, you can check those in the suspension app ingame. Since there isn’t a real car to go off however there will probably be a fair bit of guesswork in that, good luck making it consistent between cars.

INERTIA=1.9,0.9,3.4 ; Car polar inertia. Calculated from the car dimensions. Start with the generic width,height,length and modify accordingly to the car’s configuration

I’ve done the whole data thing from very nearly scratch, so if you want a hand with understanding something i wouldn’t mind showing you.

I developed this. For personal use currently.
Anyway, it took like 10 months to get it relatively close to the real thing, but its nowhere near perfect.

also AC modders hahaha toxic as F, its every man for himself out there, nobody is going to help do this.

Thanks for the inputs and pointers; sounds like you have a lot of knowledge in this area too.

Much appreciated. I’ll likely be taking you up on this offer once I’ve started looking into it the AC data files in more detail; hopefully saving you from some stupid questions. I found a few bits of information on RaceDepartment and the Assetto Corsa forums but much of the info seems to be hidden across different threads making it hard to piece together. I’d like to collate the information I find and document it somewhere - unless you’re aware of something like this already in existence.

I vauguely remember reading a forum post mentioning inertia - is it essentially a 3D shape with its origin at the CG_LOCATION used to model the weight transfer of the car?

10 months of work is some serious dedication and your screenshot looks like you have an impressive result from it - nice work.

i find its not the driving physics of beam that make it hard to race in, its just not really got any racing “modes”. Racing alongside other cars is very difficult as there is no HUD showing where they are, (afaik) no working multiplayer minimap and a fair amount of lag.

1 Like