Editing units

Moderators: Order of Battle Moderators, The Artistocrats

Post Reply
Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Editing units

Post by Horst » Sun May 03, 2015 8:36 pm

There are three units files in the data folder: units.txt, unitsB.csv, and unitsB.txt. Is it correct that only units.txt is used by the game? At least there I notice (thankfully also during scenarios) changes.
I’m thankful for the possibility to edit units, although I wish it would be as comfortable like in PG games where you can simply copy & paste excel sheet contents back and forth. It would be much easier if each unit's data is one line, preferable with spaces and not comma in-between (see Panzer Corps). The unitsB.csv looks like an attempt to do this, or I haven’t figured out yet how to manage these three unit files there correctly.
Is/was the unitsB.csv sheet a work-in-progress/test or outdated way to important unit data?

I’m only curious if there are plans to improve editing a bit without providing an extra unit editor for that.
I personally prefer calculating unit data by excel and copy my game sheet from there into PG games. Importing data into the units.txt format isn’t impossible to do, but I’d like to know if I should wait before doing a lot of unnecessary work.

adherbal
The Artistocrats
The Artistocrats
Posts: 3896
Joined: Fri Jun 24, 2005 6:42 pm
Location: Belgium

Re: Editing units

Post by adherbal » Mon May 04, 2015 2:24 pm

We started with the txt format but realised it became very hard to manage. We have an internal tool which combines data from unitsB.csv and units.txt to create unitsB.txt, then pasting the content of unitsB to units. It's still a bit of a pain :|

The best solution for both us and modding is probably to create a tool to manage all this.
Image

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Re: Editing units

Post by Horst » Mon May 04, 2015 4:36 pm

Thanks for the info! That’s too bad, but I’m still going to try it with Excel then somehow.

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Re: Editing units

Post by Horst » Thu May 07, 2015 3:15 pm

When I add or remove a unit in units.txt, the game hangs when loading the editor (Loading...). What's the matter?
I use a units.txt file in the user folder as instructed here. For example, the editor won't load anymore when I remove the last [NavalMines] unit.

Running scenarios normally with missing units works fine though. The units only miss then without ugly error messages or graphic glitches what is good.

adherbal
The Artistocrats
The Artistocrats
Posts: 3896
Joined: Fri Jun 24, 2005 6:42 pm
Location: Belgium

Re: Editing units

Post by adherbal » Fri May 08, 2015 12:15 pm

I think all consecutive unit IDs need to be present. So if you remove unit with id 5 you need to have something filling up that gap. You can also add "noEditor" and "noPurchase" traits to hide a unit from the game though.
Image

ichirou989
Lance Corporal - SdKfz 222
Lance Corporal - SdKfz 222
Posts: 29
Joined: Tue Jun 14, 2005 7:16 am

Re: Editing units

Post by ichirou989 » Sat May 16, 2015 5:59 pm

What do the three values for Torpedoes mean? I'm guessing the first number is reload time, and the last number is torpedo strength, not sure at all about the middle number though.

adherbal
The Artistocrats
The Artistocrats
Posts: 3896
Joined: Fri Jun 24, 2005 6:42 pm
Location: Belgium

Re: Editing units

Post by adherbal » Sat May 16, 2015 6:35 pm

cooldown time, range, damage
Image

Cortilein
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 216
Joined: Mon Feb 25, 2008 10:11 am

Re: Editing units

Post by Cortilein » Sun May 31, 2015 6:48 pm

Hi folks,

fiddled around with the editor a bit. By simple copy/pasting and some modifications, I have managed to create the "CA York" cruiser class and "T-Class submarine" as unique units for the British. These are used in the JavaSea Scenario ("HMS Exeter" cruiser and "HMS Truant" sub). In the original game, these simply use the CA Northampton (US Navy) and SS Tambor (US Navy) - so I used those unit data as templates for additional entries in "units.txt".

In the editor, however, the 2D preview pictures for those two new units have an empty space in the units selection slider. Just the text string of the unit is shown at the bottom of the respective panels. Same situation in game - all works nicely, but since new unit descriptor strings were created in "units.txt" (e.g. [CA_Northampton] was copied and changed to [CA_York]), the game engine obviously can't find corresponding 2D unit images (because there are none with that name, of course).

To my knowledge, the 2D preview pictures for units reside compressed in an assets file. So - in what subfolder would I put the duplicates of those files in my "Mod" folder? All I want to do is to re-use the existing 2D pictures for "[CA_Northampton]" and "[Sub_Tambor]" for the modded British units - as they share 3D models anyway (for now).

Just learning things - I thought it would be nice if at least the named units had their proper ship classes displayed in all cases. Don't care at the moment that they would all share the same 3D models for now. If only I knew more about it - the front part of the BCV Ise and the rear of the BB Nagato would make for some nice fake-Fuso! :D

Regards,
Cortilein

Cortilein
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 216
Joined: Mon Feb 25, 2008 10:11 am

Re: Editing units

Post by Cortilein » Tue Jun 02, 2015 2:15 pm

So - I guess I would have to integrate a corresponding .tex_2 file entry into the resources.assets file then (i.e. CA_York.tex_2)?

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Re: Editing units

Post by Horst » Sat Jun 13, 2015 11:21 am

I haven’t been busy much yet with adding new units, so can’t help there.

What I’ve noticed while modifying existing units is that you can’t simply add an existing weaponEffect to units without problems. Let’s say when I add the "MG" effect to a truck including proper attack values then you will see damage numbers endlessly floating over the attacked enemy unit. This will heavily slow down the game too. It’s like the unit is missing a parameter when to stop with that (invisible) attack animation.
I don’t have much clue about 3d modelling, but I guess each 3d model needs supporting effect positions to make anything work correctly?

Btw, is the torpedo range really limited to 4 in the game? I’ve increased it once to 5, but I can’t target any ship although the white line correctly reflects 5 hexes range. Hardcoded limit due animation?

Cortilein
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 216
Joined: Mon Feb 25, 2008 10:11 am

Re: Editing units

Post by Cortilein » Sat Jun 13, 2015 3:36 pm

Horst wrote:What I’ve noticed while modifying existing units is that you can’t simply add an existing weaponEffect to units without problems. Let’s say when I add the "MG" effect to a truck including proper attack values then you will see damage numbers endlessly floating over the attacked enemy unit.
Confirmed - just tried to add an MG effect to the Japanese "Type 98 So-Da" transport, taking the British "Bren Universal Carrier" as reference. I guess one would have to add a hardpoint in the 3D model to define where the fire animation / muzzle flash is supposed to appear...

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Re: Editing units

Post by Horst » Fri Jun 26, 2015 3:20 pm

Just created a Japanese Engineers '42 unit with id=530 by copying the '41 data in units.txt. For a proper name, I've also added a line with unit_530 in the english_2.txt language file.
So, all that is still required is the unit's icon now which currently only shows as "placeholder icon". The animated 3d-model of the '41 engineers works fine while playing.
Let's see what tools the future will bring to make at least duplicate units working if you aren't a 3d model-maestro. A simple game file which defines the used default icon picture would already be great too. That could also theoretically be added to the units.txt data without much extra work.

What worries me a bit is that you have to follow ID numbers, otherwise the game will freeze. In order to create a mod with new units and maps, you would have to create many dummy ID numbers/units with noeditor/nopurchase settings if you don't want to ruin your custom mod and maps by official content which will most likely continue with ID 530. That was much more tolerant with PzC where you simply skip many ID numbers and start with id 10.000 or something to be on the safe side.

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1664
Joined: Mon Feb 18, 2013 1:22 pm

Re: Editing units

Post by Horst » Fri Jun 26, 2015 6:23 pm

I’ve discovered some flaws with the movement/transport mechanics:
If you modify the towed artillery guns to make very heavy ones only moveable by transport (mp=0), then this will also prevent the attached transport move at all. If artillery starts the map switched to transport, it can’t switch to the gun anymore either. Therefore, you have to keep at least 1 point of movement for tow and platform type units.

It’s also important that you better keep the chassis.txt stats of tow and platform type to either 1 or 100, otherwise the transport could theoretically move onto the hex, but won’t change to the towed gun there. The gun must also be able to move onto this terrain type.
My idea here was that medium-heavy guns could still move on roads and flat terrain with their mp=1, but not onto hilly/difficult terrain, forests and such. Only light guns with mp=2 should have be able to do that without transport.
Oh well, time to trash the idea then what nicely worked in Panzer Corps. "Push that damn 14t Long Tom, you lazy wimps! Even my grandma could do that alone!"

Post Reply

Return to “Order of Battle : World War II - Scenario Design”