RyanCrierie
Posts: 1461
Joined: 10/14/2005 Status: offline
|
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.
_____________________________
|