Page 1 of 1

Adding new terrain types?

Posted: Sat Oct 17, 2015 1:31 pm
by Mark50
Is there a guide available? I couldn`t find it.

Looking at the files I`m guessing a new line needs to be entered in terrain.pzdat and that needs a corresponding line in strings.pzdat. The image for the editor needs to go in terrain.png from Graphics/Editor and then each movement type from movement.pzdat should get a new entry for the new terrain. That said, how will the engine know what tile background and overlays to place on the designated hex in the editor when it generates the terrain? I feel I`m missing something. :D

Re: Adding new terrain types?

Posted: Sun Oct 18, 2015 7:14 am
by BiteNibbleChomp
Download bebro's Jap campaign and snoop around the files. You'll get a good idea pretty quickly!

- BNC

Re: Adding new terrain types?

Posted: Sun Oct 18, 2015 9:08 am
by Mark50
You'll get a good idea pretty quickly!
That statement would imply that you`ve done so already. Hence you could tell me the summary and be even quicker. :D

As far as I can see, bebro did not add new terrain types in his IJA campaign.

Re: Adding new terrain types?

Posted: Sun Oct 18, 2015 11:00 am
by BiteNibbleChomp
Mark50 wrote:
You'll get a good idea pretty quickly!
That statement would imply that you`ve done so already. Hence you could tell me the summary and be even quicker. :D

As far as I can see, bebro did not add new terrain types in his IJA campaign.
I haven't added new terrains properly - I've just messed around with them a bit (ie. new movement settings). The above is just how I tend to work things out - taking apart other people's work and see how they've done it!

Bebro added heaps of new stuff like dense jungles (IIRC regular jungles didn't exist in the version IJA was originally designed for).

Your first post sounds like a good start - though you will want to consider the minimap (It would be strange to add a volcano hex that looks like an ocean!)

- BNC

Re: Adding new terrain types?

Posted: Sun Oct 18, 2015 11:24 am
by Mark50
Bebro added heaps of new stuff like dense jungles (IIRC regular jungles didn't exist in the version IJA was originally designed for).
Based on his LayerTerrain.png I`m guessing he simply replaced the overlay graphics for the forest and thick forest. Which would be in line with the rest of the things he implemented in IJA (the new factions replace existing factions; the new amphibious movement replaces the alpine movement).
though you will want to consider the minimap
Now that you`ve mentioned it... :D Any idea what to do about it?

EDIT: does anyone know what this comment (from terrain.pzdat) mean?
# Terrain features are directional (i. e. there is a 6-bit direction mask associated with each in map files)

Re: Adding new terrain types?

Posted: Mon Oct 19, 2015 6:57 am
by BiteNibbleChomp
In Graphics/MiniMap, there is a file called terrain.png. I imagine you would just add an iron-cross-shaped blob of your colour of choice at the end, but you may have to replace something. I don't think anyone has tried before.
Mark50 wrote: EDIT: does anyone know what this comment (from terrain.pzdat) mean?
# Terrain features are directional (i. e. there is a 6-bit direction mask associated with each in map files)
That relates to roads and railroads. I don't think it will apply in what you are doing.

- BNC

Re: Adding new terrain types?

Posted: Mon Oct 19, 2015 2:04 pm
by Mark50
BiteNibbleChomp wrote:In Graphics/MiniMap, there is a file called terrain.png.
Thank you! I hadn`t noticed that.

Re: Adding new terrain types?

Posted: Tue Oct 20, 2015 3:18 pm
by Mark50
I`m starting to think the terrain types are hardcoded. I`ve made a test.

- in movement.pzdat I`ve added a new effect for the new terrain at the end of each movement type set of entries.
- in strings.pzdat I`ve added an entry for the new terrain at the end of the file.
- in Graphics/MiniMap I`ve edited the terrain.png to add a new colour "plus" at the end of the file for the new terrain.
- I`ve even edited the three LayerTerrain files to have a new set of overlays, just in case it will load them for any new terrain entered.
- in Graphics/Editor I`ve edited the terrain.png file to have a new hex for the new terrain.
- most importantly, in terrain.pzdat I`ve added a new entry for the terrain.

Everything showed up fine in the Editor apart from the string of the new terrain hexes which said Major River. Apparently that was because I had inserted the new terrain line before the # Terrain features tag that continued to list the terrain features. Ok, I`ve edited the file again and placed the new terrain line after the entry Road which meant it was literally at the end of the file. The effect was that there was no string associated with it in the editor and the validate terrain option was finding this problem for the new terrain hexes. The generate terrain option was making the new hexes look like clear terrain with no other overlays and I`m guessing this is basically the default.

Unless I`ve missed something, my conclusion is that the terrain is defined somewhere internally and you can`t just add new entries in terrain.pzdat.

Re: Adding new terrain types?

Posted: Tue Oct 27, 2015 9:44 pm
by ThvN
Hi Mark50, after some experimenting the past few days, I can't get it to work either, unfortunately. I'm calling it quits for the time being because my ancient Photoshop has become very unstable after some recent Windows updates, and it took me forever to make some simple graphics that weren't corrupted (the editor failed to load sometimes because of it). If I figure out a way to get PS going again I might give it a try again in the future.

But I was thinking while going through the terrain entries, with Afrika Korps extra terrain types were added (about five I think, all the desert types), maybe comparing the original file structure with the newer one will give some clues on how it is supposed to work?

Re: Adding new terrain types?

Posted: Wed Oct 28, 2015 11:42 am
by Mark50
ThvN wrote: But I was thinking while going through the terrain entries, with Afrika Korps extra terrain types were added (about five I think, all the desert types), maybe comparing the original file structure with the newer one will give some clues on how it is supposed to work?
That`s one of the reasons I think it`s hardcoded. The new terrain types (desert, dunes etc.) were not added after all the other entries in terrain.pzdat, but before the major river and river entries. Doing similarly seems to confuse the reading of the strings when modding the file. Hence my conclusion that they are referred to somewhere internally.

Thanks for looking into it too!

Re: Adding new terrain types?

Posted: Fri Oct 30, 2015 6:07 am
by BiteNibbleChomp
With all this in mind, nothing is stopping you from replacing one with another. Some terrains are only used in very specific cases and can be replaced for a custom mod - rough desert/dunes and shallow sea would be the first two to go in my mind.

- BNC

Re: Adding new terrain types?

Posted: Sun Nov 01, 2015 4:58 pm
by Neubaufahrzeug
As far as I understand it is not possible to create new terrain types like these???

# Name Traits Initiative cap Base entrenchment
IDS_TRN_VILLAGE close, glow 100 1
IDS_TRN_TOWN close, glow 2 2
IDS_TRN_INDUSTRIAL close, glow 1 4

Greetings
Neubaufahrzeug


Sorry - should be a question... :oops:

Re: Adding new terrain types?

Posted: Fri Nov 06, 2015 5:21 pm
by Neubaufahrzeug
Nobody likes to help? :(