Enginecrafter77 / SurvivalInc

A Minecraft mod that aims to make your minecraft life a little bit more annoying
https://www.curseforge.com/minecraft/mc-mods/survival-inc
MIT License
9 stars 6 forks source link

[Heat Mechanic Suggestion] Add Compatibility with "Sips", or alternatively, add additional drinks/containers #36

Open Trex9921 opened 3 years ago

Trex9921 commented 3 years ago

I was taking a look at this mod earlier, trying to get some solid combinations of weather mechanics into my personal modpack right now. I saw some of the issues and suggestions, like how Heat needs some type of a revamp and to add compatibility with Heat and Climate, which I think is also a very good mod. It got me thinking about other ways to help cope with heat/cold and I also went to create a creative world for tests, found a nice Snowy Tundra, and built a small dwelling to test various mechanics. I was scrolling through curse and saw "Sips", which is a small mod that adds containers that pick up the various liquids. Water, Lava, Milk, Mushroom Stew even. It has simple config options to allow people to add Nutrient values, damage, and potion effects to be added to any fluid. And any unknown fluids have some default effects depending on their temperature.

It definitely sounds like it could help to have either compatibility with the mod, or some similar type of system but on a smaller scale. For example, being able to drink Mushroom Stew or another liquid that's classified as a warm temperature in order to give your body some kind of base warm saturation effect for a short period of time, or alternatively water also giving you a cooled saturation for when you're in the desert. Basically a heap of Heat/Cold resistance but again for a limited duration. This isn't a full on rework, but it may prove to be a decent stop-gap measure and help get some ideas flowing. Anyways I'm gonna get back to playing, let me know what you think and in the meantime I'll try and think of anything else that may be good.

Thanks!

Enginecrafter77 commented 3 years ago

Hi, sorry for the delay, I was facing a lot of difficulties lately and so I was unable to work on this project. To the point, I am already working on a system of giving items sort-of "boosts" using a simple JSON file. This way, cross-mod compatibility can be easily added. I have already commited some of the changes here, but in it's current state it's a dumpster fire to be honest so I really need to work on that. But I hope I can work that out so it turns out successful.

gatoborrachon commented 3 years ago

@Enginecrafter77 well, first of all take your time, there's no hurry, many thanks for developing this mod, it's a true (and better/immersive) alternative to mods like TaN or SimpleDifficulty mod.

I am already working on a system of giving items sort-of "boosts" using a simple JSON file

if i understand correctly and for example: We can add to a modded food the property to increase the body temperature?

Also, i think that the best way to handle the compat for fluids would be through Potion Effects, so if you implement potions to increase/decrease the body temperature, we only need to add that potion effect to the desired fluid.

Enginecrafter77 commented 3 years ago

@gatoborrachon Yeah I was thinking about implementing some potion effects influencing the stats, though I don't think using them all the time is an optimal approach. I find it rather hacky. I mean, it's okay to e.g. have an XY item that gives you small heat boost effect (let's say for 30s or so), but I don't really like having an item keeping a potion effect on all the time. I mean, there are already facilities for implementing it more effectively, the JSON system I'm currently working on (temporarily dubbed "the ItemEffect framework") being one of them.

And yes you're right. The system will allow you to specify the influence of an item on the stats in various situations. Here's an example of a JSON compatible with the current implementation (but don't take it too seriously, I'm 99% positive I will adjust it later on to accomodate additional functionalities)

[
    {
        "type": "inventory",
        "parameters": ["minecraft:apple"],
        "effects": {
            "survivalinc:sanity": 0.1
        }
    },
    {
        "type": "hand",
        "parameters": ["minecraft:beef"],
        "effects": {
            "survivalinc:sanity": -0.5,
            "survivalinc:hydration": -0.5
        }
    }
]

To explain the structure, the top-level structure is an array with the situation objects. Each situation is defined by a "type" (which corresponds to a handler in the code). In this example, there are two handlers: "inventory" is the situation where an item is in the inventory, while "hand" is a situation where the item is held in main hand. The parameter is a string array that is passed directly to the situation handler; in this case it's used to specify the item the situation concerns. And the effects object is pretty much self-explanatory: it defines the change performed each tick to a stat with the given identifier.

gatoborrachon commented 3 years ago

I find it rather hacky.

-oh i see it now, yeah if we can add to an easy-to-obtain fluid a powerful effect to change the body temp, that would be unbalanced if we look at the other (more complex/balanced/polished) methods to control the temperature that we have. i totally get your point.


-also, i like the system that you are working on, it gives the desired effect based on an item (that can be hard to obtain) and if you require to expend an inventory slot or even, one hand slot.

-but i have some doubts: 1.- the values (of for example: sanity drain/increase) that we have in the config file of SurvivalInc should be taken as the reference values for future customizations right?

2.- (In both config and that .json file) is it possible to let us use items with Metadata? or that would require a lot of rewrite in the code? (no problem if its not possible)

Enginecrafter77 commented 3 years ago
  1. Yes you can think about it that way, but mainly for balancing reasons. I mean, the values in the JSON are not dependent on the values in the config, so you can pretty much put any value there if you find it appropriate. I can see that it may be viable to add some sort of variables so you can use that in the JSON, for example 1.5 * ${base_sanity_drain}. Also, don't take the values from the JSON I posted to seriously, this is just a testing JSON I used to test the system. I purposefully amplified them so the effect would be more noticeable.
  2. At the time of writing, it is not possible, but it certainly will be. Considering the fact that many 1.12.2 mods still use the "one item registry name for every item in the mod (with varying meta)" approach (probably a relic from the era of numeric IDs), it is absolutely necessary to implement metadata matching.