Search found 13 matches

by jeremiahs
Wed Jun 22, 2011 2:19 am
Forum: Support and Development
Topic: Reduce memory usage by consolidating tiles.
Replies: 15
Views: 4968

Re: Reduce memory usage by consolidating tiles.

So I removed the width and height values from each tile table and hardcoded them in the draw routine. function tile:initialize(img) local theQuad local default = {} local width local height if global.spriteHolder[img] == nil then self.spriteKey = img global.spriteHolder[img] = {} global.spriteHolder...
by jeremiahs
Tue Jun 21, 2011 1:25 am
Forum: Support and Development
Topic: Reduce memory usage by consolidating tiles.
Replies: 15
Views: 4968

Re: Reduce memory usage by consolidating tiles.

Two things: First, I want to be able to handle arbitrarily large map sizes. Even ludicrously large maps. For no reason at all than because I said so. There is no specific problem this is causing at the moment. Second, I don't understand what's taking up all the memory, and learning the answer to tha...
by jeremiahs
Sun Jun 19, 2011 9:09 pm
Forum: Support and Development
Topic: Reduce memory usage by consolidating tiles.
Replies: 15
Views: 4968

Reduce memory usage by consolidating tiles.

The attached game loads up a large map with just two or three small tiles that get repeated over and over again. Ideally the memory used would not be much more than whatever is needed to hold and draw those two or three tiles When a tile is loaded, the code checks the global sprite table to see if t...
by jeremiahs
Sun Jun 19, 2011 8:46 pm
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Re: Fast way to draw large number of quads?

Further experimentation with the framebuffer idea has made me decide it won't work the way I might hope it to work. I think I'll table the idea, because it's a "want" not "need" thing, and look at spritebatches/multiple spatial hashes for rendering when I decide it needs to be im...
by jeremiahs
Sun Jun 19, 2011 12:01 am
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Re: Fast way to draw large number of quads?

Okay, so I just messed around with the framebuffer idea. LOVE crashes whenever I try to make a framebuffer larger than 16384 by 16384, which, with 50 by 50 tiles is a 327 by 327 tile map. And there are weird performance issues; it stalls and jumps for what seem like no reason. One of the things I'm ...
by jeremiahs
Sat Jun 18, 2011 10:19 pm
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Re: Fast way to draw large number of quads?

So when moving, the framerate would be just as bad as it is now; when standing still, the framerate would fly?
by jeremiahs
Sat Jun 18, 2011 10:01 pm
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Re: Fast way to draw large number of quads?

Robin, could you help me out a bit? Maybe some pseudocode or a link? I'm not getting something basic about the idea. If the visible portion of the map changes (which it does every time the character moves), won't I have to redraw the framebuffer every time, making it just as bad as the current metho...
by jeremiahs
Sat Jun 18, 2011 9:46 pm
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Re: Fast way to draw large number of quads?

Kadoba: I do use dt. "A" and "S" make the character movement and animation faster/slower. The speed is displayed in the upper left-hand corner. 100 is the "base" speed, but I set it to 500 just to run around the map quicker during testing. I'll give spritebatches a look...
by jeremiahs
Sat Jun 18, 2011 9:10 pm
Forum: Support and Development
Topic: Fast way to draw large number of quads?
Replies: 14
Views: 6282

Fast way to draw large number of quads?

The adventure continues! Thanks to my last question , I got schooled in how to draw a more efficient map. And it worked! I implemented a "spatial hash" and all is right with the world... except for one thing. The framerate craters when I zoom out, I assume because LOVE has to start drawing...
by jeremiahs
Wed Jun 08, 2011 7:41 am
Forum: Support and Development
Topic: Fast way to cull off-screen tiles? Also: random slowdown
Replies: 6
Views: 2523

Fast way to cull off-screen tiles? Also: random slowdown

Currently I loop through every tile and check whether or not it's on the screen. If it is, it gets drawn. If not, it doesn't get drawn. Simple enough, and it seems to work okay, but the framerate got cut in half when I tried it with a larger map. Instead of high 200 FPS, I'm getting low 100s. Right ...