Search found 137 matches

by Xii
Fri Oct 29, 2021 7:32 pm
Forum: Support and Development
Topic: How to make bitser more robust
Replies: 6
Views: 7607

Re: How to make bitser more robust

Use Blob instead. It recently got userdata support when I asked for it!
by Xii
Fri Aug 20, 2021 7:03 am
Forum: General
Topic: Bouncing an idea for determining bot behavior
Replies: 10
Views: 11170

Re: Bouncing an idea for determining bot behavior

Ignoring one's environment is hardly intelligence. AI needs to look around and make decisions based on what they see. What you've described is simply random behavior (with some behaviors more likely than others, but not conditionally so). If you add an evaluation function to each node instead of a f...
by Xii
Sun Aug 15, 2021 12:14 am
Forum: General
Topic: How to do pixel-perfect rendering in löve?
Replies: 14
Views: 15185

Re: How to do pixel-perfect rendering in löve?

Instead of pre-deciding on a fixed resolution with black bars around, I adapt to any screen size and orientation. Scaling only by integer multiples (for square pixels), but drawing the upscaled canvas such that the edgemost 1 pixel on all sides "bleeds" outside the screen. That is, the vie...
by Xii
Fri Aug 13, 2021 12:07 am
Forum: Support and Development
Topic: Implementing save data
Replies: 32
Views: 22125

Re: Implementing save data

Ignore all functions in save files? How do you load a Lua file while "ignoring all functions"? data = require("savedata.lua") This super simple and fast mechanism executes everything in savedata.lua. The trouble with it is you have to trust that the file hasn't been maliciously ...
by Xii
Thu Aug 12, 2021 7:18 pm
Forum: Support and Development
Topic: Implementing save data
Replies: 32
Views: 22125

Re: Implementing save data

Serializing to Lua like that has the benefit of "free" deserialization by the Lua parser itself, which is implemented in fast C.
The disadvantage is that the save file can execute Lua code, which might not be desirable, especially if players share save files.
by Xii
Wed Aug 11, 2021 6:06 pm
Forum: General
Topic: Ravi
Replies: 1
Views: 5416

Re: Ravi

Only supports 64-bit numbers (ref) , so not very useful at all. LuaJIT which LÖVE uses supports a wide variety of types (ref) : 8, 16, 32, and 64 -bit signed and unsigned integers. Smaller numbers are important for games with large tile-based worlds. If you only need an 8-bit value, that's 87.5% sma...
by Xii
Tue Aug 10, 2021 6:54 pm
Forum: General
Topic: Passing arguments to a function used as an argument?
Replies: 7
Views: 8296

Re: Passing arguments to a function used as an argument?

Razvii wrote: Sun Aug 08, 2021 2:16 pm if I ever need the collision function to do more than play a sound I can't have the sound argument be argument #3 of the original function.
Why not? This solves your original question.
by Xii
Sun Aug 08, 2021 3:54 pm
Forum: General
Topic: Passing arguments to a function used as an argument?
Replies: 7
Views: 8296

Re: Passing arguments to a function used as an argument?

A function when passed around is just the function. If you also want to pass around arguments, you have to pass them separately (as you've been trying), or you can wrap the function in a table. In other programming languages this is called a closure or a delegate . This code is a bit weird for educa...
by Xii
Sat Aug 07, 2021 3:25 pm
Forum: Support and Development
Topic: Multiplayer using sock.lua | Can't host a server
Replies: 17
Views: 14488

Re: Multiplayer using sock.lua | Can't host a server

leankyr wrote: Fri Aug 06, 2021 6:34 pm Should it be the private IP or the public IP?
Generally always the public IP. Private IPs only work on the Local Area Network (LAN), i.e. only for computers connected to your modem/router.