Author Topic: Improper EP Consumption when Building, Producing, or Morphing units  (Read 2501 times)

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
This has been a legacy issue from Vanilla Glest, but currently when EP is consumed on Build, Morph and Produce skills, EP is taken on every cycle, which means that the unit will run out of ep before the action is completed. This behavior is wrong, EP consumption should only happen once(on those skills), either when action is completed or when started but only once.
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

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
What is wrong with it, Precisely atm?, i can remember this have been up before, but.

Also a secondary question what happens if a skill is empty for ep before the

I Think it's cool we can control is so precisely as it is atm, What we need i think is more options for controlling it.
(fx consume on end,consume on start). Stuff like this.

And for gods sake make it modular.

The entire skill/command system should be like lego bricks.
WiP Game developer.
I do danish translations.
"i break stuff"

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
What is wrong with it, Precisely atm?, i can remember this have been up before, but.

Not sure whats presice or good about it honestly, Currently the system has major flaws:

-Misleading information if it says cost to produce is 10 ep then it unfair for it to cost more than what is told

-Player has to know ahead of time just how much ep is really needed meaning newbie players will take the ep cost at face value

-Waiting for unit to be produced only to have it canceled due to running out of ep, wasting all that units ep, and your time waiting

-Broken Ai: AI will constantly attempt and fail to produce/morph unit

-Skill may not even be possible, For example unit may have 100 ep and cost is 10 ep to produce, but if it takes more than 10 cycles then it would never be built.

I Think it's cool we can control is so precisely as it is atm, What we need i think is more options for controlling it.
(fx consume on end,consume on start). Stuff like this.

And for gods sake make it modular.

The entire skill/command system should be like lego bricks.

While I do agree that more options are better, I just see the current system as broken and unusable. Really I cant think of one mod that uses ep for unit creation/morphing, I'm sure its mainly for this reason. However, if you really need this to stay then I suggest implementation of tags to support the old system (ep cost per cycle) but I really feel that it shouldn't be the default.  Would that be fair?
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
I had to deal with this when I was working on Mandate. It was really annoying. I ended up rewriting the entire resource for skill code.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile

Not sure whats presice or good about it honestly, Currently the system has major flaws:

-Misleading information if it says cost to produce is 10 ep then it unfair for it to cost more than what is told

-Player has to know ahead of time just how much ep is really needed meaning newbie players will take the ep cost at face value

-Waiting for unit to be produced only to have it canceled due to running out of ep, wasting all that units ep, and your time waiting

-Broken Ai: AI will constantly attempt and fail to produce/morph unit

-Skill may not even be possible, For example unit may have 100 ep and cost is 10 ep to produce, but if it takes more than 10 cycles then it would never be built.

While I do agree that more options are better, I just see the current system as broken and unusable. Really I cant think of one mod that uses ep for unit creation/morphing, I'm sure its mainly for this reason. However, if you really need this to stay then I suggest implementation of tags to support the old system (ep cost per cycle) but I really feel that it shouldn't be the default.  Would that be fair?

1.Yes it is misleading and the way the cost is showed should be changed so that it fits.
2.This is basically the same as 1. And yes it's a problem and should be fixed.
3. Another good point, Also needs to be fixed. Making a skill able to wait for EP would be cool so that you could have paused units in production.
4.I don't bother with AI anymore, it's just useless for mods, im sorry but yeah they are.
5. Not sure what you mean with this, Yes if a unit does not have enought EP for a build skill it will not work. (Duh). :)

But i agree it should be fixed.

And Molaos, Could we see screenshots of mandate?, it's kinda annoying to hear about it alot but never see screenshots. Not to mention the LONG overdue 3d editor you mentioned months ago /years?  ;)
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Sorry, I'm playing EVE and I had to get a job. Not much time for Mandate. Being an EVE nullsec industrialist takes a lot of time and its only going to get worse as I crack the 1tril isk barrier.

I have some videos demonstrating stuff, although my sound refuses to sync so they are weirdly silent. Also you could grab the source and look at it yourself.

Also, this thread is like, almost 4 months old.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Ah yes eve, The Endless timesink for people with spacedreams, Ive been there. :).

But still relevant, this issue is still annoying and counter intuitive!.
WiP Game developer.
I do danish translations.
"i break stuff"

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Well, I am still not sure how to fix it ( and if this is really something which needs to be fixed ).

I can imagine an additional option for HP consumption which only reduces EP on start of a skill, BUT:
Imagine an attack command, it will never stop attacking if there are still enemies in range, as there is no new skill started.

Or maybe you must be able to give a minEP for a skill, not only a  "ep-cost"  tag. So this is an additional condition to be allowed to start the skill.
Example:

minEP=1000
epCost=100

This would mean the skill can be started if you have at least 1000 EP and needs 100 EP each cycle. I bet with this you can create the wanted behaviour. (This would be a feature request)
In general EP is not meant as a resource , so don't use it that way.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
...This would mean the skill can be started if you have at least 1000 EP and needs 100 EP each cycle. ...
for how many cycles? (it should be visible for player before action) ... and what exactly is that cycle? :|

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile

In general EP is not meant as a resource , so don't use it that way.

Then what is it meant as?.

Also what about implementing a "skill full cycle". Wich determines what a full skill cycle is and then you can determine cost on this?.

fx i know that for my skill to fully complete it takes a skill cycle of 500. and on that it subtratcs fx50 ep from the unit. so something like this
also with this behavior it should subtract the EP when the unit starts the ability since it's a requirement.

<skill-cycle-complete value="500" value-cost="50">
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
The way I did it was to remove the ep-cost thing and just add a skill cost class. This class can do items, resources, or any stats pretty much. On the start of an attack it uses up the resource-stat costs given in skill-cost. It iterates through the resource pool vector, in case you want to assign energy, mana, heat, willpower and/or any other number of costs. It also separately eats through health, the shields vector, resources carried by a unit, and items possessed by a unit. Anyone making a moba for instance needs to be able to use multiple resource cost types, for instance LOL has mana, energy, rage, etc.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
The way I did it was to remove the ep-cost thing and just add a skill cost class. This class can do items, resources, or any stats pretty much. On the start of an attack it uses up the resource-stat costs given in skill-cost. It iterates through the resource pool vector, in case you want to assign energy, mana, heat, willpower and/or any other number of costs. It also separately eats through health, the shields vector, resources carried by a unit, and items possessed by a unit. Anyone making a moba for instance needs to be able to use multiple resource cost types, for instance LOL has mana, energy, rage, etc.

Was there any side effects or negative behavior with doing it this way?.
Sounds like a good way to do this. and it would fix this age old issue. and makes things easier :)
WiP Game developer.
I do danish translations.
"i break stuff"

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Hm I think some of you did not get the EP idea as it is now. EP is not meant to be a ressource! EP is something that is unit specific and consumed over time. "time" is one command cycle in megaglest. Just take it as a constantly ticking clock. Its used for food consumption too for example. Up to know there was no real need to show this time to the player. Maybe we should think about it, but that has nothing to do with this problem.

As far as I got Maolas idea, I think thats no solution for MegagGlest, as it breaks current behaviour ( for golem for example ).
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Hm I think some of you did not get the EP idea as it is now. EP is not meant to be a ressource! EP is something that is unit specific and consumed over time. "time" is one command cycle in megaglest. Just take it as a constantly ticking clock. Its used for food consumption too for example. Up to know there was no real need to show this time to the player. Maybe we should think about it, but that has nothing to do with this problem.

As far as I got Maolas idea, I think thats no solution for MegagGlest, as it breaks current behaviour ( for golem for example ).

Titi, Molas simply stated how he did it, you don't need to remove the way the EP cost works as it is now simply modify molas idea to fit.

Instead of removing ep just add the added functionality as Molaos described, As you said yourself titi you have not found a way to do it yourself so what about trying out Molaos idea?. It sounds as a well tought design and as far as i know molas have had that down for some while so the basic idea of it whould work?.

am i wrong?

This is a excellent opportunity to take advantage of having several forks in the glest community.
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
The way I did it was to remove the ep-cost thing and just add a skill cost class. This class can do items, resources, or any stats pretty much. On the start of an attack it uses up the resource-stat costs given in skill-cost. It iterates through the resource pool vector, in case you want to assign energy, mana, heat, willpower and/or any other number of costs. It also separately eats through health, the shields vector, resources carried by a unit, and items possessed by a unit. Anyone making a moba for instance needs to be able to use multiple resource cost types, for instance LOL has mana, energy, rage, etc.

Was there any side effects or negative behavior with doing it this way?.
Sounds like a good way to do this. and it would fix this age old issue. and makes things easier :)

I don't follow, what side effects could there be?

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Well, Since you already had implemented this i was simply asking if there was any secondary effect or you had noticed something about it. Asking for you experience with the implementation is all.
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Hm I think some of you did not get the EP idea as it is now. EP is not meant to be a ressource! EP is something that is unit specific and consumed over time. "time" is one command cycle in megaglest. Just take it as a constantly ticking clock. Its used for food consumption too for example. Up to know there was no real need to show this time to the player. Maybe we should think about it, but that has nothing to do with this problem.

As far as I got Maolas idea, I think thats no solution for MegagGlest, as it breaks current behaviour ( for golem for example ).

Why would it break current behavior? You mean for ep cost on movement or something? This wouldn't necessarily be an issue. For instance in the new AI of Mandate, whenever a unit calculates the optimal attacked based on damage and how much mana, or w/e other resource, it resends the attack skill.

That's not how movement works currently but a trivial fix could be implemented to cause the same behavior as the golem currently has.

As far as the purpose of EP, I am not an MG dev but from my perspective the original Glest simply implemented commands in a non optimal way. Also the terminology may be confusing for a non native english speaker. Mana or energy in the case of Glest games is a resource in the general sense. Its not a resource like faction resources like gold and wood and stone are resources, yes, but resource is a pretty general term. Resource stat would probably be the way to be specific in this case. Health and ep in standard Glest derivatives are resource stats. As opposed to armor which is a modifier stat.

The current way of implementing EP is simply not extensible and not conducive to modding in any of the Glest forks, its not just MG.

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Well, Since you already had implemented this i was simply asking if there was any secondary effect or you had noticed something about it. Asking for you experience with the implementation is all.

Do you mean bugs? I don't have any problems that I'm aware of, although I could be missing some or not have been in a situation where one would appear. In fact because MegaGlest doesn't implement items or local resources or the vectors for shields/mana type stuff it would be fairly simple in comparison to what I had to do.

Indeed I was thinking of reworking skills/commands in general because of the pain it caused me trying to import a skill from a separate XML file as part of my RPG/multi-classing and traits and shit. My primary goal is to make code that is easily extended. Of course I can't be perfect because I can't model another person's mind well enough to know what avenues to leave open, but I do my best.

Although that last paragraph is a little off topic MG wise.

FreshDumbledore

  • Guard
  • ***
  • Posts: 61
    • View Profile
i recently added a produce skill on something with an ep 'cost' (so no over time fading) and to get around this i just made it have pretty much no production time :P but i understand that some people would like to use EP as a resource (only way to do time value based skills in MG, isnt it?), so this wont help everyone.