Search found 155 matches

by szensk
Fri Jun 12, 2015 3:50 pm
Forum: Libraries and Tools
Topic: [library] namem 0.5
Replies: 2
Views: 1338

Re: [library] namem - another random name generator

I like the names generated by this method.

One oddity in the source. init.lua shouldn't make namem be a global variable, it should be local and returned via init.lua. This prevents polluting the global scope with variables. (And locals are faster than globals)
by szensk
Thu Jun 11, 2015 11:20 pm
Forum: Support and Development
Topic: Framerate Inconsistencies
Replies: 7
Views: 1913

Re: Framerate Inconsistencies

Have you checked if it's the garbage collector?

Try turning off the garbage collector and see if the frame rates stabilize. How? Put

Code: Select all

collectgarbage("stop")
in your love.init. Of course you can't "ship" the game like this but it may help to diagnose the problem.
by szensk
Sat May 30, 2015 3:32 am
Forum: Support and Development
Topic: Collisions and ipairs! Eep!
Replies: 3
Views: 993

Re: Collisions and ipairs! Eep!

That's a double for loop then, eh?

Some pseudocode:

Code: Select all

for i, redLobster in ipairs(crusaderRed.lobsters) do 
     for i, blueLobster in ipairs(crusaderBlue.lobsters) do
        if CheckCollision(...) then --arguments omitted for brevity
             --do stuff here
        end
     end
end
by szensk
Fri May 29, 2015 4:11 am
Forum: Support and Development
Topic: about distributing on windows...
Replies: 11
Views: 2477

Re: about distributing on windows...

tl;dr: This is far more difficult than it's worth. A few previous related threads: https://www.love2d.org/wiki/Source_Obfuscation https://love2d.org/forums/viewtopic.php?f=3&t=79352 https://love2d.org/forums/viewtopic.php?f=4&t=76674 One approach is to distribute the code in compiled bytecod...
by szensk
Sun May 24, 2015 6:08 am
Forum: General
Topic: um I lost #love
Replies: 6
Views: 796

Re: um I lost #love

Server is oftc.net
by szensk
Thu May 21, 2015 7:41 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 221147

Re: "Questions that don't deserve their own thread" thread

Here's an example, basically right from the Lua manual: local function printlocals() local n = 1 while true do local name, value = debug.getlocal(2,n) if not name then break end print(name, value) n = n + 1 end end do g = 1 local l = 2 printlocals() end If you wanted to something other than print th...
by szensk
Sun May 17, 2015 5:19 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 221147

Re: "Questions that don't deserve their own thread" thread

Thanks for the reply(s) Robin and szensk. So szensk: What exactly does that mean? Isn't LuaJIT a part of the love package? Your use of the word "can" implies these things are NOT turned on by default. Why not? And how would these optimizations actually be manipulated? By default, LuaJIT (...
by szensk
Sun May 17, 2015 2:59 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 221147

Re: "Questions that don't deserve their own thread" thread

Another thing to note: many of the optimizations you mention can be done automatically by LuaJIT. It tries to do loop unrolling (#3), constant folding (#2) and code hoisting (#1 but only in loops IIRC). I do #1 frequently myself because love.graphics is a mouthful but also LuaJIT doesn't always kill...
by szensk
Sat May 16, 2015 7:28 am
Forum: General
Topic: questions about 1.0.0 (not 0.10.0)
Replies: 25
Views: 4957

Re: questions about 1.0.0 (not 0.10.0)

according to a benchmark of various programming languages I found a while ago Javascript is the fastest language for most calculations and operations. Faster than C or C++? In micro-benchmarks, V8 is about 4x slower than C++ and execution time is much more variable. Micro-benchmarks are the areas t...
by szensk
Sun May 03, 2015 5:32 am
Forum: General
Topic: Which version of Lua should I learn for Love 0.9.2
Replies: 2
Views: 1178

Re: Which version of Lua should I learn for Love 0.9.2

Probably Lua 5.1 since that's what everyone uses.