Too many Globals = bad?

Post » Mon Nov 19, 2012 12:39 am

Hey guys. For a time I was scared of using globals. The thought of using data outside a script just frightened me for some reason. Now though, I can't get enough Globals! I use them for almost everything in my radiant quests, as well as other quests. I set values/track values for globals for kills, legendary kills, times quests completed, counts... I use them in dialogue, text replacement, conditions, scripts... Basically I now love them.

My question (probably silly but you never know) is can too many be bad for the game? IE could it bog down a save for example?

I'm not talking thousands, just a few dozen, probably a hundred or two by the end.

Thanks as always :)
User avatar
Ian White
 
Posts: 3476
Joined: Thu Jul 19, 2007 8:08 pm

Post » Mon Nov 19, 2012 10:31 am

You won't need to worry about save bloat as a result of making too many forms in the Creation Kit. Generally only things that happen at runtime, like calling http://www.creationkit.com/PlaceAtMe_-_ObjectReference without cleaning up after yourself when necessary or flooding the stack via http://www.creationkit.com/RegisterForUpdate_-_Form with a short interval and a long http://www.creationkit.com/OnUpdate_-_Form event body.

If you're using a lot of GlobalVariable objects, though, and accessing them from multiple scripts, you should remember that that you might run into issues if 2 scripts try to get or set the same GlobalVariable at the same time. Make sure you use the thread-safe http://www.creationkit.com/Mod_-_GlobalVariable function whenever necessary.

Cipscis
User avatar
Crystal Clarke
 
Posts: 3410
Joined: Mon Dec 11, 2006 5:55 am

Post » Sun Nov 18, 2012 10:16 pm

You won't need to worry about save bloat as a result of making too many forms in the Creation Kit. Generally only things that happen at runtime, like calling http://www.creationkit.com/PlaceAtMe_-_ObjectReference without cleaning up after yourself when necessary or flooding the stack via http://www.creationkit.com/RegisterForUpdate_-_Form with a short interval and a long http://www.creationkit.com/OnUpdate_-_Form event body.

If you're using a lot of GlobalVariable objects, though, and accessing them from multiple scripts, you should remember that that you might run into issues if 2 scripts try to get or set the same GlobalVariable at the same time. Make sure you use the thread-safe http://www.creationkit.com/Mod_-_GlobalVariable function whenever necessary.

Cipscis

That's good then :)

Yea I was worried about loosing track of them, but I'm really careful about how I run my data. I restrict a lot of the data the game can access for the player in runtime. It's hard to explain, but basically I've got a lid on it :)
User avatar
Dylan Markese
 
Posts: 3513
Joined: Sat Dec 01, 2007 11:58 am


Return to V - Skyrim