Search found 2599 matches

by pgimeno
Mon May 10, 2021 2:06 am
Forum: Libraries and Tools
Topic: LuaPreprocess - straightforward preprocessor with simple syntax
Replies: 27
Views: 35223

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: 24
Views: 7226

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

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

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

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

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...
by pgimeno
Mon May 03, 2021 9:02 pm
Forum: Games and Creations
Topic: Don't learn to code - WesternPunk
Replies: 14
Views: 10381

Re: Don't learn to code - WesternPunk

But I did learn to code from zzt and megazuex so... yeah... LOL that's awesome! Certainly not the best way to learn programming in general, but who am I to speak, since I started by learning ZX81 BASIC then Z80 assembler... Anyway, my dream has always been to implement a MZX-style game designer in ...
by pgimeno
Mon May 03, 2021 8:19 pm
Forum: Support and Development
Topic: How to Generate Gibberish voices
Replies: 14
Views: 561

Re: How to Generate Gibberish voices

I don't think The Sims uses generated voices.

You could try with some sound synthesis software, feeding it generated words. I wrote a word generator for Spanish-sounding words (post in Spanish): http://orden-y-concierto.blogspot.com/2 ... abras.html
by pgimeno
Mon May 03, 2021 7:59 pm
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1757

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

Xii, I generally agree with your post, but this part: The canvas you draw on is a continuous 2-dimensional surface, its coordinates are floating point numbers with approximate, fractal precision. In this model, there is no 2 ! The exact number 2 might not actually exist! In Lua floating point, there...