Search found 2614 matches

by pgimeno
Tue May 11, 2021 6:56 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 828

Re: Garbage going crazy

Nice fix.
grump wrote: Tue May 11, 2021 4:44 am I should try to get a trace log but it's a bit difficult when you use LÖVE.
Try with: require 'jit.dump'.on() and .off()
by pgimeno
Tue May 11, 2021 6:46 pm
Forum: Games and Creations
Topic: [LD31] GridCars
Replies: 28
Views: 8107

Re: [LD31] GridCars

Apologies, I forgot to test without a config.txt and it turns out that I made two blatant mistakes. Fixed in 1.1.1:

https://notabug.org/pgimeno/GridCars/releases
by pgimeno
Mon May 10, 2021 10:40 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 17
Views: 828

Re: Garbage going crazy

Without much analysis, I think what you see is that the short loop (1..10) is stopping the trace. Unrolling it solves the issue. In interpreted mode, FFI sucks. If you add jit.off() at the beginning, you'll see the memory grow with either test case. This crashes in just a few iterations: collectgarb...
by pgimeno
Mon May 10, 2021 9:38 pm
Forum: Libraries and Tools
Topic: LuaPreprocess - straightforward preprocessor with simple syntax
Replies: 39
Views: 36427

Re: LuaPreprocess - straightforward preprocessor with simple syntax

Thanks. So there doesn't seem to be a way around embedding the Lua code for the parameters and copy it verbatim to the output. The problem that I'm trying to solve is this: http://lua.space/general/assert-usage-caveat . In the article, my proposed solution is a hack around the lack of a preprocessor...
by pgimeno
Mon May 10, 2021 8:59 pm
Forum: Games and Creations
Topic: [LD31] GridCars
Replies: 28
Views: 8107

Re: [LD31] GridCars

Good work Dedicated can also be modified to run with love. Since: * LFS function utilized is available in love * socket is available in love * installing lua, and lfs and socket for lua can be relatively difficult That's reasonable. I've implemented it. Where I can find the .love file? There wasn't...
by pgimeno
Mon May 10, 2021 2:06 am
Forum: Libraries and Tools
Topic: LuaPreprocess - straightforward preprocessor with simple syntax
Replies: 39
Views: 36427

Re: LuaPreprocess - straightforward preprocessor with simple syntax

As a result of a recent question, I decided to try to write a proper assert using LuaPreprocess, but I'm having trouble. A proper assert is one where: - with assertions disabled, the result is no code at all (i.e. even if the conditions are complex, they won't be included in the program if assertion...
by pgimeno
Sun May 09, 2021 11:12 pm
Forum: Games and Creations
Topic: [LD31] GridCars
Replies: 28
Views: 8107

Re: [LD31] GridCars

Forked, updated to Löve 11.1+ and changed the URL of the server finder as the original one is dead:

https://notabug.org/pgimeno/GridCars

Note I don't run a server, only a server finder.
by pgimeno
Sun May 09, 2021 1:37 am
Forum: General
Topic: What is your advice for saving game state?
Replies: 6
Views: 862

Re: What is your advice for saving game state?

Maybe not hundreds, but there are probably dozens of serialization libraries. For T2R I decided to use JSON; today I would have chosen Smallfolk, but if I wanted the files to be compact and not necessarily human-readable, bitser. I don't trust serialization libraries that generate Lua code.
by pgimeno
Tue May 04, 2021 10:41 pm
Forum: Support and Development
Topic: [Solved] "Unmodifiable" table gets wiped after using it
Replies: 7
Views: 960

Re: [Solved] "Unmodifiable" table gets wiped after using it

Copy and randomize at the same time:

Code: Select all

local function CopyRandomize(t) -- tribute to Spectrum 128K
  local res = {}
  for i = 1, #t do
    local j = math.random(1, i)
    res[i] = res[j]
    res[j] = t[i]
  end
  return res
end