Free Sprites

Libraries, utilities, bootloaders...

Re: Free Sprites

Postby erico » Sat Apr 12, 2014 12:04 am

hehe you guys are playing too much custer´s revenge...it is just a bunch of pixels.
On attempt to change topic...the gamebuino in the dark looks cool with all those leds.
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Free Sprites

Postby Myndale » Sat Apr 12, 2014 1:01 am

@Draker: you got it!



I switched to a fixed-frequency interrupt-driven refresh this morning and the magic number for eliminating flicker seems to be somewhere around 41FPS, it can probably be improved with more accurate timer code. The hatch pattern helps a lot with static images but it becomes really noticeable once you add animation, so it's gone in that video. Grey flicker is worse in the video than it is to the eye, if you look closely you'll see the black is flickering a bit as well. One thing that is obvious is that it appears to be closely related to ambient light levels...more obvious under bright lamp light, practically invisible under LED illumination.

I think one of the biggest challenges with grey-scale games will be the RAM requirements. The obvious method of 2 bits per pixel (which I'm currently using) requires two frame buffers for a total of 1008 bytes i.e. almost half of available RAM. An optimal pixel format would require exactly 799 bytes (i.e. log(3^(84*48))/log(2)/8) but it would be impossible to work with. What might be a good compromise is to pack 5 grey-scale pixels per byte (3^5=243). Reserve the top (or bottom) 4 lines for a static area to display score etc and you would then only need 9 bytes per column i.e. a total buffer size of 756 bytes.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Free Sprites

Postby erico » Sat Apr 12, 2014 2:05 am

Interesting xperimentation.
Flicker by ambient light is probably related to light type frequencies (in my naive opinion) it happens not only to screens but paper and bright surfaces.

I take you are scrolling 1 pixel per frame on ~20.5fps? looks like half of it?
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Free Sprites

Postby Myndale » Sat Apr 12, 2014 2:32 am

Yes, that's correct. I render each of the two frames for every pixel I scroll.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Free Sprites

Postby Drakker » Sat Apr 12, 2014 3:21 am

Wow, that looks very good! Guess I'm sold on the idea of using grayscale.

Wouldn't using 2 bits sprites with a conditional be better for displaying gray? Say, when the frame is even, gray is drawn as black, and when the frame is odd, gray is drawn as white. This could be easily implemented in a simple wrapper function that puts the sprites on the screen. In a scheme like this:
0 = transparency
1 = white
2 = gray
3 = black
User avatar
Drakker
 
Posts: 297
Joined: Sun Mar 30, 2014 2:54 am
Location: Québec, Canada

Re: Free Sprites

Postby Myndale » Sat Apr 12, 2014 3:35 am

I think Erico might be right about the flicker, I just filmed it again using ambient indoor daylight and with a much better quality camera and at hi-res the video looks exactly as it looks to my eye:



@Draker: that would be a good format for sprites, I was thinking more about full-screen scrolling backgrounds that would never need alpha.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Free Sprites

Postby Drakker » Sat Apr 12, 2014 3:44 am

@Myndale: oh, true. Well, what's been done on moon patrol for some platform is that the game starts with 3 bands of color, black for the star field and for the far blue mountains, yellowish for close mountains and brown for ground. Afterward, they draw only details on there, say, mountains shapes and shadows, holes in the ground and rocks that need to be shot. Then, once this is done, they draw the vehicles, projectiles and enemy ships.

This can be seen in this video: https://www.youtube.com/watch?v=uyPZwuynMFA

Maybe something similar could be done on the Gamebuino with black/gray/white.
User avatar
Drakker
 
Posts: 297
Joined: Sun Mar 30, 2014 2:54 am
Location: Québec, Canada

Re: Free Sprites

Postby erico » Sat Apr 12, 2014 5:22 am

That video has one of the best explosions I have ever seen, when enemy bullets hit ground. :shock:
...
Great video Myndale!
Last edited by erico on Sat Apr 12, 2014 5:41 am, edited 1 time in total.
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Free Sprites

Postby erico » Sat Apr 12, 2014 5:36 am

I have to add, that the speed Myndale is scrolling is quite xtreme for that kind of game :shock:
Superb test!

Suppose on that moon patrol mock, we are probably going to scroll the foreground about half of that speed? Maybe only main sprite and enemies move that fast, and that is if.

And background, just a slice of screen at about 1/8 of speed.

Really great to see live videos of Gamebuino. :)
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Free Sprites

Postby DFX2KX » Wed May 07, 2014 1:43 pm

Myndale wrote:I think Erico might be right about the flicker, I just filmed it again using ambient indoor daylight and with a much better quality camera and at hi-res the video looks exactly as it looks to my eye:

@Draker: that would be a good format for sprites, I was thinking more about full-screen scrolling backgrounds that would never need alpha.


That came out surprisingly good! The blur is a lot better then the TI-8x monitor was.
DFX2KX
 
Posts: 250
Joined: Mon Apr 14, 2014 3:48 am

PreviousNext

Return to Software Development

Who is online

Users browsing this forum: No registered users and 60 guests

cron