News:

Please help making MegaGlest rock-stable by testing the pre-release snapshots.

Main Menu

[Please Test] Tags

Started by Omega, 22 July 2014, 01:22:13

Omega

I intend to re-implement a feature of GAE that I believe was useful: tags.

Tags are just a label (or multiple labels) that can be given to a unit type. Then we can make changes that only apply to units that have certain tags. For example, instead of listing all the units that an upgrade is applied to, we could instead use tags to assign some custom property (eg, "warrior" or "mage") and then apply the upgrade to all units with that property. These are more useful with attack boosts, since attack boosts can affect multiple factions.

Tags are most effective if they are used consistently throughout the entire techtree. They make it easy to apply attack boosts to a group of units based on some property (such as whether they're a building, a sword user, etc).

Tags also have future potential in being used with other features. For example, looting could be improved by assigning a list of tags for units that can loot (perhaps normal units can loot, but buildings (like the defense tower) cannot). In fact, I intend to extend looting in this way after tags are implemented.

I intend to use the same syntax as GAE did. As an aside, the feature does seem redundant when first using it, but it's actually quite a please to use (speaking from experience) when used consistently throughout the techtree. It works best for mods that use attack-boosts (emanations in GAE) heavily. It's a pain in the ass to keep adding units to the various affects lists of attack-boosts every time you create a unit. Easier to add a tag in one spot.

For a real example of how a tag is useful, consider some zombie warrior that inflicts a disease (using an attack boost) on nearby units (in GAE, this would be better done with an effect, which is essentially an attack boost that is applied to the target of an attack). Anyway, it doesn't make sense to apply a disease to a building, so naturally we're going to limit this attack boost to only effect humanoid units. How do we do this? Do we keep an affects-list of every humanoid unit in this attack boost (and bear in mind we have to manage all these affects-lists)? Tags provide an alternative by simply saying that the attack boost affects "humanoids", and then each humanoid can be given a "humanoid" tag. Thus, we localize the unit properties (being humanoid) to the location that they are relevant.

It's going to be a few days (or perhaps until the weekend) until I can get started with this, so feel free to discuss this idea.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Coldfusionstorm

I *** LOVE IT!.

I miss this! This feature is so nessesary, and should work for targeting too.

i vote yes.

A way to show what tags a Building has would be nice too.(optionable on a per Building per tag basis). so you can chose only to show some tags. so you can create mechanics that rely on tags and use tags for show and hidden mechanics.
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

Quote from: Coldfusionstorm on 22 July 2014, 14:45:21
This feature is so nessesary, and should work for targeting too.
Could you elaborate on what you mean by "targeting"?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Coldfusionstorm

im not sure it's entirely the same, but basically, removing and adding targets to a skill, for example. a skill that does acid damage does not effect Buildings but does effect biological units, but not fx mechanical units. so 3 tags named "Building" "Mechanical" "biological"

a attack skill.
<valid-targets target"=biological">
<non-valid-targets target="building""mechanical">

Does this makes sense.
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

That's simple enough on its own, but because it affects the AI, it's a bit more complicated.

Might be something worth looking into in the future (although at the time, I have little experience with AI).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Coldfusionstorm

Awesome.  :thumbup: you rock omega
WiP Game developer.
I do danish translations.
"i break stuff"

titi_son

Quote from: Coldfusionstorm on 22 July 2014, 15:24:20
im not sure it's entirely the same, but basically, removing and adding targets to a skill, for example. a skill that does acid damage does not effect Buildings but does effect biological units, but not fx mechanical units. so 3 tags named "Building" "Mechanical" "biological"

a attack skill.
<valid-targets target"=biological">
<non-valid-targets target="building""mechanical">

Does this makes sense.

I thought this would be for attack boosts or upgrades and not for attacks because the things your descripe there can be done already. Its called attack-multiplier and uses the armor of the units. You can also say that the unit will only take half the damage or something. Maybe we could add that you can upgrade all units with a specific armor-type. Or can tags and attack-multiplier exists at once? This is not that simple I think, because we need to plan exactly for which things we use those tags.

I think having both could be possible but would confuse players.
My first Tilseset: SPRING :) (included in Megaglest )


Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Coldfusionstorm

Quote from: titi_son on 22 July 2014, 16:20:07

I thought this would be for attack boosts or upgrades and not for attacks because the things your descripe there can be done already. Its called attack-multiplier and uses the armor of the units. You can also say that the unit will only take half the damage or something. Maybe we could add that you can upgrade all units with a specific armor-type. Or can tags and attack-multiplier exists at once? This is not that simple I think, because we need to plan exactly for which things we use those tags.

I think having both could be possible but would confuse players.

This is NOT The same. This makes unit's untargetable by the unit and the damage is simply not applied to units with tags.

Armor is for migation of damage across different units and making some units stronger even tho they have different health portions.

Basically Armor makes a unit Tougher
What i suggest makes you unable to hit a unit.

Again it is NOT the same
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

#8
At the moment I'm having build errors on the current develop branch (without any changes) and have not been able to get any assistance with these.

So I'm putting this on the backburner for now. It's no fun to develop for a program that I can't even reasonably get to compile. If I'm able to get the code to work with me in in the future instead of against me, I'll take another look at implementing this. But in the meantime, this is just a major pain in the ass. Thus, I will not be making any more changes to MegaGlest's game code.


EDIT: Got it working now. As per the advice of titi, the build folder (in mk/linux) has to be removed. It seems that the issue is related to CMake.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

Are these Tags just some kind of shortcuts so you don't have to list all effected units and just write the tag?

If it is like this  and it needs many changes in the code I don't think its needed too much. If its added it should be just made as a shortcut while loading the techtree. Inside the loaded types the unittypes should be explicitlly listed like now because it keeps things simpler( and I think faster )  in the game



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

No, They can work like that, but the purpose is classifying units.
WiP Game developer.
I do danish translations.
"i break stuff"

titi

yes, but thats only useful if you use the classification. And in moment you use it it's the same.



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

and not creating the function in the first place is suposed to help?. Classifying a unit based on unit-type is important.

I will bet you money that this function is going to be worth GOLD.

i know that as a creator it feels good to have control with what's going on but dont strangle this man, Just because you can't see the need or use for it, others can, and we can use it.
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

The one thing about tags is that you need to create the mechanic to utilize the tag. So tags may be of use to modders using scripting, but less valuable to people who can't/don't script.

Tags may be more useful if things are put directly into the engine, such as managing AI and other stuff. I have no idea how far Omega plans to take tags though.

Omega

Molas brings up some additional ideas on how tags could be useful. A Lua function could provide access to tags (so you could, eg, have an area that damages humanoid units).

With that said, I do think tags simplify the process of assigned affected units. Many types of upgrades affect categories of units. Used consistently, assigning units to a category ("tag") in one place (their unit XML) removes the worry of creating inconsistencies (by failing to change every other place that requires this change). It's fairly well established that the more places that have to be updated to fully implement a change, the more complicated it is to create the change (evolutionary coupling aka logical coupling).

Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

Quote from: Omega on 29 July 2014, 04:19:46
With that said, I do think tags simplify the process of assigned affected units. Many types of upgrades affect categories of units. Used consistently, assigning units to a category ("tag") in one place (their unit XML) removes the worry of creating inconsistencies (by failing to change every other place that requires this change). It's fairly well established that the more places that have to be updated to fully implement a change, the more complicated it is to create the change (evolutionary coupling aka logical coupling).
Exactly.  Also, if you want an aura that effects units from other factions (whether friend or foe), without tags you'd have to every possible unit in the tech tree that could be affected, whereas with tags it's much easier.  If you want the aura to affect human units, you just specify that tag, and then it kinda takes care of itself.

titi

What John.d.h says is the first thing that convinces me  ;) . I am just not sure how many changes this will need.



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

Quote from: titi on 29 July 2014, 08:39:01
What John.d.h says is the first thing that convinces me  ;) . I am just not sure how many changes this will need.

The sad thing is that what i said was the exact same thing as Jhon.D, Just in another way...

Im happy Jhon. D got the point across but im a little sad it's so difficult to communicate in general.
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

Quote from: Coldfusionstorm on 29 July 2014, 15:45:02
Quote from: titi on 29 July 2014, 08:39:01
What John.d.h says is the first thing that convinces me  ;) . I am just not sure how many changes this will need.

The sad thing is that what i said was the exact same thing as Jhon.D, Just in another way...

Im happy Jhon. D got the point across but im a little sad it's so difficult to communicate in general.

Its probable that Titi is simply given John undue weight in discussions for reasons that have little to do with the validity of the specific points in question.

John.d.h

Quote from: Coldfusionstorm on 29 July 2014, 15:45:02
The sad thing is that what i said was the exact same thing as Jhon.D, Just in another way...

Im happy Jhon. D got the point across but im a little sad it's so difficult to communicate in general.
I think I emphasized more the cross-faction capabilities and how much work it would save in that regard, which isn't really a message that I gleaned from your posts.  If it's there, I missed it.  If I do better at communication, it's because I have a ton of practice at it, and we're dealing in my native language.

Quote from: MoLAoS on 29 July 2014, 21:55:19
Its probable that Titi is simply given John undue weight in discussions for reasons that have little to do with the validity of the specific points in question.
If you're implying favoritism, my track record with feature suggestions in MegaGlest suggests otherwise.  This might be the first one he's ever agreed with. ;D

MoLAoS

Quote from: John.d.h on 31 July 2014, 02:20:27
Quote from: Coldfusionstorm on 29 July 2014, 15:45:02
The sad thing is that what i said was the exact same thing as Jhon.D, Just in another way...

Im happy Jhon. D got the point across but im a little sad it's so difficult to communicate in general.
I think I emphasized more the cross-faction capabilities and how much work it would save in that regard, which isn't really a message that I gleaned from your posts.  If it's there, I missed it.  If I do better at communication, it's because I have a ton of practice at it, and we're dealing in my native language.

Quote from: MoLAoS on 29 July 2014, 21:55:19
Its probable that Titi is simply given John undue weight in discussions for reasons that have little to do with the validity of the specific points in question.
If you're implying favoritism, my track record with feature suggestions in MegaGlest suggests otherwise.  This might be the first one he's ever agreed with. ;D

Its not favoritism exactly. Its more that he respects you even if he disagrees most of the time. Most people don't base their decisions in discussions on the points made but who makes them. Its not something specific to Titi or you.

titi

John.d.h said that those tags would work across factions ( and maybe even techtrees so you can move factions form other techtrees in and out if they work with the same tags ) . This was a very important point.



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

Quote from: titi on  1 August 2014, 08:51:43and maybe even techtrees so you can move factions form other techtrees in and out if they work with the same tags
Since tags are merely strings, yes, they can be moved into other factions. Of course, this does have the downside of no "type checking" (if you typo a tag, you won't be warned), but this is a useful tradeoff (and not the only thing that isn't checked).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MoLAoS

Quote from: Omega on  2 August 2014, 01:46:05
Quote from: titi on  1 August 2014, 08:51:43and maybe even techtrees so you can move factions form other techtrees in and out if they work with the same tags
Since tags are merely strings, yes, they can be moved into other factions. Of course, this does have the downside of no "type checking" (if you typo a tag, you won't be warned), but this is a useful tradeoff (and not the only thing that isn't checked).

You could make a tag list for the tech tree and check tags in the rest of the XML against that. That will prevent types pretty easily. Its barely any extra effort.

Ishmaru

I support the idea of tags for attack boosts. Both Annex and Terra would benefit greatly from them.

Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer