Dev Diary Pt. 22 - Moving a High Poly 3D model from Blender to Editor to Ingame (BMW 8 series/AC)

in #gaming6 years ago (edited)


Read the next part here:

https://steemit.com/blog/@peterschroeter/dev-diary-pt-24-physics-data-materials-or-ingame-refinement-bmw-alpina-8-series-ac



Starting from the final shot of my last diary entry we'll now move this model into the sim. Before it is export ready though materials need to be assigned to each object.

As mentioned last time it is advisable to simply name each material slot in Blender according to the object as all materials and textures are handled by the KS Editor that translates the model and all its properties into Assetto Corsa readable files. Hence, any material or texture created in Blender is obsolete. Therefore we simply use them to enable selection in the editor.

For instance, in the shot above you can see the chrome exhaust tips, blinker and rear light as well as body paint. What I did in Blender is select the faces that belong to the blinker and assign a new material called 'blinker'. The rest of the rear light was selected and assigned a material called 'rear light', the exhaust tips were selected and assigned a material called 'exhaust', etc.

In this way the assignment of materials and textures in the editor is made quick and easy (depending on the number of objects).

Lesson learned: Thing to know with the editor is that any object that is assigned a certain material will get it once you've defined the material once. So taking the material 'chrome' as an example it is enough to select say the exhaust tips, navigate to material in the editor and then define the values and textures for that material. Once it is set all other objects that have the material 'chrome' assigned to them will automatically show up using 'chrome'. In this case the front air intake (kidney grills) frames, exhaust tips, BMW roundel accents and logos around the ca show up in 'chrome' as all of those had been assigned that material in Blender.




Another thing to note is that any tex mapping that has happened in Blender is accepted by the editor. In this instance I had UV mapped the center of the wheelhub cover the Alpina logo and so it shows up in the editor exactly in the right spot. Only thing I had missed is that I assigned it in Blender to a mirrored object, at the time I had not made the 4 wheels separate objects so the editor correctly interprets my mistake and shows the logo as mirrored on the right side wheels of the car.


With a rough assignment of all objects to a material we can now export the model and check it out ingame...so go to 'File...' > 'Export .kn5...' > select your game folder for the car and hit 'Save' and voila.

I'm using Content Manager which is a third party app to manage Assetto Corsa so I start that up and look for my model and what do you know? I found it. When trying to start a session the game crashed back to the menu.

By checking the crashlogs (...MyDocuments>Assetto Corsa>logs) I was able to find out that the sound was not set correctly and also that the game complained about an error in the 'aero.ini' file but more on that later.

For now, let's look at the model in the showroom...

And there it is. Parts are missing in the interior as you can tell by the weird shadows on the ground but all in all it is recognizable as an 8 series BMW - whoohoo!

To check for coherence in the physics department Content Manager has the option of 'Align using data' which simply means that the app uses the car's data (which I have previously defined, mostly estimated) instead of the visual model. Clicking that resulted in this:

I knew my data was roughly correct so this didn't look like a data error. Instead if you think about it there seemed to be an issue with scale. If the model size is above a certain threshold the interpretation of my car data could result in very weird display of objects like the one above.

To investigate further we can use one of content manager's functions called 'display data' such as 'wheels', 'fuel tank' and 'suspension'...

There's definitive proof that it's a scale issue. As you can see the data in and of itself shows up correctly but the visual model is all off. This is an effect that happens when models are too large, the engine moved the visual objects out up to the limit at which point they move back into the scene on the other side. So in the picture you can see the left side wheels mirrored on the right side.

I had a scale issue.

I also noticed that the car is flipped along the y axis.


Long story short, through a series of trial and error attempts I went back to Blender's exporter as KS Editor cannot edit an objects' scale and started to

  • flip the y axis from 1 to -1 (so reversed)
  • set the scale from .01 to .001

and exported with the remaining settings unchanged. Reassigning all materials and inevitably falling victim to tweaking this material and that texture I saved and loaded it up in the showroom again and added an original Kunos car (era correct BMW M3 E30) for good measure and comparability.

So, y axis is correct, scale is correct and car looks quite good from above. In my previous attempt I had not set the windows set correctly - now corrected and opaque.

During my scale fixing in Blender I actually set the model in Blender to the correct size as per BMW specs. It turned out my model, when set to the exact length in mm, was off .8cm in width and .3cm in height - pretty cool given the fact I had only used photo matching, inaccurate blueprints and good measure when building the model.


We still need to get it to work in game though and for that we need good data so here goes the 'Align with data' option again...

Now that doesn't look too good. Hints at incorrect wheelbase, incorrect center of gravity (which in this engine determines the position of the wheels relative to the center) and incorrect suspension pick up points or rod length values as the car sits a tad too high.

After my first tweaking attempts editing the weight distribution, rod length, pick up points and wheelbase I arrived at this:

Better but not optimal. With countless discussions in AC forums and the epic 'AC Discord' channel and a lot of help from fellow modders and physics experts I finally had this in my showroom:

Wheelbase in terms of data is still long by 3cm, I still don't know where these 3 centimeters go. Ride height, track front and rear, fuel tank position and all other values were set correctly.

At least so I thought, during further research I noticed that no BMW has a fuel tank behind the rear axle but instead in front. Also my wheels and tires were not set correctly but more on that later.

I then used content manager's 'Position the driver' feature to put a more human touch to the model (pun intended):


After fixing my sound issue and correcting the 'aero.ini' file I loaded the car onto my favorite test track > Japan's infamous Tsukuba and hit 'Start'......................

It worked. Can't tell you how great it feels to see your scratch build model in game for the first time and be able to drive it. It is not finished, doesn't look too great, drives not too great and all in all is just in very rough early stages but still the moment is unforgettable!

If you've stuck with me for this long, thank you for your interest in this project. The next installment will follow in the coming hours and days. As it turned out there were still many more issues to deal with before I could actually drive it in any sort of manner that could be called 'somewhat authentic'.

For now I'll leave you with some beautiful renders of a half finished car model of this 1993 Alpina B12 5.0:

Note the off color of the rear left wheel? The mesh density difference between the body and the rear fascia? The missing headlight lenses? Yeah, I did too.

Catch ya later!!

Sort:  

Hi peterschroeter,

This post has been upvoted by the Curie community curation project and associated vote trail as exceptional content (human curated and reviewed). Have a great day :)

Visit curiesteem.com or join the Curie Discord community to learn more.

Congratulations, this post was rewarded with a SteemGC Upvote!

Want to meet fellow Steemit gamers and earn upvotes yourself? Join the SteemGC Discord channel!

Hi peterschroeter,

This post has been upvoted by the Curie community curation project and associated vote trail as exceptional content (human curated and reviewed). Have a great day :)

Visit curiesteem.com or join the Curie Discord community to learn more.

Incredible how complicated that everything to have at the end such a simple model of car. I think for people who do not understand much in sketching the graphics for creating computed models of car, or any parts of computer games it seems like it should not too difficult. But seeing every single step and that the result depends a lot from any small miss typed code that is really unbelievable. I am glad you have some other interested guys in discord and you exchange your thoughts and ideas, that is a driver for innovation. Very interesting and demonstrative work!

Glad you like it. To be honest this project basically came out of a failed attempt at getting another one of my models into a flight sim. The community there was helpful but the guys actually importing models and making everything work were either too busy, too secretive or simply unable to communicate the necessary steps a noob like me needs to get it to work. In the end they were like ‘submit your model and hand over all rights’ and we’ll put it in.

In the case of Assetto Corsa and the missing community it’s much more active and alive and many ppl who are in it now started like me so there’s a lot more access to knowledge and experience.

I’ll admit more than once I was thinking it’s too hard or too complex but in the end if you keep at it and just keep learning and asking and trying you eventually get a hang of it.

Enjoy my future content on this!

Thank you for such explanation, I think it is normal to be more anxious initially before starting to do and while doing learn something, but that is why not many people have a courage to start something new. Will keep an eye on your posts :)

Hey everyone Im just trying to self promote lol, but i do logos and photo touch ups and i needed more clients going through a tough time right now ill do it for a really affordable price compared to all the other prices out there.

-Malcolm

This car is so cool, I know it is unfinished but it still looks great. It must have taken you a long time to do this, I had no idea what you were saying with those "blender" stuff but I did enjoy going through and reading all of the process... Feels really nice to see how all these things are done, I do hope to learn more...

It's a whole lot of work really and it fascinates me how you are able to put in this much in to it. I guess its just passion.

So, yeah! The unfinished car still played in the game, I can only imagine how excited you were to see something you developed work. I am sure it will get better with a few touches. 😃

How long did it take you to reach to this point?

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 62796.11
ETH 3045.55
USDT 1.00
SBD 3.85