Adding items to maps in the map editor

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Adding items to maps in the map editor

Post by beetlenaut »

The Idea
It would be nice if the map editor included items and scenery from the folders of the same names. They could be automatically added to the current brushes menu, or maybe there could be a new tool specifically for adding items.

The Problem it Solves
Currently, the workflow for adding a rock, tree, or other scenery item is this: Open the editor and load your map. Take a guess at where the item would look good, and record that location. Open a text editor and load the scenario file. Create a prestart event that loads the correct image from the data folder, and puts it at the location you recorded. Close and reopen BfW, and load a campaign with your map to see if you got it right. Making it easier for map designers would probably result in more interesting and varied maps, and eventually, more scenery pieces available.

The Implementation
I can think of one way to do this that seems to make sense. We could add some functionality to the [map_data] tag. It would look in the map data text for item strings formatted in a way it understands. At runtime, (when macros are being expanded?) each item string would be expanded into a prestart event with an [image] tag and moved out to the top level tag (usually [scenario]). They could also just be saved in the map data as events already. Either way, this would leave [map_data] backwards compatible with current map files.

Of course items that are supposed to function in the game would still need coding, but that makes sense. If this sounds doable, I can add it to Gna as a feature request, but I thought I'd ask for feedback here first.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Matthias1217
Posts: 15
Joined: April 6th, 2009, 6:23 pm

Re: Adding items to maps in the map editor

Post by Matthias1217 »

This is a great idea. It would also be nice to maybe be able to add another item like "holy water" or something like that. Then when ever you load the map (even in multi-player) there would still be the item.
Just a thought. :)
ideans
Posts: 10
Joined: May 3rd, 2008, 3:08 am

Re: Adding items to maps in the map editor

Post by ideans »

or adding shops.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Adding items to maps in the map editor

Post by Ken_Oh »

See the slippery slope you're opening, beetlenaut? ;)
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: Adding items to maps in the map editor

Post by pauxlo »

So, maybe simply a possibility to put _anything_ on a map, without really defining, what it is.
Only put item "XZY", and later in WML you can define that item "XYZ" is a holy water bottle, a shop, a spawning point for enemies, some scenery without function, or whatever.

It should need only a way to mark some more positions/ranges on a map, to don't have to calculate the coordinates by yourself.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Adding items to maps in the map editor

Post by beetlenaut »

pauxlo wrote:Only put item "XZY", and later in WML you can define that item
Um...yes. That's exactly what I was saying.
Ken_Oh wrote:See the slippery slope you're opening, beetlenaut? ;)
Yeah, it's the slope that leads to campgen. That's going too far. And hard to code. This is just the tippy top of the slope--hardly over the side at all really. I don't think.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Re: Adding items to maps in the map editor

Post by SkeletonCrew »

This idea has been proposed before and we want the map editor to
stay a map editor. There have been ideas about a campaign editor
which should allow for this kind of thing. So I agree with the general
idea, only not the proposed solution.

I think a campaign editor would be really nice to have and I have
several ideas about it but it, but at the moment I don't have time
for it :-(

Embedding the items in the map format has also been proposed
before and is also a bad idea, since it will clutter more unrelated
code together.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Adding items to maps in the map editor

Post by Ken_Oh »

For what it's worth, I think it would be cool to be able to overlay an image in the editor just to see what it looks like. It wouldn't actually put in wml code but would give the designer a visual idea without having to load up the scenario.

EDIT: Actually, never mind, because then you'd have a thousand newbs asking why their images aren't showing up on their maps. :?
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: Adding items to maps in the map editor

Post by pauxlo »

SkeletonCrew wrote:Embedding the items in the map format has also been proposed
before and is also a bad idea, since it will clutter more unrelated
code together.
Then, to be consequent, also remove the sides' starting positions from the map format :-)
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Adding items to maps in the map editor

Post by beetlenaut »

SkeletonCrew wrote:Embedding the items in the map format has also been proposed
before and is also a bad idea, since it will clutter more unrelated
code together.
I see what you mean regarding items, but what about scenery? That seems to be more related to the maps than to the scenario events. If I want to sprinkle a dozen rocks or burnt villages around the map, it would take 60 lines of code unrelated to the scenario. All those lines do is decorate the map. But, they look identical to the lines adding usable items.
SkeletonCrew wrote:So I agree with the general idea, only not the proposed solution.
I'll give one more try at a proposed solution. What about a [scenery_data] tag that holds all the map decorations in a way similar to how [map_data] holds terrain? If that was editable in the map, it would solve the same problems I was complaining about in my original post. You could make the graphics in [scenery_data] unaffected by removeitem, which would keep scenario designers from embedding pickuppable items in it.
SkeletonCrew wrote:I think a campaign editor would be really nice to have...
I'm not asking for that, because I'm not convinced it would be a good thing. It might encourage every ten-year-old to start a campaign. I do like the idea of nicer looking maps made easy.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Re: Adding items to maps in the map editor

Post by Mist »

Ken_Oh wrote:For what it's worth, I think it would be cool to be able to overlay an image in the editor just to see what it looks like. It wouldn't actually put in wml code but would give the designer a visual idea without having to load up the scenario.EDIT: Actually, never mind, because then you'd have a thousand newbs asking why their images aren't showing up on their maps.
Why not? Just make an overlay terrain of the image. I'm attaching a C source for a very small and simple app that'll crawl the directory it's in and make [terrain] [terrain_graphics] code for each .png file it finds (it's not strict ANSI but you can compile it on anything POSIX conformant and with MinGW on windows). Take the output file, include it in the campaign _main.cfg file (UtBS is an excellent example of how to do it for both the campaign and the editor) place the .pngs into /images/terrains and your free to go. You can decorate inside the editor as much as you wish ;)
Attachments
script.c
(2.92 KiB) Downloaded 231 times
Somewhere, between the sacred silence and sleep.
Disorder.
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Re: Adding items to maps in the map editor

Post by SkeletonCrew »

pauxlo wrote:
SkeletonCrew wrote:Embedding the items in the map format has also been proposed
before and is also a bad idea, since it will clutter more unrelated
code together.
Then, to be consequent, also remove the sides' starting positions from the map format :-)
That would of course be an option if you to develop Wesnoth from scratch ;-)
For now it would break the feature that you can use a single map file to play
a MP game.
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Re: Adding items to maps in the map editor

Post by SkeletonCrew »

beetlenaut wrote:
SkeletonCrew wrote:Embedding the items in the map format has also been proposed
before and is also a bad idea, since it will clutter more unrelated
code together.
I see what you mean regarding items, but what about scenery? That seems to be more related to the maps than to the scenario events. If I want to sprinkle a dozen rocks or burnt villages around the map, it would take 60 lines of code unrelated to the scenario. All those lines do is decorate the map. But, they look identical to the lines adding usable items.
At the moment scenery is often added as item only nothing happens when you reach the hex.
beetlenaut wrote:
SkeletonCrew wrote:So I agree with the general idea, only not the proposed solution.
I'll give one more try at a proposed solution. What about a [scenery_data] tag that holds all the map decorations in a way similar to how [map_data] holds terrain? If that was editable in the map, it would solve the same problems I was complaining about in my original post. You could make the graphics in [scenery_data] unaffected by removeitem, which would keep scenario designers from embedding pickuppable items in it.
I just want to avoid having the map code more cluttered up with additional code and
avoid the editor to mandatory have a scenario file to work with. Which means a separate
editor which can load scenarios and edit both the scenario and the map would be the
best solution.
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Adding items to maps in the map editor

Post by Gambit »

So then we need a new editor. A Simple Scenario Editor. Able to place ordinary images with no affect whatsoever.

Able to place units. A unit button brings up a dialog. In this dialog there is a button that brings up the debug mode's list of all the units on your pc. There are 3 text input fields asking for name, ID, role, and side.

Able to place items that have simple affects. An item button triggers a dialog with drop down box asking what trait to affect (with a list of moves, max moves, hp, max hp, excetera). Then another drop down box that asks how to modify, add, subtract, or set. Then a text entry field asking for an integer. And a button that brings up a browser for images.

It should be able to program simple sides. For all sides already in the map it should be able to affect (via toggles or rollers, or checkboxes) human or AI? have leader? can recruit? fog? shroud? Then text input fields for start gold, income. It should also be able to create new sides that by default have no leader.




If there's not too much opposition to this idea I'll flesh out the tree of options more as I have time? To be honest though I know only rudimentary amounts of C++ and VB so I wouldn't be any use in actually implementing this. But I can save you guys time designing/inventing it.


Also I don't think it should have to be able to edit the map... it would be a separate editor able to load the map so you could work on top of it.
Last edited by Gambit on April 26th, 2009, 4:08 pm, edited 1 time in total.
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: Adding items to maps in the map editor

Post by Ken_Oh »

I think the idea, Gambit, is if you want to see it happen, then you have to code it for us.
Post Reply