[Brainstorm] Features for another type of wml-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:
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

[Brainstorm] Features for another type of wml-editor

Post by tsr »

[Background]
Ok, so one thing that seems to pop-up from time to time are requests for a 'better' more feature full editor for BfW. This is mostly shoot down by some or all of:
1. no, it's a map editor
2. use campgen
3. learn wml

I agree with 1, the map editor should stay a map editor. Campgen does seem a bit difficult to use (from my own experience I couldn't really get anything working, but then again, I didn't know WML then). Learn WML, yes, this is a must but a good editor can actually help with that and make the transition from ignorant to wml-guru shorter.
[/Background]

So, how should a good wml-editor work? What features are essential? What would be good to have? Brainstorm away, and maybe, just maybe we will have a nice spec that we can work with and convince a coder to do it or actually code it ourselves.

/tsr - just trying to focus peoples imagination, etc :)
CarpeGuitarrem
Posts: 250
Joined: November 19th, 2007, 7:46 pm
Location: One among the Fence

Post by CarpeGuitarrem »

Probably something that you can set certain parameters, set things up, so that you could program a moderately customized scenario...

And the WML would appear to the right of whatever you were doing!

So basically, as you enter in things, you see the WML generate, so that you can learn how it works. Plus, it would let you edit the WML if you wanted. So it could easily be a training tool.

(Just some rough ideas, concepts, not thinking about application yet)
Glory in Blood...Needs Programming Help!

If you have time, check out my ongoing serial story...
The Hidden: Secrets of the Future's Past
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Post by Viliam »

In my opinion a good WML editor should always provide you with a list of tags/attributes available in given content... also with a short description what they do.

It should also come with a few templates or wizards, like "normal day-night cycle", "underground", "create unit", "say message", etc... for frequently used parts of WML code. At least it should have some wizard for creating a new scenario.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Viliam wrote:It should also come with a few templates or wizards, like "normal day-night cycle", "underground", "create unit", "say message", etc... for frequently used parts of WML code.
I'd say all the WML the scenario is capable of inserting with a few clicks should be based on templates, which are not hard-coded but specified in some reasonably simple language in an external file. That way, people could easily contribute templates for any action imaginable ("change units from side x to side y on turn z if condition foo is true", "auto-recall unit on scenario start", whatever). If you hardcode all the things the editor can do, it'll be a pain to maintain.

Such a template for a "say message" action could look like this:

Code: Select all

event_action::speak(unit_filter who, string message) {
    insert {
        [message]
            {{who}}
            message= _ "{{message}}"
        [/message]
    }
}
That would appear in the menu of actions you can insert into your scenario when you have the appropriate piece selected (in this case, any event), and choosing it would result in a pop-up dialog asking you for the unit filter and the message, with of course some simple, standard controls for choosing the unit and a textfield for the message. When you fill those up and click ok (and if what you filled in is valid), the editor would insert that piece of WML into the selected location in the event. Then you'd of course have a side panel of some kind where you'd see the list of actions/things that exist within the current scope (campaign, scenario, event, side definition, etc), and you could drag-and-drop them around to change their order, etc so you wouldn't actually have to touch the WML if you didn't want to.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

IMO what would be nice is something like BlueFish which makes it very easy to edit HTML.

I'm not sure how easy BlueFish would be to extend/make a module for for WML, but it might be worth looking into.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

A few of my own thoughts:

- I've noticed that there are quite a few wml-tools in the main data-dir of wesnoth, hopefully those could be used (And esr will continue to improve on them)

- I'd like some 'wizards' for bulk-actions that are boring, tedious and easy (like creating a standard SP/MP scenario)

- Whatever tool is used should have an up-to-date wml-reference (maybe it's possible to get (and reformat?) the wiki-ref from w.o)

- It should be possible to launch the map-editor from the wml-tool

- It should be possible to one-click change the scenario back and forth to [test] (for easy testing)

- I'd like for the tool to handle directories/binary_path's

-------------

Bluefish does look nice (it sure has evovled since I looked at it last time :)),

/tsr
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

Ok, so I'm trying to find a suitable host to do this on, and so far I've found jEdit, but I would like to have other options (not emacs/vi - since they are not newbie friendly atm).

Bluefish seems to lack some flexibility, but maybe I'm just awful at reading/finding the correct documentation ;)

jEdit seems very powerful in how you can extend it, otoh it's written in java which I'm a bit scared of.I posted a small list of features I wanted to have and it seems that it can do those.

Anything else 'we' want/wish, etc?

/tsr
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

I particularly like the wizard feature (of all the proposed ones).

The wml reference would have to be up-to-date, perhaps reading some html documentation that could be shipped with BfW?

Some things I would consider really interesting:

a) macro capabilities: standard macros should be generated wherever possible instead of wml tags. This is something I recognized recently: if you use macros, your content can weather the changes in WML much better than if you use only the tags directly. Plus it's more efficient. I think macro usage should be encouraged wherever possible.

It should also be able to expand those macros on the click of a button - so that you can go down to the pure wml level. ;)

Indeed, macros could bridge the gap for the templates that zookeeper mentioned. Actions could be tied to a macro name in an editor action template. Then the editor takes the macro definition and assigns attributes according to the macro arguments. Now that wmllint is doing some type-checks on macro arguments and they get standardized names wherever possible, it would be feasible to base a template system on macros.

b) map component: I follow the argument that the map editor should stay a map editor. But to have a (non-artistic - that means no transitions, perhaps not even images) representation of the map bundled with the code would be a great time saver. And it would lower the hurdle to the code for people who aren't programmers, as it ties the underlying code to something which is closer to the player experience (which happens on a map).

Also, this map component wouldn't choke on custom terrain (something which made working on UtBS awful...). It wouldn't have to, as it could simply display the terrain letter code and perhaps color-codes the hexes based on that (it would be terrain-agnostic).

Select a number of hexes on the map, click on moveto event - and you have a filter on those hexes. Select a [unit] tag and the hex that the unit is placed in is highlighted in the map. Need to change the terrain in one hex quickly? Click the hex and select the terrain from a dropdown (or edit the letter code). That would be fantastic.


This is of course a different scale of undertaking than writing a plugin/theme/extension to an existing editor application to trigger scripts, enable highlighting syntax and code autocompletion. Perhaps jEdit even has an api for wizards?

For the bells-and-whistles approach, one could perhaps throw together Scintilla, an open-source cross-platform editor component, and the map part of Atlantis Little Helper, an open-source hex map pbem client using wxWidgets? Both are written in C++. Might not be quite what you had in mind, though...
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

I really like both of your ideas Rhuvaen, and yes that would mean building something from 'scratch' more than creating a mode.

Do you have any thoughts on how the macro-thing could work (logically I mean), should it be hard coded into the app or should it parse all the standard macros and whenever you try to write a tag that occurs in it it suggests to use a standard macro instead? Should it aim to have a parser that can see when code is repeated inside a project (unit, era, scenario) and suggest breaking it out into a macro? (Not that I know if that's even possible)

About the map thingy, I like! Maybe it can use a similiar system as the [ map] code from the forum to display a basic map (without transitions).

Keep it coming!

/tsr
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

tsr wrote:Do you have any thoughts on how the macro-thing could work (logically I mean)
Nothing as fancy as suggesting macros for what you type... no, I just thought that there would be some "actions" (menu / buttons whatever) that could be configured to use specific macros. For instance:

Code: Select all

ACTION_TERRAIN_CHANGE = 'MODIFY_TERRAIN'
At startup it would browse for the configured macro definitions and find out what arguments they need.

Perhaps it would come supplied with a number of special macros that wouldn't be of general use, but implement editor features (macros for generic events...).

The user then presses the button / selects the menu item that is linked to the terrain change action, and can fill in the arguments (X and Y could be done by mouseclick, for instance).

I don't think it would be sane to try to make a program suggest macro substitutions - that would be like backward macro expansion!
User avatar
scienceguy8
Posts: 226
Joined: June 27th, 2007, 2:54 pm
Location: Middle of Nowhere, U.S.A.
Contact:

Post by scienceguy8 »

One of the things I really hated about CampGen, aside from the fact that it did not come with clear instructions, was that it required you to create a new campaign in order to create a new race. It would not let you save your work otherwise. I just want to develop a race at the moment, not a campaign. Unit, race, and era templates would be great.
"You can't kill an unarmed, upside down man!"
Dr. Rodney McKay
Stargate Atlantis
Runner

Gilberti Industries
scienceguy8
Proud Member of the Marching Salukis
User avatar
Lizard
Posts: 355
Joined: January 19th, 2008, 8:20 am
Location: Hiding in a swamp (gtm +1; DST)

Post by Lizard »

It would be cool if the auto completion is as Borland Delphi: based on the location different options are shown, e.a. in a leadership tag it only show you the valid keys. Delphi also remember the names of Variables and show them too. And on an array[x]. It only displays attributes of that array.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

Ok, what I'm thinking of right now is to create a stand alone app that would feature:

- the UI is divided into:
1. a leftsided panel that will show two tree views of
a) top area: your local data-dir
b) bottom area: wesnoth-install dir/core/data

2. an editing area

- when you create a new project you decide what that project will be (scenario, campaign, multiplayer, era, race, unit, ai, map, others?), a bunch of relevant dirs/files are created and filled with some code-snippets

- each file is associated with a filetype so that the editing area acts in different ways for different kinds of files

- map-files have the default option to be shown using images so that you can point and click/drag for hexes/areas to get info to be used in other files (like coordinates/terrain type, etc?)

- path-handling is done automagicly so that you can move around/rename your files/dirs without breaking your project

- syntax highlighting and auto-completion for WML, terrain codes and python (for AI writing)

- links to or incorporated wml and pythonAI reference

- extensive use of wizards (like when you create a new project you chose what kind of project, name, etc) but for a lot of things like events, variable-manipulation, etc

- autoloaded core macro snippets (/wizards)

- forced indentation using wmllint or something similar

- some kind of sanitychecking, either by using wmllint or by writing a basic wml-parser

I think I didn't forget anything, and remember this is still a brainstorm/wishlist-generator so don't shoot down ideas for lack of unimplementationality just focus on adding useful features and refine the thoughts so far (and not only mine).

/tsr
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Post by AI »

scienceguy8 wrote:One of the things I really hated about CampGen, aside from the fact that it did not come with clear instructions, was that it required you to create a new campaign in order to create a new race. It would not let you save your work otherwise. I just want to develop a race at the moment, not a campaign. Unit, race, and era templates would be great.
That might be because of the way add-ons work, everything is a campaign, even if there isn't one in it. EE is a campaign for instance.
CarpeGuitarrem
Posts: 250
Joined: November 19th, 2007, 7:46 pm
Location: One among the Fence

Post by CarpeGuitarrem »

I'd like to mention that IMO, wizards are a must.
Glory in Blood...Needs Programming Help!

If you have time, check out my ongoing serial story...
The Hidden: Secrets of the Future's Past
Post Reply