Hardcorio:SC2

by maroder

Version 26.12.2017. Remake of Stx3's Hardcorio:SC2. Hardcorio:SC2 turns Factorio into a hardcore survival game, by completely replacing the enemies, combat mechanics and added life support requirements.

Overhaul
1 year, 5 months ago
0.13 - 1.1
2.48K

i Source code | Github

5 years ago
(updated 5 years ago)

Any chance you'd put this on Github? It'll allow others to work on it and is also easier if someone wants to translate it as they'll be able to access the files "directly" and create pull requests.
Basically I've made some performance improvements because Hardcorio went literally unplayable (took over 12ms per update tick). It's only been 2 "major" changes that fixed it, but I've tried to do some more tweaks here and there.. though it's rather hard to optimize what's left now. Anyway, I've went down to one 5th or 6th of what it used to use. It's still 10 times bigger than the mod "Bottleneck" (https://mods.factorio.com/mod/Bottleneck) and that one is already doing a lot (and known for its not so small impact)

There's one game changing thing I did though... Turrets and Radars work entirely differently from before.
I couldn't get rid off looping over all Radars and energy Turrets because energy might go down (unless I figure out how to access and list power grids) so I'm calculating the radar's and turret's operating percentage based on energy level, so a radar at 50% energy is only worth half a radar would... so on medium difficulty that is 3.5 radar slots instead of 7.
The same is true for a turret though, so an energy turret at 50% energy is also only worth half a turret (it's only shooting half the time, so that's fair)
What happens when "slots < turrets" is that they simply start to miss. That is, 80 slots, 100 turrets means 20% of shots miss. I've currently set upper and lower limits though. So a >90% (<100%) chance is actually 90% to punish people from going below what's "required", a 0% chance is also 0.05% to at least hit something (spray & pray). I originally thought about adding critical hits like a 110% chance to hit if you've got some spare radar slots (10% to crit and deal double dmg). Or it could scale with slots.. like having double the required slots means a 100% chance to do critical hits.... But I think that might imbalance things... It would be easy to add though.
Btw. this change also removed the "not enough radars" message because turrets that miss popup a red "miss" text above their heads, so it's kinda obvious. "Radar slots" also shows the percentage if below 100%

Theoretically it's possible to get rid of radar and turret loops altogether... turret loops could be ignored to make things even harder (turret only half at speed, yet counting as a fully working one, same for unpowered turrets) and radar loops would be possible to ignore... since there's the "on_sector_scanned" callback.. but a radar takes 33.33 seconds to scan a sector.. so the radar count would only change every 33.33 seconds and might fluctuate between "cycles" so it'll look weird.
EDIT: I forgot that the loops for electric turrets are required... as they're not using normal electricity.

5 years ago

@White-Tiger - Any chance that you could create a Github repo containing your fixes? Ideally Maroder would create a public repo, but barring that, perhaps we could use your codebase as a starting point?

4 years ago

@Maroder - Is there any chance that you could share the source code with us or publish to github?

4 years ago

Hi. My English is not so good, so I don’t see any reason to upload it to github. You can see the source code by unzipping the downloaded mod.

4 years ago

people wanting to help you and you see this as not a good enough reason to upload? you should re-evaluate your decision

4 years ago

@nickcpainter sorry for the "delay", I might just take a look at it again, though I'll have to re-adapt my changes and I'm not currently playing Factorio / Hardcorio which means I'm not sure how that'll work out. (bug wise, the changes mentioned above were complete and did work on a rather large base without issues, but I was working on further optimizations when I stopped)

New response