Making abilities a little more flexible

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

Moderators: Forum Moderators, Developers

Forum rules
Before posting a new idea, you must read the following:
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Making abilities a little more flexible

Post by Dave »

Unit abilities such as 'heals', 'cures', 'regenerates', 'ambush', etc, are difficult to make flexible. To make a system that would allow anyone to define any ability they want in WML would require a full-fledged programming language, that'd probably be so complicated that anyone who could use it would probably be better off just modifying C++ anyway.

But, that doesn't mean we can't make it a little more flexible. One of the key things that people want in abilities is to specify that the ability is only active under certain conditions. The two main conditions I can think of are based on the time of day/night, and based on the terrain the unit is in. For instance, ambush can be defined as the 'invisible' ability, only active in 'forest'.

We could remove the definition of 'ambush' from the code, and just have a more general 'invisible' ability, and then we could define ambush in WML:

Code: Select all

[ability]
name=ambush
based_on=invisible
    [condition]
    terrain=f
    [/condition]
[/code]

Likewise, suppose you wanted an ability to regenerate, but not at night.

Code: Select all

[ability]
name=solar powered #ok this probably isn't the name we would give it ;)
based_on=regenerates
    [condition]
    time_of_day=day,twilight
    [/condition]
[/ability]
This would give scenario designers more flexibility in adding abilities that they want to.

Thoughts?

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Post by Sangel »

I like it. The more options for unit design, the better. Could we also make the description which pops up from mousing over the ability editable?
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry

Dobob
Posts: 123
Joined: October 6th, 2003, 9:21 pm

Post by Dobob »

That would be good, but to give further customization, the amount healed be regeneration should be variable. Heal and cure could also be merged by allowing a variable amount of healing and the possibility to cure poison and stone.
Likewise, leadership could be expanded to give variable bonus, and toggle who get affected by it (only lower level units, only units of the same race, only chaotic units,...)

More flexibility is always better :!:

miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

Flexibility is good (for the engine), we still want Wesnoth to be simple, not complex. Of course you can create your own campaign with your own units and take full use of this - make it as complex as you want.

- Miyo

miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

Dave,

go for it.

- Miyo

Integral
Posts: 244
Joined: December 14th, 2003, 9:36 pm
Location: Pennsylvania

Re: Making abilities a little more flexible

Post by Integral »

Dave wrote:Thoughts?
This sounds like it would be moving WML in the directions of being a constraint language. I wonder if it would be a good idea to explicitly take that point of view, so you can make use of the work that's already been done on constraint languages. Constraint programming gives you a lot of the power of a "real" programming language, but would be a lot more natural in the context of Wesnoth scenarios (as you've already noticed).

Just a thought induced by working way too much with constraint languages lately..I could be totally off my rocker :).

Daniel

Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Sangel wrote:Could we also make the description which pops up from mousing over the ability editable?
What do you mean by make them editable? They are found in data/translations/english.cfg (assuming you're using English) and you can edit them there...

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Make them editable as in when you give a unit ambush (based on invisibility) you want to have a description of it that is not a description of invisibility. yo would want to specify in a toot-tip that it is only invisible in forest.
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

Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

turin wrote:Make them editable as in when you give a unit ambush (based on invisibility) you want to have a description of it that is not a description of invisibility. yo would want to specify in a toot-tip that it is only invisible in forest.
Yes, that would be possible by putting an entry in data/translations/english.cfg (hmm...it might also be directly specifiable in the tag...maybe)

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Ave
Posts: 221
Joined: February 28th, 2004, 4:42 pm
Location: Hungary

Post by Ave »

This is a good idea only if you can reduce more than 2 effects.
Generalisation may have a side effect of removing important side effect.

One idea: making units invisible in deep water: diving

Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Post by Sangel »

You know, that strikes me as a perfect way to up-power mermen and nagas without making them unbalanced... invisibility in deep water...

That way the enemy won't be able to see mermen until they approach the coastline.
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry

Dobob
Posts: 123
Joined: October 6th, 2003, 9:21 pm

Post by Dobob »

And if a new skill who would boost chance to hit when attacking some terrain is added, merman could get a +10% to hit enemies in water. That would be as nice, without making water battle a game of hide-and-seek (as with invisibility).

Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Post by Sangel »

What would the point of that be? Non-swimmers are already weak in water, and getting a bonus to hit other aquatic creatures in water doesn't make sense.

As for hide-and-seek - most of the time, swimmers are only used in supporting roles. Hiding a bunch of mermen in the middle of the sea is useless - they usually end up in situations where they would be seen even with deep water invisibility.
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry

Dobob
Posts: 123
Joined: October 6th, 2003, 9:21 pm

Post by Dobob »

It would mostly be for merman vs naga battles, who are as boring as elf vs elf battles in forest. (those 30% to hit are boring). Also, some units have the same defense in shallow water and in grassland (ex : trolls).

Circon
Posts: 1200
Joined: November 17th, 2003, 4:26 am
Location: Right behind Gwiti, coding

Post by Circon »

As to flexibility, how about adding a "hp=" tag for heal, cure and regen? Then one can make units that regen 5hp or heal 1hp/unit.

Post Reply