Mods / No Charcoal Lost

Category: #Cheat #QoL #Tweak
Author: BillyGalbreath
Side: Server
Created: Aug 18th 2023 at 8:55 PM
Last modified: Aug 18th 2023 at 8:56 PM
Downloads: 2728
Follow Unfollow 63

Latest file for Various v1.19.x:
NoCharcoalLost.zip 1-click install


Tired of losing firewood to the charcoal pit?

This mod ensures a 1:1 ratio of firewood:charcoal so none of it is lost.

Put 1 block of firewood in (32 firewood) get 1 block of charcoal out (8 layers)! \o/

If you like this mod, you might also like No Coke Lost.


-------------------------------------------------------------------------------------------------------------

Remember, I build these mods for myself and my family. Not you. I owe you nothing. I just like sharing what I've built with others for free. You will receive minimal to no support when using any of my mods.

-------------------------------------------------------------------------------------------------------------

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.0 2728 Aug 18th 2023 at 8:56 PM Show NoCharcoalLost.zip Install now

11 Comments (oldest first | newest first)

💬 Pervy_Sage, Jan 21st at 11:17 AM

I never really thought about it before but the loss even with this mod is very large. I know to make charcoal it has to cook to a certain degree but how much is lost should be more fixed, otherwise the wood would "cook" to ash. This should be how it is in vanilla imo.

Thanks for sharing.

💬 BillyGalbreathAuthor, Oct 18th 2023 at 1:18 PM

Buggi

> Okay, so you are right about the firewood pile. I checked the base game files and 32 firewood goes into every full 'block' stack.

I know I'm right.

> However, you do not ever get 2 charcoal for a layer. The files (and code, I checked) only ever give you a max of 8 charcoal for a full block-height pile of charcoal. There is no randomly given extra.

I'll give you this one. I double checked and the charcoal piles from the charcoal pit indeed only give 8 charcoal (1 per layer). I was under the impression it was the same as a regular block of charcoal's 16 (2 per layer max, with top layer only having 1 if the total block has an odd number of charcoal).

image

So congrats. You have proved someone wrong on the internet about a mundane and irrelevant semantic. I hope that makes you feel better about yourself.

> So the ratio is at best 4:1.

I still dont think you understand the concept of 1 block to 1 block ratio.

> There is a seperate mod that tweaks the charcoalpile to randomly give an extra, but I'm comparing vanilla here.

No one said anything about other mods..

> So in the description above you have of a 1:1 return, can't be true as you don't have a json patch setting that each layer drops 4 charcoal.

Nope. I'm leaving the description as-is.

> What you did essentially is eliminate the randomness of 'loss'.

Yup. That's the exact goal of this mod. I'm glad you finally realized. You get back 1 full block of charcoal for every 1 block of firewood you put in.

aka 1:1 ratio

image

> And I looked closely and couldn't find a more elegant way of doing that than what you did. And I hate making Transplier mods so bravo!

Doesn't take much to impress you, I guess? This is one of my simplest mods I've created for this platform. First use of Harmony ever, even. But I'm glad I get your seal of approval..

💬 Buggi, Oct 17th 2023 at 9:26 PM

BillyGalbreath

Okay, so you are right about the firewood pile. I checked the base game files and 32 firewood goes into every full 'block' stack.

However, you do not ever get 2 charcoal for a layer. The files (and code, I checked) only ever give you a max of 8 charcoal for a full block-height pile of charcoal. There is no randomly given extra.

So the ratio is at best 4:1.

There is a seperate mod that tweaks the charcoalpile to randomly give an extra, but I'm comparing vanilla here.

So in the description above you have of a 1:1 return, can't be true as you don't have a json patch setting that each layer drops 4 charcoal. What you did essentially is eliminate the randomness of 'loss'. And I looked closely and couldn't find a more elegant way of doing that than what you did. And I hate making Transplier mods so bravo!

💬 BillyGalbreathAuthor, Sep 5th 2023 at 11:04 PM

Buggi

> There's actually 16 firewood in a block, but the most charcoal you can get back is always 8.

Well, if you want to get technical.... There's actually 32 firewood in a block, represented by 16 visual firewood. A visual firewood can be an actual 1 or 2 firewood, depending on how many are in the stack. Charcoal works in layers. there are 8 visual layers of charcoal for every 4 visual layers of firewood. Each layer of charcoal is actually 1 or 2 charcoal. So you can get a max of 16 charcoal from a max stack of 32 firewood. When i say "1:1 ratio" i am talking about the whole visual block space.

> For some reason you (the OP) just removes 13 opcodes including the conversion to integer and set the value of charCoalQuantity = (float)val.Value.X

Yes. I remove 13 opcodes from this 17 opcode instruction set to modify this single line of code, which results in charCoalQuantity = val.Value.X (the cast to float is one of the many operations that was removed)

> Why not just set the variable to 8?

Because all this logic is dealing with the entire column of charcoal. It could be 1 block (value of 8), or 13 blocks (value of 104), or any increment of 8 in between.

If you'd like to have a conversation I am available on the VS discord. Just ping me any time ^_^

💬 Buggi, Sep 5th 2023 at 10:00 PM

So the issue could be 
A) There's actually 16 firewood in a block, but the most charcoal you can get back is always 8. So even with this mod your still losing half. If the player is using a mod that modifies the original stack of wood or the stacksize of wood it might affect it.
B) Obviously versioning errors since the game just got an update and now uses .NET 7.

Here's the line he changes with this mod:
int charCoalQuantity = (int)((float)val.Value.X * (0.125f + (float)this.Api.World.Rand.NextDouble() / 8f));

For some reason you (the OP) just removes 13 opcodes including the conversion to integer and set the value of charCoalQuantity = (float)val.Value.X

Why not just set the variable to 8?

💬 Drakonianus, Aug 20th 2023 at 9:17 PM

@BillyGalbreath

 

I see the logs files.

The only weird thing I've seen is that if I load another mod, it shows up as loaded in the logs. However, if I only load yours, it doesn't show up.
It is as if the mod dll is not loaded.

That could explain why I don't see any change in the charcoal pit behavior.

I downloaded the code of your mod and compiled it and repack it. Now it appears as loaded. But it still doesn't work.

I show server-debug.log partially:

20.8.2023 23:24:11.991 [VerboseDebug] Entering runphase Initialization
20.8.2023 23:24:11.996 [VerboseDebug] Entering runphase Configuration
20.8.2023 23:24:12.055 [VerboseDebug] Entering runphase LoadAssets
20.8.2023 23:24:12.269 [VerboseDebug] [VSCreativeMod.dll] Check for mod systems in mod C:\Games\Vintagestory\Mods\VSCreativeMod.dll
20.8.2023 23:24:12.280 [VerboseDebug] [VSCreativeMod.dll] Selected assembly C:\Games\Vintagestory\Mods\VSCreativeMod.dll
20.8.2023 23:24:12.281 [VerboseDebug] [VSEssentials.dll] Check for mod systems in mod C:\Games\Vintagestory\Mods\VSEssentials.dll
20.8.2023 23:24:12.287 [VerboseDebug] [VSEssentials.dll] Selected assembly C:\Games\Vintagestory\Mods\VSEssentials.dll
20.8.2023 23:24:12.289 [VerboseDebug] [VSSurvivalMod.dll] Check for mod systems in mod C:\Games\Vintagestory\Mods\VSSurvivalMod.dll
20.8.2023 23:24:12.302 [VerboseDebug] [VSSurvivalMod.dll] Selected assembly C:\Games\Vintagestory\Mods\VSSurvivalMod.dll
20.8.2023 23:24:14.221 [VerboseDebug] [nocharcoallost] Check for mod systems in mod C:\Users\Drakonianus\AppData\Roaming\VintagestoryData\Cache\unpack\NoCharcoalLost.zip_6816642cfd53\NoCharcoalLost.dll
20.8.2023 23:24:14.223 [VerboseDebug] [nocharcoallost] Loaded assembly C:\Users\Drakonianus\AppData\Roaming\VintagestoryData\Cache\unpack\NoCharcoalLost.zip_6816642cfd53\NoCharcoalLost.dll
20.8.2023 23:24:14.225 [VerboseDebug] 5 assemblies loaded
20.8.2023 23:24:14.225 [VerboseDebug] Instantiate mod systems for nocharcoallost
20.8.2023 23:24:14.226 [VerboseDebug] Instantiate mod systems for TA_plainsandvalleys
20.8.2023 23:24:14.226 [VerboseDebug] Instantiate mod systems for game
20.8.2023 23:24:14.232 [VerboseDebug] Instantiate mod systems for creative
20.8.2023 23:24:14.233 [VerboseDebug] Instantiate mod systems for survival
20.8.2023 23:24:14.274 [VerboseDebug] Searching file system (including mods) for asset files
20.8.2023 23:24:14.453 [VerboseDebug] Finished building index of asset files
20.8.2023 23:24:14.486 [VerboseDebug] Reloaded lang file with mod assets
20.8.2023 23:24:14.508 [VerboseDebug] Started mods
20.8.2023 23:24:14.531 [VerboseDebug] Patchloader finished

 

💬 BillyGalbreathAuthor, Aug 20th 2023 at 9:01 PM

Drakonianus

Not sure what to tell you.

"It works on my machine."™

Maybe check your logs for any errors?

💬 Drakonianus, Aug 20th 2023 at 8:52 PM

I test the world with your mod only.

https://imgur.com/23HPCc0

You can see what I say in the image

💬 BillyGalbreathAuthor, Aug 20th 2023 at 8:46 PM

Drakonianus

Maybe you have another mod that messes with the same bytecode I'm messing with in this mod. Other than that, ¯\_(ツ)_/¯

If you find out what the cause is, let us know so I can start a list of incompatible mods.

💬 Drakonianus, Aug 20th 2023 at 7:34 PM

For me, the mod don't work. I still have charcoal lost. My game version is 1.18.8.

I made a new world to ensure a clean use of the mod

💬 Mendall, Aug 20th 2023 at 2:34 PM

In the real world there are methods of making charcoal with little or no loss, but they require a closed oxygen free chamber with an external fire and fuel source. So a better way to get this effect would be to make a multi block structure like a cementation furnace. In fact, it could be a cementation furnace minus the coffin and the grates in the floor

but in the real, there would be no way to get lossless charcoal in a pit where the fire is in the same area as the charcoal being made.

(edit comment delete)