Search found 2050 matches

by raidho36
Tue Feb 25, 2020 12:33 am
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

480 draw calls eating 12% of the GPU power sounds about right, in by book that's pretty generous actually. Batching will reduce the amount of draw calls. If you were using version 11 or later there should be autobatching enabled; check the output of love.graphics.getStats.
by raidho36
Mon Feb 24, 2020 11:24 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

You just shove your entire map into a spritebatch, in the order in which each tile would be rendered, accounting for layers and all. Particularly gigantic maps may need splitting into chunks but yours are very small. You can break up the batch if your effects necessitate a shader switch (or uniform ...
by raidho36
Mon Feb 24, 2020 7:45 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

Third, post a .love if you want people to help you better. We won't "steal" your game, we're too busy trying to make our own games. He posted (the relevant fraction of) his code. Presumably it's bottlenecked by the CPU due to having to work through pretty ridiculous amount of data before a tile can...
by raidho36
Mon Feb 24, 2020 12:34 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

GUI just goes on top of everything so it doesn't needs to be a layer. Well actually since everything is rendered in specific order and layers' only purpose is to impose a specific render order - which already exists - there is never any need for layers. I decided not to answer any of that because it...
by raidho36
Mon Feb 24, 2020 11:42 am
Forum: Support and Development
Topic: Infinite vertical platform generation
Replies: 2
Views: 70

Re: Infinite vertical platform generation

There aren't a lot of platforms so just plopping them around is fine.
by raidho36
Sun Feb 23, 2020 7:00 am
Forum: Support and Development
Topic: Error while trying to play a .Wav file
Replies: 5
Views: 240

Re: Error while trying to play a .Wav file

The error text spells it out for you: the function expects string as a 2nd argument, and you gave it nothing.
by raidho36
Sat Feb 22, 2020 7:45 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

I've only just realized that Canvases just store the instructions given to them and parse them when called via the draw command Uh, no? That would be spritebatch (and technically it just combines sprite geometry into a single megasprite). Canvas is the same as the screen, except not rigidly tied to...
by raidho36
Sat Feb 22, 2020 7:34 pm
Forum: Support and Development
Topic: Variable becomes nil after passing it to another function
Replies: 2
Views: 76

Re: Variable becomes nil after passing it to another function

You didn't use the colon notation when you called the detection function.

It's a bit complicated subject but the gist of it is that colon notation definition expects colon notation usage, same with dot notation.
by raidho36
Sat Feb 22, 2020 7:16 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

This code looks like you took Durgasoft courses a little too unironically. You can start by not using globals and not using nondescript numerical indices. Not grinding through a bunch of static data for every single tile would also help. Finally you can organize render order of your tiles by GPU dra...
by raidho36
Sat Feb 22, 2020 6:12 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 989

Re: Any way to get canvases to be more efficient?

For a decent example of similar visual effect, just about any modern 2D top-down-Zelda-style game with lots of layering would suffice. Graveyard Keeper, Stardew Valley, and Undermine all come to mind as decent examples of games of the style in question. There's absolutely nothing in there that warr...