The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Splitting cycles - best scripting habits.
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#1
Lightbulb  Splitting cycles - best scripting habits.

Hi, I'm a perfectionist, and I've got two pretty complex questions about which way is the most optimal way to script, in terms of clock cycles and instructions gained or wasted.

A lot of parameters are internal names, which are often wasted.
When it comes to Addtimer() functions, you can have every AddTimer() call the same function, and then divide this function according to the internal names. This will obviously spare the engine from keeping track of several functions, so the code becomes neater.
However, you can also have every type of callback call the same callback function, and then divide them according to asEntity, asParent, and so on. Whether or not this is wasteful of clockcycles, depend on how had it is for the engine to rig up an entirely new function, compared to making an additional if case statement.
Which method is the most perfect?


Another thing is that there are lots of callbacks that can be defined through the level editor itself (under the Entity tab of the entities) instead of at OnStart(). Which method is the fastest and neatest in this case?

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 05-07-2012, 08:25 AM by Cranky Old Man.)
05-07-2012, 08:15 AM
Find


Messages In This Thread
Splitting cycles - best scripting habits. - by Cranky Old Man - 05-07-2012, 08:15 AM



Users browsing this thread: 1 Guest(s)