HackersQuest.org Forum Index HackersQuest.org
Discussions for HackersQuest
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

new World Map in 14.4
Goto page 1, 2  Next
 
Post new topic   Reply to topic    HackersQuest.org Forum Index -> AnarchyOnline::General
View previous topic :: View next topic  
Author Message
Beaker
Wannabe


Joined: 09 Jan 2002
Posts: 1456
Location: Seattle

PostPosted: Tue Jun 18, 2002 6:50 pm    Post subject: new World Map in 14.4 Reply with quote

as some of you may have noticed there is a new world map coming in 14.4
see
http://kuren.org/ao/screenshots/144testworldmap001.jpg
http://kuren.org/ao/screenshots/144testworldmap002.jpg
http://kuren.org/ao/screenshots/144testworldmap003.jpg

I wrote a little PHP script to extract the PNG files from PlanetMapGfxNormal.bin

Code:
<?
   // open the map file and put it in the variable $contents
   $mapfile = fopen('PlanetMapGfxNormal.bin', "rb");
   $contents = fread ($mapfile, filesize ('PlanetMapGfxNormal.bin'));
   fclose ($mapfile);

   //open the index file and collect all the byte locations
   $data="";
   $fp = fopen("PlanetMapIndexNormal.txt","r");
   while(!feof($fp))
   {
      $data = fgets($fp, 4096);
      $data=trim($data);
      if (strcmp(substr($data,0,8),"FilePos ")==0)
         $pnglocations[]=0+substr($data,8);
   }
   fclose($fp);


   //write out all the PNGs
   $i=101;
   for($j=0;$j<sizeof($pnglocations);$j++)
   {
      $k=$pnglocations[$j];
      if ($j==sizeof($pnglocations)-1)
         $l=strlen($contents);
      else
         $l=$pnglocations[$j+1]-$pnglocations[$j];

      $currentPNG=substr($contents,$k,$l);

      $pngfile="$i.png";
      $fd = fopen($pngfile, "wb");
      fwrite($fd, $currentPNG);
      fclose($fd);
      $i++;
   }
?>


Put this code into a php file and drag and drop it onto php.exe and it will make 84 png files

if you don't have PHP.exe and php4ts.dll you can get them at http://www.php.net/downloads.php
Back to top
View user's profile Send private message
Beaker
Wannabe


Joined: 09 Jan 2002
Posts: 1456
Location: Seattle

PostPosted: Thu Jun 20, 2002 8:51 pm    Post subject: Reply with quote

has anyone taken a look at how the new world map works?

Its made of 84 PNG files.

Is there a program that will let you draw/edit on seperate PNG files as if they are one image? I'm suck at graphics, so I wouldn't have a clue where to start. Would Fireworks do this?
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Mon Jun 24, 2002 9:29 am    Post subject: Reply with quote

Well, after taking a quick look at the images.....

The file format of the PlanetMapIndexNormal.txt file is really simple.

Code:
File <File that images are stored in>
TextureSize <HeightWidth>
  #one value, so images must be square
Size <X> <Y>
  #in pixels (size of map)
Tiles <X> <Y>
  #how many tiles per column and row to make the map, respectively
MapRect <X_Start> <Y_Start> <X_End> <Y_End>
  #Note that the map in game has a small amount of black space
  #on the left edge, so the file shows the actual maprect as starting
  #at 23 for the small one and 56 for the large one
  #not sure on specific reason for this
FilePos <offset>
  #where png data for tile begins
  #must be as many FilePos lines as there are X_Tiles x Y_Tiles


So, with this data, you could easily paste all the tiles back together to form a complete map. Smile

Example, with Beaker's php map ripper, you'd get files for the small map that would go like:

Code:
101 105 109
102 106 110
103 107 111
104 108 112


I assume with the "normal" dir, they're probly setting up to allow you to choose custom maps with (or maybe independantly of) your skins.

Probly worth mentioning that while PHP can't deal with png images by itself, if you compile it with the --with-gd=PATH option, you could probly write a script that rips the images AND puts them all together to make complete maps in one shot. I don't personally have GD on my windows box at home and I'm too tired to write the script remotely right now and test it, but if nobody does it in the next day or so, I'll do it.

Hope any of this was useful to someone. Razz
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Mon Jun 24, 2002 9:51 am    Post subject: Reply with quote

One more note. I figure MapRect probly has something to do with the overlay coordinates used for displaying your position, mission locations, etc. Being that now they use more than one size of map, it allows them to line things up properly with any size map.

Code:
X_Coord_Max / (X_End - X_Start) = X_Resize_Factor


Using (X_Resize_Factor * X_Coord) + X_Start, you could take any in game coordinate and display it on any sized map.

(Pardon me, but it's late and I'm really tired, that might not even make any sense, but you get the general idea hopefully, you all seem to be reasonable coders Smile )

sample map:



I would have done the large one, but I did this one by hand. Open all the images by dragging them onto Fireworks (well, 101-112 anyway). Then just drag the images from their own windows to a new one that I made with the X and Y sizes from the txt file.

Goodnight. Wink
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Mon Jun 24, 2002 10:20 am    Post subject: Reply with quote

So, I'm still up working. Should REALLY go to sleep. Something just occured to me. If you're using windows and you downloaded the .zip version of PHP..... you already have the GD library. Rolling Eyes
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Mon Jun 24, 2002 10:37 am    Post subject: Reply with quote

http://www.php.net/manual/en/function.imagecopy.php

This is what you'd want to use. Create a large enough image and just use imagecopy() to copy the full 128x128 tiles to the new image at 128 pixel increments. :O

I refuse to actually write this tonight. REALLY going to sleep this time. Very Happy
Back to top
View user's profile Send private message
Beaker
Wannabe


Joined: 09 Jan 2002
Posts: 1456
Location: Seattle

PostPosted: Mon Jun 24, 2002 5:30 pm    Post subject: Reply with quote

do you really want to combine them? won't you have to uncombine them to put them back into a map file?

isn't there a program that will let you edit them as if they were one file?

I know there are web sites that have photo's that are really made up or more than one image. Surely there must be an editor that will simulate one large map but keep the files separate?
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Tue Jun 25, 2002 4:35 am    Post subject: Reply with quote

If you want to edit the map and put it back in, DEFINITELY put them together, then edit, the split.

Writing a script to seperate them is just as easy as writing a script to join them Smile

The added bonus is that Shocked you can edit them with ANY program. Very Happy
Back to top
View user's profile Send private message
Kir
Wannabe


Joined: 25 Jun 2002
Posts: 506

PostPosted: Tue Jun 25, 2002 3:01 pm    Post subject: Very easy, 5 days i made it Reply with quote

I've already splitted the PlanetMapGfxNormal.bin,
then rebuilded under Photoshop with layers.
Then i added Slicers to save each tile on incremented PNG format.
I have a .PSD to start with now.
I made a .BAT to concatenate all the files in a new .bin
I perform a Dir *.png > sizes.txt
I import it on excel and export the sizes of the files in the
PlanetMapIndexNormal.txt

That works fine Wink

http://www.efrance.fr/eqmaps/aoroot/data/AO_PlanetMap.jpg
Back to top
View user's profile Send private message
svensken
Wannabe


Joined: 06 Jun 2002
Posts: 112
Location: Sweden

PostPosted: Tue Jun 25, 2002 3:48 pm    Post subject: Reply with quote

Very Happy Really, really nice map! Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Beaker
Wannabe


Joined: 09 Jan 2002
Posts: 1456
Location: Seattle

PostPosted: Tue Jun 25, 2002 5:41 pm    Post subject: Reply with quote

Kir, does your new map work in the game or does the client balk and try to download a new map?
Back to top
View user's profile Send private message
Kir
Wannabe


Joined: 25 Jun 2002
Posts: 506

PostPosted: Tue Jun 25, 2002 7:01 pm    Post subject: Reply with quote

I noticed no problem. The map is independant from the skin file.
And the game doesnt overwrite the new .bin
On the test server that works very well for the moment.
I /pray FC to not change that when it goes live (maybe thursday).

I only modified the big map, the first part of the .bin file contains
PNG for the little map. I let it at it was.

If you have abilities to use photoshop 6 or above, i can post a link
to the .PSD i created.

Let me find a webspace (PSD are heavy).
Back to top
View user's profile Send private message
NeuralizR
Lamer


Joined: 31 May 2002
Posts: 23

PostPosted: Tue Jun 25, 2002 7:13 pm    Post subject: Reply with quote

Kir, that seems like an aweful lot of work when you can just run a single script to rip the map and build it into a single .png file. Then when you're done editing, you can run another script to take that single png and put the tiles back into the resource file.
Back to top
View user's profile Send private message
Kir
Wannabe


Joined: 25 Jun 2002
Posts: 506

PostPosted: Tue Jun 25, 2002 7:30 pm    Post subject: Reply with quote

I'm not enough experienced with photoshop scripts to do that.
But how many map will you do ? one, two ... ?
It takes me 2 minutes to combine then with a .bat

Here is the method:

- Make a backup of the two files in \cd_image\textures\PlanetMap\Normal
- Launch Photoshop 6+ and open the PSD
- View -> Show -> Slices (to display the tiles)
- You can work on new layers
- You can enable some of my layers i made invisible
- File -> Save for Web...
- Select Output as PNG-24-bit Files
- Click OK
- Photoshop will generate 72 new PNG Files in the directory
you choose for the webpage. Yes, photoshop create a webpage with
a table of 8x9 Tiles.
- Copy the Part1.bin in the folder \Images photoshop has created
- Use the Concat.bat in the folder \Images (Part1.bin + 72 Tiles are
combined)
- Perform a Dir *.PNG /on > sizes.txt
- Modify the Sizes.txt to copy/paste only filesizes (you can use excel to
merge the string 'FilePos ' in front of each data.
- Copy/paste this block of data in a copy of your PlanetMapIndexNormal.Txt
-Rename my newpack.bin in a new PlanetMapGfxNormal.bin

Enjoy Wink

My pack (i hope Lycos will not erase this file)

-- EDIT --

Arg, i have to find an other webspace... 5Mo needed...

BTW i added a little program i builded in 1995. It's a dos only program to
extract a part of a big file from the beggining, the end, at the middle when you know the offset and the size, or two offsets, etc...

Sorry, i've no time to rewrite it in VC7 with arguments on command line.


Last edited by Kir on Tue Jun 25, 2002 8:16 pm; edited 2 times in total
Back to top
View user's profile Send private message
Beaker
Wannabe


Joined: 09 Jan 2002
Posts: 1456
Location: Seattle

PostPosted: Tue Jun 25, 2002 7:33 pm    Post subject: Reply with quote

thanks, (I had to copy and paste the URL, direct clicking didn't work)

ps: hmm, seems like a corrupt zip file.

do you have a new PlanetMapGfxNormal.bin and index file? or a screenshot of your new map?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    HackersQuest.org Forum Index -> AnarchyOnline::General All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group