Search found 2597 matches

by pgimeno
Sun May 09, 2021 1:37 am
Forum: General
Topic: What is your advice for saving game state?
Replies: 6
Views: 157

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

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

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

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

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

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

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...
by pgimeno
Mon May 03, 2021 3:50 pm
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1606

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

It's not that difficult or weird actually. Rectangles and lines drawn at 0,0 will be blurry and should be placed at .5,.5 instead because that's how the coordinate system works. Images and text drawn at .5,.5 will be blurry and should be placed at 0,0 instead because that's how the coordinate syste...
by pgimeno
Mon May 03, 2021 11:13 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1606

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

In the end, it doesn't matter how the underlying hardware works. The only thing which matters is the contract that the API offers. And for a 2D platform such as Love2D, specified pixel locations should *absolutely* be accurate because they should directly map to an underlying surface, for example a...