War on the Sea

War on the Sea

Index in .txt files
Hello KFG, let me ask you about the modification of the WoTS game. I asked about the contents of the model.txt file where it says 'materialsOnMeshIndex', what does that actually mean? do you have a list of that index? I also see that in another txt there are also many indexes, I'm confused, what does that index mean? Thank you. Also don't you want to give us a mod guide as users? isn't it with mod support it will be even better?
< >
Affichage des commentaires 1 à 15 sur 56
+1 on this
Killerfish Games  [dév.] 14 juin 2021 à 16h41 
Lets use agano.txt as an example:

{"materialName":["Agano_Main_Gray","Agano_Acc_Gray","Rigging","Transparent","Agano_Gray_D"]}
This defines all of the materials for the agano model.

"meshNames":["Main_LOD0","Main_LOD1".....
This defines the series of meshes that make up the model.

"materialsOnMeshIndex":["{\"mats\":[4]}","{\"mats\":[4]}"...
This defines the index of the materialName to be applied onto each mesh as defined in MeshNames; the ordering of meshNames and materialsOnMeshIndex must be correct as they correspond to each other.

So;
"Main_LOD0","Main_LOD1" both get index 4, namely "Agano_Gray_D". This is the agano material with support for the damage shading of regions.

"Accessories_LOD0","Accessories_LOD1" get index 1, namely "Agano_Acc_Gray" which are the accessories for agano in the base gray color scheme.

Further on,
"Rigging" gets index 2: "Rigging" material
"Transparency" gets index 3: "Transparent" material for railings, cranes etc.
See the pattern :)

Material definitions are presented as a List of materials for example "{\"mats\":[4]}" puts material index 4 on the mesh.

But some meshes have multiple sub-meshes, for example takao gun turrets with a solid base and railings on top, hence the need to define a list of materials.

If you look at takao_model.txt you will see "Main0" (main gun turret 1) has the material indexes "{\"mats\":[3,1]} corresponding to "Transparent" (for the railings) and "Takao_Acc_Gray" for the gun turret itself. Note the next turret has the sub-meshes in the other order.

Ships are clustered into groups which share common features. For example all IJN heavy cruisers use "Takao_Acc_Gray" (takao accessories gray) since their torpedo launchers, life boats etc are all shared between the models.

That is why you see the iowa folder which contains the accessories textures for the "iowa" ship group which currently contains the US battleships.
Killerfish Games a écrit :
Lets use agano.txt as an example:

{"materialName":["Agano_Main_Gray","Agano_Acc_Gray","Rigging","Transparent","Agano_Gray_D"]}
This defines all of the materials for the agano model.

"meshNames":["Main_LOD0","Main_LOD1".....
This defines the series of meshes that make up the model.

"materialsOnMeshIndex":["{\"mats\":[4]}","{\"mats\":[4]}"...
This defines the index of the materialName to be applied onto each mesh as defined in MeshNames; the ordering of meshNames and materialsOnMeshIndex must be correct as they correspond to each other.

So;
"Main_LOD0","Main_LOD1" both get index 4, namely "Agano_Gray_D". This is the agano material with support for the damage shading of regions.

"Accessories_LOD0","Accessories_LOD1" get index 1, namely "Agano_Acc_Gray" which are the accessories for agano in the base gray color scheme
With this in mind, would a single asset bundle containing the materials be sufficient or do they need to be separated?
Furthermore, in regards to the default\materials folder am i right in that its referencing the materialName shared with the file from a units folder, and then assigns the textures to the material?
For example the "materialName":"Shokaku_Hull_Gray", which then follows with a file path that leads to the ships texture asset bundle and references a set of specific textures.

So in order to assign materials to my custom model i would:
1. Have the ships model.txt file have the meshNames, materialNames and materialOnMeshIndex sections finished correctly.
2. Create a new section in default\materials\xxx.txt of the material asset bundles name.
3. Fill out said section with the corresponding file path and textures assignment.

Is that correct?
Dernière modification de Teslaman90; 16 juin 2021 à 4h15
Killerfish Games  [dév.] 16 juin 2021 à 16h21 
A single Asset Bundle containing the 4 textures would be sufficient.
Materials are never defined in an asset bundle, they are generated dynamically from the data in default/materials folder.

"Furthermore, in regards to the default\materials folder am i right in that its referencing the materialName shared with the file from a units folder, and then assigns the textures to the material?"
Correct, the exact name.
Note at the bottom of shokaku_model.txt is the exact reference to your example:
{"materialName":["Shokaku_Hull_Gray"....

1) Correct. The relative position of all 3 of these lists must correspond and by definition they must all be the same length.

2) If you enter your "material line data" into an existing material file, you are ok.
If you create a new file, you will need to add it to the config.txt list:
"materialFiles":["ammunition.txt","_common.txt","submarine.txt","destroyer.txt","cruiser.txt","other.txt","aircraft.txt"]

3) Are you referring to material names at bottom of the ship_model.txt file:
{"materialName":["Shokaku_Hull_Gray","Shokaku_Superstructure_Gray","Shokaku_Acc_Gray","Transparent","Poles","Shokaku_FlightDeck","Shokaku_Hull_Gray_D","Shokaku_SS_Gray_D","Shokaku_FD_D"]}
- The position of each of these in the list correspond to the indexes specified in materialsOnMeshIndex.

Or the material line in the material txt file:
{"materialName":"Shokaku_Hull_Gray_D","materialShader":"ShipDamage","materialTextures":["unit/sea/shokaku/shokaku_tex_gray/T_Hull_D","unit/sea/shokaku/shokaku_tex_gray/T_Hull_M","unit/sea/shokaku/shokaku_tex_gray/T_Hull_N","unit/sea/shokaku/shokaku_tex_gray/T_Hull_AO","unit/sea/shokaku/shokaku_dmg/T_Shokaku_Hull_DamageMask_L","unit/sea/shokaku/shokaku_dmg/T_Shokaku_Hull_DamageMask_R"],"glossScale":1.0,"damageIntensity":1.0,"offsetNoiseTiling":{"x":5.3,"y":3.67},"damageNoiseTiling":{"x":5.53,"y":5.0},"damageColTiling":{"x":1.0,"y":1.0}}
- Each of the "materialName" specified here correspond to those defined in the material data file.

Cause you need to do both :)


CAUTION:
"materialShader":"ShipDamage"
This material requires damage masks to be specified in order to shade damaged areas of the ship. You may have already seen the coloured masks in shokaku_dmg asset bundle.

If you look at skokaku:
{"materialName":["Shokaku_Hull_Gray","Shokaku_Superstructure_Gray","Shokaku_Acc_Gray","Transparent","Poles","Shokaku_FlightDeck","Shokaku_Hull_Gray_D","Shokaku_SS_Gray_D","Shokaku_FD_D"]}

"Shokaku_Hull_Gray" - this is index 0, but it is NOT referenced anywhere in "materialsOnMeshIndex". This is the original plain gray version without any damage shading.

Shokaku_SS_Gray_D - this is index 6 and referenced for the HULL meshes as it has the later implemented damage shading (hence the _D suffix).

When defining materials recommend do not use "materialShader":"ShipDamage" unless you intend to specify the colored mask textures also.

Aircraft never use "materialShader":"ShipDamage" at this time.
kinantanz a écrit :
Hello KFG, let me ask you about the modification of the WoTS game. I asked about the contents of the model.txt file where it says 'materialsOnMeshIndex', what does that actually mean? do you have a list of that index? I also see that in another txt there are also many indexes, I'm confused, what does that index mean? Thank you. Also don't you want to give us a mod guide as users? isn't it with mod support it will be even better?
Previously, thank you for the answer KFG, thank you also for your support for modders. I've tried to match it, but only the hull I'm trying to install. But after I checked at the museum the result was still a purple mesh, do I have to install all the materials for each mesh? Then the next question, Why is it that when I preview my ship in the museum, the camera can't be moved, and the underwater view looks weird? And also slowly my ship's mesh is sinking. Where do you think the error is? Thank you KFG
Killerfish Games  [dév.] 16 juin 2021 à 21h03 
Purple mesh means a material reference failed or the material itself is invalid, likely missing a texture reference.

Your output_log.txt file should show an error of some kind.

If the materials fail, creation of the ship fails. This stops the rest of the scene initialising causing camera, underwater lighting/fog and gravity/physics to fail.
Killerfish Games a écrit :
Purple mesh means a material reference failed or the material itself is invalid, likely missing a texture reference.

Your output_log.txt file should show an error of some kind.

If the materials fail, creation of the ship fails. This stops the rest of the scene initialising causing camera, underwater lighting/fog and gravity/physics to fail.
So i've made an attempt with the materials and textures with no success, my workflow was this:

1. Create a new entry in materials\other.txt, named "Taiho_Material", using standard shader
2. Input all the textures in the order they appear within their bundle. In this case each texture looks like "unit/sea/taiho/taiho_tex/xxxxxx"
3. Enter "Taiho_Material" into the materialNames section of the taiho_model.txt file.
4. Enter "{\"mats\":[0]}" in the materialOnMeshIndex section, and repeat it for each of the meshes in the model (78 meshes in total).

The output_log.txt gave the following error, repeated indefinitely:

(Filename: Line: -1)

NullReferenceException: Object reference not set to an instance of an object
at UnitSea.CalculateSpeedPenalty () [0x00000] in <filename unknown>:0
at UnitSea.UpdateMovementData (Single duration) [0x00000] in <filename unknown>:0
at Unit.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

NullReferenceException
at (wrapper managed-to-native) UnityEngine.Transform:INTERNAL_get_position (UnityEngine.Vector3&)
at UnityEngine.Transform.get_position () [0x00000] in <filename unknown>:0
at ThirdPersonCamera.LateUpdate () [0x00000] in <filename unknown>:0
Dernière modification de Teslaman90; 17 juin 2021 à 19h52
Killerfish Games  [dév.] 17 juin 2021 à 21h53 
Yeah there is a lot of data to sync up... it could be that weapons are not set up correctly or the ship_data file has references to subsystems that are not correct...
Killerfish Games a écrit :
Yeah there is a lot of data to sync up... it could be that weapons are not set up correctly or the ship_data file has references to subsystems that are not correct...
Does the ship need weapons? I've removed them initially since i figured i'd do them once i had textures to be able to see them properly.
As for subsystems and the compartment cells, they're a direct copy from Shokaku then i'd tweak them later. Would that effect it?
Killerfish Games  [dév.] 17 juin 2021 à 22h23 
Yes. Cell subsystems referring to "Primary" and "Secondary" guns, Propellers, Rudder/s, Magazines??, Directors will look for the weapon/subsystem setup on the ship (corresponding mesh reference) and fail if they are not there.

Could delete all "Cell/UpperCell" data initially while trying to get the meshes/textures working.

Just tested this by deleting all Shokaku cells and it works in Museum!
Shokaku Model and Mesh comes into the Museum just fine.

Throws lots of other errors looking for directors etc, but that can get looked at once your model is working :) The scene works normally, Shokaku sails happily and camera is fully functional above/below water.

If you are still having issues, check ship_model.txt file as well, if you do not have the appropriate meshes available or defined you must clear the lists for:
propellerHubs
rudder
directors
mountedWeapons
mountedWeaponData

aaaGuns - parent AAA game object and in particular baseTransformNames must exist on the model.

You could consider starting with existing shokaku, delete all cells/upperCells as well as the data mentioned above to make sure you can get the empty shell in game.
Killerfish Games  [dév.] 17 juin 2021 à 22h27 
Here you go: blank shokaku txt files that works in Museum:

shokaku_model.txt
{"regionNames":["SecondaryFP","SecondaryAP","SecondaryFS","MainGuns","AAA","COL_Hull","COL_Hull0","COL_Other","Graphic"],"meshNames":["Hull_LOD0","Hull_LOD1","Superstructure_LOD0","Superstructure_LOD1","Accessories_LOD0","Accessories_LOD1","Crane","GirderTowers_L","GirderTowers_R","Trans","Poles","Prop0","Prop1","Prop2","Prop3","Rudder0","Rudder1","FlightDeck","Director0","Director1","Director2","Director3","Sec0","Sec1","Sec2","Sec3","Sec4","Sec5","ShipAAA0","ShipAAA1","ShipAAA2","ShipAAA3","SBarrel0","SBarrel1","SBarrel2","SBarrel3","SBarrel4","SBarrel5","SAAA0","SAAA1","SAAA2","SAAA3"],"materialsOnMeshIndex":["{\"mats\":[6]}","{\"mats\":[6]}","{\"mats\":[7]}","{\"mats\":[7]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[3]}","{\"mats\":[4]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[0]}","{\"mats\":[0]}","{\"mats\":[8]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}"],"propellerHubs":[],"propellerBlades":[],"propellerBlurs":[],"propellerDirections":[1,1,-1,-1],"rudder":[],"divePlanes":[],"directors":["Director0"],"funnelSmoke":[{"x":2.0,"y":1.226,"z":0.116}],"bowWavePosition":{"x":0.0,"y":0.0,"z":12.45},"propWashPosition":{"x":0.0,"y":0.0,"z":0.0},"cavitationPosition":{"x":0.0,"y":-0.632,"z":-8.92},"flagPosition":{"x":1.38,"y":3.174,"z":2.979},"flagReference":"flag_imperial_japan","movingPart":[],"movingPartData":[],"fixedGuns":[],"fixedGunData":[],"simpleWeapons":[],"simpleWeaponData":[],"mountedWeapons":[],"mountedWeaponData":[],"aaaGuns":[],"aaaGunsData":[]} {"materialName":["Shokaku_Hull_Gray","Shokaku_Superstructure_Gray","Shokaku_Acc_Gray","Transparent","Poles","Shokaku_FlightDeck","Shokaku_Hull_Gray_D","Shokaku_SS_Gray_D","Shokaku_FD_D"]}

shokaku_data.txt
{"unitSubtypeString":"Aircraft_Carrier","length":257.5,"width":29,"displacement_weight":25670,"testDepth_ceiling":0,"crew":1660,"maxKnots":34.2,"acceleration":0.03,"deceleration":0.01,"dive":0.0,"climb":0.0,"maxTurnRate":2.4,"turnRate":0.5,"speedPenaltyAtMaxTurn":0.38,"maxRudder":35.0,"rudderRate":0.3,"heelOver":6.0,"maxPlane":0.0,"planeRate":0.0,"maxShaft":500.0,"dimensions":{"x":3.2,"y":1.0,"z":25.5},"baseLevel":-0.86,"deckLevel":0.67,"gridDimensions":[5,3,15],"hullGridOffset":{"x":0.0,"y":0.0},"hullGridCellSize":{"x":45.0,"y":16.0},"deckCellPositions":[{"x":185.0,"y":42.0},{"x":-175.0,"y":42.0},{"x":185.0,"y":-42.0},{"x":102.0,"y":-34.0},{"x":64.0,"y":9.0},{"x":35.0,"y":-34.0},{"x":-10.0,"y":-34.0},{"x":115.0,"y":0.0},{"x":-35.0,"y":0.0},{"x":-235.0,"y":0.0}],"directorLines":[{"x":83.0,"y":-12.0}],"hullViewOffset":264.0,"damageParties":5,"maxBuoyancyOffset":1.0,"regionFactors":{"x":0.25,"y":1.0},"floodingCapacity":[70,115,110],"maxTDS":0.55,"unitRadarSizeModifier":1.0,"unitVisualSizeModifier":1.0,"unitActiveSonarFactor":1.4,"unitPassiveSonarFactor":7.0,"visualHorizonDistance":20.0,"surfaceRadarStrength":0.0,"airRadarStrength":100.0,"passiveSonarStrength":1.6,"activeSonarStrength":0.0,"esmStrength":0.0,"esmIsDirectional":false,"fireHeights":[1.7,1.7,1.7],"aircraftOnBoard":["zero","val","kate"],"aircraftTotal":[24,24,24],"hullFoamWidth":10}
By the way, thanks KFG, for answering our questions and regarding mods support. We hope that you will always support us as users of your game and modders, and also provide new features that inspire the emergence of new ideas for us.
Killerfish Games a écrit :
Here you go: blank shokaku txt files that works in Museum:

shokaku_model.txt
{"regionNames":["SecondaryFP","SecondaryAP","SecondaryFS","MainGuns","AAA","COL_Hull","COL_Hull0","COL_Other","Graphic"],"meshNames":["Hull_LOD0","Hull_LOD1","Superstructure_LOD0","Superstructure_LOD1","Accessories_LOD0","Accessories_LOD1","Crane","GirderTowers_L","GirderTowers_R","Trans","Poles","Prop0","Prop1","Prop2","Prop3","Rudder0","Rudder1","FlightDeck","Director0","Director1","Director2","Director3","Sec0","Sec1","Sec2","Sec3","Sec4","Sec5","ShipAAA0","ShipAAA1","ShipAAA2","ShipAAA3","SBarrel0","SBarrel1","SBarrel2","SBarrel3","SBarrel4","SBarrel5","SAAA0","SAAA1","SAAA2","SAAA3"],"materialsOnMeshIndex":["{\"mats\":[6]}","{\"mats\":[6]}","{\"mats\":[7]}","{\"mats\":[7]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[3]}","{\"mats\":[4]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[0]}","{\"mats\":[0]}","{\"mats\":[8]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}","{\"mats\":[2]}"],"propellerHubs":[],"propellerBlades":[],"propellerBlurs":[],"propellerDirections":[1,1,-1,-1],"rudder":[],"divePlanes":[],"directors":["Director0"],"funnelSmoke":[{"x":2.0,"y":1.226,"z":0.116}],"bowWavePosition":{"x":0.0,"y":0.0,"z":12.45},"propWashPosition":{"x":0.0,"y":0.0,"z":0.0},"cavitationPosition":{"x":0.0,"y":-0.632,"z":-8.92},"flagPosition":{"x":1.38,"y":3.174,"z":2.979},"flagReference":"flag_imperial_japan","movingPart":[],"movingPartData":[],"fixedGuns":[],"fixedGunData":[],"simpleWeapons":[],"simpleWeaponData":[],"mountedWeapons":[],"mountedWeaponData":[],"aaaGuns":[],"aaaGunsData":[]} {"materialName":["Shokaku_Hull_Gray","Shokaku_Superstructure_Gray","Shokaku_Acc_Gray","Transparent","Poles","Shokaku_FlightDeck","Shokaku_Hull_Gray_D","Shokaku_SS_Gray_D","Shokaku_FD_D"]}

shokaku_data.txt
{"unitSubtypeString":"Aircraft_Carrier","length":257.5,"width":29,"displacement_weight":25670,"testDepth_ceiling":0,"crew":1660,"maxKnots":34.2,"acceleration":0.03,"deceleration":0.01,"dive":0.0,"climb":0.0,"maxTurnRate":2.4,"turnRate":0.5,"speedPenaltyAtMaxTurn":0.38,"maxRudder":35.0,"rudderRate":0.3,"heelOver":6.0,"maxPlane":0.0,"planeRate":0.0,"maxShaft":500.0,"dimensions":{"x":3.2,"y":1.0,"z":25.5},"baseLevel":-0.86,"deckLevel":0.67,"gridDimensions":[5,3,15],"hullGridOffset":{"x":0.0,"y":0.0},"hullGridCellSize":{"x":45.0,"y":16.0},"deckCellPositions":[{"x":185.0,"y":42.0},{"x":-175.0,"y":42.0},{"x":185.0,"y":-42.0},{"x":102.0,"y":-34.0},{"x":64.0,"y":9.0},{"x":35.0,"y":-34.0},{"x":-10.0,"y":-34.0},{"x":115.0,"y":0.0},{"x":-35.0,"y":0.0},{"x":-235.0,"y":0.0}],"directorLines":[{"x":83.0,"y":-12.0}],"hullViewOffset":264.0,"damageParties":5,"maxBuoyancyOffset":1.0,"regionFactors":{"x":0.25,"y":1.0},"floodingCapacity":[70,115,110],"maxTDS":0.55,"unitRadarSizeModifier":1.0,"unitVisualSizeModifier":1.0,"unitActiveSonarFactor":1.4,"unitPassiveSonarFactor":7.0,"visualHorizonDistance":20.0,"surfaceRadarStrength":0.0,"airRadarStrength":100.0,"passiveSonarStrength":1.6,"activeSonarStrength":0.0,"esmStrength":0.0,"esmIsDirectional":false,"fireHeights":[1.7,1.7,1.7],"aircraftOnBoard":["zero","val","kate"],"aircraftTotal":[24,24,24],"hullFoamWidth":10}
Hello KFG, after I used the base of your blank shokaku, and followed the instructions above, I hope I got the results. Texture has been successfully installed, here is the link for the image:

Website link [imgur.com]

and also one thing I found, organizing this reference material is a bit of a gamble, when I type the meshname like this: "meshNames":["ASB023_Georgia_1945_bow.002","ASB023_Georgia_1945_midback.002","ASB023_Georgia_1945_front.002","ASB023Georgia.002"..Georgia.002".. ..], then the result is as I sent above (the stern is still purple.

but if I write this : "meshNames":["ASB023_Georgia_1945_bow.002","ASB023_Georgia_1945_midback.002","ASB023_Georgia_1945_midback.002","ASB023_Georgia_1945_stern.002"...], then the stern will be textured. and you see the text? I have to write twice "ASB023_Georgia_1945_midback.002"?

here the preview for the second result:

Website link [imgur.com]
Killerfish Games a écrit :
Here you go: blank shokaku txt files that works in Museum:
https://imgur.com/a/eLOiJrz
I've managed to get a base grey material to appear, so does that mean my data files are correct but my texture paths aren't?

I also want to clarify that the meshNames section refers to the actual meshes as referenced in Unity, and not the game objects?

Basically i'm not entirely sure where to go from here.
Dernière modification de Teslaman90; 28 juin 2021 à 3h57
kinantanz? why you are trying add ship which never existed in reality?
< >
Affichage des commentaires 1 à 15 sur 56
Par page : 1530 50

Posté le 14 juin 2021 à 0h48
Messages : 56