Important information: this site is currently scheduled to go offline indefinitely by end of the year.

World of Warships

Post questions about game models here, or help out others!
gr33nmous3
ultra-n00b
Posts: 9
Joined: Mon Sep 28, 2015 11:12 am
Been thanked: 4 times

Re: World of Warships

Post by gr33nmous3 »

Try

Code: Select all

try:
    import cPickle as pickle
except:
    import pickle

import codecs, json, sys

class GPEncode(json.JSONEncoder):
    def default(self, o):
        t = o.__dict__
        for key in t:
            if isinstance(t[key], str):
                try:
                    t[key].decode('utf8')
                except:
                    try:
                        t[key] = t[key].decode('MacCyrillic')
                    except:
                        try:
                            t[key] = t[key].encode('hex')
                        except:
                            pass
        return o.__dict__

sys.stderr = open('error.txt', 'w')

f = open('GameParams.txt')
d = pickle.load(f)
f.close()

f = codecs.open('GameParams.json', 'w', encoding='utf8')
f.write(json.dumps(d, cls=GPEncode, sort_keys=True, indent=4, separators=(',', ': '), encoding='utf8'))
f.close()
The updated script will try to decode strings as UTF-8, if that fails then it'll replace the string with a decoded Mac-Cyrillic version, if that fails it'll replace it with a hex version.

Also is "path" defined?
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

yes.. I pass the path to the script from .NET
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

This wont work either.
I got an error..
Something about cant convert ascii 210d at position 0
I'd love to change the world but I can't get my hands on the code.
Xentaxi
ultra-n00b
Posts: 2
Joined: Sat Dec 05, 2015 8:38 pm

Re: World of Warships

Post by Xentaxi »

Could someone please give me a help?
I've been using this Wot/WoW model editor and working with World of Warships .PRIMITIVES -files.
I have exported them to .OBJ -format and then I want to import them to 3D modelling software.
However importing them to Blender or 3DS Max 2016 doesn't work properly. Parts of those imported meshes geometry is missing!
All vertices don't show up. Is the problem in .OBJ -files or am I using wrong import settings?
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

Xentaxi wrote:Could someone please give me a help?
I've been using this Wot/WoW model editor and working with World of Warships .PRIMITIVES -files.
I have exported them to .OBJ -format and then I want to import them to 3D modelling software.
However importing them to Blender or 3DS Max 2016 doesn't work properly. Parts of those imported meshes geometry is missing!
All vertices don't show up. Is the problem in .OBJ -files or am I using wrong import settings?
Have you been reading this thread?
Currently.. with the versions 30.0.X, the exporting does not work at all. This is because the entire program is being re-written, a section at a time.
The old version never wrote all the children objects.

I'm sorry but... right now, there is no way to write out the entire ship with its children and grand child objects.
I'm hoping to start working in the exporting again in the next week but right now, there are issues with translations and missing objects that has to be fixed.
I'd love to change the world but I can't get my hands on the code.
Xentaxi
ultra-n00b
Posts: 2
Joined: Sat Dec 05, 2015 8:38 pm

Re: World of Warships

Post by Xentaxi »

Thank you very much for your reply and sorry for the disturbance. This thread is so long (36 pages) so I didn't want to read every single post.
Could you give any estimation how long it would take for the next release of WoT/WoW Model Editor? Which would have functional OBJ-exporter in it?
This tool was very useful for World of Tanks and it could be for World of Warships as well.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

Hi..
Yes.. A very long thread.

I have been giving a lot of thought about the WOW format and how best to export the entire ship with all of the additional child and grand child models.
The .OBJ format does NOT include a way to specify translation of a mesh.
Be cause the WOW models use matrices to position every child model, the only way to export the entire ship in OBJ is to translate each vertex and normal prior to exporting. This can be done.

FBX on the other hand can export translations but they do not work the same as WOWs.
The rotation in XYZ has to be extracted from the Matrix along with translation XYZ and scale XYZ.
Seems easy but there is the problem of compounded transforms.
All models are transformed and even some of the parts that make up a child are transformed by the child's own internal matrices.
I think I can get the numbers needed by starting with a identity matrix and multiplying it by all the matrix stack. After that, I will need to extract the rotation, scale and translations from the final matrix.
On the other hand.. I could just multiply the vertices and normals by the matrix stack and export them. This is what needs to be done to export in OBJ format.
The issue with this method is there will be NO easy way to rotate the turrets inside of Max, Maya or any 3d app. I would like to export the so called bone structure as well but after spending years looking at this, There seems to be no real structure going on that is compatible. There are no mesh weights and the skeleton is not the right shape to be useful with max. I may be wrong on this but as far as I can tell Big World has its own custom deform methods and are created using custom tools. From looking at their site, Models are created in Maya or Max and than exported using a special big world exporter, Once this is done, it is imported in to their modeler. I am not sure if the bones are converted in their modeler or if this is done during the export from Max/Maya.
In any case.. I don't know how to export them in FBX.
FBX has lots of samples floating around the internet on importing but finding info on exporting is hard to come by. I think this is mainly because its proprietary AutoDesk shit.

Before I can even start re-writing the exporter, I have to solve the issues with all the transforms.
There are Directors that translate perfect on one ship but yet this same exact director model is backwards on a different ship. This is true for a number of child models on different ships.
I did find a way to make sure I loaded the parts of each child in the correct order and this fixed some of the transform problems but not all.
An example of this causing problems are with the smaller main guns with shields.
Some of the models have the shield first and the gun/turret 2nd. This was causing problems with the matrix for the shield being applied to the gun rather than the gun matrix being applied to the shield.
Also, there are life rafts on one of the turrets on one of the ships that is completely translated wrong. I spent a bunch of hours trying to understand why its only effecting this one turret and cant find an answer.
I believe the ship is the Cleveland 1945 that has this issue.

I have been trying to sort out how the translations work for years and have yet to figure it out. What works for one model on one ship doesn't always work for that same model on a different ship. Why the hell this is I have no idea. All the ships hulls have the same base transform matrix.

Anyway... To answer your question "when will this export the entire ship?" the answer is I have no idea.
I am doing this when I have time and in the mood to pull my hair out trying to sort out issues with the transforms.

I have added shading back in and will release this today or tomorrow.
I changed the shader a lot... I removed all the shadow crap and added in code for selection highlighting and dealing with the NULL dummy place holders. This was done an entirely different way before by simply redrawing the selected item in red.
There is one main issue yet to deal with and this is the lighting on the grand children is wrong.
This is because the normals need to be translated a 2nd time by its own matrix. Although this is easy to do, it adds a shit load of time to the rendering process. The shader is only producing around 12 FPS with a fully loaded Midway carrier. (I have a nVidia 660 Ti and this is horrible FPS for this card)
For the last few days when I have felt like screwing with this, I have looked at ways to speed up the FPS.
Part of the reason is passing so many texture IDs and other info to the shader.
I have to set the active texture.. bind the texture.. pass the ID to the shader and than repeat this 2 times for every item in the scene. I could try sorting the models by texture IDs and binding the textures less times but I'm not sure this will speed things up very much. There are so many different textures to load.

I can't get the new gameparams to convert to jason.
I don't know Python well enough to know what's wrong or why it won't read the file as text.
I'd love to change the world but I can't get my hands on the code.
gr33nmous3
ultra-n00b
Posts: 9
Joined: Mon Sep 28, 2015 11:12 am
Been thanked: 4 times

Re: World of Warships

Post by gr33nmous3 »

The official gameparams shouldn't have the issue when it releases, it's happening because of a bunch of text strings that are in different encodings which i am assuming won't carry over to the production version so you shouldn't worry too much.

Also you could try COLLADA instead of OBJ/MTL, it supports multiple objects, complex materials and transforms, but it's one big blob of an XML file.
User avatar
Andrakann
ultra-veteran
ultra-veteran
Posts: 392
Joined: Wed Jul 06, 2011 8:47 am
Location: Russia
Has thanked: 974 times
Been thanked: 192 times
Contact:

Re: World of Warships

Post by Andrakann »

Coffee wrote:I have been trying to sort out how the translations work for years and have yet to figure it out. What works for one model on one ship doesn't always work for that same model on a different ship. Why the hell this is I have no idea. All the ships hulls have the same base transform matrix.
I think it's impossible to correct transform guns and other skinned objects without understanding how their skeleton and weights is done.
Because those transformations affects skeleton bones, not objects. Also just parts of objects involved sometimes, like gun barrels:
Image
As you can see, morphing is present in game, so it's data must be inside primitives. I found a strange bytes in HEX view of AGM124_12in50_Mk7.primitives - in ~70% of mesh data those bytes is "09 09 09", but in other ~30% here's 03 and 06 mixed with 09:
Image
Maybe it's weights data?
Also for unskinned primitives vertex data is 32 bytes for vertice(?) instead of 37 bytes for skinned:
Image

Btw, "rival firm" is already have good transformations, skeleton and weights done:
Image Image
Maybe you ask author for help, or just reverse how it's done?

Even in BW-editor skeleton looks totally wrong:
Image
(not structure, but point where's "GunFire" placed)

And your Editor, atm, loads this gun really bad:
Image

So, I think it's time to dig deeper in guns primitives and achieve results close to UUw3D ones.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

Thanks for pointing out the difference in the vertices length....

There are a few different formats the vertices are stored as.
Almost all models are stored as XYZNUVTB
N T and B (Normal, Tangent and Binormal) are the XYZ components compressed in to a single uint32.
There is also this format: XYZNUVIIIWWTB... It has the same compression of N, T and B but 5 extra bytes.
I forgot all about this other format. Only a few models use it but it looks like the main guns are indeed using this.
So this is probably the weights or for sure something to do with it.

There is also another format: XYZNUV ... In this format, all the numbers are real (N is actually 3 floats). Very few use this format. Mostly LOD from WoT tank models.

I think I will contact the author of that plugin and see if I can get any info.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

gr33nmous3 wrote:The official gameparams shouldn't have the issue when it releases, it's happening because of a bunch of text strings that are in different encodings which i am assuming won't carry over to the production version so you shouldn't worry too much.

Also you could try COLLADA instead of OBJ/MTL, it supports multiple objects, complex materials and transforms, but it's one big blob of an XML file.
Thanks...
I sure hope they are not actively trying to stop what we are doing.

I looked at Collada. It can do everything I need to export... but like you said, it creates one monster sized file. This isn't really a issue..
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

Btw, "rival firm" is already have good transformations, skeleton and weights done:
One model does not cover it.
Show me a fully loaded ship with all children and grand children and with all the correct transforms and I'll agree with the "done" part of that statement :)
But seriously, who ever wrote that does understand the weights and I will contact them.

EDIT:
Im not wasting my time trying to contact this person. I thought this was wrote by some one other than the author of UUW3d.
This is trial/buy software.. there is NO way he will share anything about any part of that App.

I found some old code kicking around the net.. It's in C but sort of shows how the Index and weights work (IIIWW)
Its looking like the part of the matrix stack is being used but how Im not sure yet.
from AGM019_8in55_CA68_dead.visual :

Code: Select all

      <node>   Roll_Back1_BlendBone </node>
      <node>   Roll_Back2_BlendBone </node>
      <node>   Roll_Back3_BlendBone </node>
      <node>   Rotate_X_BlendBone   </node>
      <node>   Rotate_Y_BlendBone   </node>
Also it looks like the index values point at which 3 of these are used.
They are dividing these index numbers by 3 before using them to index the matrix stack. This is probably because of the way the stack is stored??
I don't care about deforming the guns.. its the least of my problems right now and I dont want to pre multiply every vertex to get to the end transform. What I do want is to create a final matrix that can be used at render time and export to position the objects at the correct locations, rotations and scale. I am already grabbing the entire matrix stack so its a matter of figuring out which of these matrices are used.
I think I can take a identity matrix and multiply it by the stack and get the final transform. I'm not good at matrix math so I could be wrong about this.

Any one that knows matrix math is welcome to join this conversation.

The weights are mostly values of 255. so it should be pretty easy to create a weight map for export.
Also..
they are creating a 3rd value from the 2 weights. This is probably the actual value but I need to dig in the code more.
W3 = 1.0 - (w1/255) - (w2/255)

Also.. They look for "skinned" in the material. I would assume this is how they decide what kind of vertex this model uses but Im not 100% on that.
The vertex header has the name in plain text of what type vertex.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Warships

Post by Coffee »

I uploaded version 30.0.3
This adds back the shading tho its not 100% correct. it works good enough and adds the bump mapping and lighting with levels back in.
All the shading settings should be working now.
I'd love to change the world but I can't get my hands on the code.
User avatar
Andrakann
ultra-veteran
ultra-veteran
Posts: 392
Joined: Wed Jul 06, 2011 8:47 am
Location: Russia
Has thanked: 974 times
Been thanked: 192 times
Contact:

Re: World of Warships

Post by Andrakann »

Coffee wrote:
Btw, "rival firm" is already have good transformations, skeleton and weights done:
One model does not cover it.
Show me a fully loaded ship with all children and grand children and with all the correct transforms and I'll agree with the "done" part of that statement :)
But seriously, who ever wrote that does understand the weights and I will contact them.
I mean "for single mesh" of course :)
Btw, I'm not sure if I understand weights correctly too - I think if weight is 1.0, then vertex reflects all bone transformations 1:1, and if weight is 0.5 - vertex does half of bone transforms. But "Count" value in weights table says nothing to me...

Also I didn't find any clue how primitive parts (or vertices) is attached to blendbones in HEX-view of primitives.
Maybe by numbers, related to blendbones order inside of visual file?..
Coffee wrote:I looked at Collada. It can do everything I need to export... but like you said, it creates one monster sized file. This isn't really a issue..
Maybe it's better to export to .blend format for Blender?
I think it's support everything, and it's free.
And format documentation must be enough good.

Then, from Blender, everybody can export to COLLADA or FBX. Or just render in place.

Blender have slightly complicated but powerfull materials support, I even made material with two masks for EVE Online ship (with good tuto):
Image
Coffee wrote:I uploaded version 30.0.3
This adds back the shading tho its not 100% correct. it works good enough and adds the bump mapping and lighting with levels back in.
Normal maps looks inverted (pushed instead of bumpy), and, if you activate light to fly around, there's only small sector of 360 degree in which you can see bumps - maybe 5-10 degrees of circle, otherwise they not reflect anything.
Tested on GSB001 Bismarck bow, in BW editor this bow looks really bumpy:
Image Image

And if you circle light with AGM124 loaded, gun barrels lighted mirrored (btw, transformations is also wrong).
TheSeeker
advanced
Posts: 44
Joined: Tue Sep 29, 2015 1:36 am
Has thanked: 4 times
Been thanked: 17 times

Re: World of Warships

Post by TheSeeker »

Andrakann wrote:
Coffee wrote:
Btw, "rival firm" is already have good transformations, skeleton and weights done:
One model does not cover it.
Show me a fully loaded ship with all children and grand children and with all the correct transforms and I'll agree with the "done" part of that statement :)
But seriously, who ever wrote that does understand the weights and I will contact them.
I mean "for single mesh" of course :)
Btw, I'm not sure if I understand weights correctly too - I think if weight is 1.0, then vertex reflects all bone transformations 1:1, and if weight is 0.5 - vertex does half of bone transforms. But "Count" value in weights table says nothing to me...

Also I didn't find any clue how primitive parts (or vertices) is attached to blendbones in HEX-view of primitives.
Maybe by numbers, related to blendbones order inside of visual file?..
Coffee wrote:I looked at Collada. It can do everything I need to export... but like you said, it creates one monster sized file. This isn't really a issue..
Maybe it's better to export to .blend format for Blender?
I think it's support everything, and it's free.
And format documentation must be enough good.

Then, from Blender, everybody can export to COLLADA or FBX. Or just render in place.

Blender have slightly complicated but powerfull materials support, I even made material with two masks for EVE Online ship (with good tuto):
Image
Coffee wrote:I uploaded version 30.0.3
This adds back the shading tho its not 100% correct. it works good enough and adds the bump mapping and lighting with levels back in.
Normal maps looks inverted (pushed instead of bumpy), and, if you activate light to fly around, there's only small sector of 360 degree in which you can see bumps - maybe 5-10 degrees of circle, otherwise they not reflect anything.
Tested on GSB001 Bismarck bow, in BW editor this bow looks really bumpy:
Image Image

And if you circle light with AGM124 loaded, gun barrels lighted mirrored (btw, transformations is also wrong).
Do you mind if I ask how you extracted that EVE model? They changed the client architecture in March 2015 and there's basically tens of thousands of nondescript files numbered in hex, and I've got no idea what to do with them.
Post Reply