Mods / Immersive Phototrophy

Tags: #Food
Author: OmegaHaxors
Side: Both
Created: Sep 14th 2021 at 1:14 AM
Last modified: Apr 24th 2023 at 10:09 AM
Downloads: 7123
Follow Unfollow 33

Latest release (for Vintage Story 1.18.1, outdated):
ImmersivePhototrophy.zip  1-click install


Hate eating all the time? Think that hunger mechanics are more annoying than they are fun?
Become a plant. They can make energy from the sun, skipping the eating process completely!

Simply type /photosynthesis to become a plant. If you type it again, you'll turn back into a boring mundane animal.
While a plant, you restore energy when in light. Not just sunlight, but also held light, block light, and even light coming off of entities.
Your plant skin will also generate sugar and inject it right into your blood, giving you lots of energy. The more light, the faster you go.
Not only that, but you can also sunbathe by sleeping out in the sun in order to gain food at the cost of daylight. Risk and reward!

All values are based on real life. A lot of research and effort went into ensuring a perfect balance, backed up by real world values.
It's not all good though, there's downsides. Your heavy plant skin will make you 10% slower. Clothing and armor also blocks light.
This means that you'll have to put up with harsher winters, will be more vulnerable to enemy attacks, and will likely live in a greenhouse.

By typing /exposure, you can get a quick look at how much energy you are producing and how much skin is exposed.
The more skin is exposed, the more energy you will produce and the faster you will go, negating the downside.
Even at maximum exposure, you'll still move slower than normal when relying on vanilla torchlight.



Here are the following traits you will gain upon typing /photosynthesis. I plan to add more in the future.
All these values assume the default plantlevel of 0.5, but will scale up or down if you adjust it.

+ Phototrophic: Generate saturation proprotional to light, allowing you to feed off the sun.
+ Thick-Skinned: Damage from armor-blockable sources is divided by 1.5, stacking with armor.
+ Oxygenic: Generate oxygen proprotional to light, directly restoring your stamina.
+ Solar-Powered: Your move/digspeed is increased by up to +25% based on light level.
- Relaxed: Life is good. Both move and dig speed is reduced by a flat -10%.
- Sterile Gut: Saturation bar will no longer pause for a time after eating food.

I've had a lot of time to playtest the system and it feels really balanced.

New progression system: Plantlevel

No gameplay yet, but there's now an internal value called "plantlevel"
This level determines how strong the upside and downsides of the traits are.
It defaults at 0.5 (50%) so if you set it to 1 you'll move +40% faster in light and -20% slower in dark.
The same is true in inverse. At 0.25 you'll move 12.5% faster in light and -5% slower in dark.
You can change this value by typing /plantlevel [value] and it acts as a per-player config
The default value of 0.5 should give you the most balanced experience.

Do you think torches are too overpowered? Nerf block light values by downloading World of Darkness!
Want a little more immersion? Look the part with some Phototrophe Class (and skins) for your character.

Hopefully this passion project of mine makes for a unique and enjoyable experience for all who download.
Please leave feedback on the forum thread, and let me know what you think about the new mechanic:
https://www.vintagestory.at/forums/topic/5571-immersive-phototrophy/

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
0.5.5 immersivephototrophy 462 Apr 24th 2023 at 10:09 AM ImmersivePhototrophy.zip 1-click install

Long-needed optimization update. Now splits the mod into three ticks:

Fasttick: Only activates when the game speeds up (sleeping) Fires 10 times per second. Basically the old lag-inducing tick rate but you'll be sleeping so it won't matter. This will false-activate if you boost the game speed via command. Might fix this later but for now it's a very low priority.
NormalTick: Ticks one time per second. Only used for restoring oxygen while underwater, and stamina when I get around to adding that.
Slowtick: All the heavy lifting is done here, which caches values for the other timers. Most code was moved here. Activates every 10 seconds.

It won't stop those weird lag spikes which cause your character to get sudden velocity bursts, but it will make them FAR less frequent.

0.5.4 immersivephototrophy 233 Apr 5th 2023 at 2:31 AM ImmersivePhototrophy.zip 1-click install

Now compatible with v1.18.0
Reduced tickrate to 1 tick per second to help with desync issues
Reintroduced sugary nutrition as its removal was not helping anything
Animal players can now see the light bar, though it will always be empty
Fixed light bar crashing the player when becoming plant

0.5.3 immersivephototrophy 285 Dec 28th 2022 at 9:41 PM ImmersivePhototrophy.zip 1-click install

Uhm so in my last update I tried disabling nutrition but I ended up disabled saturation gain completely.
Fixed phototrophes not gaining saturation when they should have been.

0.5.2 immersivephototrophy 245 Dec 27th 2022 at 7:19 PM ImmersivePhototrophy.zip 1-click install

Removed fruit nutrition gain as it was causing rubber-banding. Will re-add this when the underlying bug is fixed.
Added plantefficiency variable to allow the user to adjust balance without changing plantlevel (for non-standard hunger drains)
Defaults to 1. Main purpose is to adjust how much hunger is restored from light without affecting movement speed and damage reduction

0.5.1 immersivephototrophy 273 Nov 20th 2022 at 5:32 PM ImmersivePhototrophy.zip 1-click install

Good news, I finally got the sunshine bar working. Adds a new light meter near the food bar which tells you how exposed you are.
I yoinked a lot of the GUI code from Oxygen Not Included and have thus added that developer to the list of contributors.

0.5.0 immersivephototrophy 262 Nov 20th 2022 at 1:47 PM ImmersivePhototrophy.zip 1-click install

Last update I switched to a nonlinear system. Well turns out I forgot to apply it to block/entity light.
This mean that lower levels of block light were too strong and higher levels of block light were too weak.
Now it uses the approperate %light = %light^2 curve

0.4.6 immersivephototrophy 273 Sep 21st 2022 at 10:24 PM ImmersivePhototrophy.zip 1-click install

Had a chance to playtest a bit and it feels like the hunger balancing is where it should be, but I didn't like how speed worked. For this reason, I have toned down the effects of both speed bonuses and speed nerfs by half.

You will suffer a 10% reduction while in full darkness
You will gain an increase of 25% while in direct sunlight
This means a 15% increase of move/mining speed while in direct sunlight

I also clamped light values at 100% since light over a certain level cannot be photosynthesized.

0.4.5 immersivephototrophy 301 Aug 11th 2022 at 1:09 AM ImmersivePhototrophy.zip 1-click install

Sunlight level is now non-linear. This means more energy during the day and less during the night.
This fixes the issue with getting 20% light level during the dead of night during winter and not gaining a bonus during summer.

0.4.4 immersivephototrophy 272 Aug 10th 2022 at 1:35 PM ImmersivePhototrophy.zip 1-click install

Fixed exhausting glitch where the game tried running code on a player who was still joining.
This isn't the first time this has happened to me and it won't be the last.

0.4.3 immersivephototrophy 292 Aug 6th 2022 at 7:39 AM ImmersivePhototrophy.zip 1-click install

Photosynthesis now gives "Fruit" nutrition instead of "Unknown" nutrition.
This is backed up by the fact that honey is pure sugar, gives Fruit Nutrition.
Seeing as how photosynthesis makes suger directly, this is easy to justify.

0.4.2 immersivephototrophy 311 Aug 6th 2022 at 6:15 AM ImmersivePhototrophy.zip 1-click install

Small update: Sugar rush now also effects mining speed at a 1:1 ratio.
Meaning if you have a 10% move speed bonus, you will gain 10% mining speed as well.
Beware, the penelty will also apply if you have a negative movespeed bonus!
Terraforming will be made easier and digging for ores will be more difficult.

0.4.1 immersivephototrophy 282 Aug 5th 2022 at 10:55 PM ImmersivePhototrophy.zip 1-click install

Fixed annoying bug with hotbar resetting itself.
Movespeed system now uses the proper system.

Now you can see your movespeed modifier in the character screen.

0.4.0 immersivephototrophy 280 Aug 5th 2022 at 1:58 AM ImmersivePhototrophy.zip 1-click install

Here's a big one.

Reduced damage division from 2 to down to 1.5 as it was a bit unrealistic
Internal light calculation now uses game code instead of custom handler
This allows for support of Seasons and custom sunlight levels. It's all handled by the game now.

Now supports custom time. Beds now work, which means you can now sunbathe.

Now ticks 10x faster for even better accuracy.
Support for custom tickrates, might one day make it a config.
Added a friendly welcome message for new players who just installed the mod.

0.3.2 immersivephototrophy 306 Aug 1st 2022 at 4:42 AM ImmersivePhototrophy.zip 1-click install

Added new plantlevel system
You can now set your plant level via the /plantlevel command.
The higher the level the more extreme the upsides and downsides.
Default value is 0.5 (or 50%) which is what the old values used.
You can set the values higher than 1 but values lower than 0 might break things.
Game will snark you if you try adding a non-number argument to the /plantlevel command

0.3.1 immersivephototrophy 283 Jul 22nd 2022 at 4:54 PM ImmersivePhototrophy.zip 1-click install

Whoops! It was possible to stave off starvation permenantly by simply holding a torch. You will no longer generate calories if you would have less than 1 saturation point to prevent this exploit. In practice, this means that you should only regenerate hunger if it would take you out of starvation. In other words, you're not going to avoid starvation damage by restoring only a 100th of a point of saturation. Now your existing saturation + amount to restore must be at least 1 for the ability to activate.

0.3.0 immersivephototrophy 278 Jul 21st 2022 at 8:28 PM ImmersivePhototrophy.zip 1-click install

Added the Hard Skin and Sterile Gut traits:
Because your skin is made of plant cells, you gain a natural armor which blocks 50% of damage
However, because you rarely, if ever, eat, your gut bacteria have starved off and you will not gain any grace period after eating food, causing hunger and nutrients to fall off much faster

DEPRICATED: Download 0.3.1 as it fixes an exploit prevent starvation damage from being applied properly

0.2.5 immersivephototrophy 335 Jul 15th 2022 at 9:23 AM ImmersivePhototrophy.zip 1-click install

Single update: Allows players to breathe underwater through the power of nature.
Oxygen will be restored proprotional to your Caloric restoration: For every 1 Calorie of hunger restoration, you will gain 1 second of breath.
If you're regenerating over 1 Calorie per second, you will actually restore your breath faster then you will lose it.

For obvious reason; this will only work on V1.17.0-pre4 and up, since the Oxygen mechanics aren't present before then.

0.2.4 immersivephototrophy 353 Jul 14th 2022 at 11:20 AM ImmersivePhototrophy.zip 1-click install

Increased frequency of hunger regeneration to 1 operation per second (up from 10) to make it a little more responsive to active play. Let me know if this causes any lag.
/exposure command will now show Calorie regeneration to 4 decimal places to give you a better idea of how much energy you're generating.
Should now work properly on version 1.16.5 stable

Fixed issue from 0.2.3 where it would attempt to send client packets to users not fully logged in. It now checks before sending the packet.
The issue has been brought up with the team, but since this was bad programming on my end, it's been fixed here too.

0.2.2 immersivephototrophy 467 Sep 26th 2021 at 8:02 AM ImmersivePhototrophy.zip 1-click install

Minor update. No longer required on client.
Shouldn't cause issues. Hopefully.

0.2.1 immersivephototrophy 440 Sep 24th 2021 at 3:48 AM ImmersivePhototrophy.zip 1-click install

Minor update which reverts the efficiency back to where it should be.
It ended up being a little bit too overpowered, with torchlight providing 6 Satiation per second.

Realistic, but overpowered. Photosynthetic Efficiency is now half, back to 10%
For those who want the old values, feel free to download the version just before this one.

0.2.0 immersivephototrophy 445 Sep 22nd 2021 at 7:50 PM ImmersivePhototrophy.zip 1-click install

Fixed issue where energy was half what it should have been.
Fixed loose alpha assets somehow finding their way into the mod file.
Classes have been scrapped as the stat changes are now accessed via a command.
Armor and Clothing now negatively impacts how much light affects you.
Efficiency has been doubled to make up for this change. Let me know if this is overtuned.
Added new command: /exposure to provide useful information

0.0.1 immersivephototrophy 444 Sep 14th 2021 at 1:15 AM ImmersivePhototrophy.zip 1-click install

The first release. Expect bugs.


24 Comments (oldest first | newest first)

💬 Blaeky, Sep 17th at 7:32 AM

Will you be updating to the latest version at all, in the meanwhile? I'm trying to use this mod with the added class, but the code here repeatedly crashes my game, about a minute into playing.

💬 OmegaHaxors , Jan 15th 2024 at 8:17 AM

Stroam
It was originally intended to be a character class then eventually subclass, but I guess it makes sense as a race too.
Glad you enjoy it, I have plans to (eventually in the long future) completely overhaul the mod and its gameplay.

Make it so that normal players can get up to 50% plantlevel through gameplay, and phototrophes start with +50% but are limited to how much they can eat.
So normal players can get up to 50% level and have no restrictions, while using the class allows you to get up to 100% but you have to play differently.
Also I have to completely overhaul how stats are applied to the player to be client-sided to fix annoying desync issues and massive amounts of lag.
Most importantly move everything out of commands because it's a really clunky system that players shouldn't be expected to have to interact with.

💬 Stroam, Jan 10th 2024 at 1:16 AM

I love it. A new race! We need more of these.

💬 OmegaHaxors , Apr 5th 2023 at 2:32 AM

Now compatible with the latest version, and fixed a few small annoying bugs.

💬 OmegaHaxors , Nov 20th 2022 at 5:32 PM

Good news, I finally got the sunshine bar working. Adds a new light meter near the food bar which tells you how exposed you are.
I yoinked a lot of the GUI code from Oxygen Not Included and have thus added that developer to the list of contributors.

Should I hide the exposure bar if the player lacks the ability to perform photosynthesis? It might be useful.

💬 OmegaHaxors , Nov 20th 2022 at 1:48 PM

Last update I switched to a nonlinear system. Well turns out I forgot to apply it to block/entity light.
This mean that lower levels of block light were too strong and higher levels of block light were too weak.
Now it uses the approperate %light = %light^2 curve

💬 OmegaHaxors , Sep 21st 2022 at 11:00 PM

Rebranded Amored Skin to Thick-Skinned
Rebranded Sugar Rush to Solar-Powered
Rebranded Heavy Skin to Relaxed

💬 OmegaHaxors , Sep 21st 2022 at 10:28 PM

Just a tweak to the balancing:
Light level clamps at 100%. Any light level over this is no longer useful.
Halved both the speed upsides and downsides as both were frustrating.
(Wearing plate armor made you near-immobile and walking at night was a slog)
(Wearing nothing made you overshoot where you wanted to be and caused a lot of rubberbanding)

Balancing is now at a point where I can comfortably call it 'vanilla-compatible'

💬 OmegaHaxors , Aug 11th 2022 at 3:51 AM

Cancelling the weather system, since the weather code is a huge mess and as it turns out, weather doesn't actually affect light level.
Not released yet, but I did some work internally to allow for clothing to block partially or negatively to make room for a future update.

💬 OmegaHaxors , Aug 5th 2022 at 1:59 AM

Now with seasons and bed support.
Sleep in the sun, I strongly suggest it.
Movespeed can now be seen in your character menu
Sugar Rush now also affects digspeed on top of movespeed
Sugar produced by photosynthesis now gives Fruit Nutrition

💬 OmegaHaxors , Aug 4th 2022 at 3:24 AM

Sounds like cool ideas but all of it is out of my abilities.
The mod's designed to be built on and I was kinda hoping that people would build addons, so if you wanna try and figure it out you have my blessing.
I know that adding new items (such as the bark armor) can be accomplished with JSON and textures, so it's worth looking into if you're up for it.
If you add a bunch of plant-based armors I can impliment them to add "exposure" to the player. Mod cross-compatiliby is really easy. Yelb

I would also strongly suggest you join the discord (on the fourm thread) to have more complete conversations on various topics in the future.

💬 Yelb, Aug 2nd 2022 at 6:50 PM

Plantlevel is a nice addition, even if still only a "tag", yet. I’d love any kind of Growth, indeed, and more plant related stuff. What about Bark types instead of clothes or armor ? You could be more or less heavy, more or less burnable, more or less flexible (jump and run), and if you wear bark, you don’t have the malus from common human armors ? What about special skills, doable ? Like, poison spit or spear, thorns to retaliate when attacked, ivy or liana to capture a target, stun it maybe or make it stop moving for a while ? What about fire fear ? You can carry a torch, but you get some kind of Fear debuff, or if you carry it too long you may burn ? And maybe you burn from a longer distance, like 2 tiles away from a true fire (maybe not forge etc or it will become tedious...) ?

💬 OmegaHaxors , Aug 1st 2022 at 2:10 AM

Next update is going to have the coveted "plantlevel" system.
It defaults to 50%, but you can set it higher or lower based on your preferences using the /plantlevel command
Setting it to 100% will double the upsides AND downsides while setting it to 25% will do the opposite.
The only exception to this is Sterile Gut which will always be in play as long as the player is Phototrophic.
So if you wanna do a challange run you can set your plant level to 0% while keeping the phototropic tag on.
Or if you wanna roleplay as a true plant you can set your level to 100% and disallow yourself from eating.

There is no reason why you can't set the value over 100 or under 0%, though who knows what would happen if you go below 0%.

I'm also going to include an anti-abuse feature called Photosynthetic Exhaustion, which is a real thing plants have to deal with where if you get too much light (and not enough darkness) efficiency drops to zero. It should never impact normal legitimate players but those who use excessive artificial lighting might find themselves having to put up with it. 18 hours on, 6 hours off just like the real thing. This turned out to be a lot harder than I expected because of how beds are implimented. It's going to get its own update, probably.

And done, check it out. Yelb

💬 OmegaHaxors , Jul 31st 2022 at 9:10 PM

I was actually thinking of adding a progression system instead of just being a binary, though haven't figured out how to do TreeAttributes yet.
Right now it stores your player's Phototropic state as a single bit with the value [1] but I wanted to make it a precentage you can level up/down. Some day.
At the current moment, the player is assumed to be at a 50% so feel free to eat as you need to, especially to get nutrition.
Great feedback, the thing i'm struggling the most on right now is balance. I recently implimented a huge buff and a huge nerf and i'm not sure if I went too far with it.
Keep in mind that since you take half damage from enemy attacks, that means you effectively have a double health bar since it stacks with armor.

As for the mod being simple... that's because it's actually just a few lines of code!! Every time I add a new feature I have to figure it out by scratch, usually alone.
That's combined with lack of motivation means that new features just don't really come in all that fast. (massive understatment) Not that I can't do it, just that it's hard.

I do have a lot of ambitions on things I want to do, so over time when I find the inspiration to do so, i'll be sure to add the features you've suggested.
Considered adding the ability to eat fertilizers in order to gain nutrition stats, but figured that might be a little too overpowered so it's been on the shelf.

Your playtesting is extremely appreciated, thank you so much Yelb

💬 Yelb, Jul 26th 2022 at 7:19 PM

After about 20 hours in 1.17pre5, i like this mod, but i also don’t like it. There should b a way IMO to "grow", similar to when you eat regular food, to get better stats and all. At first it’s easier and convenient not to eat, but later going underground and exploring high danger places, i feel i lack "something". Also i’m in a region with lot of rain and clouds, so the sun is scarce, and i actually like it. Maybe make some new food with fertilizer, insects, water... Or just up/down the stats day by day based on season ? Like a little weaker in winter, a little srtonger in spring etc ? Anything but "something" to get some depth, as the food in this game is quite fun and "usefull". Anyway, i’m keeping the mod active, but i’d love to see it extended, the idea is really reat.

💬 OmegaHaxors , Jul 21st 2022 at 8:33 PM

Yelb
This brings me joy. Please let me know feedback and if you enjoyed playing it.

I have added two new traits to the 'class'. One upside, one downside. Download the latest update to check them out.

💬 Yelb, Jul 18th 2022 at 10:18 AM

I love the idea of this mod ! Thanks fhor doing it. I will run it when game update is stable.

💬 OmegaHaxors , Jul 14th 2022 at 7:47 AM

The preview version of Vintage Story has teased Oxygen mechanics, and you KNOW this mod is going to play around with that.
In preperation for this update, I have increased the regeneration rate to 1 per second down from 10 seconds.
Also fixed the weird issue it was having running on Version 1.16.5 (stable)
Next update will allow you to restore your breath using photosynthesis: Your oxygen will restore as long as your Calorie generation is higher than your Calorie usage.
EDIT:
After a bunch of bumbling around, I have finally managed to figure it out. All those on 1.17.0-pre4 can download the latest version to try it out.

💬 OmegaHaxors , Feb 8th 2022 at 11:58 AM

TODO features:
Add "sterile gut" trait: Cannot gain saturation-immunity from cooked meals [implemented]
Reduce saturation gain from eating across the board while Phototrophic [cancelled]
Impliment "hard skin" trait, reducing armor-blockable damage by 50% [implemented]
Add sunbathing mechanic, allowing users to sleep in the sun to restore saturation [implemented]
Make herbivore animals such as bunnies track and bite at Phototrophic players 
Phototrophic players drop special food items on death to encouraging PvP 
More gameplay-friendly way to modify Phototropic tag that dosen't rely on the /photosynthesis command 
(Putting seaweed on the offhand while holding a knife to take some damage and gain the trait?) 
Add support to the Phototropic tag to allow for precentages instead of just being a "if not null" check  Uses watchedattributes now.
Add benefits and penalties at various phototrophy precentages. For example: Can't eat at all at 100% 
Better handling of Exposure, primarly on clothing items that cover more or less than average for that slot 
Add "Leaf" Armor which automatically exposes that slot to light, even if clothing underneath blocks it 

TODO mod support:
Add support for Aspyxia allowing Phototrophic players to breathe in carbon dioxide
Add support for Oxygen Not Included allowing Phototrophic players to restore oxygen with light
Add support for VSMovement Mod allowing Phototrophic players to restore stamina with light

💬 OmegaHaxors , Oct 23rd 2021 at 4:45 PM

DArkHekRoMaNT
Actually that was the original plan... but
The class system is hot trash and miserable to work within.
Any attempts to impliment it have been permenentaly cancelled.
What ideas I did have made it into this, or are planned for the future.

The mod works by giving your player the phototrophic tag. The value dosen't matter, as long as it's not null.
It checks if you have the tag, and if you do, it runs the calculations. If you don't it will just skip over you completely.
Knowing this, you can impliment your own class if you can figure out how to give them that tag on character creation.

I'll give you a hint; it's way harder than is even remotely reasonable and may actually be impossible. Save your time.
But if you can figure it out, awesome. Feel more than free to make your own mod and have this one as a dependancy.

The mod is still subject to change/improvement as the game's API opens up, and as I figure out how to do things.

💬 l33tmaan, Oct 21st 2021 at 4:20 PM

I think that was the original goal? DArkHekRoMaNT

💬 DArkHekRoMaNT, Oct 21st 2021 at 12:18 PM

Have you thought about adding instead of a command - a separate plant class (possibly optional)? :)

💬 OmegaHaxors , Oct 19th 2021 at 12:56 PM

Thanks for the feedback, Theisgood.
Don't worry too much about it, just go outside and watch your hunger bar restore.
You'll get a general feel of how much light you're getting by how fast you move.
If you're too slow or hungry, take some clothing/armor off and get some sunshine.

💬 Theisgood, Sep 27th 2021 at 8:40 PM

Such a cool mod idea.

 

Its intimidating to me but I think if I just try it I can make it work.

 

Once again this is super unique and different. 

 (edit comment delete)
Основной веб-сайт | Почтовый сервер | FTP сервер | Административная панель | API интерфейс | Content Delivery Network | Статические файлы | Ресурсы сайта | Изображения | Файловое хранилище | Блог | Интернет-магазин | Техническая поддержка | Справочная система | Документация | Форум | Новости | Загрузки | Демонстрация | Тестовая среда | Приложение | Медиа контент | Разработка | Промежуточная среда | Бета версия | Безопасная зона | Вход в систему | Панель управления | Портал | Система управления контентом