ColeDeanShepherd / TESUnity

World viewers for Elder Scrolls games in the Unity game engine.
MIT License
92 stars 19 forks source link

Add support for loading NPCs and creatures. #9

Open ColeDeanShepherd opened 8 years ago

demonixis commented 8 years ago

Do you have some ideas to get started?

ColeDeanShepherd commented 8 years ago

Yeah, getting this working fully will be a little involved, though... The first step is to add support for new ESM Record types like CREA, BODY, NPC_, and LEVC. You can see the format of those records here. You would add code to support this here. That file is a bit of a mess, and not well documented, so sorry for that. I might make a quick commit adding some comments explaining how to add support for new record types. You would have to make new record classes, add the records to GetModelFilename, add the record types here if needed. And you would maybe add a line of code here.

Then, depending on how extensively we want to support NPC's and creatures, we might have to edit NIFObjectBuilder. One thing it doesn't support is skinned meshes, that's why the flag you looked at in your video was oriented strangely.

Wow. What a mess. This is what happens when you write prototype code without thinking much about a clean design, sorry about that. I've been meaning to refactor the entire project's source code, but I've only gotten around to refactoring most the code in the "Core" folder.

demonixis commented 8 years ago

Ah ah don't worry about the code and thanks for the explanation about the Record types. I'll try few things, now I know where to start!

demonixis commented 8 years ago

I did good progress on my branch for creatures

image

I have added blank files for PNC_, BODY and LEVC. I'll try to implement them asap.

ColeDeanShepherd commented 8 years ago

Very nice! I might clone your branch and get some work done this weekend.

demonixis commented 8 years ago

Great! I started to work on NPC too but it was not as easy as creatures, but as I already said, I'm new to Morrowind (for now 😎)

ColeDeanShepherd commented 8 years ago

Yeah, NPCs are going to be tricky, I think, because they use the character customization system.

demonixis commented 8 years ago

Yep... I have made some progress this morning on my side. I have discovered that the BODY record has more than on SubRecord, it contains MODL, NAME and FNAME but it's not in the doc.. Have you an idea?