How does wesnoth tiling system work?
Moderator: Forum Moderators
How does wesnoth tiling system work?
As an experiment, I attempted to display wesnoth maps in the browser. As I was doing this, I was surprised by the involved complexity. This WML graphics with all its macros look crazy! ;P
What I don't understand though is why some tile transitions are "border based", like most terrain. While others are "corner based" like castle. ...I mean, is it even possible that a castle has two different towers on the same side?! Same goes for chasms apparently.
Is there a reason these are handled differently that I'm missing? ...or is it just some kind of historical artifact/accident?
Also, some things are a bit muddy to me, for example the water. When I look in the images folder, there are three types of water: gray, default and tropical. However, only the "tropical" one has wave animations and border transitions in the image folder. What about the two others? Are the different waters the result of applying some program-side coloring over the same images? Also, when I draw water next to grass in the editor, I see different kind of borders ...but where do these images come from? They are not in the same directory.
What I don't understand though is why some tile transitions are "border based", like most terrain. While others are "corner based" like castle. ...I mean, is it even possible that a castle has two different towers on the same side?! Same goes for chasms apparently.
Is there a reason these are handled differently that I'm missing? ...or is it just some kind of historical artifact/accident?
Also, some things are a bit muddy to me, for example the water. When I look in the images folder, there are three types of water: gray, default and tropical. However, only the "tropical" one has wave animations and border transitions in the image folder. What about the two others? Are the different waters the result of applying some program-side coloring over the same images? Also, when I draw water next to grass in the editor, I see different kind of borders ...but where do these images come from? They are not in the same directory.
Re: How does wesnoth tiling system work?
Yes, it's pretty unfeasible to try to implement a browser-based renderer that could draw terrains exactly the same way, without actually re-implementing the whole terrain builder engine and WML parser/preprocessor.
It's difficult to give a short explanation, but it's basically because something like castle or chasm simply cannot be drawn using the transition style that terrains like grass/snow/hills/etc use. Castle walls get drawn both on the castle hex as well as the adjacent non-castle hex, whereas grass transitions get drawn only on the adjacent non-grass hex; this means grass transitions can be drawn in a much simpler way using images, whereas castle walls need corner-based images to allow convex and concave corners to connect seamlessly.dagnelies wrote: ↑June 2nd, 2018, 8:01 amWhat I don't understand though is why some tile transitions are "border based", like most terrain. While others are "corner based" like castle. ...I mean, is it even possible that a castle has two different towers on the same side?! Same goes for chasms apparently.
Is there a reason these are handled differently that I'm missing? ...or is it just some kind of historical artifact/accident?
The relevant images for the current (1.14) water are ocean01-21.png for deep water, water01-17.png for shallow water and waves*.png for the beach waves. And yes, the tropical and gray coloring is then applied by overlaying the overlay-gray.png and overlay-tropical.png images on top of gray/tropical water.dagnelies wrote: ↑June 2nd, 2018, 8:01 amAlso, some things are a bit muddy to me, for example the water. When I look in the images folder, there are three types of water: gray, default and tropical. However, only the "tropical" one has wave animations and border transitions in the image folder. What about the two others? Are the different waters the result of applying some program-side coloring over the same images? Also, when I draw water next to grass in the editor, I see different kind of borders ...but where do these images come from? They are not in the same directory.
Re: How does wesnoth tiling system work?
Thanks for the prompt responses! This tiling system is indeed a challenge!