Sunday 30 June 2019

Assimp Does Magic Stuff And I Get Distracted

This was a bit of a surprise.

 That says Blend file that does

Whilst playing around and looking for bugs in the latest beta of open sourced Torque3D game engine, I accidentally imported a BLEND file from free open source(ish) Blender3D modelling program. Obviously this by accident, because I would never have thought that it would work.

I had found some ripped game models and other sculpts (see Tifa above) and was looking at them in Blender3D for modelling reference. I had experimented with various export options and was loading them into the engine when I accidentally double clicked the Blend file rather than the exported DAE file. Et voila, it actually loaded with all materials correctly mapped.

This is due to the new Assimp importer which appears to be able to read pretty much anything and import it because magic.

Literally my understand of how Assimp works ...

Assimp also comes with a metric ton of options - none of which I really understand so I just kept using the defaults except for maybe rotating the up axis to Z when needed - and it kept importing models fine as long as I had multiple mesh objects set to be read as a single sized LOD.

When the Beat-Em Up waifus are extra thicc

I had tried various other model formats and found FBX and BLEND to be the easiest at automagically loading the corrects textures into the material slots. Amusingly - or not as the case may be - the original DAE importer was the worst and created the most hassle. Not all the models I had found on the internets had their textures setup for a standard PBR material, hence the rather off colour Chunners.

DAE->OBJ->FBX->BLEND

I had also seen someone using the normals editing tool in Blender in a way that I had not thought of before. For foliage and tree leaves they had placed the mesh inside of a huge sphere object and then targeted it. This made the leaf faces orient outwards to the nearest sphere point. For my current project all leaf and foliage mesh faces are orientated nearly vertically upwards, targeting a node high above, because that's pretty much where the player's camera is for a top-down perspective.

No normal editing target->Vertical target->Spherical target

Did I mention distraction? Yes I did. I had been harassed by "The Idea Fairy" and suddenly had the urge to make a Dieselpunk Ace Combat style game. I ended up writing up a design document and fairly in depth statistics of how the whole thing would play, utilising real world 1930s and 1940s aircraft. I imagined it would play rather like the old Freespace space combat simulator, only in high altitude clouds rather than space. Aircraft would ... well, aircraft, and airships would make up an equivalent of a real world navy. I also ended up playing through Freespace 2 and the original Freespace mod for it. For the first time ever, I have a state of the art gaming PC and use it for playing 20 year old games.

This thing needs keeping on a short leash ...

So that was the distraction that stymied this month's progress. I did however get some work done on the current project, the one that I am supposed to be working on, by transferring some heavily used scripts for targeting to C++ code to take a bit of weight off the processor when they are called so often. I also added went mad for statistics and added rankings for player performance on to the already percentaged data. I went for the Japanese obsession with S which may or may not mean SPECIAL, so the highest rank is SSS, SS, S before getting into a more standard alphabetical descent, and it goes down all the way to F for FAILED MISERABLY.

Yo Dawg I heard you like Statistics ...

Of course the real reason I did all of this stuff was simply to avoid having to model 3D hair because it's boring. Yep, that was it. An entire month of obfuscation to not doing something that is time consuming and dull. I also got poisoned with a chemical gas leak for two weeks having had an engineer out to investigate a gas leak, then getting a methane detector thinking that it was a gas buildup in the drains before eventually finding the source leaking out of a vat, and I was also immobilised with a back injury for another week, which was caused by just bending over the sink. So not a great month in general.

Next month, getting back to what I should have been doing this month ... allegedly ...