Jump to content

Spawning NPCs without causing savegame bloating


Surilindur

Recommended Posts

Hello,

 

I was wondering if there would be a way to spawn a specific amount of specific NPCs at will without causing savegame bloating? Any help would be appreciated. Searching the internet has produced conflicting and/or rather vague results, so I though about asking here on the forums. After all, there should be people familiar with Oblivion here... I think. :smile:

 

I have thought of the following ways to spawn NPCs, but I am not sure which ones would be possible and/or recommended:

 

PlaceAtMe

From what I have read on the internet, every reference spawned using the PlaceAtMe command will remain stored in the savegame forever. There is, of course, the DeleteReference function in OBSE, but it cannot be used on actors. I have also read that the vanilla Oblivion gates use PlaceAtMe to spawn the creatures, but I would not like to make extensive use of it in my mod, as my mod will offer the option for the user to configure the amount of NPCs spawned and the time between the "spawnings" (if that is a real word), so it would be possible to create dozens of references almost every day (in-game).

 

PlaceAtMe with a leveled list

Arthmoor mentioned on the TESAlliance forums (see the last post of http://tesalliance.org/forums/index.php?/topic/4297-placeatme-for-npc-summoning-spell/ for the comment) that when using the PlaceAtMe function, an individual base object should not be used, but a leveled list. Does using a leveled list help with bloating? Or is there something else behind it? Would this be a better choice?

 

Spawn points

Perhaps using spawn points would be the best workaround, but I do not know if it is possible to "activate" a spawn point at will to spawn whatever it is able to spawn. If anyone knows more about spawn points, I would be happy to hear it.

 

Edit

For those who might end up reading this, I eventually decided to use a group of predefined NPCs stored in a holding cell when not needed. Not using PlaceAtMe makes me feel less guilty. But everyone should still read QQuix's report/study on dynamic items and savegame bloating.

Edited by PhilippePetain
Link to comment
Share on other sites

PlaceAtMe, Spawn Points and most items dropped from inventories are all 'Dynamic References" check FormID and Modding Terminology (also On Dynamic Items and Savegame Bloating if you care for some boring details)

 

Once created, i doubt very, very much that the game keeps track of how it was created, so I always consider them as having the same behavior.

 

I did a lot of tests with PlaceAtMe + Actors and never found a scenario where actor creation bloated the savegame, so my conclusion is that the game engine removes them 72 hours after the player leaves the cell. (although there are statements in the WIKI and forums saying that the clean up is only done if and when the player reenters the cell after 72 hours, all my tests showed that dynamic NPCs are removed from the savegame regardless of that)

 

Link to comment
Share on other sites

Savegame bloating is only a valid term when you're placing the same object, like an activator, 1000s of times when it could also have been reused. Using PlaceAtMe on an npc or leveled list really isn't a big deal, when used properly. It's even done at Oblivion Gates to spawn its creatures.

 

However, the best method to place npcs really depends on what you would want to do specifically. Are these unique npcs and are they placed only once? Are they quest items and/or have low level processing enabled? etc.

Link to comment
Share on other sites

Thank you both for your answears. It is good to see someone has tested PlaceAtMe. The internet seems to be full of rumours and such. And thank you for the link to the modding terminology page, too. I am fairly new to modding, so it really helps avoid misunderstandings.

 

The NPCs would be rather generic ones placed in the world at a random, configurable interval (if the preposition really is at). The amount of NPCs will also be configurable. There will be three base records (mage, melee, archer) and they will not be quest items. They will also have the No Low level Processing checkbox unchecked, as they are really not that important. I will also try to make the system work without attaching scripts to them.

 

The idea is to create a repeated attack scenario, in which a group of attackers attacks a castle every now and then. I have made the thing once using a set of predefined NPCs placed in the world using the Construction Set, but I want to make it configurable so that the user can tailor it to his/her own taste.

Edited by PhilippePetain
Link to comment
Share on other sites

I take it you meant No Low Level Processing checked, rather than unchecked? Also, when you say "group of attackers attacks a castle every now and then". Do you mean, similar to when cells reset (default once every 3 game days) or something more configurable?

Link to comment
Share on other sites

Oh... I was not sure whether the box prevents them from entering the low level processing state or makes it possible for them to enter it. So does it actually prevent low level processing, so that no processing will be done when the actor is not near player? If so, I will check it. The idea would be to not waste CPU power on them. But it would seem that I have actually done the opposite. :smile:

 

There is a quest that checks the GameDaysPassed (if it was called that) and compares it to a previously saved value (when the last attack took place). When the difference (which is the configurable part) is greater than a certain amount of days, it spawn the attackers, sets the time of last attack to GameDaysPassed and calculates a new value for the difference.

Edited by PhilippePetain
Link to comment
Share on other sites

The checkbox says "No Low Level Processing". Checking it means that the actor will have no low level processing, which is what you seem to want.

 

As you want to constantly spawn npcs you should avoid using PlaceAtMe (this would indeed cause a little bloating over time). As you want to control when npcs "spawn" you can't use spawn points either. With these restrictions I would use a system of recyclable npcs, which by default are stored in a custom cell. When you need them you move them to the right location(s) and back to the cell when you don't. The npcs should be resurrected before moving and disabled when not in use. To keep track of the npcs you probably want to use a few arrays.

Link to comment
Share on other sites

Thank you. I will check the checkbox for the less important NPCs, as well as remove the use of PlaceAtMe.

 

But I would really like to make the system more flexible. The current one uses eight NPCs those are stored in a holding cell, just like you suggested, although they are not disabled... and I made the terrible mistake with low level processing. So every NPC in the mod (including dead ones) now has low level processing enabled. :)

 

Perhaps I could try to make a spawn point with a 100% chance of spawning something from a leveled list and only add the attackers to the list when the attack should take place (and remove them after it)? I will see what I can do.

 

Thank you for your help. It is always good to have someone with (a lot) more knowledge and experience around. Otherwise I would be making a well disguised savegame killer and marketing it as a mod. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...