Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2413 closed defect (fixed)

[PATCH] Resource Trickle

Reported by: O.Davoodi Owned by: O.Davoodi
Priority: Nice to Have Milestone: Alpha 16
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Resource trickle component for Persian Apadana (and possible future entities/mods).

Attachments (2)

ResourceTrickle.patch (5.5 KB ) - added by O.Davoodi 10 years ago.
ResourceTrickle&FloatingResources.patch (6.2 KB ) - added by O.Davoodi 10 years ago.
Modified as per sanderd17's comments

Download all attachments as: .zip

Change History (6)

by O.Davoodi, 10 years ago

Attachment: ResourceTrickle.patch added

comment:1 by Erik Johansson, 10 years ago

I don't know anything about the coding (neither what's required, nor what you have done already), so I might be wrong, but just from a theoretical point of view it seems like something like this could be used both for a resource trickle like this and something like the corrals: I.e. resource trickle but only when some required conditions are met (i.e. animals in the corral) and with a rate depending on conditions (i.e. how many animals are in the corral). This probably has to be discussed among the programmers though as the corral will not always have a resource trickle, but rather other effects as well (to be decided exactly, but something like quicker train speed).

I just think it would be bad to develop the same thing twice if it can be done at the same time with a few adjustment :)

comment:2 by sanderd17, 10 years ago

There is a corral ticket: #1907.

Merging it gives some problems, like corrals only expect to give one resource type at a time, and there's no default rate yet. I also wonder if we should abuse corrals for something like this. The corral patch is also certainly not finished (mainly due to design issues, and the consequences of that).

So I'd like to get this in separately.

One thing I don't like in the patch is the storing of the decimals. IMO we should support decimal resources, and just round them in the GUI. It would make code like this a lot simpeler, and wouldn't require us to keep rounding stuff in all components that have something to do with resources. (note that health was also made decimal some time ago, for similar reasons).

by O.Davoodi, 10 years ago

Modified as per sanderd17's comments

comment:3 by O.Davoodi, 10 years ago

Resolution: fixed
Status: newclosed

In 14710:

Implements resource trickle. Allows decimal player resources. Fixes #2413.

comment:4 by sanderd17, 10 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.