English TheSurvivalist: Big Performance Update 02-16-18

2,001 replies
Goto Page
To the start Previous 1 2 ... 100 101 Next To the start
22.02.18 03:34:59 pm
Up
JasJack67
Super User
Offline Off
hi mrxxx,
Yeah I had found if I put the skill increments script into one "global" script, and have it "called" by another script. . .every time the player got a skill-up the engine would lag, causing a lag spike ingame.

By putting the skill-up script directly in the script being run when the skill-up occurs, it executed better and smoother, with no lag spike.

Some of the combinations repeat because there is more than one type of item that does basically the same thing, like there is 4 different hammers and their scripts are near identically besides damage/speed/breakage variable.


Another Example:
When you kill any animal and get a +1 Hunting skill-up the script is ran at that very moment with no lag spike. If it had to call one global script it makes a small lag spike the player experiences ingame. Therefore I put the +1 Hunting script attached to every unit. . .the engine executes it without have to look for it globally and returns the text onscreen +1 Hunting. . .immediately.


There are some other scripts I did the same thing with as to reduce lag. Mostly, any script that is executed "during" game play. The exception is the 2 main scripts, executed every 2 seconds, and the hourly skybox. I can only optimize them best I can. The rest generally occur at new day update, or when the player sleeps when it doesnt effect the players gameplay.

In a Nutshell: Anytime the engine has to look outside the current script that is running, it puts a strain on the engine. So, multiple identical scripts placed "inside" the currently running script runs faster, as the engine doesn't have to stop and look for something that's being requested. . .it's right there already, to be ran.

P.S. As for the script format, I have kept the same script format that Builder-02 already had established in Massive-Mod, with some very minor adjustments. The scripting is not the source-code, the source-code lies within the .exe file, and I don't personally mess with that.
edited 4×, last 22.02.18 04:08:05 pm
The Survivalist_02-16-18 is now available. DOWNLOAD HERE >The Survivalist 02-16-18 | Performance-In options keep Water Detail off
23.02.18 04:37:34 am
Up
Aedolaws
User
Offline Off
JJ congratulations on post #2000!

I am very happy you have continued working on this game! You are the best thing it ever happened to Stranded! PERIOD!!!

And I am almost 100% certain that other game developers have copied you and will continue doing so.

My biggest regret is that I am not a wizard like you and mrxxx, or the many others through the years.

Also, I like the new grass, thank you. I haven't seen it yet because I am continuing my game rather than starting a new one, but if I do I'll report back. But keep it in mind, I think even more grass/thorns may enrich the game further.

Continue working the magic! As always, thanks man!
To the start Previous 1 2 ... 100 101 Next To the start