RE: Obscure codes in the electronic map (Full Version)

All Forums >> [New Releases from Matrix Games] >> War in the Pacific: Admiral's Edition >> Scenario Design and Modding



Message


RyanCrierie -> RE: Obscure codes in the electronic map (12/26/2017 12:13:40 AM)

quote:

ORIGINAL: el cid again

I look at AE as a system. Originally an electronics technician and
machine language programmer, and a pioneer of early digital computers
(even pre-electronic digital computers, which used relays), I think in
terms of how the program works more than in terms of art. Most of my
time involved with maps is down at the level of the codes which define
the "real map" from the computer's point of view. Art is simply what
players see and has essentially nothing to do with how the program works.


I'll make this clear(er).

MAPGEN is a program designed to read that underlying binary data contained in pwhexe.dat and then render it graphically.

This is some code from MAPGEN's map dumping program:

ReadByte = [HexFileData.read(1)] # Read One Byte from file as a character.

if ReadByte == [b'\x00']: #x00 Deep Ocean
MapImage.paste(Hex_Blue_1, (int(PIXLOC_X_MODIFIER),int(PIXLOC_Y_MODIFIER)), Hex_AlphaChannel)
if ReadByte == [b'\x01']: #x01 Clear
MapImage.paste(Hex_Green_4, (int(PIXLOC_X_MODIFIER),int(PIXLOC_Y_MODIFIER)), Hex_AlphaChannel)
if ReadByte == [b'\x02']: #x02 Jungle
MapImage.paste(Hex_Green_2, (int(PIXLOC_X_MODIFIER),int(PIXLOC_Y_MODIFIER)), Hex_AlphaChannel)
if ReadByte == [b'\x03']: #x03 Mountain
MapImage.paste(Hex_Brown_1, (int(PIXLOC_X_MODIFIER),int(PIXLOC_Y_MODIFIER)), Hex_AlphaChannel)


Basically, this snippet reads one byte from pwhexe.dat; and it then does different things:

If the byte has a hexadecimal value of x00 (aka deep ocean); it pastes the "BLUE 1" hex.

If it's got a hexadecimal value of x02 (Jungle), it pastes "GREEN 2" hex.

The repacker does this in reverse. It looks at the graphical image and converts the GREEN 2 color into hexadecimal value of x02 and puts that into the binary file.




el cid again -> Mapgen (1/1/2018 4:32:17 PM)

How does this work with respect to roads and railroads?

How does this work with respect to coastal terrain. In
such terrain, pwhexe.dat codes whatever the LAND is - say
woods. But there is also WATER in the hex. And the water
might be light blue (shallow) or dark blue (deep).

Since RHS needs different maps for every season, this might
be a solution. Someone in Europe said he would make such a
program, and said it would be fun and easy - but he gave up.
But in principle, it should be possible.

Where does one find this program?




Dili -> RE: Mapgen (1/1/2018 8:51:39 PM)

Mapgen extracts one map for railroads hexes, other map for roads hexes, other map for weather, etc...

quote:

How does this work with respect to coastal terrain. In
such terrain, pwhexe.dat codes whatever the LAND is - say
woods. But there is also WATER in the hex. And the water
might be light blue (shallow) or dark blue (deep).


You paint the LAND,SEA type in called by Mapgen:TERRAIN_BIG map

You paint the coastal instead in HEX_TYPE_BIG map.
[image]http://i66.tinypic.com/333crxx.jpg[/image]

It defines the coastal hexes by painting blue clear ones.

Go to Mapgen topic and download the manual.




Dili -> RE: Mapgen (1/1/2018 8:59:46 PM)

This is the rail map. It is obviously separated from road map. To CODE paint the roads you need another map.

[image]http://i64.tinypic.com/2eydnp2.jpg[/image]




RyanCrierie -> RE: Mapgen (1/1/2018 10:00:05 PM)

Here's how you edit in MAPGEN (i'm about to release block II).

This is a railnetwork for australia.

You can see how I've crudely drawn across it with photoshop (or paint shop pro)

[image]local://upfiles/18450/AA5A50CFD27942EBA1B24EF9E9940F78.gif[/image]




RyanCrierie -> RE: Mapgen (1/1/2018 10:00:59 PM)

Same location, but in game via hotkeys following analysis/repacking of the graphical file:

[image]local://upfiles/18450/A96D10FA4CBB44B784C2766CCA77FDD1.gif[/image]




RyanCrierie -> RE: Mapgen (1/1/2018 10:04:46 PM)

Same area displayed in Photoshop, with two layers:

1.) Actual in-game artwork that you see

2.) The rail data layer extracted into graphical format via MAPGEN.

I highly recommend the use of a 64-bit graphics editing program (newer version of Photoshop or Paint Shop Pro whatever they call PSP now) because it takes 218 MB of memory for each “layer” of detail in the map if you edit the full 9000x7000+ pixel map, and that adds up fast.

[image]local://upfiles/18450/4C9320D5EDBA4306B07779EB95032227.gif[/image]




RyanCrierie -> RE: Mapgen (1/1/2018 10:26:00 PM)

MAPGEN Block II 19.6 MB ZIP

Designed to be unzipped to your WITP:AE main directory and run from there.

Source code is included in /SOURCE, documentation is in /DOCS

Files generated will be placed into /DUMP.

The program will read the files from /DUMP when rebuilding PWHEXE.dat

I've included a zipped up copy of the original PWHEXE.dat from the latest WITPAE because you won't back it up.

MAPGEN DUMP: Dumps the PWHEXE.dat file into different graphical layers.

MAPGEN REPACK: Repacks the graphical files back into the PWHEXE.DAT file.

MAPGEN MAPART: Combines the 41(!) BMP files in the \ART directory for the in-game map into one really big PNG file which is also pixel accurate with the dump graphics files that DUMP generates. Also splits the big png files back into 41 BMP files when you're done editing the big file in photoshop.

LANGUAGE USED: Python 3.x; using the following libraries:

Colorama 0.3.7
Pillow 4.0.0

and packaged into executables by PyInstaller 3.2.1 (that's why each file is so big, it includes an entire python distribution instead of just what the program needs to run, unlike most programming langauges that build executables)




RichardAckermann -> RE: Mapgen (1/6/2018 7:12:11 PM)

I need help with the PWhexe data format, and would require an expert to give me some info on it.
Like:

struct HexDataType
{
INT8 Terraintype
INT16 NE hex roadtype
INT16 etc..
};

And how many sets of this data exist for each line of hexes in the game map.

I need the info to be able to import WITP AE scenarios into my WITP AE 1 1/2 game engine.




dwbradley -> RE: Mapgen (1/6/2018 8:34:08 PM)


quote:

ORIGINAL: RichardAckermann

I need help with the PWhexe data format, and would require an expert to give me some info on it.
Like:

struct HexDataType
{
INT8 Terraintype
INT16 NE hex roadtype
INT16 etc..
};

And how many sets of this data exist for each line of hexes in the game map.

I need the info to be able to import WITP AE scenarios into my WITP AE 1 1/2 game engine.



The info in this package may be of use to you.
https://drive.google.com/file/d/1ip5AGAFvg_1s-5l4s8JgOx5SwvDK_5eu/view?usp=sharing

Cheers
Dave Bradley




RichardAckermann -> RE: Mapgen (1/7/2018 8:58:57 AM)

Yes, the documentation looks helpfull. Thanks for it.




RichardAckermann -> RE: Mapgen (1/8/2018 8:00:00 AM)

Thanks again, Dave Bradley. Those information about the PWHEXE file were perfect.

A question emerged after pasting the info into my game. There does not seem to be any "Developed" or "Cultivated" terrain type, they are all plain clear terrain. Are they just eye candy, or defined by other properties of the hex?




Dili -> RE: Mapgen (1/8/2018 11:03:42 AM)

There isn't.




Page: <<   < prev  1 [2]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.070313