Terraria weight gain mod (in development)

I guess just adding a lot a config options would be the best way to go about it. Everyone will want something different.

”Do note that there are currently no plans for NPC fattening as I first wanna get the player perfect”
My idea was that since adding sprites for every accessory and armor piece is virtually impossible, a more reasonable alternative would be to give the player the option to pick from some premade characters/NPCs that would include all of the sprites associated.

1 Like

Hmmm okay so note, apparently honey applies constantly, so adding a large number for it makes u balloon incredibly quickly

image

Sorry for replying so often, I’ve just been actively using this mod and want to give feedback (I’m also very excited to use it!), where is the logic for weight loss from movement stored? I think it’s a bit too punishing right now for normal gameplay and want to try to tune it!

It’s in Common/Players/WgPlayer.cs

public override void PreUpdateMovement()
{
    float factor = MathF.Abs(Player.velocity.X); // X Velocity
    factor += MathF.Abs(Player.velocity.X - _prevVel.X) * 40f; // Acceleration
    factor *= 0.001f; // Multiplier

    SetWeight(_weight - factor);
    _prevVel = Player.velocity;
}

It takes into consideration the player’s X velocity and also their acceleration (change of velocity) meaning sudden changes in movement will result in the most effect (for example, starting to walk, or stopping)

Also I moved the BuffTable from WgPlayer.cs to WgMod.cs just so you know :3 (You can see the full history of changes over at the git repo)

1 Like

Got it… I assume the multiplier would be the best place to begin for fine tuning? Thank u so much for being so communicative!

1 Like

I added another 0 to the multiplier value (0.001f to 0.0001f), and the fat is much stickier now! It feels properly like I need to exercise if I wanna lose weight, rather than just losing weight passively by doing what I’d normally do >:3

Would it be possible to clamp how many times weight effects can be applied per amount of time? I’ve noticed that for AOE effects as well as environmental effects, the effect is applied every frame, meaning that the weight gain will also be applied every frame

That could be an option however that would be too much work for me :’3
I’m a programmer that just so happens to do art too; What I’m trying to say is art can be pretty exhausting
That’s why currently fat animations are done via code, meaning I only have to draw some bellies and legs once and the code does the rest

Oh, also, I forgot to clarify the hitbox situation earlier
The thing about those… is that I don’t know :3 I have a preeetty big suspicion that player hitboxes are hardcoded on Terraria… so resizing the hitbox could be next to impossible, would probably require some hacky workaround

1 Like

Like a cooldown? I reckon maybe a better way to tackle that would be to give the player a Bloating/Gaining buff that lasts a certain amount of time (and would only be given if it isn’t active already)

Update, I’m playing master more / revengeance, needing to fight tough bosses while all of the potions I’m chugging are slowly making me less and less mobile was really hot and I would recommend it

1 Like

Hmm maybe maybe! Essentially what my idea is is that when u’re submerged in honey, u have no choice but to swallow the honey and it’s fattening u up >:3

1 Like

woah I’m actually so hyped for the changes you’re adding, are you releasing the files anywhere? I kinda wanna work on my own fork with some funny ideas…

They’re already on Github! I believe it’s linked in the initial post

You should definitely share your mod changes at some point so that they can be added to the main repo :3c

:0 I’d love to! I’m currently still playing with my changes for the first time so I still need to tweak them, but I can absolutely post my vibes-based values I came up with!


        [BuffID.WellFed] = 4f,
        [BuffID.WellFed2] = 5f,
        [BuffID.WellFed3] = 6f,
        [BuffID.ObsidianSkin] = 3f,
        [BuffID.Regeneration] = 6f,
        [BuffID.Swiftness] = 1f,
        [BuffID.Gills] = 2f,
        [BuffID.Ironskin] = 4f,
        [BuffID.ManaRegeneration] = 4f,
        [BuffID.MagicPower] = 3f,
        [BuffID.Featherfall] = 1f,
        [BuffID.Spelunker] = 6f,
        [BuffID.Invisibility] = 2f,
        [BuffID.Shine] = 1f,
        [BuffID.NightOwl] = 1f,
        [BuffID.Battle] = 2f,
        [BuffID.Thorns] = 1f,
        [BuffID.Archery] = 2f,
        [BuffID.Hunter] = 3f,
        [BuffID.Gravitation] = 2f,
        [BuffID.PotionSickness] = 24f,
        [BuffID.Tipsy] = 12f,
        [BuffID.Honey] = 0.05f, // This value needs to be very low because the honey effect applies every single frame while submerged in honey, causing rapid weight gain
        [BuffID.Ichor] = 2f,
        [BuffID.ManaSickness] = 12f,
        [BuffID.Mining] = 1f,
        [BuffID.Heartreach] = 3f,
        [BuffID.Calm] = 6f,
        [BuffID.Builder] = 1f,
        [BuffID.Titan] = 8f,
        [BuffID.Flipper] = 2f,
        [BuffID.Summoning] = 3f,
        [BuffID.Dangersense] = 1f,
        [BuffID.AmmoReservation] = 2f,
        [BuffID.Lifeforce] = 6f,
        [BuffID.Endurance] = 4f,
        [BuffID.Rage] = 2f,
        [BuffID.Inferno] = 3f,
        [BuffID.Wrath] = 4f,
        [BuffID.Fishing] = 1f,
        [BuffID.Sonar] = 1f,
        [BuffID.Crate] = 1f,
        [BuffID.Slimed] = 2f,
        [BuffID.SoulDrain] = 1f,
        [BuffID.SugarRush] = 12f,
        [BuffID.Lucky] = 2f,
        [BuffID.HeartyMeal] = 2f

This is the list I’m using as of right now! These numbers definitely need more tweaking, but overall I’m satisfied with how the whole “potions fatten you up” thing plays!

1 Like

Something I think I’m sorely missing out on is an easier way to lose weight

I’ve decreased the weight loss multiplier enough so that the weight sticks on me for long periods of time rather than disappearing immediately, but I still need to tweak it in a way that I can lose weight more easily

I’ve actually already built my own sort of treadmill via hoiks! It works for passive weight loss but isn’t perfect

1 Like

I’m gonna look into how I can do stuff like, say, coding accessories, because I have so many accessory ideas for this mod that I’d love to try and make

def check out the tModLoader wiki it shouldn’t bee too hard to comprehend if you have basic C# knowleadge :3 Also take a look at the ExampleMod’s source code, whenever I can’t find what I’m looking for in the wiki or anywhere else I look at it, it has examples for pretty much anything

1 Like

So I notice that a lot of the example accessories have “using” at the top with various supposed other files listed, could that be used to link an item to one of this mod’s files? For instance if I wanted an accessory to affect how quickly weight is lost or gained!

Well that’s part of the C# programming language. It’s a using directive.

Types in C# have a namespaces, and while you could type the whole name every time you want to use a Type, it’s better to have a using directive at the top of the file so that for example instead of typing “Microsoft.Xna.Framework.Vector2” you’d type “using Microsoft.Xna.Framework;” at the top then just type “Vector2” whenever you want to access it. Namespaces are independent from folders (but the latter are often structured to fit namespaces) and are a way to organize code.

If you’re not familiar with programming then a bunch of that must sound like nonsense x3

1 Like