Ryandor.com

Forums
It is currently Thu Mar 28, 2024 4:58 am

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 25 posts ] 
Author Message
PostPosted: Sun Oct 29, 2006 5:19 am 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I'm trying to convert some Dragon maps into Map Generator maps. It's been a real pain and has been very time consuming since the color pallettes are different. Any ideas on the most efficient way to do this would be appreciated.

I'm not worried about statics or decorations. I basically just want to get Map Generator compatible files for the terrain for further editing and tweaking.

Any ideas for conversion methods? I've tried to pull the Dragon maps into a Map Generator BMP so that I can manually convert the colors, but when I do that all of the colors go wonky due to the different pallettes - its hard enough to do this by hand, but when I can't compare the Dragon color tables to the ones on the map its virtually impossible.

I've tried converting the Dragon maps to MULs and then using Map Generator's MUL2BMP to generate the terrain and altitude files. But unfortunately the resulting BMPs just come out as a mess. Just a blur of random colors all over the BMP. Is Map2Bmp working at all? Or is there something causing this result?

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 8:16 am 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
If someone would post a mapping of Dragon pallette numbers to the two palette numbers in MapGenerator, I can write a little program to do that.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 11:10 am 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
Do you mean the RGB values of each pallette color?

-Goldrush
*******


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 1:18 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I believe so.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 1:25 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Punt,

Quick questions - are Map Generator's altitude and terrain XML files compatible with UO Landscaper?

I'm asking because if they are, could your old Map2Bmp utility written for UO Landscaper do the job?

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 1:32 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Also, what format should the conversion table be in? I'll try to marry up the color tables of Dragon Mod 9 Plus and Map Generator.

Or alternately, you could write a program that reads from an XML file or something and then just give me the format to populate.

OR just complete Map2Bmp in Map Generator, that would pretty much solve all conversion issues. :)

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 1:52 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
THe utility for UO Landscaper is data driven. So you can set it to make it compatable *grin* (assuming it isn't).

I undertand the data driven, but have no idea of the Dragon format (guess I could just define a format, and let someone bulid it onetime).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 2:05 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
For dragon it depends on which version of the transition files are used.

The most popular seems to be "Mod 9 Plus".

If you go to http://www.ryandor.com/files there is a file there called Dragon Mod 9 Plus. Inside the zip there is a graphic with the Mod 9 color tables.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 2:43 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
yes, but you see.....

Nevermind, suffice to say I am incredibly lazy for things I don't even use.


Let me see, I think the easiest thing is for me to create a utlity that takes a dragon.bmp , altitude.bmp,terrain.bmp images (the last to made via mapgenerator), and a conversion file, and update the two bmps. The conversion file will be the format:

index = terindex,altindex


Would that work for people?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 3:16 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I was going to post the colortable here but either the forum doesn't do attachments or I dont have permissions to do attachments. :(

Dragon only has 1 .bmp file, it uses one color table for both terrain and altitude. The altitude and terrain are all in the same map file.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 3:23 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Yes, I am aware of the single color map. That is why I had:

index = terindex,altindex

Index is the dragon index.

Really, this would be great program for any aspiring QT programers to do (don't even need QT, but it hides the internals of a BMP file from one if one did).

So any takers? I can of course consult. If none, I guess I could write it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 10:07 am 
Offline
Young
Young

Joined: Sun Jun 13, 2004 9:54 am
Posts: 16
Location: Gothenburg, Sweden
If I were to make a dragon bmp into a mapgen one I'd do it the simple yet
effective way.

Photoshop all the way.
Just open up the Dragon bmp map and use the magic wand to mark all the
grass (all the different elevations of it)
Then use the invert marking option, that way you'll keep the exact same
position. And simply move the marking over to a empty bmp to be used for
Maggen. Invert the marking again so its back to normal and fill in the correct
color. Redo the same steps for all the different land tiles. Then use the same
method to create the altitude file.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 1:53 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Punt, here's an idea.

Why not whip together a utility that will read a Map Generator 2 XML file, and output the results to an XML file that is compatible with your old Map2Bmp utility for UOL?

If you did this, then essentially your old Map2Bmp tool could be used with any Map Generator 2 transition sets to convert MULs to Map Generator 2 compatible bmps! That would allow us to convert ANY maps made with other tools into files we could use with Map Generator 2.

I was comparing the 2 XMLs and it seems like it should be fairly easy. For reference, here is a standard entry for terrain from the Map2Bmp tool:

Code:
   <Terrain Name="Rough Sand" ID="129" TileID="22" R="200" G="191" B="51" Base="88" Random="True" >
      <Tile ID="26"/>
      <Tile ID="27"/>
      <Tile ID="28"/>
      <Tile ID="29"/>
      <Tile ID="30"/>
      <Tile ID="31"/>
      <Tile ID="32"/>
      <Tile ID="33"/>
      <Tile ID="34"/>
      <Tile ID="35"/>
      <Tile ID="36"/>
      <Tile ID="37"/>
      <Tile ID="38"/>
      <Tile ID="39"/>
      <Tile ID="40"/>
      <Tile ID="41"/>
      <Tile ID="42"/>
      <Tile ID="43"/>
      <Tile ID="44"/>
      <Tile ID="45"/>
      <Tile ID="46"/>
      <Tile ID="47"/>
      <Tile ID="48"/>
      <Tile ID="49"/>
      <Tile ID="50"/>
      <Tile ID="68"/>
      <Tile ID="69"/>
      <Tile ID="70"/>
      <Tile ID="71"/>
      <Tile ID="72"/>
      <Tile ID="73"/>
      <Tile ID="74"/>
      <Tile ID="75"/>
  </Terrain>


Here is a standard altitude entry for altitude.xml from Map2Bmp:

Code:
  <Altitude Key="239" Type="Other" Altitude="115" R="201" G="0" B="201" />


It seems like all the info you would need for Map2Bmp can be extracted from Map Generator 2 xmls.

What do you think? Someone of your ability could probably toss this together in 5 minutes!

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 12:40 am 
Offline
Journeyman
Journeyman

Joined: Mon Sep 19, 2005 6:07 pm
Posts: 109
Awesome, this would definately help with converting our Dragon maps over to Map Gen 2. It would be great!

_________________
Demuria Studios


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 12:30 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I haven't heard from Punt, so I'm taking a shot at writing this myself. I can write this application, but it just takes me a LOT longer than it would take a more experienced programmer. :) I'm not kidding when I said Punt could probably write this in his sleep. :) Me, I have to figure it out as I go and reference a lot of tutorials.

So far I've figured out how to read the Map Generator 2 XML. I'm working on the code to write it back to a bmp2map XML. Then I'll do the altitude files.

As soon as I have something usable I'll post it! Probably by the end of the week.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 1:51 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Hot damn, I've got the altitude file conversion done. :)

That part was pretty easy, the 2 XML file formats were pretty much the same except for the element attribute names.

I have probably learned enough to read/write the XMLs to get the terrain file conversion done now.

Making progress!

Of course, there may still be some problems - I've been told that Map2Bmp works pretty good for UOL but I have no ability to change any of the inner workings of that program. Plus any problems with the Map Generator 2 terrain and altitude XMLs will carry over into the Map2Bmp conversion.

The proof will be in the pudding, which will be:

1. Converting the Map Generator 2 terrain and alt XML's to Map2Bmp format with my new utility.

2. Then using Map2Bmp on a map0.mul to create Map Generator 2 image files.

3. Re-compiling those Map Generator 2 image files back to MUL.

Punt, do you remember if there were any limits on the map sizes hard coded into Map2Bmp?

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 3:34 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Well, no, I don't recall, but there probably is.

First I think it is great that you took this up. We need to get more active coding by others, and this is just fantastic news. Something about teaching a man to fish....

Now, your approach is fine, but there is a big "but". The advantage of taking he dragon bmp to mapgenerator bmp is the set of variables (palette index) is controlled. Mul2bmp only worked if the map was made from UOL to begin with (and even then, there where a few issues). That is because the xml could/did not account for every possible tile.

So as long as you understand that constraint, I think you have a good thing coming (personally, I would do the bmp to bmp conversion).

As a matter of curiousity, are you using QT?

One of the reasons I have been relatively quiet, is I am been rebulding all my computers. Probably wont be stable for a few more weeks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 4:55 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Hi Punt!

The XML conversion program is coming along great, I will probably finish it up tomorrow. The program is pretty much done, all of the conversion stuff is done and working, right now I'm just inputting a lot of boring tile data from the Map2Bmp XML so that my program will build it into its output file. It's a little sloppy and I'm sure there are some things I could have done better or more efficiently - but I was in a hurry. :) And it should work.

Basically it just reads the Map Generator 2 altitude and terrain XML and converts the values in it to their corresponding Map2Bmp XMLs. I figure that in this way, Map2Bmp should be able to produce Map Generator 2 ouput bmps since the color tables will be the same. I'll be able to take it for a test drive tomorrow and see how it works out.

I figured that Map2Bmp probably won't give bmps that are 100% accurate, especially for more complex maps, but hopefully it will be good enough to output BMPs that are somewhat close in order to convert from other formats and then touch up for Map Generator. I'm trying to make the switch without losing all of my work from Dragon.

I've never messed around with manipulating graphics files programmically before so I was a little unprepared to dive into something like that. I've also never used QT and I struggle a little bit to program using DLL's as I haven't done a lot of that either. (I know I know you never get better until you try! :) But for the purpose of this I thought it would be a good quick down and dirty type of project that some people may be able to use).

I'm writing the code in C#. It will be my first standalone C# program heh. C# has some great functions built in for reading and writing XML so a lot of it was just boning up on how to use them.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 6:17 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Ok, it is a tad more complicated then that, to truely convert it.

The terrain.xml for instance, shows a single tileid to a palette id. however, if one is converting a mul made from that file, then any of the tileids for the transistions that are possible are also tileids that should be mapped to that palette id (and thus the potential for duplication). So something to think about.

QT has a wonderful XML reader as well *grin*


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 11:56 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Well I noticed that the original Map2Bmp terrain files have a number of tiles listed for some terrain types - that is the data I am duplicating in my program. So hopefully it should work at least as well as the original Map2Bmp transition files worked.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 3:26 am 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Ok, the utility is completed. I'll take it through a test run when I get home from work this evening.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 4:19 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Just an update for those who are interested:

The utility seems to work fine. There is a *possible* issue with the altitude file, it works ok but doesn't match the color table that is provided with Map Generator 2. I need to take a closer look to see if its a problem on my end, or if the source xml's just don't match with the color table that is provided with the program.

The only problem I've encountered is that the stock Map Generator 2 archive is missing a lot of transition files. But that is not really an issue with this utility, you would need the transition files to compile *any* map with Map Generator 2.

SO - I am going to take a few days to iron out any glitches and tidy things up, and then I'll release it here in a few days.

---

Just to recap:

This utility, combined with Mul2Bmp, will let you decompile a Map0.mul into Map Generator compatible image files. This way you can convert maps designed for other utilities (Dragon, UO Landscaper, etc.) to Map Generator 2 - or create Map Generator 2 images from any mapX.mul supported by Mul2Bmp. (It definately supports the older Map0.mul format, I need to check to see if it works with other map files or the newer Map0.mul format).

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 12:20 pm 
Offline
Journeyman
Journeyman

Joined: Mon Sep 19, 2005 6:07 pm
Posts: 109
Awesome work! Thanks for taking this up HellRazor, I'm going to greatly appreciate this work, since it helps out a lot.

As far as the transitions for MapGen2, what is done with them, what isn't? Maybe we should start a thread to track and possibly complete the transitions. Then maybe have a mod type thread where people have created their own styles of transitions that they probably might want to share.

Just an idea of course.

_________________
Demuria Studios


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 3:11 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I posted over at the Worldmaker site but no one has replied yet. :( I've got to say the map making community sure is getting quiet lately, I hope there are people still alive out there! Maybe I'll start a thread here. I know some people have made their own transitions, I would like to start filling in all those blanks so we can have a complete transition package to go with MapGen2. Right now I'm finding that MapGen2 isn't really usable - not because of the program, but because no one has ever finished the transitions. :(

SO - needless to say, we are looking for volunteers to help finish Map Gen 2 transitions.

---

Oh, yeah, so far as the Mul2Bmp altitude problem goes (the problem I mentioned above where the altitude maps all come out in shades of purple) - that appears to be an issue with Mul2Bmp.

The altitude.xml for Mul2Bmp is broken out into regions with a different color for each terrain type. However, it looks like this feature was never fully implemented, because as near as I can tell, Mul2Bmp scans the entire map as "Other" terrain (i.e., it doesn't distinguish between water, land, or other types of terrain that are set up in the altitude.xml). Which basically means it is using 1 series of colors for the entire map. SO - the altitude map comes out in shades of purple (or I guess shades of whatever colors you decide to use for each z plane under "Other" in altitude.xml).

The altitude.bmp works fine in Map Gen 2. Its just difficult to edit. But you can always go in and manually fix it in your paint program if you want to have a different color for different terrain types the way that Map Gen 2 allows you to do.

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 2:57 pm 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
Ok, I finished the program and even gave it a GUI instead of leaving it as a DOS command.

You can find it at this thread:

http://www.ryandor.com/forum/viewtopic.php?t=3125

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group