Various WML questions about Terrain

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Various WML questions about Terrain

Post by Eleazar »

In this thread i'm working on enhancing several areas of terrain graphics. I've been away from Wesnoth for a while, and my previously shaky grasp of terrain WML is worse now, especially since features have changed. WML questions are, i think, getting lost among the pretty pictures, so i'm going to start posting them here were more people are likely to see them who know this stuff.


* Is there any approximately up-to-date documentation on terrain WML? browsing through the wiki, i just see stuff from 1.3 and 1.4.


* Rhyging designed a transition that works well (i believe) smoothing out the differences between tiles animating out of sync-- it's a rather abrupt transition which keeps too many details from getting blurred. It doesn't work well in transitioning from ocean to shallow, since it is far to quick. I'm afraid for optimal appearance we need 2 sets of non-land transitions a water-to-water-of-the-same kind transition, and a transition to blend with other types of water. We can do that, right?


* IN PROCESS: I think it would be more useful to convert several terrains like the windmill and the flowers to overlay only-- i.e. if you paint a windmill on the map it will go over whatever base terrain is there. I don't think this will cause compatibility problems with old maps... am i right?


Nevermind. Solved. * In trunk I don't see the windmill anymore-- it's in the editor, but on the map it look like plain grass. I don't think i did anything to it. Is it showing up in trunk? Did i accidentally mess up some WML?


* In trunk the base (ground) of the orcish castle makes a transition when next to a snowy orcish castle. It shouldn't since it's just 2 base tiles of the same type adjacent to each other. Not the most horrible thing in the world, but does anyone know how to fix that?


* In terrain.cfg some terrains have just a "name" tag, while others also have a "description" tag. Can someone explain what these two similar tags do? It seems that "name" is ignored with "description" is present -- at least i don't see where "name" is being used. When a "description" is present that's what appears in the upper right.


* For some terrains like cave wall, or chasm, the transition is the main thing. I'd like to eventually be able to make alternate images to be randomly chosen for these terrain, so they can get some random variation like normal terrains. Is this feasible?

More to follow...
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Various WML questions about Terrain

Post by Alarantalara »

Eleazar wrote: * Rhyging designed a transition that works well (i believe) smoothing out the differences between tiles animating out of sync-- it's a rather abrupt transition which keeps too many details from getting blurred. It doesn't work well in transitioning from ocean to shallow, since it is far to quick. I'm afraid for optimal appearance we need 2 sets of non-land transitions a water-to-water-of-the-same kind transition, and a transition to blend with other types of water. We can do that, right?

* For some terrains like cave wall, or chasm, the transition is the main thing. I'd like to eventually be able to make alternate images to be randomly chosen for these terrain, so they can get some random variation like normal terrains. Is this feasible?
I know both of these are possible. For the second, I suspect it would be easier if there were the same number of alternates for every transition image. Then the existing macros could just have a probability added. If there were different numbers of alternates it would still be possible, but possibly much messier.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: Various WML questions about Terrain

Post by Eleazar »

Alarantalara wrote:For the second, I suspect it would be easier if there were the same number of alternates for every transition image. Then the existing macros could just have a probability added.
Sure, no reason to make it more complicated than necessary. If equal numbers of transitions aren't available, just make some duplicate images which can easily be differentiated later.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: Various WML questions about Terrain

Post by Eleazar »

* What's the deal with villages? I can't change the base terrain on any of them with the editor. How come i can put whatever base i want under forests but not villages? And if i use a text editor to change the color of the grass under a village, the map will no longer load. This kind of ruins the appearance fall and pre-snow winter maps when most villages sit on a spot of bright green grass, and everything else is dead.


* This wall doesn't transition nicely with anything that sticks up. There's your example of a terrain that floats.
I think the problem is in the macros, i can't fix it.
Image
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Various WML questions about Terrain

Post by Alarantalara »

I don't know what's up with your second problem. It seems to work fine in 1.8.0.
tree with wall.png
tree with wall.png (81.04 KiB) Viewed 2915 times
I can get the villages to work, but I want to play around a bit since many of them are specialized for things like snow or hills and I want to make sure they stay somewhat limited.

Here's why I want to experiment a bit first:
unrestricted housing.png
unrestricted housing.png (139.8 KiB) Viewed 2915 times
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Various WML questions about Terrain

Post by Alarantalara »

Okay, it's done. Attached is a new terrain.cfg file. It contains all the changes to make all of the villages placeable on anything. Just replace the one in core.

This does mean that you can get villages on water. I have set suitable defaults for all terrain, so if you want an alternate base you have to shift-click with the village to get it. This stop villages from appearing on water unless you really want them to.

However, I left the merfolk villages alone, since they only take their movement/defense from water for some reason, so putting them elsewhere doesn't make sense at the moment.

There is a gameplay side effect of this change: All units now get the best of flat and village in villages on flat ground, rather than only village as before. I expect it won't have too many actual effects.

EDIT: I found a typo in human snow villages. Corrected. Also added picture to show what it looks like.
Attachments
villages.jpg
terrain.cfg
(28.25 KiB) Downloaded 245 times
Last edited by Alarantalara on May 7th, 2010, 3:21 pm, edited 1 time in total.
User avatar
doofus-01
Art Director
Posts: 4131
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Various WML questions about Terrain

Post by doofus-01 »

Eleazar wrote:* This wall doesn't transition nicely with anything that sticks up. There's your example of a terrain that floats.
I think the problem is in the macros, i can't fix it.
I ran into a similar problem, but never found an answer as to how things get layered. http://forum.wesnoth.org/viewtopic.php?p=410769#p410769
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: Various WML questions about Terrain

Post by Eleazar »

Alarantalara wrote:I don't know what's up with your second problem. It seems to work fine in 1.8.0.
I'm running 1.8 with the terrain WML and images from trunk. Animation works differently, and there may be other unexpected differences. If what i see is not what people running the trunk see, i can ignore it. It's also possible (but i think unlikely in this case) that i messed something up accidentally in trunk.

Alarantalara wrote:There is a gameplay side effect of this change: All units now get the best of flat and village in villages on flat ground, rather than only village as before. I expect it won't have too many actual effects.
Thanks for looking into this. You did the right thing opening a post in the ideas tread.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Various WML questions about Terrain

Post by Alarantalara »

There is a gameplay side effect of this change: All units now get the best of flat and village in villages on flat ground, rather than only village as before. I expect it won't have too many actual effects.
Scanning the units shows me that there are only two consequences as a result of this: Bat defense of 40% in villages no longer matters, since they get 60% everywhere else and Naga Myrmidons get 50% defense instead of 40% in villages. The second effect is trivial (and possibly desired), while the first has much more serious consequences as it will dramatically affect multiplayer.

I'll see if I can coerce the WML into having flat be only village while everything else is the combination. Then we get everything. Failing that, the only way to get what you want is to create a huge number of terrain types and be forced to choose both village type and base terrain at the same time.

Edit: I can get it as close to working as needed. It only takes one village terrain type for every flat terrain type + one more for everything else for each village. It's a lot of extra types, but I can hide them all from the editor, so it won't be cluttered. It will triple the size of terrain.cfg, so it might be preferable to have the "only village" option only for the default terrain for each village. This will preserve all existing behaviour while still allowing placement of villages at will.
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Various WML questions about Terrain

Post by Alarantalara »

I submitted a patch (sadly in the wrong format due to impossible connection speed) to gna that allows for non-merfolk villages to be placed everywhere without changing gameplay. Macros are my friend.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Various WML questions about Terrain

Post by Boucman »

Eleazar wrote:
* Is there any approximately up-to-date documentation on terrain WML? browsing through the wiki, i just see stuff from 1.3 and 1.4.

not that I know of, I use it as the base for what I looked for... I havn't looked deeply at the code yet
Eleazar wrote:
* Rhyging designed a transition that works well (i believe) smoothing out the differences between tiles animating out of sync-- it's a rather abrupt transition which keeps too many details from getting blurred. It doesn't work well in transitioning from ocean to shallow, since it is far to quick. I'm afraid for optimal appearance we need 2 sets of non-land transitions a water-to-water-of-the-same kind transition, and a transition to blend with other types of water. We can do that, right?
we sure can, the code is at line 583 in current trunk, you just have to double that line and change the filters a bit...
Eleazar wrote: * IN PROCESS: I think it would be more useful to convert several terrains like the windmill and the flowers to overlay only-- i.e. if you paint a windmill on the map it will go over whatever base terrain is there. I don't think this will cause compatibility problems with old maps... am i right?
even if it does, it might be worth doing some small compatibility changes, we are early in 1.9 so we have time to upgrade, and if we don't do it now we never will

Eleazar wrote: * In trunk the base (ground) of the orcish castle makes a transition when next to a snowy orcish castle. It shouldn't since it's just 2 base tiles of the same type adjacent to each other. Not the most horrible thing in the world, but does anyone know how to fix that?
IIRC the two base tiles don't look good next to each other and do need a transition. However you've tweaked that area recently and it might not be the case anymore

in any case, I think line 467 is responsible for that transition
Eleazar wrote:
* In terrain.cfg some terrains have just a "name" tag, while others also have a "description" tag. Can someone explain what these two similar tags do? It seems that "name" is ignored with "description" is present -- at least i don't see where "name" is being used. When a "description" is present that's what appears in the upper right.
A quick scan of the source, I couldn't find any reference to description, i'll keep you posted...
Eleazar wrote: * For some terrains like cave wall, or chasm, the transition is the main thing. I'd like to eventually be able to make alternate images to be randomly chosen for these terrain, so they can get some random variation like normal terrains. Is this feasible?
most likely yes, I'd have to look a bit more, but simply adding a probability at the right place should do it, and missing images should be fine, so no problem if we don't have variations for everything
Fight key loggers: write some perl using vim
Exasperation
Posts: 462
Joined: June 8th, 2006, 3:25 am

Re: Various WML questions about Terrain

Post by Exasperation »

Boucman wrote:
Eleazar wrote:
* In terrain.cfg some terrains have just a "name" tag, while others also have a "description" tag. Can someone explain what these two similar tags do? It seems that "name" is ignored with "description" is present -- at least i don't see where "name" is being used. When a "description" is present that's what appears in the upper right.
A quick scan of the source, I couldn't find any reference to description, i'll keep you posted...
There is a reference in the wiki; TerrainWML says:
# name: the name of the terrain, a translatable string used for the display of terrain type in the game and the map editor
# description: (Development version only) the detailed description of the terrain, a translatable string used for the display of terrain type in the game and the map editor. If this is not present, the game and editor will fall back to the name attribute. The difference is that the name tends to describe the game effect of the terrain type (e.g., "Forest") but the description attribute also carries information about visual subtype (e.g. "Summer Deciduous Forest").
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Various WML questions about Terrain

Post by zookeeper »

Alarantalara wrote:I submitted a patch (sadly in the wrong format due to impossible connection speed) to gna that allows for non-merfolk villages to be placed everywhere without changing gameplay. Macros are my friend.
You probably got the e-mail notification from my reply to the patch comments, but for anyone else interested: I wrote a bit of a different solution to the problem. It requires all maps using some of the hills, snow hills and mountain villages terrains to be converted using wmllint because it involves some necessary terrain code changes, but it's something I've wanted to do before and which should make things work in a bit cleaner manner. It also doesn't have gameplay changes, except for a few snow hills villages which were incorrectly aliasing to just hills instead of snow hills and which I fixed.

Also, about villages aliasing to flat,village: it does have a notable gameplay effect, namely bats. Personally I'm all for making villages alias to base,village in the name of consistency, but it does require the MP crew to rebalance bats (possibly some mounted units too?) accordingly. The current behaviour is confusing, since bats get 60% defense on hill villages (because they alias to hills,village) but 40% on normal, flat villages (because they do not alias to flat,village), but we can't change it just like that since it's a major aspect of the undead faction's MP balance.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: Various WML questions about Terrain

Post by Eleazar »

When we added in the new water, i thought the more turquoise blue was nice, but not something we would want everywhere, so now there are 2 animated shallow water terrains, one matches the color of our old water and one looks tropical.

So currently the terrain code for ordinary shallow water is "Ww" and for tropical it is "Wt". Wt is an alias of Ww. It's quite possible we will add more alias of shallow water in the future, for instance brown, muddy water or ripple-less cave water.

Would it make WML easier if all shallow water terrains started with "Ww..." so wildcard matching can be used, or is this not important? It would be most convenient to switch this before too many maps use Wt.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Various WML questions about Terrain

Post by zookeeper »

Eleazar wrote:When we added in the new water, i thought the more turquoise blue was nice, but not something we would want everywhere, so now there are 2 animated shallow water terrains, one matches the color of our old water and one looks tropical.

So currently the terrain code for ordinary shallow water is "Ww" and for tropical it is "Wt". Wt is an alias of Ww. It's quite possible we will add more alias of shallow water in the future, for instance brown, muddy water or ripple-less cave water.

Would it make WML easier if all shallow water terrains started with "Ww..." so wildcard matching can be used, or is this not important? It would be most convenient to switch this before too many maps use Wt.
I don't think it's very important, but yes, I'd rather see tropical water as Wwt than Wt. Even reef and ford use Ww* codes, so I think that any direct alias of shallow water should do so as well.
Post Reply