Search found 2602 matches

by pgimeno
Mon May 10, 2021 10:40 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 2
Views: 73

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: 31
Views: 35381

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: 27
Views: 7331

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: 31
Views: 35381

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: 27
Views: 7331

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: 257

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: 434

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
by pgimeno
Tue May 04, 2021 3:14 pm
Forum: Support and Development
Topic: How to Generate Gibberish voices
Replies: 14
Views: 661

Re: How to Generate Gibberish voices

I've checked Reigns gameplay; it looks to me that these are also pre-recorded from human actors, like The Sims, except the snippets are shorter and there is some "mix and match" (concatenation) of snippets.
by pgimeno
Tue May 04, 2021 1:29 pm
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1986

Re: Coordinates for lines vs points (and pixel grid alignment for points)

It's interesting, that Lua has no integer data type, but there is small different: a = 10 b = 100/10 -- looks like 10 print(a) -- prints 10 print(b) -- prints 10.0 print(tostring(a==b)) -- prints true Somehow 10.0 will be same as 10, but it prints it in other way. Can't reproduce. I get 10 both tim...