I recently implemented some triple buffering in a game I'm making in Blitz Plus i.e. draw everything to an image in memory (not on the video card) and then call Drawblock to copy it all to the video card. This allows me to use ReadPixelFast on the image in memory for cool effects like transparency etc. and it works about 5 times faster than if I use ReadPixelFast on the Backbuffer.
Problem is that all the standard blitz functions like DrawBlock and DrawImage seem to be much slower in memory than when they are used on the BackBuffer. This means that the draw routine in my game has gone from 5ms to 20ms on an Athlon 1GHz i.e. around 4 times slower! This makes the game drop from silky smooth >60FPS to half that i.e. around 30FPS and this has a noticable effect on the animations and mouse pointer movement.
I tried writing my own draw block function with WritePixelFast but it was WAY too slow even though it was just locking the buffer, looping and unlocking.
So my quesiton is should I a) keep the triple buffer and really make use of it with some cool effects, but up the min system specs to 2GHz or b) restore the old straight to BackBuffer code and allow 1GHz (and less) users to play the game? or c) something else amazing that I don't know yet?!
You see my dilemma, logic would say, the more PCs that can play it, the bigger the market = more sales but it may not look as cool and thus sales could be lost.
Btw, buying BlitzMax and recoding it all is not an option at this point, but the next game WILL be in Max as I'm fed up with software rendering being so slow.
It has been suggested by Indiepath to use a dirty rects method, i.e. only draw the bits that have change but to do this you have to store the background behind the thing you are drawing so that it can be replaced the next frame. This means twice as much drawing for every object and if you have a lot of objects all moving at once, it could be slower than my brute force method of DrawBlock the background and then draw everything on it. Unless I'm missing something here?
Any suggestions (or flames ;-) are really appreciated.
Thanks in advance.
P.S. I've put this in General Discussion because, although I'm using Blitz Plus, I think that the concept of raising min spec for better effects and alienating users is a general discussion point.
Problem is that all the standard blitz functions like DrawBlock and DrawImage seem to be much slower in memory than when they are used on the BackBuffer. This means that the draw routine in my game has gone from 5ms to 20ms on an Athlon 1GHz i.e. around 4 times slower! This makes the game drop from silky smooth >60FPS to half that i.e. around 30FPS and this has a noticable effect on the animations and mouse pointer movement.
I tried writing my own draw block function with WritePixelFast but it was WAY too slow even though it was just locking the buffer, looping and unlocking.
So my quesiton is should I a) keep the triple buffer and really make use of it with some cool effects, but up the min system specs to 2GHz or b) restore the old straight to BackBuffer code and allow 1GHz (and less) users to play the game? or c) something else amazing that I don't know yet?!
You see my dilemma, logic would say, the more PCs that can play it, the bigger the market = more sales but it may not look as cool and thus sales could be lost.
Btw, buying BlitzMax and recoding it all is not an option at this point, but the next game WILL be in Max as I'm fed up with software rendering being so slow.
It has been suggested by Indiepath to use a dirty rects method, i.e. only draw the bits that have change but to do this you have to store the background behind the thing you are drawing so that it can be replaced the next frame. This means twice as much drawing for every object and if you have a lot of objects all moving at once, it could be slower than my brute force method of DrawBlock the background and then draw everything on it. Unless I'm missing something here?
Any suggestions (or flames ;-) are really appreciated.
Thanks in advance.
P.S. I've put this in General Discussion because, although I'm using Blitz Plus, I think that the concept of raising min spec for better effects and alienating users is a general discussion point.