Ryandor.com

Forums
It is currently Fri Dec 14, 2018 12:33 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Jul 02, 2009 1:16 am 
Offline
Newb
Newb

Joined: Wed Jun 24, 2009 12:57 pm
Posts: 4
Transitions are the tiles used to transition (duh) from one terrain type to another, for example grass to sand. As the users of mapgen2 have most likely noticed all of the terrain types don't have transitions even though the graphics would be available. Lack of transitions for certain terrain types results in buggy tiles which have to be repaired manually thus adding more work to the already overwhelming practice.

I began studying transitions a few days ago and noticed that their working mechanism is pretty simple and surely known to some of you. Regardless I didn't notice a topic like this or other transitions being shared than the ones for beach.

The following is a very basic transition "Grass to Forest" and can be found in the data/transitions folder of mapgen2. The files are .xml and I recommend using notepad or a similar program for viewing them.


<Trans Name="SANB" HashKey="404040303030303030" >
<Terrain>
<Tile ID="200" AltIDMod="0" Weight="1"/>
<Tile ID="201" AltIDMod="0" Weight="1"/>
</Terrain>
</Trans>


Trans name: self-explanatory, I haven't noticed that this would affect actual results on the map.


Hashkey: This is the soul of the transition. Every two digits/symbols represent a type of terrain on the map, these types are then used to define which kind of tile would fit in the spot.

The hashkey in the example has forest and grass type terrains; 40 representing forest and 30 of the grass. The hashkey is read from left to right, filling 3 rows with 3 sets of figures.

N
404040
W 303030 E
303030
S

That is how the hashkey would look if laid on a map, the middle tile being the one to be transitioned. So in actual graphics we would see a tile with grass on the south end and forest on the north end appearing at such a spot. The different hashes (2-digit figures/symbols) can be found from terrain.xml in the data folder.


Tile ID (terrain): Just what it sounds like, the identifier for the graphics to be filled in the middle tile. These are LANDTILES, you can check them out with a program like Uofiddler for example.


AltIDMod (terrain): Altitude for the landtiles to be created at.


Weight: When using several tiles the chance for a certain tile to occur, these are added so in the example it's 50% chance for each of the tiles to appear.


There is also Tile ID for art which is pretty much any item in the game. Art tiles allow one to create an extra tile - this is useful because one can't have more than one landtile in one tile. Art tiles in transitions are mainly encountered with coastal transitions, creating water over the brownish landtiles underneath. AltIDMod applies to art tiles in the same way it applies to landtiles.

Basically creating transitions is quite an easy task, especially if you trust the numerous examples in the data folder. Now this has been made even easier.. I requested a player with coding experience to create this simple program to ease our burden. I managed to create jungle embankment to jungle -transitions in less than 30 minutes.

http://jesuz.no-ip.org/bone/files/Mapge ... placer.zip

The tool is less than 24 hours old and will probably receive some more refining but even though the community isn't too active I felt like the prototype should be out there as soon as possible. It is very easy to use, one just pastes the transition file of such type that he wants to modify into something else into the program and inserts which old values will be changed into new.

Basically if you want to do transitions for snow embankment for example you just look up forest embankment in the data and fill in the spots with hashes of snow and snow embankment. Then just do the same for graphics (you'll have to use UoFiddler or something to figure out which are to be replaced with what). Save your transition as .xml to the transitions folder, generate your map and laugh at how easy it all was.

I hope that the transitions spawned by this topic and the tool would be given for the community to use - sharing information helps us to keep this "subculture" alive.

Any comments and added information to the topic is more than welcome.

~Bonethor of the Northern Winds shard.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 11, 2009 7:29 pm 
Offline
Newb
Newb

Joined: Sat Jul 11, 2009 7:27 pm
Posts: 3
i only have one question. I already had made a new transition, but i want to add new tiles, like a cave with snow, how can i do this?

PD: Good job, this tutorial is really usefull


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 13, 2009 6:51 pm 
Offline
Newb
Newb

Joined: Wed Jun 24, 2009 12:57 pm
Posts: 4
Nice to hear that this has been of some use!

I'm not quite sure what you exactly mean by adding new tiles, if you wish to create a new ground type you'd have to create the graphics for that and put it on your server with some mul editing program.. So you'd have to search for topics on that.

This link is somewhat dated but it describes the process rather well.
http://sorea.profitux.cz/patching/#purpose


If you already have the graphics you want to use, then you simply just change the TileID's to corresponding values - here's an example from the common.xml in the transitions folder:


<Trans Name="Mountain Cave" HashKey="C0C0C0C0C0C0C0C0C0">
<Terrain>
<Tile ID="556" AltIDMod="30" />
<Tile ID="557" AltIDMod="30" />
<Tile ID="558" AltIDMod="30" />
<Tile ID="559" AltIDMod="30" />
</Terrain>
<Art>
<Tile ID="1339" AltIDMod="0" />
<Tile ID="1340" AltIDMod="0" />
<Tile ID="1341" AltIDMod="0" />
<Tile ID="1342" AltIDMod="0" />
<Tile ID="1343" AltIDMod="0" />
</Art>
</Trans>

As you see it's the mountain cave, the roof being generated as normal terrain at a certain height. Now if you were to change your cave to a snowy one all you'd have to do is to edit the tile ID's of <Art> to snow instead of dungeon floor. Of course to draw this kind of terrain you also need to define it in the terrain.xml.

Here's a row from the terrain.xml

<Terrain Name="Mountain Cave" ImgIndex="192" Hash="0xC0" Tile="581" Red="100" Green="95" Blue="0" BaseAltIndex="208" />

You need to check that you have an ImgIndex which is free of any colour and assign it for a certain terrain. You will then define the hash it's going to use. Since you're not modifying the actual terrain in any way but only the art in this case it'd suffice to use the same hash.

Input the correct tile and the RGB values that you wish to use alongside with the basealtindex and you're set. Generate new swatches and draw away.


P.S.
The mapgen way of making caves is extremely rude in nature, making the mountain above always that 30z higher. If anyone has any ideas on how to tie the <Art> to a certain altitude so the mountain would follow the lines you've drawn but the cave inside would be flat.

Of course some people may want to do it the other way, but I feel this would be the simplest option.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 15, 2009 8:52 am 
Offline
Newb
Newb

Joined: Sat Jul 11, 2009 7:27 pm
Posts: 3
I have tried that before but I can't find any free colour and imgindex, I must create one new? I tried that but didn't works, do you have any example? Other thing that I want to make is a empty tile, with anything, is it possible? i have tried to change the no-draw, but it create an object and i don't want anything because I want to create stairs to go down create secrets rooms, or dungeon entrance, and I don't want anything down like change altitude and create it with mapgen.


PD: Sry for my English :oops:


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

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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