Alternative tile implementation

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Alternative tile implementation

Post 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.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Alternative tile implementation

Post 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.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Alternative tile implementation

Post 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!
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Alternative tile implementation

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Alternative tile implementation

Post 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.
Help us help you: attach a .love.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Alternative tile implementation

Post 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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Alternative tile implementation

Post by bartbes »

I remember Lafolie's game disabled certain blood effects when your hardware didn't support it.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Alternative tile implementation

Post by appleide »

I have a macbook pro (2009) and it does not support framebuffers.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Alternative tile implementation

Post 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.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Alternative tile implementation

Post 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?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 42 guests