Nice work Errol. I'm very impressed. (And looking forward to seeing the Novadrome cars in C:R...) :)
1.6gb on memory is a lot. But then again the map is huge.
How do you read the map? I mean when you read the data do you make it a binary array so you can manipulate it easily and fast with low memory usage or how? Sorry i'm not a game developer. Don't know how you read meshes and stuff like that. I'm a middle ware developer and write my services to manipulate binary data.
Because I'm dealing with multiple model formats (MDL, DAT and whatever it is that TDR used) I've written an abstraction layer (cunningly named Model) and just read into that.
Each Model is a collection of ModelMeshes, each ModelMesh is a collection of ModelMeshParts (one per material) and each ModelMeshPart is made up of faces that themselves just reference collections of vertex positions, normals, texture co-ordinates and the like.
I then wrote a basic content pipeline Import and Export. MDLImporter for instance would take an MDL and translate it into a Model. I could then use DATExporter to save that Model as a DAT file.
As to the memory usage I've found a few places where I could improve things. I currently load each texture into memory three times and models are replicated in many different forms. The processing time is my big bugbear though. 16 seconds is totally unacceptable.
unfortunately can't build flumerry. To many missing assemblies, bad references.
Warning 1 The project 'LibSquishNet' cannot be referenced. Flummery
Warning 2 The project 'ToxicRagers' cannot be referenced. Flummery
Error 3 The type or namespace name 'ToxicRagers' could not be found (are you missing a using directive or an assembly reference?) C:\Users\HighEnd\Documents\GitHub\Flummery\Flummery\ContentPipeline\Stainless\MDLImporter.cs 3 7 Flummery
Error 4 The type or namespace name 'MDL' could not be found (are you missing a using directive or an assembly reference?) C:\Users\HighEnd\Documents\GitHub\Flummery\Flummery\ContentPipeline\Stainless\MDLImporter.cs 14 13 Flummery
Error 5 The name 'MDL' does not exist in the current context C:\Users\HighEnd\Documents\GitHub\Flummery\Flummery\ContentPipeline\Stainless\MDLImporter.cs 14 23 Flummery
Even if you point the solution to the correctly dir, still doesn't load.
Otherwise i would try to help you speedup the reading process.
Ah thanks, the 2 missing project make it work now.
Errol, you say it takes 16 second to load the hotel. On my system the complete level takes 16 seconds.
However a lot of materials are not loaded and a lot of holes in the geometry.
Anyway, very nice work sir. This give me the opportunity to learn a lot of new c# code :-)
I optimised the code quite a bit yesterday, 16 seconds is now 0.2 seconds for the hotel mesh.
The holes could be caused by it not loading accessories and just loading the main meshes.
Feel free to raise anything you consider as an issue on the githubs. And thanks for the help!
Cant wait for this thing to be finished, modding is gonna be loads of fun. It seems so close to being done according to the first post's list.
The big thing - although not entirely necessary for a viewer only release - is triangle strip generation. The MDL files I'm spitting out at the moment are... shoddy. Once I've got that down then I'll be able to save a reasonable approximation of the MDL files.
Thinking about it, I'm mostly just dragging my heels on a public view-only release. Let me see about tidying up what I've got and just getting something out there.
The sooner it's released the sooner I can fix the infinitude of bugs that'll be found and reported.