Search found 3580 matches

by pgimeno
Wed May 22, 2024 8:40 am
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

It takes a few minutes on my 4gb system. And top doesnt properly show it, i can not explain the behaviour but this code will crash all my systems veryfiying that this code does in fact not release its memory. I left it running for over an hour, and the love executable didn't reach 8 GB according to...
by pgimeno
Tue May 21, 2024 10:29 pm
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

Regardless of what people want to call this, it does sound problematic as you have to explicitly call collectgarbage() before the program crashes, which isn't obvious if you expect the garbage collector kicking in on its own after a while. Not really. Just adding a line before newFont, like the fol...
by pgimeno
Tue May 21, 2024 8:05 pm
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

Even if your entire program is just Font = love.graphics.newFont( 12) Font = love.graphics.newFont( 21) In my book thats a memory leak, those two lines cause a memory leak. Because it fits the definiton of "not freeing unused data". And thats the whole thing, this line, it fits so it is. ...
by pgimeno
Tue May 21, 2024 7:45 am
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

This is the very definition of a memory leak. And of course its not anymore if you call garbage collect, i mean.... thats the point. What are you trying to say here? A memory leak consists of memory that is never released. The difference with what I'm saying is that garbage collection would eventua...
by pgimeno
Mon May 20, 2024 9:26 pm
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

Practical example for a memory leak: Have a textbox, have it have a zoom in/out function. We reload our font with Font = love.graphics.newFont( zoom) _Font_ is overwriten each time so logically we would assume the old font data is discardet as it is no longer referenced. This is not the case becaus...
by pgimeno
Mon May 20, 2024 4:52 pm
Forum: General
Topic: Pool(Billiards) physics (Need help)
Replies: 5
Views: 610

Re: Pool(Billiards) physics (Need help)

Here's a PoC of the love.physics approach. Lots of magic numbers everywhere as I fine-tuned the parameters by trial-and-error, sorry.

As I feared, love.physics doesn't do bouncing too well, and balls sometimes stick to the cushions if they are very slow, even when setting restitution to 1.
by pgimeno
Mon May 20, 2024 10:54 am
Forum: Support and Development
Topic: How do you really tell if your game has a memory leak?
Replies: 21
Views: 1685

Re: How do you really tell if your game has a memory leak?

It's quite uncommon to have a memory leak when you're not using FFI. The most common cause of memory usage growth is not a memory leak; it's allocating objects and then disposing of them without releasing them, as Lua won't bother to garbage-collect them early because it doesn't "see" that...
by pgimeno
Mon May 20, 2024 10:15 am
Forum: General
Topic: Pool(Billiards) physics (Need help)
Replies: 5
Views: 610

Re: Pool(Billiards) physics (Need help)

Well, it depends on the degree of sophistication you're after. If you just want basic bounces, without considering aspects like friction with the cushions or during ball collisions, or whether the ball is hit off-centre to give it a spinning efect, then you could do with a simple bouncing-based sche...
by pgimeno
Sat May 18, 2024 6:12 pm
Forum: Support and Development
Topic: [SOLVED] push.lua and love.graphics.newQuad problem
Replies: 5
Views: 582

Re: push.lua and love.graphics.newQuad problem

The images with push use a linear filter, while the images without push use a nearest filter. With the nearest filter the adjacent tiles can bleed into the current tile. Changing to linear should solve it, if that's acceptable for your project. Otherwise, you'll need to fix your tileset by separati...
by pgimeno
Sat May 18, 2024 6:26 am
Forum: General
Topic: Polygon is too bitmap.
Replies: 9
Views: 838

Re: Polygon is too bitmap.

Have you tried what mön said? Filled polygons and circles are made of OpenGL triangles, which are usually rendered by default without antialiasing. setFilter won't help in this case though.