Open IdleSol opened 4 weeks ago
Turns out that's not the end of it. Let's take the original version of the pill. The concentration is 1, set the absorption time to 16 minutes (so that it is not a multiple of 30 minutes).
3.1 "vit_type": "toxin" and "vit_type": "counter" | Time | |
---|---|---|
8:59:50 | Tablet consumed. Message received about vit_AMED_I vitamin appearance | |
9:00:00 | Nothing | |
9:04:00 | Message received about vit_AMED_I vitamin missing | |
9:30:00 | Message received about vit_AMED_II vitamin appearance | |
9:36:00 | Message received about vit_AMED_II vitamin missing |
Time | |
---|---|
9:00:00 | Tablet consumed. Message received about vit_AMED_I vitamin appearance |
9:04:00 | Message received about vit_AMED_I vitamin missing |
10:00:00 | Message received about vit_AMED_II vitamin appearance |
10:08:00 | Message received about vit_AMED_II vitamin missing |
8:00:00 + 4x16 = 9:04:00 + 2x16 = 9:36:00 + 2x16 = 10:08:00
But 8 hours, that's 8 x 60 / 16 = 30. Let's change it to 17 minutes, to check the starting point.
Time | |
---|---|
8:59:50 | Tablet consumed. Message received about vit_AMED_I vitamin appearance |
9:15:00 | Message received about vit_AMED_I vitamin missing |
9:30:00 | Message received about vit_AMED_II vitamin appearance |
9:32:00 | Message received about vit_AMED_II vitamin missing |
9:15:00 + 1x17 = 9:32:00
08:00:00 + 4x17 = 9:08:00 != 9:15:00 00:00:00 + 32x17 = 9:04:00 != 9:15:00
??? 19 min: 9:04:00 23 min: 9:00:00
And also 9:00:00 is 5216400 moves (=sec), which corresponds to 60 full days and 9 hours. So we count the cycle from the “creation” of the world? I guess that makes sense?
No one wants to see how much resources it takes? Make a tablet with 10-20 different vitamins and different rate
parameters and look at the load.
3.2. "vit_type": "drug"
rate = 16 min |
Time | |
---|---|---|
8:59:50 | Tablet consumed. Message received about vit_AMED_I vitamin appearance | |
9:00:00 | Message received about vit_AMED_II vitamin appearance | |
9:04:00 | Two messages. Vitamin vit_AMED_I and vit_AMED_II is missing |
Time | |
---|---|
9:00:00 | Tablet consumed. Message received about vit_AMED_I vitamin appearance |
9:04:00 | Message received about vit_AMED_I vitamin missing |
9:30:00 | Message received about vit_AMED_II vitamin appearance |
9:36:00 | Message received about vit_AMED_II vitamin missing |
Describe the bug
Discount my poor command of the English language.
Vitamin documentation: https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc/VITAMIN.md
I. Introduction In this topic, I will look at two ways to obtain vitamins. Here are both ways, in one example:
As you can see from the example, we can add a vitamin as:
use_action
section (see vit_AMED_I)They do not conflict with each other and can be used simultaneously. Tested on version cdda-windows-tiles-x64-2024-10-04-0532.
On a separate note, there is another way. Add an effect that adds a vitamin during its effect. Theoretically, it could also set the absorption rate of the vitamins. But I am not considering it in this topic. (And I don't plan on checking it). So if anyone wants to test it, they can feel free to start.
While testing the methods described above, I found a few bugs in the work. At least between the way I understood the documentation and the results I got. So this thread is a bug report, not a suggestion.
II. How does it work? What is the difference between these methods? To find out, a test version of the A-MED pill will help us. test_med.json
Details
``` [ { "id": "test_AMED", "type": "COMESTIBLE", "comestible_type": "MED", "name": { "str_sp": "TEST A-MED" }, "description": "Abstract medicine", "weight": "1 g", "volume": "1 ml", "price": "2 cent", "price_postapoc": "30 cent", "material": [ "drug_filler" ], "symbol": "!", "color": "white", "container": "bottle_plastic_pill_painkiller", "healthy": -1, "flags": [ "WATER_DISSOLVE", "EDIBLE_FROZEN" ], "use_action": { "type": "consume_drug", "activation_message": "You take some %s.", "vitamins": [ [ "vit_AMED_I", 1 ] ] }, "vitamins": [ [ "vit_AMED_II", 1 ] ] }, { "id": "vit_AMED_I", "type": "vitamin", "vit_type": "toxin", "name": { "str": "AMED_I" }, "excess": "TEST_MESSAGE_AMED_I", "min": 0, "max": 10, "rate": "15 m", "disease_excess": [ [ 1, 10 ] ] }, { "type": "effect_type", "id": "TEST_MESSAGE_AMED_I", "max_intensity": 1, "rating": "good", "apply_message": "vit_AMED_I START", "remove_message": "vit_AMED_I STOP" }, { "id": "vit_AMED_II", "type": "vitamin", "vit_type": "toxin", "name": { "str": "AMED_II" }, "excess": "TEST_MESSAGE_AMED_II", "min": 0, "max": 10, "rate": "15 m", "disease_excess": [ [ 1, 10 ] ] }, { "type": "effect_type", "id": "TEST_MESSAGE_AMED_II", "max_intensity": 1, "rating": "mixed", "apply_message": "vit_AMED_II START", "remove_message": "vit_AMED_II STOP" } ] ```Key details:
As you can see, they are the same vitamins, with the same concentration and time of absorption. And the effects make corresponding entries in the log messages. So all the differences will just depend on the location of the vitamin section.
2.1. "vit_type": "vitamin"
Not within the audit scope.
2.2. "vit_type": "toxin"
It seems simple: t = 0. Used the tablet. Received both vitamins (two text messages about the beginning of the effects) t = +15 minutes. The vitamins are absorbed by the body. (two text messages about the finishing of the effects)
Let's change the concentration of the tablets. Let's set it to 10 units each. Checks every 15 minutes, through the debug menu. 8:59:50 - Tablet consumed. The consumption time of the tablet is 6 seconds, so the first measurement is at 8:59:56. Format for recording the concentration:
daily
/overall
Change the rate value by setting it to 1 hour.
"rate": "60 m",
For all vitamins. Let's leave the other parameters as in the previous example. (Concentration 10 units).Conclusions
rate
or the current stomach cycle, equal to 30 minutes, will be completed. Subsequent units are absorbed according to therate
value.rate
parameter.2.3. "vit_type": "counter"
Expectations haven't changed. However, the results have not changed either. They fully correspond to the results with “vit_type”: “toxin”
2.3. "vit_type": "drug"
The description talks about the stomach cycle. And that it should take 30 minutes at first. Simple?
Expectation:
t = 0. Used the tablet. t = +30 min. Received both vitamins (two text messages about the beginning of the effects) t = +45 min. The vitamins are absorbed by the body. (two text messages about the finishing of the effects)
Cancel all changes in the test_med.json file. Concentration is equal to 1,
rate
parameter is equal to 15 minutes. Change thevit_type
.Now let's increase the concentration to 10 units. 8:59:50 - Tablet consumed. The consumption time of the tablet is 6 seconds, so the first measurement is at 8:59:56. Format for recording the concentration:
daily
/overall
One last check, let's increase the rate parameter to 60 minutes.
Conclusions
rate
or the current stomach cycle, equal to 30 minutes, will be completed. Subsequent units are absorbed according to therate
value.3. Conclusion. None of the ways in which the vitamin enters the body are consistent with the documentation. I'm not at liberty to say what the problem is. Perhaps incorrect implementation or insufficiently detailed description in the documentation.
The most universal method is to include the vitamin in the
use_action
section. Then regardless of the type of vitamin, it has the same behavior. If the item is not supposed to use this section (why does it need vitamins?). Then it is better to use thedrug
type. Since they have the most predictable behavior.Separately, I would like to point out that the higher the concentration, the less the influence of the way the vitamin is recorded. For example, if the concentration is 1000, it makes no difference whether the count starts at 1000 or 999.
At the same time, it is not possible to accurately predict the duration of the vitamin. Because it is not known at what point in the stomach cycle the tablet will be taken. This is especially critical for long-acting vitamins with small concentrations. To give you an example: 1 vitamin with a 1-day duration, will be absorbed in the first half hour.
Attach save file
n/a
Steps to reproduce
n/a
Expected behavior
Screenshots
No response
Versions and configuration
Tested on game version: cdda-windows-tiles-x64-2024-10-04-0532
Additional context
No response