Forum > Software Development

[WIP] LK to BC M2 converter in C (aka The Endless Nightmare)

<< < (2/4) > >>

PhilipTNG:
@OP: I can't give any help but I'd like to say Good On You Brother!! , Atleast you're going about it in an actual programming language instead of a markup XD. I wish you the best man :)


--- Quote from: "Skarn" ---I've never understood why people stick with TBC or Vanilla..
--- End quote ---
I dunno about other people, but for me, I just enjoy tinkering with data, especially when there's several handfuls of people saying something isn't possible to do in so and so... kinda makes you want to prove them wrong more and more :)

Kind of like all those guys that said Kaev was an ambitious dreamer with a goal he'd never reach... boy were they wrong XD.

stan84:
Good job Spik! :)

I have sent you on PM an c source for particle converter that makes LK->BC conversion, still mostly undone, but i think the output particles structure is right. maybe you can merge that function it with the project. The main bug is that function crashes if number of particles is more than 5 ( probably i screwed something in loops).

the tool is cmd and requires 2 args, source and target file. It takes particles from oryginal lk model and puts it converted at the end of TBC one.

spik96:
Thanks =) !

@Stan84 This code will be veeeery useful. ATM I'm not trying to do too much things at the same time.

I'm already struggling to find the best way to store data in Animation Blocks. I succeed by making one structure at the time but the complexity is hellish.
On the wiki, it looks easy, when you see this :

--- Code: --- struct array_ref
 {
   uint32_t number;
   T* elements;
 };
--- End code ---

But this pointer is a file relative offset. So, you read the N array_ref, then you must create a whole new structure with N*number elements. And you probably want to retrieve them individually later for writing or manipulating, so enjoy the arrays everywhere. But hey, that's the easy part.
In each LK Animation Block, you have
--- Code: ---array_ref<array_ref<T>> values
--- End code ---
Yup. Array_refs "pointed" by Array_refs. So, you have your ABlock with the first array_ref, create an array to store all the things your array_ref pointed, but these are also array_refs, so an array of arrays is useful because you need to store their values too.
Considering the sizes are not constant, you just tinker with pointers (real f*cking C pointers this time) all the time and hope.
And now, the best part : it's incredibly hard to see if you succeeded. There is no reference to know how each value should look ! You know the type but when these are ints are the value correct or just addresses you placed by mistake ? I try to change things and choose the best-looking values.
So that was for 1 ABlock.
Now, the particles have a dozen Animation Blocks. So my idea to store them must be solid or I will fail everywhere.

I understand why this has never been done before.

PhilipTNG:

--- Quote from: "spik96" ---Now, the particles have a dozen Animation Blocks. So my idea to store them must be solid or I will fail everywhere.
--- End quote ---
Particles aren't too bad, just make sure your bones are done right so they face the right way... lol... like my crazy ass not realizing I did it wrong the first dozen times(probably a bit more :lol: ) and all my bones were facing in the opposite directions, so everything was shooting the wrong way lololol.  The most particles I had done was for a 2H Sword that had 22 particles on it, worked well enough as far as I could tell.

spik96:
How did you manage to make your bones face the wrong way ? x)
You used unsigned int instead of int or something like that ?
If there are easy stupid mistakes I can avoid.. Better don't fall in the same holes ><"

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version