Search found 48 matches

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

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

Okay, now it's really getting weird! I tried checking the CPU usage on the testing environment I built, and it was using sub-4% of the CPU when it started dropping below 60FPS. The main game, meanwhile, consumes around 8 to 12% of CPU power when just at the 60FPS threshold. It's like something is th...
by Sky_Render
Mon Feb 24, 2020 11:42 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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 Sky_Render
Mon Feb 24, 2020 8:13 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

I think this topic has gotten a bit far off the mark of what I was trying to get help with. Let's start this over with the question I should have asked. How does one efficiently proceed with rendering a tilemap when said tilemap consists of a large number of layers which all require rendering over o...
by Sky_Render
Mon Feb 24, 2020 6:27 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

I've been doing some testing on various rendering in a dedicated program, and have found the following thus far: - Rendering to a SpriteBatch is limited to about 16 layers for efficiency, and holds many other limitations as well. - Rendering to an ImageData is limited to about 19 layers for efficien...
by Sky_Render
Sat Feb 22, 2020 7:30 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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 dr...
by Sky_Render
Sat Feb 22, 2020 6:42 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

As promised, now that I've managed to resurrect my working code, here's what it's doing. This is called once when the game loads: function render_layers() -- Renders all layers of the selected map local i = 1 -- Draw background while i <= map_lastshadow[current_map] do if i ~= map_collisionlayer[cur...
by Sky_Render
Sat Feb 22, 2020 6:17 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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...
by Sky_Render
Sat Feb 22, 2020 6:07 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

I'd have to make some fixes to my code right now to get it working again; the SpriteBatch experiment really messed it up (good thing I didn't delete my original render code!). I have been working on that while we've been talking, though, and once I've got it fixed I will be posting what I've got so ...
by Sky_Render
Sat Feb 22, 2020 5:56 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

I would settle for a simple explanation of how you can "touch every pixel only once" when you have many, many layers that need to be rendered over one another. Because from what I can tell from this conversation, that is patently impossible by any method. How do you render layers efficient...
by Sky_Render
Sat Feb 22, 2020 5:44 pm
Forum: Support and Development
Topic: Any way to get canvases to be more efficient?
Replies: 38
Views: 16676

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

If that's the case then don't quite get how you're supposed to render large numbers of layered objects properly. I mean I'm only drawing to the screen once technically since what's outputted is assembled to a master Canvas that's exactly the screen resolution, but that doesn't seem to affect the eff...