Page 4 of 5

Re: Alternative tile implementation

Posted: Mon Jul 04, 2011 7:27 am
by T-Bone
I implemented this now, and it seems to run pretty well. What I do is that I, at start, create as many 512*512 framebuffers as I need, and draw tiles to them. Then, I draw the one or two framebuffers currently needed to the screen. Just wondering, how many 512*512 framebuffers is it reasonable for a computer to be able to keep in its memory? Between 5-10 something seems to work great on my netbook, but I'm guessing it's going to vary a lot between computers. I guess framebuffers are stored in VRAM so it's kind of hard to guess.

Re: Alternative tile implementation

Posted: Mon Jul 04, 2011 6:30 pm
by Jasoco
T-Bone wrote:I implemented this now, and it seems to run pretty well. What I do is that I, at start, create as many 512*512 framebuffers as I need, and draw tiles to them. Then, I draw the one or two framebuffers currently needed to the screen. Just wondering, how many 512*512 framebuffers is it reasonable for a computer to be able to keep in its memory? Between 5-10 something seems to work great on my netbook, but I'm guessing it's going to vary a lot between computers. I guess framebuffers are stored in VRAM so it's kind of hard to guess.
I did tests a while ago on my MacBook Pro 13" and it let me do thousands of them. But some other modern PC's can't even do 1. So there's no "average" to aim for. The best you can do is use as many as you need and if possible offer a non framebuffer mode or put a readme with the project that tells the user they won't be able to use it.

What I would do is use the pcall on the function that creates the framebuffers, and if it fails, place a message on screen in plain english/spanish/whatever that their computer is not worthy enough to play the game because their video card is not up to date.

Re: Alternative tile implementation

Posted: Tue Jul 05, 2011 6:47 am
by T-Bone
Jasoco wrote:
T-Bone wrote:I implemented this now, and it seems to run pretty well. What I do is that I, at start, create as many 512*512 framebuffers as I need, and draw tiles to them. Then, I draw the one or two framebuffers currently needed to the screen. Just wondering, how many 512*512 framebuffers is it reasonable for a computer to be able to keep in its memory? Between 5-10 something seems to work great on my netbook, but I'm guessing it's going to vary a lot between computers. I guess framebuffers are stored in VRAM so it's kind of hard to guess.
I did tests a while ago on my MacBook Pro 13" and it let me do thousands of them. But some other modern PC's can't even do 1. So there's no "average" to aim for. The best you can do is use as many as you need and if possible offer a non framebuffer mode or put a readme with the project that tells the user they won't be able to use it.

What I would do is use the pcall on the function that creates the framebuffers, and if it fails, place a message on screen in plain english/spanish/whatever that their computer is not worthy enough to play the game because their video card is not up to date.
That sounds like a good solution. Thanks!

Re: Alternative tile implementation

Posted: Thu Jul 07, 2011 11:23 pm
by Jasoco
You could also use the Boolean that gets returned to do things differently instead of just erroring out so the player can still play the game, just not as fully intended.

Re: Alternative tile implementation

Posted: Thu Jul 07, 2011 11:36 pm
by Robin
Jasoco wrote:You could also use the Boolean that gets returned to do things differently instead of just erroring out so the player can still play the game, just not as fully intended.
That is a very good way of handling things if the game doesn't depend too much on the framebuffers.

Re: Alternative tile implementation

Posted: Fri Jul 08, 2011 7:04 am
by T-Bone
Currently, all menus and all tiles in-game depend on framebuffers, so that's not a very good solution for me :P

Re: Alternative tile implementation

Posted: Fri Jul 08, 2011 12:07 pm
by bartbes
I remember Lafolie's game disabled certain blood effects when your hardware didn't support it.

Re: Alternative tile implementation

Posted: Sat Jul 09, 2011 7:07 am
by appleide
I have a macbook pro (2009) and it does not support framebuffers.

Re: Alternative tile implementation

Posted: Sat Jul 09, 2011 7:54 am
by bmelts
2009? Are you sure it doesn't just support power-of-2 framebuffers? I know some graphics cards can handle framebuffers with PO2 dimensions but otherwise fail.

Re: Alternative tile implementation

Posted: Sat Jul 09, 2011 8:30 am
by T-Bone
appleide wrote:I have a macbook pro (2009) and it does not support framebuffers.
That sounds... Horrible. Truly terrifying if that's the case. I really hope it supports sqaure PO2 framebuffers, otherwise this could really be an issue.

Try this:

http://dl.dropbox.com/u/7572962/algal.love

This game shows first a title screen, where it uses non-PO2 framebuffers to draw the text. Then, press "k", and it takes you to my test of this tileset implementation (you can scroll with WASD, but scrolling too far to the left causes issues), which uses PO2 framebuffers. Does it work?