Stuckez12 Radiation


A simple world environment standalone mod that includes radiation as a new hazard. Inspired by TibsRadiationMod

Tweaks
6 hours ago
2.0
110
Environment

b [FIXED] Issue with UPS performance when installed

21 days ago

Installed this but I am immediately hit by extreme performance costs and it drops me below 60UPS with constant stuttering.
It's basically unusable in its current state.

20 days ago

Would it be possible if you can send me over your save file so i can have a futher look into this

Also planning for the 0.7.0 release to refactor all the code to be more efficient so having a save file can greatly help comparing the before/after performance changes

20 days ago

Got a save file for a vanilla megabase so will look into reducing the UPS impact

when 1.0 for the mod is released, it should hopefully have minimal impact (current versions are a basic proof of concept for now)

20 days ago

Cool cool :) Will take a look again when the update is out and give some feedback.

Also consider supporting other mods in the future, like Cerys and PlutoniumEnergy mods, etc.

20 days ago

You could also check out the Krastorio 2 source code for inspiration on how to optimize it.

https://codeberg.org/raiguard/Krastorio2/src/branch/trunk/scripts/radioactivity.lua

20 days ago

Will do.

Once mod is complete for a vanilla playthrough, compatability with other mods will be my next focus.

There is a way to add/remove items (including modded hopefully) to my list of "treat as radioactive" but have yet to test.

Biggest reason for the UPS drop is the "player.surface.find_entities_filtered" function I am running.
Oversight on my side as I thought it would only check the entities in the specified region but instead checks the entire surface (nauvis) of every entity causing the UPS drop.

19 days ago
(updated 19 days ago)

Version 0.7.0 is now available with the UPS issue addressed.

Should now only use between 0.004 to 0.012 UPS per frame compared to the 34 it used.
Tested on a 12k science per minute vanilla megabase save.

All previous versions had this issue so were removed as well.

19 days ago

Cool I'll check it out!

19 days ago

Runs way better now :) Here's some suggestions/issues:

  1. Add power armor as requisite research, since they share the same size equipment grid. (Optional)
  2. Mk1 and Mk2 items in factoriopedia show in reverse order.
  3. Entering then exiting editor mode seems to disable radiation damage completely.
  4. Tips and tricks page that explains the radiation mechanic, and the use of the radiation suit and modules. (Trigger the tip on taking radiation damage the first time.)

I'm a bit confused at how the damage works since it seems one pixel sometimes causes either 1 damage or I instantly die (no suit.) I assume it's scaling based on amount of items nearby? I think it might help with a bigger radius on the damage area of the uranium. It can start out very low for a while before it starts ramping, so you can get a good early warning to avoid randomly getting one shot.

Would also be cool when you get to adding mod compatibility to have more tiers of suits/modules for other mods that add radioactive materials, which could be even more dangerous. That lets you add in more suits for more complex crafting later on. I could see some cool production chains for making new special modules for things like plutonium radiation, etc. And for very lategame, maybe even a special module that can just slot into normal armor that completely negates any damage? Made by promethium or something?

18 days ago

Bear with me as this will be a long message.

I'll first have to thank you for bringing up the UPS issue that my mod had in previous versions. When I started developing this mod, I was creating new saves or using saves that had little to no entities/world explored. I didn't think of testing it on megabase scaled saves as I assumed it would behave the same. After testing it on an actual save that many players would achieve (not me tho for now), it taught me to be more thorourgh with my testing and how I create/expand on features.

I'll also thank you for your last comment as well because I was originally planning to rework my logic for how I calculate radiation damage as I knew I was doing it inefficiently (e.g. doing an area check for one entity then having to do an area check for another entity) and then call the mod complete. But with you mentioning that how I calculate radiation is not communicated in any way reminded me that the tips and tricks existed (I forgot). It also gave me fresh new ideas that I could implement based on radiation as well which I plan to experiment with in the near future.

What you mention in number 3 (editor mode radiation disabled), I am assuming you mean when you are viewing the map and detached from your character. If thats the case then you still do take damage since you are still in the radius of the radioactive materials but the sound and healthbar isn't played/displayed. I do plan to fix this in a future update as this can become quite frustrating for players as they'll think they died for no reason.

Also when you mention a module/equipment that fully negates radiation damage, I don't plan on implementing such module/equipment. I did give it a good thought as it would give the player less to worry about but then since this mod is aimed to be an addon with this new threat, obtaining a module/equipment that fully negates radiation would overall be the same as not having the mod installed. This sort of item in my opinion would be more suitable for modpacks/overhaul mods as you feel you have made progression to not worry about x threat/issue anymore. If you feel like this should still be implemented, I am up for a further discussion regarding it.

Overall I plan to keep developing this mod and hopefully have it in a complete finished state in about a months time max (who knows, the bugs might invade my codespace as well as my factories). I have written/plan to write a roadmap and what each version will add to the mod.

Since this discussion thread was origionally about the UPS issue you brought up, I am gonna lock it now since the issue has now been resolved. You are free to open up more discussion threads on this website or ask me some further questions on discord and I will happily respond to any query/issue you bring up. Thanks again for your help.

This thread has been locked.