Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Frame Rate Drop From Scripts Help

Author
Message
The Master D
15
Years of Service
User Offline
Joined: 20th Feb 2009
Location:
Posted: 17th Apr 2013 17:16
I'm using several different scripts inside of my survival game. such scripts are a health system that is split into 3 trigger zones, a script that creates a weapon slot variable, a cash counter, and a script that let's you buy each gun. My frame rate is initially in the 40's but then it ends up dropping to around 13 in like 2 minutes. I'm guessing this is from the looping of the scripts, but I can't see 500-600 lines of code split into different trigger zones and entities to cause such a dive in performance.

I'd really appreciate any help that can be offered because this is putting my project on hold for the moment. Thanks in advance!

AMD FX-6300 Vishera 3.5GHz, Radeon HD 7850 2GB, 8 GB RAM, Win 7 Pro 64 Bit
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 22nd Apr 2013 10:57
I have the same problem when I add too many sound zones. Even though its spread out unless you destroy them. The engine still has to read through and execute each one.
The Master D
15
Years of Service
User Offline
Joined: 20th Feb 2009
Location:
Posted: 23rd Apr 2013 17:10
It's just that I've seen people with thousands of lines of script and it ran no problem, and their systems aren't as good as mine. Am I probably just doing something wrong or is there maybe a way to change the settings of FPSC?

AMD FX-6300 Vishera 3.5GHz, Radeon HD 7850 2GB, 8 GB RAM, Win 7 Pro 64 Bit
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 23rd Apr 2013 18:10
I ahve a pretty good system as well. Have you tried omitting each script then adding them one by one, testing each time to zero in on which script it is?

When you have a looping script where it's constantly checking var's and the like. This maybe why your system is slowing.

You could and build a small test level maybe 8x8, just a floor, then add your triggers and scripts and see what happens.

I do this alot(use test levels) to test out scripts or custom AI. It makes the process a lot quicker because you don't have to load a whole map.
The Master D
15
Years of Service
User Offline
Joined: 20th Feb 2009
Location:
Posted: 23rd Apr 2013 20:06
I'll try that when I go home, I'm hoping I can figure out what the issue is because this really is annoying me haha

AMD FX-6300 Vishera 3.5GHz, Radeon HD 7850 2GB, 8 GB RAM, Win 7 Pro 64 Bit
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 23rd Apr 2013 20:44 Edited at: 23rd Apr 2013 20:45
Quote: "It's just that I've seen people with thousands of lines of script and it ran no problem, and their systems aren't as good as mine."


The script cap is at 350 lines per script so if you have 10 scripts all using the maximum line cap that "start-run-loop" then it will affect frame rate. Even though my script cap is set higher, one script continually running a loop using 350 lines will drop my frame rate at least by 10 fps and I have a fairly descent system.

The key is to call the scripts with triggers/entities you need at the time to run then activate/spawn other triggers/entities with scripts when needed. By using that balance, you should be able to keep your frame rate at a steady value.

In addition, if you have scripts that are using the "videotexture" feature or post effect feature, that too will drop frame rate.


There's no problem that can't be solved without applying a little scripting.
The Master D
15
Years of Service
User Offline
Joined: 20th Feb 2009
Location:
Posted: 24th Apr 2013 03:35
I'm running a Nazi Zombies style system, so that has the cash system with looping pickup scripts for each weapon, a script for perks and a power switch, AI for enemies, and a looping health system that displays HUDs when hurt to a certain degree. The only script that would come close to the limit is the health system. But all of these scripts are constantly running so maybe that's the issue.

AMD FX-6300 Vishera 3.5GHz, Radeon HD 7850 2GB, 8 GB RAM, Win 7 Pro 64 Bit

Login to post a reply

Server time is: 2024-11-23 13:51:36
Your offset time is: 2024-11-23 13:51:36