From The Mana World
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
This feature is for experienced mappers, so if you are a beginner.... Do a map without automapping first, that helps you understanding what problems might occur, and what we are talking about in here.
=What is the Automapping feature?=
=What is the Automapping feature?=
Guess you want to make a map, which looks this:
Guess you want to make a map, which looks this:
Line 19: Line 22:
How long does it take to make such an one-layer draft? 10 minutes?
How long does it take to make such an one-layer draft? 10 minutes?


=how to use it?=


The automapping feature needs to know how the tiles have to be setup, to create such an cave-wall.
=Quickstart=
So we got to create some rules how these walls are generated.
- get a version of tiled, which supports automapping feature
 
- get this data here: [[User:Argul/automapping/data]] or alternatively check the examples delivered with tiled
 
- open example_cave.tmx in the maps folder.
 
- edit the set layer with the existing tileset as you want.
 
- click automap


==create a new map==
- have fun
 
=Theory behind the automapping feature=
 
The automapping feature needs to know how the tiles have to be setup, to create the map.
So we have got to create some rules how the map should be generated.
 
These rules are compared to each possible position within the map, and there will be checked if the rule condition matches.
 
If the rule condition matches, the rule output will be applied to the map.
 
==Create a new map==
Create a new map.
Create a new map.
Save this map where ever you want.
Save this map where ever you want.
I suggest the  tmwdata/maps folder of the "tmwdata" project from our [[Git repository]].  
I suggest the  tmwdata/maps folder of the "tmwdata" project from our [[Git repository]].  


==setup rules.txt==
==the rules text file==
Within the same folder of your map there needs to be a textfile "rules.txt",  
Within the same folder of your map there needs to be a textfile "rules.txt",  
which contains pathes to rulefiles.
which contains pathes to actual rulefiles.


Check if there is such an file.
Example:
If not put something like this:
[[Media:Automapping_example_rules.txt]]
[[Media:Automapping_example_rules.txt]]


Line 40: Line 60:
The rules will be applied in that order as in this file.
The rules will be applied in that order as in this file.
So at first the rules in the very first line are applied.
So at first the rules in the very first line are applied.
At last the very last line rules are applied.  
At last the very last line rules are applied.


==setup the rules.tmx==
You can also put another textfile again, which holds the actial rules
[[Media:Automapping_example_rules1.txt]]
 
==structure the rules.tmx==
Now we need to make the rules with tiled and these rules need to be saved to the path given in the textfile of step 2.
Now we need to make the rules with tiled and these rules need to be saved to the path given in the textfile of step 2.


But first we need to identify these rules:
But first we need to identify these rules:


===structure of rules files===
===defining a rule===
Lets have some theory first:
There must be a TileLayer called '''ruleRegions'''.
In this layer you define regions, where the rules are found.


These rules files need this structure:
Each coherent region of the same tiles describe one rule.
These Tilelayers are needed:
 
- "ruleRegions"
It does not matter which tiles are used for describing where the region is, but these tiles must be all the same.  
In this layer you define regions, where the rules are found.
(decision is boolean: either there are tiles or not)
One coherent region describes one rule.
It does not matter which tiles are used for describing where the region is.
(decision is boolean: either there are tiles or not)
- "ruleSet"
===defining a precise condition===
Here you put the information, which condition must be matched, that this rule is applied.
A rule should only be applied to certain places in you map, where certain conditions are matched.
 
- layers describing the terrain in the rule.
These layers have the prefix "rule_"
In the "rule_XXX" layer you put the information how the terrain is
in the usual XXX layer.
 
 
==working on your map==
 
have fun with the automapping feature
 
=Example of rules: Rule_cave_002=
==some pictures==
[[Image:Example_cave.png‎|left|frame|this is what you might want to have. The lower border is in the Over-layer of course, The rest of the walls are in Ground-layer. The walls are unwalkable: The collision Layer must be set properly.]]
 
[[Image:Example_cave_set.png‎|center|frame|this is what you have to draw with automapping feature. All in one Layer, the special "Set" layer. and of course you need the proper rules.]]


[[Image:Example_cave_1.png|left|frame|After the very first rules we have the Ground set.]]
To define these conditions you can have '''ruleSet''' and '''ruleNotSet''' tile layers.
[[Image:Example_cave_2.png|frame|After the next rules we have the standard straight walls.]]


==explanation of the file, describing the rules==
There can be multiple layers with the same name, so multiple layers of '''ruleSet''' and '''ruleNotSet''' are possible.


In this section we will have a closer look to the rules:
Basically in '''ruleSet''' you can put the tiles which have to be matched, that this rule condition gets matched.


In '''ruleNotSet''' you can put the tiles which must not occur, so that the rule condition is true.


C - F describe layers of a rules file.
These tiles are directly above each other in the tmx file.
For better understanding here below each other.


C: Layer "rule_boxes" describes where the rule will be defined.
===defining the rule output===


D: describes which condition must be matched
We need layers describing the terrain in the rule.
(so whenever there are these 2 black tiles and then there is a red tile this rule is applied.)
So what output is expected to be put in the map, when this rule matches its condition?


E: is the "rule__Ground" layer, which means that such an leftwall-tile will be setup in the Ground-layer, when this rule is applied.
These layers have the nameformat '''rule<X>_<Y>'''.
So this is the prefix '''rule''', followed by a random character sequence (must not contain an underscore), followed by an underscore, followed by another charater sequence.


F: is the "rule__collision" layer which makes the wall unwalkable.
'''<Y>''' is the name where this layer information is copied to. So when you have a rule which should set up the "Ground" layer,
this layername should be "rule_Ground".


'''<X>''' gives the a unique name for a output possibility. It can be anything, even empty.
When there are different names found, this rule will have different output possibilites.  When the output consists of multiple layers, all layers of the same name are taken. The actual possibility (name) is then chosen by chance.


It would be enough to use only a 2x1 condition, but this works too of course.
=examples=
[[User:Argul/automapping/examplecave]]

Latest revision as of 08:30, 30 July 2011

This feature is for experienced mappers, so if you are a beginner.... Do a map without automapping first, that helps you understanding what problems might occur, and what we are talking about in here.


What is the Automapping feature?

Guess you want to make a map, which looks this:

Automapping example cave 1.png

So you have an idea how the form of the cave is. Now you must create this map. How long does it take? maybe an hour?

With the automapping feature you just draw the outline of the cave which looks like this:

Automapping example cave 2.png

What are the advantages?

- just one layer to edit
- just draw what you mean there should be (cave in the middle with a little sea)
- no need for drawing and combining many tiles for the wall. This is done automatically

So this feature generates from the given draft the cave. How long does it take to make such an one-layer draft? 10 minutes?


Quickstart

- get a version of tiled, which supports automapping feature
- get this data here: User:Argul/automapping/data or alternatively check the examples delivered with tiled
- open example_cave.tmx in the maps folder.
- edit the set layer with the existing tileset as you want.
- click automap
- have fun

Theory behind the automapping feature

The automapping feature needs to know how the tiles have to be setup, to create the map. So we have got to create some rules how the map should be generated.

These rules are compared to each possible position within the map, and there will be checked if the rule condition matches.

If the rule condition matches, the rule output will be applied to the map.

Create a new map

Create a new map. Save this map where ever you want. I suggest the tmwdata/maps folder of the "tmwdata" project from our Git repository.

the rules text file

Within the same folder of your map there needs to be a textfile "rules.txt", which contains pathes to actual rulefiles.

Example: Media:Automapping_example_rules.txt

Each line give a path to rules. This path can (should) be relative to the directory with rules.txt and your map. The rules will be applied in that order as in this file. So at first the rules in the very first line are applied. At last the very last line rules are applied.

You can also put another textfile again, which holds the actial rules Media:Automapping_example_rules1.txt

structure the rules.tmx

Now we need to make the rules with tiled and these rules need to be saved to the path given in the textfile of step 2.

But first we need to identify these rules:

defining a rule

There must be a TileLayer called ruleRegions. In this layer you define regions, where the rules are found.

Each coherent region of the same tiles describe one rule.

It does not matter which tiles are used for describing where the region is, but these tiles must be all the same. (decision is boolean: either there are tiles or not)

defining a precise condition

A rule should only be applied to certain places in you map, where certain conditions are matched.

To define these conditions you can have ruleSet and ruleNotSet tile layers.

There can be multiple layers with the same name, so multiple layers of ruleSet and ruleNotSet are possible.

Basically in ruleSet you can put the tiles which have to be matched, that this rule condition gets matched.

In ruleNotSet you can put the tiles which must not occur, so that the rule condition is true.


defining the rule output

We need layers describing the terrain in the rule. So what output is expected to be put in the map, when this rule matches its condition?

These layers have the nameformat rule<X>_<Y>. So this is the prefix rule, followed by a random character sequence (must not contain an underscore), followed by an underscore, followed by another charater sequence.

<Y> is the name where this layer information is copied to. So when you have a rule which should set up the "Ground" layer, this layername should be "rule_Ground".

<X> gives the a unique name for a output possibility. It can be anything, even empty. When there are different names found, this rule will have different output possibilites. When the output consists of multiple layers, all layers of the same name are taken. The actual possibility (name) is then chosen by chance.

examples

User:Argul/automapping/examplecave