King's Turret Shields

by Kingdud

Forked from Turret-Shields by OwnlyMe. Cleaned up the code, removed a lot of options, internal tweaks to how power and damage affect the shield. Lightweight scripted shields with power consumption (configurable or researchable)

Content
2 years ago
1.0 - 1.1
6.58K
Combat

b Entity Prototypes Count

3 years ago

I hit an error with this mod enabled and it seems to be due to overshooting the games total entity prototype count of 65535. In the log file this mod shows as the second highest count with 10207 with the highest being Rampant at 55005. Now, I kinda understand Rampant having a huge number because of it overhauling all mobs so vastly though it still seems a tad excessive and I am going to mention it to them as well. However this mod having over 10K seems like something must be wrong and makes it so I cannot run it in conjunction with Rampant. This being said, I previously ran OwnlyMe's original build of this next to Rampant as well as a vast selection of other mods and never saw this error.

Here is the actual error line:
36.926 Error ModManager.cpp:1514: Reached id limit for entity. The game can't contain more than 65535 instances of this prototype due to hardcoded limits of the engine. See the log file for more detail.

3 years ago

This mod creates one extra entity for every turret. If you had 22,000 laser turrets, 22,000 ammo-turrets, and 22,000 flame turrets, then this mod would trip that limit because there'd be 66,000 shields for all of them. The only other way for you to hit the limit is:

  1. You found a new bug I can't reproduce in my own testing, where you keep building up old shield entities instead of them being cleaned up during research / upgrades.
  2. A mod you are using is doing something screwy with replacing entities and it is not following code paths I expect it to, therefore causing the shield entities to not properly be fixed.

Are you using Repair Turrets, by chance? if so, do you have turrets dying frequently? That may be why.

3 years ago
(updated 3 years ago)

Huh, I do indeed run Repair Turrets but I have yet to have one die. This error happens during the initial loading of the game before I get to my save.

Also, I only have 247 gun turrets and 61 repair turrets.

3 years ago

Ok. I'm marking Repair Turrets as an incompatible mod. Something Klonan is doing drives mine nuts.

3 years ago

Ouch, alright. Well that sucks though that mod isn't exactly the most optimized from the user's PoV either.

3 years ago

Yea, good news is, with a bit of research, you won't need to repair anything. Your shields will soak up all the damage. Though, your power requirements for that might be a bit large...look into my Nuclear Rebalance mod if you need help getting power density without sacrificing UPS.

3 years ago

Well, TBH the repair turrets were more for walls and such and for the (albeit slightly OP) ability of being able to build completely remotely lol. Good old fashion construction drones it is I guess.

3 years ago

Update: repair turrets disabled and I get the same exact error as soon as I turn on Rampant again.

37.432 Info PrototypeList.cpp:79: entity counts:
37.432 Info PrototypeList.cpp:81: Broodmother: 157
37.432 Info PrototypeList.cpp:81: ForceFields2: 12
37.432 Info PrototypeList.cpp:81: Insectitron: 48
37.432 Info PrototypeList.cpp:81: KingsTurret-Shields: 10207
37.432 Info PrototypeList.cpp:81: Mining_Drones: 285
37.432 Info PrototypeList.cpp:81: Rampant: 55005
37.432 Info PrototypeList.cpp:81: SpidertronWeaponSwitcher: 5
37.432 Info PrototypeList.cpp:81: Tral_robot_tree_farm: 495
37.432 Info PrototypeList.cpp:81: base: 539
37.432 Info PrototypeList.cpp:81: core: 1
37.432 Info PrototypeList.cpp:81: deep-storage-unit: 3
37.432 Info PrototypeList.cpp:81: fluid-memory-storage: 4
37.432 Info PrototypeList.cpp:81: logistic-memory-units: 5
37.432 Info PrototypeList.cpp:81: miniloader: 15
37.432 Info PrototypeList.cpp:81: reverse-factory: 4
37.432 Info PrototypeList.cpp:81: spidertron-extended: 6
37.432 Info PrototypeList.cpp:81: spidertron-logistics: 2
37.438 Error ModManager.cpp:1514: Reached id limit for entity. The game can't contain more than 65535 instances of this prototype due to hardcoded limits of the engine. See the log file for more detail.

3 years ago
(updated 3 years ago)

Hah. Now that I have shields... https://i.imgur.com/YrBkobV.png is how I create my defensive walls. The red turrets are another of my mods: Gatling Pulse Lasers. Basically, it makes the laser turret have the same DPS as a gun turret. It does not make lasers scale as well as gun turrets, but it brings...basically I remember making the lasers be able to hit the 12k DPS that gun turrets can with a certain set of upgrades. But yea, the core idea was to have the concrete walls far enough behind the turret line that acid splashes don't hit them. The wall is only there to ensure that no biter can run past my wall and get in to my base (this isn't needed with vanilla biters, but might be with rampant ones).

I do have normal roboports covering my defenses, but I don't actually need them anymore. Nothing actually damages anything now, so I could totally get away with only having radar coverage and putting a few roboports in the specific spots I actually need.

For your crash:

  1. Disable rampant
  2. Load save.
  3. press ~ (key to the left of 1 on most keyboards)
  4. Type in 'kts reset' (no quotes). This Is NOT a console command. This will cause all shields to be replaced and should remove any duplicate entities.
  5. Save your game (in a new save file!)
  6. Re-enable Rampant
  7. Load the newest save you made.
  8. It should now load and work.

If not...idk what to tell you. I'm not sure how to recover your save if that doesn't work.

3 years ago

It also turns out that the hard prototype limit really is the issue. I loaded in with no save files, only this mod and Rampant since their totals are only 323 prototypes shy of the limit and combined with the base and core the total exceeds the limit and gives the same error on game load. I'm wondering why this mod would apparently have such a giant prototype count though. If you aren't able to reproduce this error simply by installing Rampant next to this mod then there must be a setting somewhere causing my issue.

12.540 Info PrototypeList.cpp:79: entity counts:
12.540 Info PrototypeList.cpp:81: KingsTurret-Shields: 10207
12.540 Info PrototypeList.cpp:81: Rampant: 55005
12.540 Info PrototypeList.cpp:81: base: 539
12.540 Info PrototypeList.cpp:81: core: 1
12.546 Error ModManager.cpp:1514: Reached id limit for entity. The game can't contain more than 65535 instances of this prototype due to hardcoded limits of the engine. See the log file for more detail.

3 years ago

I just enabled this mod, disabled Rampant ,and enabled every one of my 92 other mods(almost all of Bob's, AAI, Space Exploration, Alien Biomes...) and no crash. Then I switched this mod with Rampant and still no crash. Deductive reasoning leaves an incompatibility with Rampant I guess.

3 years ago

Yep, I found the problem. The entity limit is the limit of entity definitions. i didn't realize that there even was a limit on that. I thought this was a limit on entity instances. Which, on reflection, was a silly belief. Anyway, I added a mod setting: Maximum research level. I had originally set it to 100, but that causes 10,000 entity prototypes to get created. Instead, the new default is 25, which will only create 625 prototypes.

The reason so many prototypes are needed is because every single level of research for either size or recharge rate needs its own electrical interface. Thus, 25 levels of each research is 25^2 entity prototypes needed.

3 years ago

Ok that makes perfect sense based on the fact that it happens as the mods are being loaded. I suppose the issue with Rampant creating so many is because of evolution. Thank you so much for working with me to resolve it.

New response