Search found 595 matches

by grump
Mon Jan 13, 2020 2:19 pm
Forum: Support and Development
Topic: [SOLVED] How to create a simple encryption for a lua table?
Replies: 7
Views: 303

Re: How to create a simple encryption for a lua table?

I used your moonblob for binary serialization and then applied the encode/decode. Unfortunely, love.js does not port it (Something about FFI), so I will need to find other binary system or stick with Tserial, but that is a minor issue. moonblob is not the best choice for this anyways, because it fa...
by grump
Mon Jan 13, 2020 10:00 am
Forum: Support and Development
Topic: [SOLVED] How to create a simple encryption for a lua table?
Replies: 7
Views: 303

Re: How to create a simple encryption for a lua table?

I wouldn't mess with "real" encryption for this. You don't even care about hacks so just go with obfuscation and keep things as small as possible. - Serialize the data into a string. Use a binary serializer rather than one that outputs text for smaller and more obfuscated results - Compress the seri...
by grump
Mon Jan 06, 2020 2:24 pm
Forum: Support and Development
Topic: Execution speed varies wildly (47x) between (but not during) runs
Replies: 15
Views: 812

Re: Execution speed varies wildly (47x) between (but not during) runs

I tested it too, and can confirm the observations. Simplifying the example code more would go a long way towards getting better answers here. I'd suggest removing complexity step by step until you find the culprit. Search the forums for "profiler", ivan released a lib that might be helpful here. it ...
by grump
Mon Dec 30, 2019 8:41 am
Forum: Games and Creations
Topic: Cardioid: Sunday kind of LÖVE 1K Challenge
Replies: 12
Views: 1228

Re: Cardioid: Sunday kind of LÖVE 1K Challenge

(atm, mine are the smallest in both cases, whether or not we take the fact that the OP specified a "cardioid animation". :3) Alright, let's see how far we can bend the rules. Animated: 63 60 bytes function love.draw()love.graphics.print("<3",os.time()%9)end Not animated: 48 46 bytes function love.d...
by grump
Sun Dec 29, 2019 4:28 pm
Forum: Games and Creations
Topic: Cardioid: Sunday kind of LÖVE 1K Challenge
Replies: 12
Views: 1228

Re: Cardioid: Sunday kind of LÖVE 1K Challenge

790 bytes https://i.imgur.com/8hppAEf.png l=love;g=l.graphics;i,s=g.newCanvas(),g.newShader([[#define v vec3 #define f float #define l normalize #define r return extern f t;f T=cos(t*3);f g(v p){v q=p*p;f a=q.x+2*q.y+q.z-1;r a*a*a-(q.x+.1*q.y)*(q*p).z;}f h(f x,f z){f y=.5;for(f a=0,b=1,i=0;i<12;i++)...
by grump
Sat Dec 28, 2019 2:51 pm
Forum: Games and Creations
Topic: Cardioid: Sunday kind of LÖVE 1K Challenge
Replies: 12
Views: 1228

Re: Cardioid: Sunday kind of LÖVE 1K Challenge

Will any heart-shaped object do or does it have to be a literal cardioid? 512 bytes https://i.imgur.com/7jOBa5F.png l=love;g=l.graphics;i,s=g.newImage(l.image.newImageData(1,1)),g.newShader([[#define f float #define v vec2 extern f t;f b=t*6.283;float h(v p,v c,f s){v k=(c-p)/s;f d=k.x*k.x+k.y*k.y,a...
by grump
Tue Dec 17, 2019 2:41 pm
Forum: Libraries and Tools
Topic: Steamworks FFI
Replies: 6
Views: 1077

Re: Steamworks FFI

In general, pure Lua can't handle such large numbers: n = 0xffffffffffffffff The point is that you can use the ULL suffix to write 64 bit integer literals directly in LuaJIT, there's no need to call strtoull. assert(0xffffffffffffffffULL == ffi.C.strtoull("0xffffffffffffffff", nil, 16)) http://luaj...
by grump
Tue Dec 17, 2019 10:45 am
Forum: Libraries and Tools
Topic: Steamworks FFI
Replies: 6
Views: 1077

Re: Steamworks FFI

Code: Select all

ffi.C.strtoull("0xffffffffffffffff", nil, 16)
LuaJIT accepts a ULL suffix for this.

Code: Select all

0xffffffffffffffffULL
by grump
Tue Dec 03, 2019 1:34 pm
Forum: Support and Development
Topic: How does one debug silent crashes?
Replies: 5
Views: 977

Re: How does one debug silent crashes?

I remember a thread dedicated to one of those. Did you find the issue? I can't remember details anymore, just that examining my own code thoroughly in these situations always led me to the cause - usually off-by-one errors when accessing ffi-allocated memory - faster than trying to make sense of th...