Custom Units and Camo

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Post Reply
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 140
Joined: Thu Apr 30, 2020 11:52 pm

Custom Units and Camo

Post by FunPolice749 »

So having come back to finally put out a mod I return to problems I ran into before. Notably this whole lack of unique models that makes it hard to have more than kinda what the base game has. Now I understand for vehicles this is pretty much how it has to be since we players cannot import new models in any meaningful way. However, that is not what I am trying to do here. Instead my only goal is to figure out how to change the base skin of a unit in game.

As an example I want to take something like the US Rangers and apply a different camo as the default for them. Take something like say US Airborne 2 as what I am looking for. I am not trying to have a new model or anything but I do want to figure out if there is some way to make these units look different at least color wise for easier recognition as I have added several types of infantry. With so many skins out there I could make quite a mix of things but right now they all end up looking the same handful of models with the same skins so you have to manually edit the camos to tell them apart.

I think an ideal scenario is if anyone knows how to use units.csv and have it apply the camo to the unit. I tried random things and none worked but if someone like knew how to set up a new column for camo, or could edit the model reference to use a different camo, or just anything that would be the perfect and easiest solution.

In the case that above point isn't possible though I guess my next question would be where does units.csv get it's models from and then would it be possible for me to create like a new model that uses a different skin? Like could I create a ranger model that is just a different skin used with it? Where can I find such files and try to tinker with it?
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1919
Joined: Mon Aug 04, 2014 10:07 pm

Re: Custom Units and Camo

Post by Grondel »

FunPolice749 wrote: Thu Nov 23, 2023 5:28 pm So having come back to finally put out a mod I return to problems I ran into before. Notably this whole lack of unique models that makes it hard to have more than kinda what the base game has. Now I understand for vehicles this is pretty much how it has to be since we players cannot import new models in any meaningful way. However, that is not what I am trying to do here. Instead my only goal is to figure out how to change the base skin of a unit in game.

As an example I want to take something like the US Rangers and apply a different camo as the default for them. Take something like say US Airborne 2 as what I am looking for. I am not trying to have a new model or anything but I do want to figure out if there is some way to make these units look different at least color wise for easier recognition as I have added several types of infantry. With so many skins out there I could make quite a mix of things but right now they all end up looking the same handful of models with the same skins so you have to manually edit the camos to tell them apart.

I think an ideal scenario is if anyone knows how to use units.csv and have it apply the camo to the unit. I tried random things and none worked but if someone like knew how to set up a new column for camo, or could edit the model reference to use a different camo, or just anything that would be the perfect and easiest solution.

In the case that above point isn't possible though I guess my next question would be where does units.csv get it's models from and then would it be possible for me to create like a new model that uses a different skin? Like could I create a ranger model that is just a different skin used with it? Where can I find such files and try to tinker with it?
any .csv table in the game can be modded.
if ur lucky the camo is set in one of those. try searching here and in the subfolders:
..\Steam\steamapps\common\Panzer Corps 2\PanzerCorps2\Content

sers,
Thomas
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 140
Joined: Thu Apr 30, 2020 11:52 pm

Re: Custom Units and Camo

Post by FunPolice749 »

Grondel wrote: Thu Nov 23, 2023 5:56 pm
any .csv table in the game can be modded.
if ur lucky the camo is set in one of those. try searching here and in the subfolders:
..\Steam\steamapps\common\Panzer Corps 2\PanzerCorps2\Content

sers,
Thomas
I dug around in those files for this exact thing but have come up short overall. The issue I run into is that I cannot find the source of where the game links models and units together. In Units.csv they reference a model that they draw from but I just don't know where the models really get sourced from. If I could find the file where models get their default skins that would be the solution but my few hours of searching didn't find me the place. If you happen to know it please let me know.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1919
Joined: Mon Aug 04, 2014 10:07 pm

Re: Custom Units and Camo

Post by Grondel »

FunPolice749 wrote: Fri Nov 24, 2023 12:44 am I dug around in those files for this exact thing but have come up short overall. The issue I run into is that I cannot find the source of where the game links models and units together. In Units.csv they reference a model that they draw from but I just don't know where the models really get sourced from. If I could find the file where models get their default skins that would be the solution but my few hours of searching didn't find me the place. If you happen to know it please let me know.
\Panzer Corps 2\PanzerCorps2\Content\Graphics\Units\DE
my guess would be here but seems all are encrypted by unreal. sadly the tables to open them is not shipped with the game.

edit:
\Panzer Corps 2\PanzerCorps2\Content\Graphics\Data\UnitModels.csv this one looks promising

sers,
Thomas
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 140
Joined: Thu Apr 30, 2020 11:52 pm

Re: Custom Units and Camo

Post by FunPolice749 »

Grondel wrote: Fri Nov 24, 2023 1:34 am \Panzer Corps 2\PanzerCorps2\Content\Graphics\Units\DE
my guess would be here but seems all are encrypted by unreal. sadly the tables to open them is not shipped with the game.

edit:
\Panzer Corps 2\PanzerCorps2\Content\Graphics\Data\UnitModels.csv this one looks promising

sers,
Thomas
Ok so Unitmodels.csv seems to be for vehicles and then there is infantrymodels.csv in the same area for infantry. In those files we have this unfilled column called "arts" which I assume could be where camos could be applied to units. The issue is there is no example in either file of what this is requiring. I tried going into skins.csv and copying those paths like DE_Lnd_Ambush_Late over into the arts column but it doesn't do anything.

I'm gonna keep trying but this does feel like the right place to do something like this. I just need to figure out what exactly is needed to place there to put different camos. Or maybe I'm completely wrong and this is the wrong place lol
Patrick Ward
Slitherine
Slitherine
Posts: 1211
Joined: Thu Sep 04, 2014 2:49 pm
Location: A small island in the Outer Hebrides.

Re: Custom Units and Camo

Post by Patrick Ward »

I've only a rudimentary understanding of the backend systems and as the bulk of the graphics are done don't have much involvement atm, but can give you some pointers.

With infantry, the materials are individually defined in
Graphics/units/infantry/materials
and defaults are assigned to each rigged mesh. So a default material and its associated textures are baked into the mesh. However ..
SoldierModels.uasset defines the single soldiers mesh, its default texture, weapon and animation sets used by each individual unit model. That seems to take priority over the link embedded in the mesh but I can't guarantee it.

data/skins.uasset is where camos are defined and could be added to if you want to add extra camo variants. Defaults will have entries for vehicles, aircraft, ships and infantry. Most others are single entry only and so get filtered based on the unit type.

There is no system for a secondary/modded camo list so be aware that with every update skins.csv will get replaced.

Camo swatches and unit textures are basically dds files but Unreal seems to change the format to something proprietry so they're not readable AFAIK. There maybe some converters out there but thats modders territory.

InfantryModels.uasset defines the squad .. so has entries for each individual figure. This is how we get mixtures of different models/weapons in a given squad.


Non-infantry are different.
Unitmodels.uasset has a column for Path. This, in conjunction with its basename is taken from the Name column, is AFAIK used to point to the unit model and the material path.
All vehicle materials are stored in
Graphics/units/materials/(Faction Path)
data/skins.uasset contains all the camo definitions.
then the default camo for every unit in the scenario is assigned in the scenario. At both a global level and the individual unit if required.

The way different vehicle parts articulate is based on their suffix and matching socket to attach them to. So the game automatically treats something as a tank if it has _tracks. _Turrets always rotate around their heading. _Gun rotates a little around its pitch. _Barrel recoils when firing. _Body always has to be the root etc.

Weapons are defined in
Data/Weapons.uasset
That includes firing VFX, sound and all the different hit FX based on the target type and location.

The unit textures, _Alphas and _Colour are non standard. Each channel of _Alphas is a composite of multiple data streams that are filtered and used separately. Too complicated to go into in great detail but
R contains moslty diffuse reflection values, ambient occlusion, gloss
G is a mask to define painted areas
B Is a combination of specularity, metalness, shine
A is a rundamentary height/detail map.
they get filtered to provide controls over camo, undercoat, metal areas, wear and tear, dust and snow, paint thickness, pre-shading, post shading, surface atributes etc. etc. and have nearly 80 parameters.

So essentially at this point the only things you can definitly edit are .csv files. We can't provide you with the original spreadsheets for these as they don't exist outside of Unreal. There are no .xlsx files.
Some people have had success getting their own vehicles in. I assume they used Unreal but they're not saying. IF they HAVE done it that way then I'm not sure why you couldn't access the spreadsheets as well. But again .. they'll likely be replaced with every update unless modders have a way around that.


NB. Most of you will of been aware of the 1.9.3 update and the issues with the Japanese infantry and ships. This is one that really caught us out and something to be aware of if you add your own models.

The more recent versions of Unreal 4 seem to have a problem with small polygons, specifically on initial import from fbx. No error was reported and there was no obvious visual indication. All meshes inside and outside the program looked fine.
What we realised too late was that the automatic collision-object creation that occurs on import was going wrong with some small objects. Namely 1 Japanese rifle and one ship gun.

Unfortunately due to the conveyor belt process that is release, we were locked into a schedule and the game was going to be released whether we wanted to or not. The team did eventually figure it out thanks to a seemingly unrelated issue reported by a tester. We fast-tracked the update and hoped we'd caught it in time. That the fix would be implemented just before release and not impact anyone. But it got delayed somewhere for who knows what reason and you ended up having to update it yourselves. Far from the situation any of us wanted but at least it was rectified in the end.
............................

Pat a Pixel Pusher

............................
Post Reply

Return to “Panzer Corps 2 Scenario Design”