My mistake. I only just now looked into the the source code for pygame.
blit() seems to assume its an alpha blit, so my earlier test was just my machine running quickly. Although thats how a scroll would normally be implemented, it relies on the underlying system to detect optimization possibilities better.
Of course my example actually blits the screen twice. Once on the surface, then the update will result in another blit. But if it didn't work that way, would end up with flicker).
I may look at the code closer tonight and see if I can optimize any of it. It really should, if blitting to a surface onto itself, just end up being a memmove.
yep, screen.blit works, and pretty fast if you remember to limit the source rect to where you want to copy from. (although that may just be my machine).
Of course, you still have to 'update' the bits that have changed, but for the rest it should be faster than doing a full update.
while 1: for event in pygame.event.get(): if event.type == QUIT or \ (event.type == KEYDOWN and event.key == K_ESCAPE): return keystate = pygame.key.get_pressed() direction = keystate[K_RIGHT] - keystate[K_LEFT] if direction == 1: screen.blit(screen, (10, 0), (0, 0, screen.get_width() - 10, screen.get_height())) pygame.display.update() if direction == -1: screen.blit(screen, (0, 0), (10, 0, screen.get_width() - 10, screen.get_height())) pygame.display.update()
The surface Surface.blit function should be able to do it if you can blit a surface onto itself, but the documentation doesn't make this clear, nor does it make clear whether it can detect the surface is identical and optimize.
As near as I can tell, Surface.blit maps to Sdl's blit, and that maps to Direct X's or whatever platform its on. So I am confident that it should work like a scroll on at the very least Direct X.
However there are a number of 'scrolling' examples on the pygame site, and none of them mention the above method. So chances are I am wrong and it just can't be done.
Now my interest is peaked though. So I am at least going to test the above theory under Linux.
I haven't done pygaming or whatever its called, but I bet there is some way to say, "The graphics here are now there". It exists in any other 'graphics' library/language I have dealt with. And its a lot faster than an actual update.
If there isn't, it shouldn't be that hard to add. The dumbest way to implement it is simply a memmove.
Remember Komander Keen, low processor, no open GL, scrolling graphics. it used tiles and bascially just told the video card to render from a different section of memory rather than re-calculating the graphics for the entire screen. Then it would update just the graphics that actually changed. It was tile based, but scrolled by less than a tile by updateing more of the screen than was actually shown so it would be there already for when scrolling had to occur.
One thing that does intrigue me is that obvious valid anti-Apple arguments are rarely seen. For instance, you have to re-purchase much of your software if you want to use an Apple computer to its full potential. If you have Office, you need Apple Office. If you have Adobe products, you need to upgrade them. And so on.
I am switching, and there is no software I need to buy. Ok, most of my games won't work, but hey, I've played them already.
Think about what software you really use on a day to day basis. Now go down to an Apple store and try out the software that is provided, and see if it isn't good enough or better.
Thats not to say I think everyone should switch. I'm only switching because I don't use my x86 machine for gaming anymore (consoles are cheaper) and I don't want to ever have to open my computer case ever again. Of course I didn't have to change to Apple to achieve that, but it was a lot easier, and it is so damn cute.
Really, I am just switching 'cause the Mac Mini looks cute.
No; they stuff pixels in PNG files and TIFF files and PNM files and GIF files and a dozen other formats that need to be parsed by completely different parsers.
You say that like its a bad thing.
png is good for icons and webpage graphics (unless your target is IE). Its compresses well, is lossless, and has good transparency
tiff is a good choice for very large, very high color images, such as producing for poster prints
pnm are an excellent format for doing batch transformations (such as sticking together, rotations, etc. Just see the pnm* tools with any Linux Distro.
gif is paletted, and compress better than png's for low color images. If you only have 20 or so colors and only a need for a mask (or perhaps would like some animation) gif is your bet. See 'screensavers' on mobile phones.
In your world, webpages would take much longer to load, poster prints seem faded and image transformation tools would take forever. Oh, and I wouldn't be able to fit a 'screensaver' on my mobile phone. All because you can't be bothered to use one of the many, existing, image transformation tools.
Instead, I could just select the value in my editor, click on the annotate key, and enter (in nice WYSIWYG HTML or whatever) my comment there. As a result, the editor will show a tiny icon next to the number, or perhaps in the margin, indicating that there's an annotation. ...
Unix geeks typically balk at non-textual files, but I blame it on a fundamental lack of imagination.
I can type/* weight */ a lot faster than I can take my hands of the keyboard, find the mouse, move the mouse to where the text appeared on the screen, highlight said text, move the mouse to the tool button for annotate (or contextmenu, whatever), and then click to open another dialog and type 'weight' anyway.
When you type at 80+wpm anything that avoids you having to touch a mouse is good.
Rural parts of states live off of our dime in the cities
Um, you do realize that without the rural parts of the state you wouldn't eat, you wouldn't have any materials to manufacture with, you wouldn't even have a friggen job since nearly everything we do to make money starts in a rural part of a state.
Further more every dime going from city to rural comes back in the form of cheaper everything. Look at the big picture before you sign a death warrent on farming. Unless you want to pay triple prices for a steak since they now has to come from another country.
Um, you really misunderstand whats going on in the concept of loyalty.
People will rat on people ripping of Nintendo because they don't want a good thing to go away. I am a Nintendo fan because they favor quality over catering to the lowest common denominator, or at least, thats my opinion. Hence I want them to stick around so there is more quality stuff for me to get. And that in turn means I want to help them deal with anything that might eat into their ability to stick around.
The world isn't black or white. It kinda annoys me when people react to anything thats pro-establishment by statements such as "use its violent power". Yes, there are problems with corporations, and even Nintendo. But that doesn't mean they are 100% pure evil and should be slain in the name of the righteous.
When I heard about it, first thing I thought was "Hey, at last a practical use for those Turing test AI's"
virus: hey its [nick gotten of settings] here, you gotta check this out.
* virus sends file
bob: did you check it for virus
(match word virus) virus: yeah, I checked it out, its safe.
Also could check for 'is it...you', various 'bye's, etc. Actually get around the 'don't run stuff you shouldn't trust thing'.
Now mod me down before a worm author sees this comment and actually writes a messenger worm like that:)
Recently I wanted to put together a quite media pc box. something I could put MythTV on.
Only you can't buy a new quite PC. The cheapest chips need heat sinks and fans fast enough to freeze the flame of a blowtorch. I would have converted my current box but it already sounds like a jet aircraft taking off.
1Ghz (with hardware mpeg encoding, decoding, and alpha stretched blt) would be more than enough. But this can't be bought and put together new. The parts shouldn't cost more than a $100-$200. But only sold in form factors like, oh, say an X-Box.
Actually I can think of an example to back tuhis up.
Turns out there was a company that made those steering wheel locks, and for years they kept improving the key and the lock, all the while the (known) weekness was that the hook was weak and the whole thing could be just yanked off.
After a few years a reporter from a magazine actually proved it to them (hadn't mentioned how in the magazine, trying to reduce crime, not promote it). But if they had hired a car theif they might have discovered the flaw sooner.
Reform IP law and stop the M$/RIAA patent/copyright abuse.
My idea is when you patent something, you also submit your expense reports for the time the patent was developed. can't submit the same expenses for more than one patent.
Then, all license fees are accounted for, and once you have made back 3 times the amount of money you spend in development back in license (net?) then the patent is disolved.
If you make no money in the first two years, the patent is disolved.
This way, if its a sit back and sue patent, its stopped because you have to actually license it. and if its a valuable patent, then it will be out of patent and into public domain sooner. and no one can complain that innovators don't get a return on investment.
My way around this is to simply admit I am never going to complete a game.
I'm tackling the content side instead, sorta. What I have written basically is a terrain tile generator. I noticed a lot of the 'craft like games suffer from lack of good graphics, and figured that terrain was part of the graphics that might be easier to generate than to render individually.
If you are morbidly curious my stuff is at gasnippets but I don't consider it finished yet. Working on DirectFB and OpenGL variants of the same thing, to learn about the platforms more than anything else.
Doing it this way I get to work on something I find interesting (e.g. how to make good looking terrain in the range of 100000's of tile variations, without having to sit at gimp for 3 years), but not have to worry about the rest of the trappings for a game. When its done to a level I am happy with, I will post it to the 'craft like games I think could benefit from it.
My mistake. I only just now looked into the the source code for pygame.
blit() seems to assume its an alpha blit, so my earlier test was just my machine running quickly. Although thats how a scroll would normally be implemented, it relies on the underlying system to detect optimization possibilities better.
Of course my example actually blits the screen twice. Once on the surface, then the update will result in another blit. But if it didn't work that way, would end up with flicker).
I may look at the code closer tonight and see if I can optimize any of it. It really should, if blitting to a surface onto itself, just end up being a memmove.
yep, screen.blit works, and pretty fast if you remember to limit the source rect to where you want to copy from. (although that may just be my machine).
Of course, you still have to 'update' the bits that have changed, but for the rest it should be faster than doing a full update.
while 1:
for event in pygame.event.get():
if event.type == QUIT or \
(event.type == KEYDOWN and event.key == K_ESCAPE):
return
keystate = pygame.key.get_pressed()
direction = keystate[K_RIGHT] - keystate[K_LEFT]
if direction == 1:
screen.blit(screen, (10, 0), (0, 0, screen.get_width() - 10, screen.get_height()))
pygame.display.update()
if direction == -1:
screen.blit(screen, (0, 0), (10, 0, screen.get_width() - 10, screen.get_height()))
pygame.display.update()
The surface Surface.blit function should be able to do it if you can blit a surface onto itself, but the documentation doesn't make this clear, nor does it make clear whether it can detect the surface is identical and optimize.
As near as I can tell, Surface.blit maps to Sdl's blit, and that maps to Direct X's or whatever platform its on. So I am confident that it should work like a scroll on at the very least Direct X.
However there are a number of 'scrolling' examples on the pygame site, and none of them mention the above method. So chances are I am wrong and it just can't be done.
Now my interest is peaked though. So I am at least going to test the above theory under Linux.
I haven't done pygaming or whatever its called, but I bet there is some way to say, "The graphics here are now there". It exists in any other 'graphics' library/language I have dealt with. And its a lot faster than an actual update.
If there isn't, it shouldn't be that hard to add. The dumbest way to implement it is simply a memmove.
Remember Komander Keen, low processor, no open GL, scrolling graphics. it used tiles and bascially just told the video card to render from a different section of memory rather than re-calculating the graphics for the entire screen. Then it would update just the graphics that actually changed. It was tile based, but scrolled by less than a tile by updateing more of the screen than was actually shown so it would be there already for when scrolling had to occur.
And the proof is an example where the market was already there.
The console market. Microsoft entered, did the cost of games in the console market go down, no.
What about movie editing, they haven't gone in (not seriously yet), but the price is dropping on more and more higher utility software.
I would need to see more 'control' data to believe its causal.
One thing that does intrigue me is that obvious valid anti-Apple arguments are rarely seen. For instance, you have to re-purchase much of your software if you want to use an Apple computer to its full potential. If you have Office, you need Apple Office. If you have Adobe products, you need to upgrade them. And so on.
I am switching, and there is no software I need to buy. Ok, most of my games won't work, but hey, I've played them already.
Think about what software you really use on a day to day basis. Now go down to an Apple store and try out the software that is provided, and see if it isn't good enough or better.
Thats not to say I think everyone should switch. I'm only switching because I don't use my x86 machine for gaming anymore (consoles are cheaper) and I don't want to ever have to open my computer case ever again. Of course I didn't have to change to Apple to achieve that, but it was a lot easier, and it is so damn cute.
Really, I am just switching 'cause the Mac Mini looks cute.
What about applecare in Australia? anyone have any stories good or bad about that?
No; they stuff pixels in PNG files and TIFF files and PNM files and GIF files and a dozen other formats that need to be parsed by completely different parsers.
You say that like its a bad thing.
png is good for icons and webpage graphics (unless your target is IE). Its compresses well, is lossless, and has good transparency
tiff is a good choice for very large, very high color images, such as producing for poster prints
pnm are an excellent format for doing batch transformations (such as sticking together, rotations, etc. Just see the pnm* tools with any Linux Distro.
gif is paletted, and compress better than png's for low color images. If you only have 20 or so colors and only a need for a mask (or perhaps would like some animation) gif is your bet. See 'screensavers' on mobile phones.
In your world, webpages would take much longer to load, poster prints seem faded and image transformation tools would take forever. Oh, and I wouldn't be able to fit a 'screensaver' on my mobile phone. All because you can't be bothered to use one of the many, existing, image transformation tools.
Instead, I could just select the value in my editor, click on the annotate key, and enter (in nice WYSIWYG HTML or whatever) my comment there. As a result, the editor will show a tiny icon next to the number, or perhaps in the margin, indicating that there's an annotation. ...
/* weight */ a lot faster than I can take my hands of the keyboard, find the mouse, move the mouse to where the text appeared on the screen, highlight said text, move the mouse to the tool button for annotate (or contextmenu, whatever), and then click to open another dialog and type 'weight' anyway.
Unix geeks typically balk at non-textual files, but I blame it on a fundamental lack of imagination.
I can type
When you type at 80+wpm anything that avoids you having to touch a mouse is good.
Six days. The Creationism team plans on taking a rest on the Seventh day.
You know, I would be damn near tempted to chip and help buy the desk...
From what I saw on the list of stuff for sale, its damn obvious where all the money went.
Thats not a bug. Thats the "Oh, and remember to get up and stretch every so often so your butt doesn't fall asleep".
At least thats how I started responding to them after playing for four hours.
* Jaw drops *
Rural parts of states live off of our dime in the cities
Um, you do realize that without the rural parts of the state you wouldn't eat, you wouldn't have any materials to manufacture with, you wouldn't even have a friggen job since nearly everything we do to make money starts in a rural part of a state.
Further more every dime going from city to rural comes back in the form of cheaper everything. Look at the big picture before you sign a death warrent on farming. Unless you want to pay triple prices for a steak since they now has to come from another country.
Oh, you need to restart steam, apparently.
:)
90%, 92%, come on, finish already...
YES! Its unlooking....
and I don't have to be anywhere or do anything (except sleep) for at least the next 11 hours
Are they staggering when and where they unlock it? Its still locked for me...
Bah, waited this long, I think I can handle one more day.
Um, you really misunderstand whats going on in the concept of loyalty.
People will rat on people ripping of Nintendo because they don't want a good thing to go away. I am a Nintendo fan because they favor quality over catering to the lowest common denominator, or at least, thats my opinion. Hence I want them to stick around so there is more quality stuff for me to get. And that in turn means I want to help them deal with anything that might eat into their ability to stick around.
The world isn't black or white. It kinda annoys me when people react to anything thats pro-establishment by statements such as "use its violent power". Yes, there are problems with corporations, and even Nintendo. But that doesn't mean they are 100% pure evil and should be slain in the name of the righteous.
The should care about power.
power == bill to run building == expense == less profit.
I have seen Gnu/Linux put on devices at sub 6MB, 50 MB is not damn small, in fact its obese in some circles (embedded devices).
Nearly spat out my cofee when I saw that 'damn small' was as big as 50 MB.
See the familiar distribution. for more.
When I heard about it, first thing I thought was "Hey, at last a practical use for those Turing test AI's"
virus: hey its [nick gotten of settings] here, you gotta check this out.
* virus sends file
bob: did you check it for virus
(match word virus) virus: yeah, I checked it out, its safe.
Also could check for 'is it...you', various 'bye's, etc. Actually get around the 'don't run stuff you shouldn't trust thing'.
Now mod me down before a worm author sees this comment and actually writes a messenger worm like that :)
um, maybe I typed it 'quite pc'?
Thanks for the info. looks exactly like what I was after. cheap, 1Ghz, fanless.
Before someone else tells me, yes, I did see I mispelled quiet 3 times. I do that a lot with that particular word.
Recently I wanted to put together a quite media pc box. something I could put MythTV on.
Only you can't buy a new quite PC. The cheapest chips need heat sinks and fans fast enough to freeze the flame of a blowtorch. I would have converted my current box but it already sounds like a jet aircraft taking off.
1Ghz (with hardware mpeg encoding, decoding, and alpha stretched blt) would be more than enough. But this can't be bought and put together new. The parts shouldn't cost more than a $100-$200. But only sold in form factors like, oh, say an X-Box.
Ended up just getting a Tivo.
Actually I can think of an example to back tuhis up.
Turns out there was a company that made those steering wheel locks, and for years they kept improving the key and the lock, all the while the (known) weekness was that the hook was weak and the whole thing could be just yanked off.
After a few years a reporter from a magazine actually proved it to them (hadn't mentioned how in the magazine, trying to reduce crime, not promote it). But if they had hired a car theif they might have discovered the flaw sooner.
Reform IP law and stop the M$/RIAA patent/copyright abuse.
My idea is when you patent something, you also submit your expense reports for the time the patent was developed. can't submit the same expenses for more than one patent.
Then, all license fees are accounted for, and once you have made back 3 times the amount of money you spend in development back in license (net?) then the patent is disolved.
If you make no money in the first two years, the patent is disolved.
This way, if its a sit back and sue patent, its stopped because you have to actually license it. and if its a valuable patent, then it will be out of patent and into public domain sooner. and no one can complain that innovators don't get a return on investment.
My way around this is to simply admit I am never going to complete a game.
I'm tackling the content side instead, sorta. What I have written basically is a terrain tile generator. I noticed a lot of the 'craft like games suffer from lack of good graphics, and figured that terrain was part of the graphics that might be easier to generate than to render individually.
If you are morbidly curious my stuff is at gasnippets but I don't consider it finished yet. Working on DirectFB and OpenGL variants of the same thing, to learn about the platforms more than anything else.
Doing it this way I get to work on something I find interesting (e.g. how to make good looking terrain in the range of 100000's of tile variations, without having to sit at gimp for 3 years), but not have to worry about the rest of the trappings for a game. When its done to a level I am happy with, I will post it to the 'craft like games I think could benefit from it.