Author Topic: Non selectable non commandable uints  (Read 1475 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Non selectable non commandable uints
« on: 4 August 2014, 16:05:36 »
There is a new pull request about new swtiches which allows to make a unit non selectable and non commandable.
please discuss:
https://github.com/MegaGlest/megaglest-source/pull/23
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Non selectable non commandable uints
« Reply #1 on: 4 August 2014, 16:16:57 »
Non-commandable would be useful for scenarios. The normal approach (as used by the Storming scenario) is to use units in an allied faction. This would remove the need to use an allied unit (which is kind of confusing and removes a faction).

I'm not sure about use cases for non-selectable though.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Non selectable non commandable uints
« Reply #2 on: 4 August 2014, 16:51:08 »
Non-commandable would be useful for scenarios. The normal approach (as used by the Storming scenario) is to use units in an allied faction. This would remove the need to use an allied unit (which is kind of confusing and removes a faction).

I'm not sure about use cases for non-selectable though.

The new AI in Mandate functions this way. There are actually several trivial ways to implement this. The command part at least. Add a resource that the commands of a unit require, don't put the resource in the game. Boom. Can't ever use the commands. However, I don't understand the purpose of this in MegaGlest because it doesn't have player side AI. The unit would sit there doing nothing. In such a case, why even have commands on that unit?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Non selectable non commandable uints
« Reply #3 on: 4 August 2014, 18:08:05 »
In such a case, why even have commands on that unit?
Have you played the storming scenario? I'm pretty sure that it's in all engines, since it was one of the last additions to vanilla Glest before development stopped. In that scenario, you have to accompany a summoner around the map. If the summoner dies, game over. In order to make things difficult, the summoner moves on her own and you must guard her. But that would be too easy if you could control the summoner (just make her sit in a safe place).

The solution that the original Glest devs used was to make the summoner belong to an allied faction (thus preventing you from issuing commands from her). Making a unit non-commandable would allow this to be done without using a new faction.

Only complaint is that as a unit property, you'd have to create an entirely new unit to use this in scenarios (which is totally doable if you use a custom techtree/faction, but not so doable if you want to use someone else's techtree/faction). I was able to do this in military (several units only appeared in scenarios) since I had full control over the techtree. But a scenario for MG won't be able to modify the MegaPack without requiring a new version of the game (or a MegaPack clone, etc).

So setting a unit non-commandable would probably better as a Lua command.

Although that's assuming that scenarios are the only reason to set a unit non-commandable (but I can't think of any others).
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

titi_son

  • Draco Rider
  • *****
  • Posts: 284
  • titi_son
    • View Profile
Re: Non selectable non commandable uints
« Reply #4 on: 4 August 2014, 19:17:21 »
I like the thoughts about this but this was mainly made for spawn attacks as mentioned in the description of the pull request.

But I can imagine more areas for this:
A moving mine which you can deploy (with morph) and can't be selected afterwards.
Mines which can be built, but cant be selected and commanded. :D
Bees which can be produced in a beehive and will only attack if enemies get near. So you can't (really) use them to attack.

All in all this is mainly meant to be used for units which will attack nearby enemies ( and move to them unlike the attack-stopped command aka Hold Position )
When you use this with spawn attack i would also suggest to give the spawned units a small life time with negative regeneration of hp. So they are no real units in the end.

@MoLAoS Non-Commandable units will auto-attack if there is a enemy nearby for example. So they CAN use the commands, but you can't GIVE them the commands

@Omega Nice idea. I didn't think about scenarios when i made this. Non-selectable could be useful for scenarios too! If you want to make a scenario like the island from tiger you could set the animals non-selectable to get a more realistic feeling, because you can't see how much hp the animal have for example.

In Addition I forgot about the AI while programming so I suppose the AI is still able to control those units. I will try this out and fix it.
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.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Non selectable non commandable uints
« Reply #5 on: 5 August 2014, 02:37:19 »
Some interesting examples for non-commandable units, but I disagree with all the uses of  non-selectable. In all those cases, I'd argue that the unit should still be selectable, otherwise there's no way to view the unit's health. And making them non-selectable seems very inconsistent when we consider that even resources are selectable.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Non selectable non commandable uints
« Reply #6 on: 5 August 2014, 02:57:23 »
Non-selectable only makes sense to me if the unit is not able to be interacted with by the player in any way, meaning it is for cosmetic value only, in which case doesn't setting the unit's size to 0 accomplish the same thing?

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Non selectable non commandable uints
« Reply #7 on: 5 August 2014, 04:51:44 »
In such a case, why even have commands on that unit?
Have you played the storming scenario? I'm pretty sure that it's in all engines, since it was one of the last additions to vanilla Glest before development stopped. In that scenario, you have to accompany a summoner around the map. If the summoner dies, game over. In order to make things difficult, the summoner moves on her own and you must guard her. But that would be too easy if you could control the summoner (just make her sit in a safe place).

The solution that the original Glest devs used was to make the summoner belong to an allied faction (thus preventing you from issuing commands from her). Making a unit non-commandable would allow this to be done without using a new faction.

Only complaint is that as a unit property, you'd have to create an entirely new unit to use this in scenarios (which is totally doable if you use a custom techtree/faction, but not so doable if you want to use someone else's techtree/faction). I was able to do this in military (several units only appeared in scenarios) since I had full control over the techtree. But a scenario for MG won't be able to modify the MegaPack without requiring a new version of the game (or a MegaPack clone, etc).

So setting a unit non-commandable would probably better as a Lua command.

Although that's assuming that scenarios are the only reason to set a unit non-commandable (but I can't think of any others).

That's my bad. I always forget about LUA.

titi_son

  • Draco Rider
  • *****
  • Posts: 284
  • titi_son
    • View Profile
Re: Non selectable non commandable uints
« Reply #8 on: 5 August 2014, 13:56:58 »
I tried to do something like the first skill of weaver from Dota 2:

https://www.youtube.com/watch?v=mBkS_qkj2Us
https://www.youtube.com/watch?v=YfngG2WLpfc

But there the units can be selected i just did the selectable thing because it was soooo easy :P.

Some interesting examples for non-commandable units, but I disagree with all the uses of  non-selectable. In all those cases, I'd argue that the unit should still be selectable, otherwise there's no way to view the unit's health. And making them non-selectable seems very inconsistent when we consider that even resources are selectable.
Maybe you are right. As i said it was too easy to not do it ;)

Non-selectable only makes sense to me if the unit is not able to be interacted with by the player in any way, meaning it is for cosmetic value only, in which case doesn't setting the unit's size to 0 accomplish the same thing?
The non-selectable units can be attacked (even by rightclicking them ) and they will block the way unlike the 0 size units.

But think you are right the "Non-selectable only makes sense to me if the unit is not able to be interacted with by the player in any way, meaning it is for cosmetic value only".
So should this stay for "cosmetic values" or not? I remember the scenario mission: brake out (from Eleminator i think; its available in the mod center ingame) where he used a unit to make a fence and the whole fence can be selected!
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.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: Non selectable non commandable uints
« Reply #9 on: 5 August 2014, 14:02:30 »
Non-selectable only makes sense to me if the unit is not able to be interacted with by the player in any way, meaning it is for cosmetic value only, in which case doesn't setting the unit's size to 0 accomplish the same thing?

The problem with size 0 units is that they are not intractable in any way, no effect on collisions, no damage, etc so it would not accomplish the same thing.

Terra has a unit that I would prefer to be non selectable, a defensive position, it emits an attack boost that increases defense, but I want it to function more like if it was a tileset, and not a useable unit.

How about making indestructible things such as walls?

How about decoy units?

Mines like titi-son says, Mines are useless in techtrees that focus on range combat, as the ai will ALWAYS shoot the mines to clear them out, and setting their size to 0 will prevent mines from self destructing, even via attack boost.

Another would be great for Attack Spawned units.

I personally don't see the use in LUA as you can just use an allied faction.
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

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Non selectable non commandable uints
« Reply #10 on: 5 August 2014, 14:33:25 »
Mandate has emanations inside tiles themselves, as well as from map objects. Those might be more useful methods than non-selectable units and require very little code to set up.

 

anything