New features (WML, reasonable cannon, bodies..)

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.
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

New features (WML, reasonable cannon, bodies..)

Post by szopen »

Hi there!
I am not posting it into IDEAS forum, since from reading the FAQ the post does not seem approppriate there. I do not want discuss ideas or suggest developers to implement them. I want to ask, IF I would implement such set of ideas, would they be allowed into game. If I would lost few days for implementing things that would not be ever used because they are un-wesnothish, then I guess I could find better ways to spend my time (playing wesnoth for example :D ).

No feature suggested here affects current game or scenarios. I will implement them myself, again, but since I would do that in my free time (as everyone else I guess), these are not things you will see next week :)

1) New WML tags

a) textarea. The patch is already submitted, not yet accepted it seems - though after some thought I would change it somehow.
Idea: in [story] [part] tags, a new tag to allow put arbitrary text in arbitrary position. Potential use: put labels (translatable) on maps, comc-like introduction.
Format (it could change): [textarea] text="blah" x=6 y=7 w=45 font=xx.ttf [/textarea] Note, that there is no "h" and that font is not yet implemented in submitted patch (at patches.wesnoth.org).

b) Input in scenarios. Tag like [inputareas] [box] value=1 [/box] [box] value=2 [/box] variable=myvar [inputarea]

If user clicks an area, the value of variable myvar is set to proper value. It could be used in campaigns to visually choose next scenario (e.g. in HttT you could've pick a which road to choose).

c) Basic [IF] in [story]. I would implement ONLY checking variable and maybe have_unit tag. It woudl allow to show different parts depending e.g. on whether some person would be alive or not.

2) Reasonable cannon.
No idea how kolubryna is in English, so I will use "cannon" word.

Cannon cannot be recruited nor recalled.
Cannon can be only given by scenario designer.
Cannon cannot move (to simply AI design).
Cannon can only shot once a turn, should have something like 30-1 or more (More realistically would be once in few turns, of course :) ).
Cannon would be truly RANGED weapon, that is, they would shot units within its range, eg. five hexes from itself.

Therefore, It would be extremely easy to wrote AI module for that unit. Just
for all cannons: find_units_in_range; choose_best_target; shot. No problems for AI!

The rationale: to add flavour to games, allowing them to be set in future of current wesnoth. Cannons emphatically would NOT be used in any of current scenarios. It merely would add possibility of creating scenarios set in early modern era (if such things exists for fantasy games :D). They would be used in scenarios for sieges of fortresses etc. They would not be used in multiplayer (since they couldn't be recruited).

The only hard thing in implementing that would be how to present range.
3) Bodies.
This is actually the weakest idea and with less priority on my list. IF the unit dies, the body stays on field. If the unit has no image attached to "fallen" position, either no image or default image is used. If already some body occupies the field, it is replaced. If another unit occupies the field, the body is not shown. Simple, isn't it?
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

1) I do not know how useful 1a) and 1b) would be, but 1c) would be IMHO very useful, and if you made a patch for it that wasn't buggy, I bet it would be implemented.

2) I think you mean cannon, catapults, ballistas, etc. If you can find a way to implement them, it might be OK, for special circumstances, although very rare. The AI would be the hardest part.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

We did have multi-hex ranged attacks and it was removed (as Turin knows). If you could write a good AI then maybe it could go back in.

As for the other ones, I know I would personally rather have a less-capable + less-buggy game. Dave used to express the cost of new features in terms of code maintenance. Adding new features, even if the code is provided for free (i.e. by you), still adds to the upkeep cost of the code. The developers would have to decide the relative benefit.
1b sounds cool, but maybe it should be a BFW 2.0 feature.
Hope springs eternal.
Wesnoth acronym guide.
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

Post by szopen »

scott wrote:We did have multi-hex ranged attacks and it was removed (as Turin knows). If you could write a good AI then maybe it could go back in.
This is quite different. Here, the AI part would be trivial, because suggested cannon WOULD NOT MOVE. Therefore, AI had to only detemrine targets (and quick browsing the code seems to indicate that already there are functions for that), choose the best one (here, just pick some evaluation functions) and BAM!

So this is not adding multi-hex ranged attacks; it's adding one unit, maybe with limited usability but also without adding to much burden to existing code.
As for the other ones, I know I would personally rather have a less-capable + less-buggy game. Dave used to express the cost of new features in terms of code maintenance.
There is no problem with code maintance. I could, for example, implement 1a) and 1b) as separate function. Dependence fromt the rest of the code is only in drawing routine and getting events (and i doubt interface would change, no?), while not adding additional dependencies (well, the [font] tag would probably need slight modifications elsewhere :) ). Since that two features would, most probably, need only modifications in one piece of code and could be easily separated, they would be extremely easy to maintain.

e.g. in intro.cpp there would be call to
wml_textarea();
wml_inputarea();
wml_voiceover(); (here the hard part would be provide a way for making translations :) I think that simply seaerching for national directory may be enough)
wml_if() (this is only part which could introduce bugs)

If needed, those functions could react to some configuration setting. Eg. if sceanrio would set "enhanced_wml" option or "kewl_wml_effects_by_szopen" or whatever, the functiosn would act, if not, they would behave as if they do not exist (wml_if would return always true, others would simply return). In future, if the extensions would prove useful, then functions would ignore the settings.

etc.
1b sounds cool, but maybe it should be a BFW 2.0 feature.
Hm, what about wesnoth branch to see whether such features would add any bugs?

From wednesday I will have a bit of free time, and I would be more than happy to spend it creating WML tags, since WML code is so well thought and cleanly written that it is extremely easy to add new tags :)

I understand the fear about the bugs; but I doubt that any new bugs would be introduced into main campaigns (since main campaigns would not use them most probably!). Therefore, your average Joe would noe be affected.

Rigth now one may start to "if main campaigns won't use it, what's the use of it?" Well, at least one user-contributed campaign would use it :) And if they would be well-tested then the main campaigns amy include them as well.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

I don't maintain any code, so as long as the developers are happy, then it's fine with me. I don't remember any units with multi-hex attacks that did move, but you're right because it wasn't restricted to stationary units.
I also agree about usage. It's nice to have a very capable WML.
Hope springs eternal.
Wesnoth acronym guide.
hiryuu
Posts: 26
Joined: September 24th, 2004, 9:00 am

Post by hiryuu »

szopen wrote:This is quite different. Here, the AI part would be trivial, because suggested cannon WOULD NOT MOVE. Therefore, AI had to only detemrine targets (and quick browsing the code seems to indicate that already there are functions for that), choose the best one (here, just pick some evaluation functions) and BAM!
That assumes the siege weapon is always an ally of the AI. If the AI needs to deal with assaulting a siege-protected area, it needs to understand that the usual ZoC and front line unit strategy does not apply here.
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

the reasonable cannon idea would allow watch towers to have ranged attacks.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

dave want to freeze adding all features until we have 1.0 ver,
we have to wait
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Re: New features (WML, reasonable cannon, bodies..)

Post by ott »

szopen wrote:1) New WML tags

a) textarea. The patch is already submitted, not yet accepted it seems
The rule of thumb for new WML is: is there a specific requirement for it, expressed convincingly by a campaign or MP map author? I haven't seen any such arguments, so my conclusion is that this is just another "cool" feature, and is unlikely to make it into the game. As an example, adding the [objectives] tag happened after it was a feature request, after several campaign devs expressed a desire to use it to replace klunky existing workarounds to do the same thing, and after some of the developers made it clear to me it would be a good idea to implement it.
b) Input in scenarios... If user clicks an area, the value of variable myvar is set to proper value. It could be used in campaigns to visually choose next scenario (e.g. in HttT you could've pick a which road to choose).
Again, this sounds "cool" but without any need from campaign authors, it is unlikely to progress.
c) Basic [IF] in [story]. I would implement ONLY checking variable and maybe have_unit tag. It woudl allow to show different parts depending e.g. on whether some person would be alive or not.
This sounds like it could be worthwhile, try to canvass some support for it from a campaign author.
2) Reasonable cannon
See the Watch Tower. As pointed out already, this used to have a 5 hex multihex attack. As I understand, no-one could make the AI understand multihex attacks properly, and multihex attacks were removed as a source of lots of bugs without any real compensation in the form of an improved game.
Cannons emphatically would NOT be used in any of current scenarios.
Watch Towers are used in SotBE. Unfortunately, without multihex attacks they are currently a bit odd.
3) Bodies
This was last discussed on the forums a few months ago, and rejected.

It would be great if you could contribute. Right now we are trying to get to 1.0 in the short term. Have a look at the 78 open bugs, or even some of the 126 open feature requests for a list of contributions that would be likely to be welcomed.
This quote is not attributable to Antoine de Saint-Exupéry.
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

Re: New features (WML, reasonable cannon, bodies..)

Post by szopen »

ott wrote:
szopen wrote:1) New WML tags

a) textarea. The patch is already submitted, not yet accepted it seems

The rule of thumb for new WML is: is there a specific requirement for it, expressed convincingly by a campaign or MP map author?
Frankly, I just thought about what I would need to do the new campaign my way. I thought that however using that argument would be too weak since most new campaigns, i've read, are never finished.

Also, I've read a thread with request to made map translatable.
b) Input in scenarios... If user clicks an area, the value of variable myvar is set to proper value. It could be used in campaigns to visually choose next scenario (e.g. in HttT you could've pick a which road to choose).

The arguments here are the same as above.

In addition, with combination of [input] [if] and maybe directly advancing to another scenario you could do completely different game from Wesnoth without changing anything else.
2) Reasonable cannon
See the Watch Tower.

Hmm while browsing for multi-hex ranged attacks I somehow missed that one; I thought that though ranged attacks were already proposed, nobody had proposed this.

I must admit I didn't realise the true consequences for AI, I thought only about ATTACK, not about defense against it :(.
3) Bodies
This was last discussed on the forums a few months ago, and rejected.

Nihil novi sub sole :) I should really search for that feature too before posting it :D
It would be great if you could contribute. Right now we are trying to get to 1.0 in the short term. Have a look at the 78 open bugs, or even some of the 126 open feature requests for a list of contributions that would be likely to be welcomed.
I already had. Basically, I am not interesting in contributing for the joy of contribution alone. I just wanted to do campaign, enlisted things I would want to use, and then see which are not yet in Wesnoth.

But then, Dave have stated feature freeze. Hm, I guess I making set of patches, apply it to wesnoth 0.9.1 and ship sources/binary with campaign. OTOH nobody would probably want to compile wesnoth again (this is so looong) or install unknown binary just for the sake of checking uknown campaign by guy from nowhere :(

I guess the thread could be considered closed.
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

Post by szopen »

As side note, I see that voiceover tag was already suggested and is in bugs.wesnoth.org as "feature request" :D. Guess I would started with that.
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Re: New features (WML, reasonable cannon, bodies..)

Post by ott »

szopen wrote:Frankly, I just thought about what I would need to do the new campaign my way.
Exactly why can't you achieve your aims with the tools at hand?
Also, I've read a thread with request to made map translatable.
I don't understand this reference. Map labels are already translatable.
In addition, with combination of [input] [if] and maybe directly advancing to another scenario you could do completely different game from Wesnoth without changing anything else.
I don't see what is "different" about this compared to the existing mechanism that is used for instance at the end of Bay of Pearls.
I just wanted to do campaign, enlisted things I would want to use, and then see which are not yet in Wesnoth.
I suggest you get started on that campaign. WML is very powerful -- I would be very interested if you come up with interesting campaign ideas that can't be implemented using it.
This quote is not attributable to Antoine de Saint-Exupéry.
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

Re: New features (WML, reasonable cannon, bodies..)

Post by szopen »

ott wrote:
Also, I've read a thread with request to made map translatable.
I don't understand this reference. Map labels are already translatable.
Really? :-O I mean, i know that in scenario maps they are translatable, but I didn't know that one can also put labels on maps within [story] (e.g. showing map of wesnoth, green isle etc). How do you put labels on maps within story tags (on that large maps presenting whole continent etc) and why nobody is doing it?

But seriously, main reason was comic-like story. That is, you know, with baloon text etc.
In addition, with combination of [input] [if] and maybe directly advancing to another scenario you could do completely different game from Wesnoth without changing anything else.
I don't see what is "different" about this compared to the existing mechanism that is used for instance at the end of Bay of Pearls.
[/quote]

Maybe I have missed something. In Bay of Pearls you first load the scenario, and then after "winning" it you pass to another scenario. Right?
That' at least the impression I got from brwosing through WML references and campaign codes. That is, you may base further scenarios on decision made within current scenario.

What I want, is to allow to made decision BEFORE loading any sceanrio map. That is, that you could made a choice before ANY map is loaded.

This COULD be achieved by making dummy scenario in which a person would just ask you "which way you want to go now?" but I found it silly.
Unless WML allows to pass directly from one scenario to another without going via map phase.
I just wanted to do campaign, enlisted things I would want to use, and then see which are not yet in Wesnoth.
I suggest you get started on that campaign. WML is very powerful -- I would be very interested if you come up with interesting campaign ideas that can't be implemented using it.[/quote]

Ok. I wanted to implement campaigns in which you would have set of provinces to conquer. Order in which you are conquering provinces should be undetermined by campaign sceanrio. Basically, I enviosioned an image containing province maps (updated after each province is conquered). User clicks on province to conquer, scenario is fired, he wins, new province is added.

Idea for such campaign would be probably considered un-wesnothian by most, by features enabling such behaviour would not be exclusively useful only for such kind of campaign. Gameplay is not affected; hopefully no bugs are added, since if someone won't use the feature, he won't see it.

The in-campaign storyline would develop in a way of comic. Conversation, instead of drawing portraits within scenario, would be within story tags.
Voiceover would be just "cool" addition.

So, you could do both of this things with using of current WML, but after thinking about that, i decided that it would be more nice to have them "my way". I do not see anything bad about that, especially when no gameplay or other campaigns are affected.

I mean, hey, the ability to see portraits is also a "cool" addition. One could as well live without it, right? But having such feature made game more.. hmm.. picturesque.

Actually i see that "font=" tag would be far harder to implement that I initially thought.

I realise that standard answer by Wesnoth devs is "if you like the feature and we not, go and fork your own branch", but I fell i'm too thin in ears to do it :D.
aelius
Posts: 497
Joined: August 30th, 2004, 8:07 pm
Location: Virginia, USA

Post by aelius »

I believe both Rise of Wesnoth and Saving Elensefar do something like this.

Check out the WML for "The Kailan" and Turin's excellent non-linear campaign. I bet they'll point you in the right direction.

- b.
La perfection est atteinte non quand il ne reste rien à ajouter, mais quand il ne reste rien à enlever. - Antoine de Saint Exupery (of course)
szopen
Posts: 631
Joined: March 31st, 2005, 12:51 pm

Post by szopen »

aelius wrote:I believe both Rise of Wesnoth and Saving Elensefar do something like this.
No, they don't.
Check out the WML for "The Kailan" and Turin's excellent non-linear campaign. I bet they'll point you in the right direction.
- b.
In Kailan the scenario is loaded and THEN user can choose one of four next scenarios. I want to pick next scenario BEFORE scenario map is loaded.

In other words, this is something which CAN be achieved by current WML, but in totally different way. I had not checked Easter Invasion WML code (this is Turin campaign you are referencing to, right?) but after checkin WML reference, source code etc I'm pretty much sure (as sure as a newbie can be) that what I want to do CAN'T BE DONE.

To reiterate:
You can put in scenario choosing another sceanrio (as bay of pearls, kailan etc) but in those scenarios scenario maps are loaded first, and only THEN choice is made.

What i want is to made choice in storyline, and follow to another sceanrio directly. Why? And why not?

If you could tell me how to do it using current WML, I will most grateful and I will probably use it.
Post Reply