FYI, SSK is an example of a ‘super module’. That is, it requires several dozen modules once and accumulates them into a single semi-deep table/module hierarchy that is then exposed as a global.
The module (when fully loaded; and you can control this to reduce it) is about 500KB of memory.
This is NOT efficient in some regards, but from an accessibility and usability viewpoint it greatly reduces the complexity of collecting the varied functionality in SSK.
I then alleviate some of the ‘lookup costs’ associated with putting all this functionality in a single deep hierarchy by localizing functions/and features I use most.
For example, if I’m using the math2d sub-module in a game file, I put this at the top:
-- -- SSK 2D Math Library local addVec = ssk.math2d.add;local subVec = ssk.math2d.sub;local diffVec = ssk.math2d.diff local lenVec = ssk.math2d.length;local len2Vec = ssk.math2d.length2; local normVec = ssk.math2d.normalize;local vector2Angle = ssk.math2d.vector2Angle local angle2Vector = ssk.math2d.angle2Vector;local scaleVec = ssk.math2d.scale
Now, instead of this:
local vec = ssk.math2d.angle2Vector( 45 )
I can type this:
local vec = angle2Vector( 45 )
Not only is this easier to type, but by localizing the function I’ve reduced the lookup time to use it repeatedly.