Author Topic: Problem with "discount_rate" math  (Read 4119 times)

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Problem with "discount_rate" math
« on: 29 September 2010, 19:58:40 »
Ive noticed that when morphing to a unit with a discount rate that the discount rate is not applied for an initial cost. Instead after the unit is morphed the discount rate is then refunded to the player.

EX:

UNIT_A can morph into UNIT_B
discount rate = 50%
Unit_B = 100 gold

instead of costing the player 50 gold for the morph instead it cost 100 gold to start the morph, when morph is completed 50 gold is given back to the player.

This is problematic when you have for example 300 gold and 6 UNIT_A's instead of being able to morph all 6 at once, you would have to morph 3 at a time.

You can test this while morphing swordsman to guards.

This problem has been with Glest for a while and is also present in Megaglest as well. Not sure about GAE.

I hope that I explained this properly. Thanks for listening... err reading I mean!
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

ChupaReaper

  • Guest
Re: Problem with "discount_rate" math
« Reply #1 on: 29 September 2010, 20:49:40 »
I don't think it's a problem, the discount rate pays you back some at the end of the morph so that while the unit is morphing you don't have that money, if it was paid back straight away there would be no point as you might as well just decrease the morph cost itself.

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Problem with "discount_rate" math
« Reply #2 on: 29 September 2010, 21:12:16 »
I don't think it's a problem, the discount rate pays you back some at the end of the morph so that while the unit is morphing you don't have that money, if it was paid back straight away there would be no point as you might as well just decrease the morph cost itself.
Not so.  The cost of the morph is the cost of the unit, so if there are multiple methods of making that unit (i.e. recruit it at the Barracks or morph it from the Swordman), then you need a discount to change the price of the morph without changing the price of recruiting.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: Problem with "discount_rate" math
« Reply #3 on: 4 October 2010, 03:24:48 »
Would this be too difficult to fix?
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

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Problem with "discount_rate" math
« Reply #4 on: 5 October 2010, 02:51:34 »
It's on the to-do list in GAE. It will not happen in vanilla glest, though, as that is no longer actively developed. No news for MegaGlest.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: Problem with "discount_rate" math
« Reply #5 on: 9 October 2010, 18:22:20 »
Thanks!
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

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Problem with "discount_rate" math
« Reply #6 on: 10 December 2010, 10:56:03 »
You all talk about fixing it, but what is the behaviour you would expect?

In the magic faction you need 2 energy points to morph an initiate to a battlemage. If its done you get the 2 energy points back, but the new battlemage also consumes one energy. So in fact you only get one energy back after morphing. I think its an interisting behaviour and I am not really shure if its wrong or right! For me it always looked like it is meant like this, so I don't really see a bug here.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Problem with "discount_rate" math
« Reply #7 on: 11 December 2010, 07:45:26 »
Well, it got posted in 'bug reports',  but I don't think any one called it a bug.

As used in magitech, there is no problem, that is indeed as it was intended.

It's a 'problem' for modder's because it's not really what it say it is, it claims to be a 'discount' but it isn't a discount, it's a refund.

Modder's should be given the option of either behaviour (a proper discount, and a refund like the discount param currently gives).

Unfortunately we can't just use 'discount' and 'refund', because discount means refund already...
Glest Advanced Engine - Code Monkey

Timeline | Downloads