Search found 1304 matches

by ivan
Thu Jul 19, 2018 5:15 pm
Forum: Support and Development
Topic: [SOLVED] Different approaches for saving settings and game progress
Replies: 8
Views: 242

Re: Different approaches for saving settings and game progress

Actually, I would go one step further and say that regardless of the format, safety should always be of concern.
It doesn't really matter if you use Lua, XML, JSon, SQL - all of these formats could probably be exploited in one way or another.
It's really a question of what's practical in your case.
by ivan
Thu Jul 19, 2018 1:29 am
Forum: Support and Development
Topic: [SOLVED] Different approaches for saving settings and game progress
Replies: 8
Views: 242

Re: Different approaches for saving settings and game progress

Yes, using Lua is by far the most sensible choice. I like to load the default options (read-only) file as a table from the game directory, then I look for a "custom" or saved options file in the appdata directory. Then I merge the fields from the two tables if the types match: for k, v in pairs(defa...
by ivan
Tue Jul 17, 2018 4:54 am
Forum: Support and Development
Topic: [Box2D] Polygon triangulation - area > b2_epsilon
Replies: 2
Views: 115

Re: [Box2D] Polygon triangulation - area > b2_epsilon

No, box2d polygons have several limitations. Off the top of my head: - the area of each polygon must be greater than b2_epsilon (you cannot have tiny polygons) - the angle of each vertex in the polygon cannot be too low (you cannot have near 0 or 180-degree vertex corners) - each edge of the polygon...
by ivan
Thu Jul 12, 2018 2:00 pm
Forum: Support and Development
Topic: Compound Shapes?
Replies: 7
Views: 291

Re: Compound Shapes?

I have one last question about excluding shapes from other shapes hit boxes, like a cookie cutter. No, Box2D works with convex polygons up to 8 vertices max. Box2D has several other limitations too like minimum edge length and vertex angle. In short, you want to avoid long, thin triangles which is ...
by ivan
Tue Jul 10, 2018 5:15 pm
Forum: Support and Development
Topic: Scaling without blurring
Replies: 11
Views: 1695

Re: Scaling without blurring

And here is my result. You can notice a contour as well, which I do not want either (it may be a consequence of the blurring). Sorry for necroposting but I believe there is a possible solution for the contour issue. This works with transparent PNG images (using "indexed color"). You need to set the...
by ivan
Tue Jul 10, 2018 8:12 am
Forum: General
Topic: How can I store cool levels and sweet resources cozily
Replies: 5
Views: 280

Re: How can I store cool levels and sweet resources cozily

Do you have any inputs on how to organize our code better? This is a hard question. I think it's not a problem for small projects. For larger projects I like to divide my code into domains: drawing, input, audio, game logic. There is no "standard" for game level formats. Lua is a good format for st...
by ivan
Sat Jul 07, 2018 4:26 pm
Forum: Support and Development
Topic: Optomizing a Dijikstra Map
Replies: 2
Views: 267

Re: Optomizing a Dijikstra Square

Sure, setting up a profiler is a good starting point. I ran it on your initialization code (love.load) and here are the results for "C" hooks: +-----+----------------------------------+----------+--------------------------+----------------------------------+ | # | Function | Calls | Time | Code | +-...
by ivan
Sat Jul 07, 2018 5:30 am
Forum: Support and Development
Topic: VSync - Half Refresh / Skip Frames
Replies: 5
Views: 186

Re: VSync - Half Refresh / Skip Frames

Oh dear, there are much better ways than using love.sleep. VSync ensures that stuff is drawn whenever the video card is ready. You can't just use love.sleep and expect that everything will work fine. Does Love 2D have a VSync option for half-refresh rate or skip a certain number of frames? And if so...
by ivan
Fri Jul 06, 2018 2:01 pm
Forum: Support and Development
Topic: Send the love.physics world to players (multiplayer game)
Replies: 5
Views: 221

Re: Send the love.physics world to players (multiplayer game)

I've tried with Hero but I can't serialize the output... Bitser warns you right there why your "world" reference can't be serialized. It's because "world.save" returns a table with functions. This part won't be very hard to make. I suppose it depends on the game. Pretty hard to make/debug in my exp...
by ivan
Fri Jul 06, 2018 3:57 am
Forum: General
Topic: [solved] is there a better way to code this?
Replies: 3
Views: 261

Re: is there a better way to code this?

I think more generally, the question is, can multiple blocks occupy the same coordinate? If "yes" then you probably don't want to reference them using coordinates. If the answer is "no" then you need to research how hashing works. This way you can access objects directly: function removeBlock(x, y, ...