Ryandor.com

Forums
It is currently Sat Apr 27, 2024 5:55 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 22 posts ] 
Author Message
 Post subject: Lava Transition Error
PostPosted: Thu May 18, 2006 3:12 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
Ok i have problems in the 3d not the 2d client with this
there are tiles that are lava that are sappose to be transition tiles
the transition tiles are always 2 of the jungle to grass tiles
2 of the mountain to dirt tiles 3 of the dirt to jungle tiles and one of the snow to water tiles. this happens in the regular osi maps aswell. is there anyway to fix this. or do i have to do all the work by hand?

It would be nice if there was a program that you could find and replace tiles by there tile ID.. that would help fix any errors.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 3:39 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
The problem is for some tiles, OSI 3d client no longer support them.
The only way I know for sure to eliminate that problem, is to restrict to the the terrain ids that are used by OSI. That may be considered limiting, however.

Anyay, I provided stormcrow a list of all the terrain ids used in OSI maps. We will have to wait to see what makes sense to do next.


Top
 Profile  
 
 Post subject: I know
PostPosted: Thu May 18, 2006 3:45 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
I know what tiles dont work. and i know what tiles work. what im asking. is there anyway to find and replace those tiles, a bit easyer then clicking on each one individually and guessing which ones do what. like i want to replace the bottom left corner peice of jungle to grass with id 0412 which is a transition that works in both clients. but the only way for me to do that. is to do it one by one. i want to know if theres a program that i can type in find tile id 0512 with 0412 and press start. and it does it for me. i cant imagine that it would be that hard to program for the illustrious punt hahahahah :P im playing but i you know what im saying do you have a program like that? or no go am i SOL :P

btw i love you punt hahha


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 3:57 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Actually at one time WorldMaker had a fine/replace. Not sure why i removed it.

But, regardless, you can fix it on your end, "kinda" easy.

Go to the mapgenerator 2 data/Transition directory. In those subdirectories, are the transistion files (the names are kinda of a give away).

Now, under any
Code:
 <Terrain>
entry, if you see a
Code:
<Tile ID=>
that matches the id of a bad one (the ids are in decimal, unless preceeded by a 0x), either replace the ID with a valid one, or delete it (if there are other
Code:
 <Tile ID=>
that are valid under that SAME
Code:
<Terrain>
entry. Then regenerate your map.


Top
 Profile  
 
 Post subject: here is the problem
PostPosted: Thu May 18, 2006 4:01 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
the problem is dude.. is that i kinda generated the map like 5 months ago. so now i have all the citys done and everything and im just looking for fix some small map errors. if I regenerate from the BMP ill loose all the roads i put in custom with worldforge later. thats why im looking for a find replace option for tiles. because otherwise im doing it by hand. for ever hahahah do you happen to have and old copy of worldmaker around that i can download that still has the find/replace? help me punt your my only hope :P o and i generated it with dragon. i didnt even know about Punts world tools then. so you see i kinda got stuck with the problem..


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 4:03 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Can you compile a C++ program?


Top
 Profile  
 
 Post subject: i have
PostPosted: Thu May 18, 2006 4:06 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
i have microsoft visual C++ i could install. i havent installed it after i formatted again. but i guess you didnt need to know that. ya i could compile it..


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 4:09 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Ok,so I understand correctly, you didn't make this map with Map Generator 2? I want to understand if the current data we have for that results in this situation.


Top
 Profile  
 
 Post subject: No
PostPosted: Thu May 18, 2006 4:15 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
I made this map with Dragon mod 11.

I started working on the map and completed alot of it before i realized a few things.

1.) all my jungle was forest. so i just used your map editor to make some jungle tree multi files and did most the jungle with those. easy fix..
2.) the transition tiles the bottom left jungle to grass tile, the top left jungle to grass tile 3 of the jungle to dirt tiles, 2 of the mountain to dirt tiles, and 2 of the snow to water tiles,. you also call them snow to dirt. there like hill transitions. all show up as LAVA. i can fix them because i can get the item ids and replace them. but doing it each tile at a time will take so long ill prob be dead before i finish. so i was looking for a way like i said to find and replace tiles. by tile ID.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 5:48 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Aug 07, 2003 6:57 am
Posts: 472
The lava-problem is probably related to the fact that some transitions only work in one client-type (either 2D or 3D), and show up as lava in the other :|

_________________
-= Ho Eyo He Hum =-


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 6:03 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Ok, I don't know where I posted this.
but, this program reads a file in that looks like this:

badtileid,goodtileid
badtiledi,goodtileid

it doesn't have any error checking, so I would add spaces, etc. The tileids are in decimal.

Now, the progam is executed like this:

tileswap tilefile mapmulfile
Where tilefile is the file described above, and the mapmulfile is the map#.mul you want to modify. Bot file names need to have their full location specified. You start the program from the command line!!!!

Make a BACKUP before you try this. UNTESTED.


Code:
#include <fstream>
#include <string>
#include <iostream>
#include <cstdlib>
#include <map>

bool convert(std::string &input, unsigned short &key, unsigned short &value)
{
   bool rvalue=false;

   std::size_t index=input.find(",");
   if (index != std::string::npos)
   {
      std::string first = input.substr(0,index);
      std::string second=input.substr(index+1);
      key=std::atoi(first.c_str());
      value=std::atoi(second.c_str());
      rvalue=true;
   }
   return rvalue;
}
int main (int argc, char *argv[])
{
   std::map<unsigned short,unsigned short> swaptable;
   char buffer[1024];
   int status=0;
   std::map<unsigned short, unsigned short>::const_iterator iter ;

   if (argc == 3)
   {
      std::string tilefilename = argv[1];
      std::string mulfile = argv[2];
      std::fstream tile;
      tile.open(tilefilename.c_str(),std::ios_base::in);
      unsigned short key,value;
      if (tile.is_open())
      {
         while (!tile.eof())
         {
            tile.getline(buffer,1024);
            std::string raw=buffer;
            if (!raw.empty())
            {
               if (convert(raw,key,value))
               {
                  swaptable.insert(std::make_pair(key,value));
               }
               else
                  std::cerr <<"Invalid line "   <<raw<<std::endl;
            }

         }
         // We have the swap buffer ready, now time to look at the data;

         tile.close();
         unsigned short tileid;
         char alt;
         int block=0;
         tile.open(mulfile.c_str(),std::ios_base::in | std::ios_base::out | std::ios_base::binary);
         if (tile.is_open())
         {
            std::cout <<"Processing " <<mulfile<<std::endl;
            while (!tile.eof())
            {
               // for every block
               tile.read(reinterpret_cast<char*>(&tileid),2);
               tile.read(reinterpret_cast<char*>(&tileid),2);
               std::size_t index;
               for (int c=0;c<64;++c)
               {
                  index = tile.tellg();
                  tile.read(reinterpret_cast<char*>(&tileid),2);
                  tile.read(&alt,1);
                  iter = swaptable.find(tileid);
                  if (iter != swaptable.end())
                  {
                     tile.seekp(index);
                     unsigned short ntile= iter->second;
                     tile.write(reinterpret_cast<char*>(&ntile),2);
                     std::cout <<"Tile in block " << block<<", cell " <<c<<" was " <<tileid<<" replaced with " << ntile <<std::endl;
                  }
               }
               ++block;

            }
            tile.close();
         }
         else
            std::cerr <<"Unable to open " << mulfile<<std::endl;
      }


   }
   else
   {
      std::cerr<<"Usage: tileswap tilefilename mapmulfile " <<std::endl;
   }
   return(status);
}



Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 6:16 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
And yes, the mapgenerator data is going to produce the same results.

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 6:17 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
If it is, is there a way to avoid using those tileids then?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 6:28 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
I doubt it, I think it as Xuri said that they are different for each, because the tiles I use are from the 2d map. I looked at it briefly at 1 point, but I never devoted much time to it; the 3d client is a total piece of shit. If someone were to provide proper tile ids that work in both clients (because the 2d client is what most of us use) then I'd be happy to modify the scripts.

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 8:13 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
There are some 2D transition tiles that come out as lava in the 3D client. They are the upper hex numbers.. I know snow to grass transitions are almost all lava.. hex#'s 0x5BF - 0x5E2.. not sure if all, or most.. there are also a few forest to desert.. I had this issue long ago too, and had to 'work around' the problem with alternative land tiles that both clients see.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject: Yes
PostPosted: Sat May 20, 2006 10:53 am 
Offline
Apprentice
Apprentice
User avatar

Joined: Thu May 18, 2006 3:08 pm
Posts: 36
Yes the tiles work in the 2D cleint but show up as Lava in the 3D client. i can fix them manually. which ive been doing but it takes a while. thanks punt for the program, ill give it a try. it happened when they changed ultima from 2D to 3D back in the day,. i was running a server during that transition so i remember when it originally occured.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 20, 2006 11:00 am 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
Dian wrote:
There are some 2D transition tiles that come out as lava in the 3D client. They are the upper hex numbers.. I know snow to grass transitions are almost all lava.. hex#'s 0x5BF - 0x5E2.. not sure if all, or most.. there are also a few forest to desert.. I had this issue long ago too, and had to 'work around' the problem with alternative land tiles that both clients see.


Well did you write down which tiles and send them to me dumbass? :P

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 20, 2006 1:14 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
Stormcrow wrote:
Dian wrote:
There are some 2D transition tiles that come out as lava in the 3D client. They are the upper hex numbers.. I know snow to grass transitions are almost all lava.. hex#'s 0x5BF - 0x5E2.. not sure if all, or most.. there are also a few forest to desert.. I had this issue long ago too, and had to 'work around' the problem with alternative land tiles that both clients see.


Well did you write down which tiles and send them to me dumbass? :P


Hell.. It was like, 2-3 years ago when I found this issue out.. and, no. I didnt write them down... I never write anything important down. takes too much time. :?

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 20, 2006 5:43 pm 
Offline
Grand Master
Grand Master

Joined: Sat Mar 12, 2005 3:29 pm
Posts: 414
Again, if we use the tiles in the valid tile list I posted, we should be fine for both clients


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 20, 2006 6:28 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
I'll do a compare.

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 21, 2006 12:05 am 
Offline
Journeyman
Journeyman
User avatar

Joined: Fri Sep 30, 2005 12:26 pm
Posts: 75
crazy xuri and your C++


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 21, 2006 12:31 am 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Aug 07, 2003 6:57 am
Posts: 472
O_o

_________________
-= Ho Eyo He Hum =-


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

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 37 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:  
Powered by phpBB® Forum Software © phpBB Group