New map format

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

New map format

Post by pyrophorus »

Hello...

I read somewhere a new map format is planned, but I didn't found anything about it. Can someone tell me more ?
(BTW, I'm writing a map generator, that's why I'm interested in this particular topic).

Thanks in advance,
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: New map format

Post by fabi »

The new format is:

Code: Select all

[map]
    data=
    border_size=
    usage=
[/map]
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: New map format

Post by Dugi »

Does that mean that all maps will have to be redone when passing to 1.11?
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: New map format

Post by fabi »

No, 1.11 can still read the old map format and thus 1.12 will be able to do so as well.

1.13.0 will be the first version that warns about the old syntax being deprecated,
followed by the removal with version 1.13.3.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: New map format

Post by Crendgrim »

However, if you edit maps in 1.11 and then save them, they will be saved in the new map format which cannot be read by 1.10. So be careful if you develop an add-on for both versions of Wesnoth. ;)
UMC Story Images — Story images for your campaign!
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: New map format

Post by pyrophorus »

Thanks to you all,

If I understand correctly, it's only the map tag (or the header of the map file) which change, not the hex format in the data ?
(BTW, I fear I wasn't clear enough: my project creates map files like the editor. It's not a WML add-on.)

Friendly,
User avatar
Adamant14
Posts: 968
Joined: April 24th, 2010, 1:14 pm

Re: New map format

Post by Adamant14 »

And what is the reason for this change? :?:
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: New map format

Post by Dugi »

Any idea where could I get wesnoth 1.11? Google points to nowhere.
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: New map format

Post by fabi »

There are several reasons.

1) Consistency -- We had no other WML attribute lookalikes with sub-attributes in them.
2) Since Maps are concealed within the [map] tag it's possible to parse map files with the WML parser now.
This means that the map editor can be used to produce map files with additional WML content.
I use that for placing [label]s within the editor, more usage is going to come.
3) The map file loading code on the editor side has gone less complicated.
4) The [map] tag is easy to extend in the future.
For example could the starting position definition leave the terrain data string itself and be subtags of
[map] instead leading again to simplified code.

My key motivation was 2), the other points are only side effects and I wouldn't have touched it if it wasn't for that reason.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: New map format

Post by Crendgrim »

dugi wrote:Any idea where could I get wesnoth 1.11? Google points to nowhere.
There is no development release out yet (and IIUC, this will be the case for the next few months). The only way to get 1.11 now is to checkout SVN and compile Wesnoth yourself (see WesnothSVN).
UMC Story Images — Story images for your campaign!
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: New map format

Post by Anonymissimus »

pyrophorus wrote:Thanks to you all,

If I understand correctly, it's only the map tag (or the header of the map file) which change, not the hex format in the data ?
Yes.
usage= and border_size= become separated keys, that's all.
Some test:

Code: Select all

[scenario]
	#ifver WESNOTH_VERSION >= 1.11.0-svn
	[map]
		{~add-ons/A_Simple_Campaign/maps/01_Template/header.cfg}
		data="{~add-ons/A_Simple_Campaign/maps/01_Template/data.cfg}"
	[/map]
	#else
	map_data="{~add-ons/A_Simple_Campaign/maps/01_Template/header.cfg}"+"{~add-ons/A_Simple_Campaign/maps/01_Template/data.cfg}"
	#endif
(It could/should be macroified, the header doesn't need to be scenario-specific and it's not clear whether it will have to be like this, but I paste it here just to show the idea.)
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
uncleshelby
Posts: 427
Joined: May 10th, 2011, 7:20 pm

Re: New map format

Post by uncleshelby »

fabi wrote:2) Since Maps are concealed within the [map] tag it's possible to parse map files with the WML parser now.
This means that the map editor can be used to produce map files with additional WML content.
I use that for placing [label]s within the editor, more usage is going to come.
Are we talking, unit placement?
Timshel
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: New map format

Post by fabi »

uncleshelby wrote:
fabi wrote:2) Since Maps are concealed within the [map] tag it's possible to parse map files with the WML parser now.
This means that the map editor can be used to produce map files with additional WML content.
I use that for placing [label]s within the editor, more usage is going to come.
Are we talking, unit placement?
[unit] is a subtag of [side] or either be used while an event is ongoing.
Thus, the editor would either need to support the event or the side tag.
My personal favourite is the side tage for the reason that it is rather static, at least compared to event tags which can gain to an unlimited degree of complexity.

Thus, suspect the unit placement feature to be part of an 1.12 release only at good luck.
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: New map format

Post by pauxlo »

fabi wrote:
uncleshelby wrote:Are we talking, unit placement?
[unit] is a subtag of [side] or either be used while an event is ongoing.
Thus, the editor would either need to support the event or the side tag.
My personal favourite is the side tage for the reason that it is rather static, at least compared to event tags which can gain to an unlimited degree of complexity.
A simple way would be to interpret [unit] tags directly in the map section as if they were in a prestart [event], without supporting any of the other complex event stuff (ActionWML, conditions).
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: New map format

Post by fabi »

pauxlo wrote:A simple way would be to interpret [unit] tags directly in the map section as if they were in a prestart [event], without supporting any of the other complex event stuff (ActionWML, conditions).
There are several reasons speaking for the [side] tag to support anyway.

1) The editor should be able to write working [multiplayer] scenarios at least.
Without support for defining [side]s in the editor this won't be doable.

2) Both, [unit] and [village] work inside [side] without any extra work already.

3) In order to render the unit inside of the map editor it makes sense to use the same codepath the game itself uses to display the units. This codepath expects units to be part of a side already.

4) I do not want to start supporting the definition of any [event] use-case in the editor whatsoever.
This will lead to the next feature request for supporting just a little bit more of what events are able to offer.
At the end the editor will end up being what the eclipse UMC tool is for.

Still it might make sense to introduce a [unit_group] tag which defines a set of units being referable in any handwritten event.
Post Reply