Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: Raizor on May 29, 2011

Title: [Wireframe] Block Scroller
Post by: Raizor on May 29, 2011
Here's my entry for the Wireframe compo.  Not quite managed what I'd hoped to achieve but at least I got something out the door before the deadline ;)

The scroller is created using cubes to represent pixels from a 1 bit bitmap font. It's coded in C++ and uses iq's RGBA 64k framework. The music is by LizardKing (awesome musician imho).  I had a few issues due to being really rusty with C++ and WinAPI stuff, but hopefully the demo will run for most people.

I'll upload a video soon too.  The sourcecode is quite a mess at the moment, but if anyone wants it, I'll tidy it up and release it.

There seems to be an issue with slight jerking of the scroller sometimes, I think this is due to stepping in the sinus but I don't have time to dig into it :(

Thanks for reading and hopefully watching :)

Raizor
Title: Re: [Wireframe] Block Scroller
Post by: TinDragon on May 29, 2011
Well it runs on my machine, but the scroller is so fast I cant read it and everything looks a blur, probably could do with some delta timing unless you were going for super fast  ;)
Title: Re: [Wireframe] Block Scroller
Post by: hellfire on May 29, 2011
Looks nice and runs at constant 60 fps on my machine.
So TinDragon probably has VSync disabled?
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 29, 2011
Thanks Hellfire and TinDragon.

Yeah, doesn't go over 60 fps here either. I think Hellfire is probably right TinDragon. Have you disabled VSync on your vid card?
Title: Re: [Wireframe] Block Scroller
Post by: padman on May 29, 2011
Just x words, hang on i gotta count. It's six words: This is one bloody cool scroller!  :clap:

The widescreen detection is one neat feature too & it's nice to see a "newcomer" entry! Well done!  :)

Btw: I get 75fps here. And I have VSync enabled.
Title: Re: [Wireframe] Block Scroller
Post by: Pixel_Outlaw on May 29, 2011
Looks pretty neat!
Ran a bit fast on my machine too, (around 300-600 frames per second).
I was able to view it by clicking my mouse on the window and freezing it in place ever second or so.
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 29, 2011
300-600 fps, a bit fast?? Oh dear. Sounds like something is amiss.

Thanks for the feedback :)

Will try and see if I can quickly limit the speed.
Title: Re: [Wireframe] Block Scroller
Post by: Kirl on May 29, 2011
200 fps here, single frames look cool though using Pixel_Outlaw's trick. :)
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 29, 2011
I've attached a version with some forced vsync code. If the frame is rendering in under 16ms, it will block until the 16ms limit is hit.  It's a bit of a clunky fudge, but should hopefully stop the scroller flying along so far on certain machines. It might get a bit skippy though, due to the nature of the implementation.

If you don't need this version, I'd suggest using the other one. I've included both exe files in the attached zip.

Thanks for all the feedback so far, very useful and much appreciated :)
Title: Re: [Wireframe] Block Scroller
Post by: Pixel_Outlaw on May 29, 2011
Much better speed now.  :goodpost:
Title: Re: [Wireframe] Block Scroller
Post by: Kirl on May 30, 2011
Yep, good speed now. Loved it, awesomely colorful and blocky scroller. Happy to fry my retina's on this! ;)
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 30, 2011
Thank you Kirl and Pixel Outlaw :D
Title: Re: [Wireframe] Block Scroller
Post by: Shockwave on May 30, 2011
I have a soft spot for scrolls!  Nice job Raizor, good luck in the voting.
Title: Re: [Wireframe] Block Scroller
Post by: Clyde on May 30, 2011
Welldone Dude!
Title: Re: [Wireframe] Block Scroller
Post by: TinDragon on May 30, 2011
New version runs at a readable speed, looks really nice as well. On the vsync front, I dont have it forced off but it is set to off/application controlled, so unless an app. puts it on its off. But I havent ever changed that setting that i know of  ???
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 30, 2011
New version runs at a readable speed, looks really nice as well. On the vsync front, I dont have it forced off but it is set to off/application controlled, so unless an app. puts it on its off. But I havent ever changed that setting that i know of  ???

I'm not aware of a way to control vsync with OpenGL, so it looks like it's defaulting to whatever you card is set to. In your case this is 'disabled', so it races along.  Not sure of the workaround for this at the moment.  Thanks for the info though, it helps :)
Title: Re: [Wireframe] Block Scroller
Post by: hellfire on May 30, 2011
I'm not aware of a way to control vsync with OpenGL
There's an extension to set the swap-interval:
Code: [Select]
typedef BOOL (WINAPI *PFNWGLSWAPINTERVALEXTPROC)(int);
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT =
   (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
if (wglSwapIntervalEXT)
   wglSwapIntervalEXT(1);
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 30, 2011
Many thanks Hellfire :)
Title: Re: [Wireframe] Block Scroller
Post by: benny! on May 30, 2011
I really enjoyed this one. This scroll is one of the best scrolls I saw lately. Very well executed, mate.
It's cool to see you are back in C++ programming. Keep it up!
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 30, 2011
Thank you Benny. It was good fun and I'm looking forward to doing bigger and better things in C++

I implemented you suggestions for my iPhone game by the way, single life etc.  Thanks again for those :)
Title: Re: [Wireframe] Block Scroller
Post by: benny! on May 30, 2011
...
I implemented you suggestions for my iPhone game by the way, single life etc.  Thanks again for those :)

That's cool to hear. I hope my suggestions improved your install-rate. Guess I will test your game on my new iPad again.

Best,
benny!
Title: Re: [Wireframe] Block Scroller
Post by: combatking0 on May 31, 2011
That was cool - it was as though the letters were riding a very long worm :D

The way the colours changed gradually on the individual letters was a nice touch.
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 31, 2011
Thanks for the kind words CombatKing :)
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on May 31, 2011
I've uploaded a video of this onto youtube:

[youtube]rRy0nn3I3c8[/youtube]

http://www.youtube.com/watch?v=rRy0nn3I3c8 (http://www.youtube.com/watch?v=rRy0nn3I3c8)
Title: Re: [Wireframe] Block Scroller
Post by: Raizor on June 10, 2011
I've attached to the source to the first post in this topic.

I've been using Visual Studio 2008 to build it. The source contains most of iq's 64k framework.  I've ripped out anything non-windows related (the Linux, macOS etc support files).

There's also a custom resolution selector now and a working implementation of miniFmod that loads an XM file from a resource (so a nice single exe file with audio included).  I've also fixed up the issues that forced me to release a debug only build before. Release and Debug configs should both work now. I've also added some comments to the resolution selector as it uses a lot of Win API stuff (which I had to get my head around). That might be a useful reference...

There's KKrunchy stuff included too, just run compressme.bat after you've finished building. This isn't mine, it's iq's :)

That's about it. Might be useful for someone. I'll use this as a base for any future demos, so it should expand and grow in time.

Cheers,

Raizor

p.s. Big thanks to Jim for the help with my C/C++ memory include gubbins earlier :)
Title: Re: [Wireframe] Block Scroller
Post by: benny! on June 10, 2011
I've attached to the source to the first post in this topic.
...

K++ ... cool deed, mate!
Title: Re: [Wireframe] Block Scroller
Post by: Shockwave on June 10, 2011
Nice gesture Raizor, K+
Title: Re: [Wireframe] Block Scroller
Post by: padman on June 10, 2011
Too bad it's C++ and OpenGL. I doubt that I can nick something from it. Hehe Still K+ for sharing the source!  :)