Page 2 of 2

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Mon Jul 27, 2015 8:20 pm
by Sorunome
I just tried it and it is super awesome! :D

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Mon Jul 27, 2015 9:43 pm
by jonnection
Valden wrote:NOTE : I would be very happy if someone could help me finding a faster way to render the "blocks". At the moment, the worst case scenario put the CPU at 110 % which I don't really like (even if it's barely noticeable). For the rendering, I use 2 "fillTiangles" per blocks. For comparison, a wire-frame rendering only use 35 % of the CPU, but the game is less readable.


Hi Valden. Very nice game. I took a look at your 'drawWalls' code and the fillTriangle code in Gamebuino lib. The fillTriangle routine is very unoptimized (two divisions in inner loop). Division on atmega328 is a performance killer. You will not get decent speed unless you write a proper polyfill routine with scan conversion or someone optimizes fillTriangle. Furthermore fillTriangle actually uses fastHline routine which is also unoptimized as it draws the line pixel by pixel. Proper polyfill on this hardware means a) scan converting lines b) filling in with fast vertical lines using bitshifted bytes instead of pixel by pixel drawing. Literature and examples of how fast polyfill is done can be found aplenty on internet. Offhand I believe your drawwalls is about 10% of the speed of what it could be. Floating point numbers is another killer on atmega, as it has no floating point hardware.

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Mon Jul 27, 2015 9:51 pm
by Valden
jonnection wrote:
Valden wrote:NOTE : I would be very happy if someone could help me finding a faster way to render the "blocks". At the moment, the worst case scenario put the CPU at 110 % which I don't really like (even if it's barely noticeable). For the rendering, I use 2 "fillTiangles" per blocks. For comparison, a wire-frame rendering only use 35 % of the CPU, but the game is less readable.


Hi Valden. Very nice game. I took a look at your 'drawWalls' code and the fillTriangle code in Gamebuino lib. The fillTriangle routine is very unoptimized (two divisions in inner loop). Division on atmega328 is a performance killer. You will not get decent speed unless you write a proper polyfill routine with scan conversion or someone optimizes fillTriangle. Furthermore fillTriangle actually uses fastHline routine which is also unoptimized as it draws the line pixel by pixel. Proper polyfill on this hardware means a) scan converting lines b) filling in with fast vertical lines using bitshifted bytes instead of pixel by pixel drawing. Literature and examples of how fast polyfill is done can be found aplenty in the internet. Offhand I believe your code is about 10% of what it could be. Floating point numbers is another killer on atmega, as it has no floating point hardware.


Thanks for your tips. I found that the float wasn't a huge problem as if I don't do any drawing the CUP is used at around 15%. If I have the time, I'll definitely check your methods for optimizing the drawings ;) , but for now the game run fine (I can't add more feature though like grayscale because of the fact I already use 100 % of the cpu).

An important note though : Disabling the sound offers a significant boost in performance for my game, so if you happens to try compiling the game by yourself, try put the NUM_CHANNELS in the settings.c at 0. I notice lags when 1 channel is used, but none if there is no channel.

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Mon Jul 27, 2015 10:09 pm
by jonnection
(I can't add more feature though like grayscale because of the fact I already use 100 % of the cpu).

An important note though : Disabling the sound offers a significant boost in performance for my game


Sound takes up ALOT of the cpu. In my trials my Operation fox game ran at 200 fps without music and 50 fps with music. So if youre already at 100% ...

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Sat Aug 08, 2015 4:11 pm
by Skyrunner65
Thanks for the recommend, Jerom.
Now I have better footage for my game, Smash and Crash!

Oh, sorry Valden, forgot to mention that your game looks great, and WAY too hard for me.

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Thu Nov 19, 2015 11:49 pm
by superfreaky
This is hands down the most played game on the gb for me! My record is 1 minute and approximately 5 seconds. By that time, everything is going so fast it's almost impossible to see what's going on. I guess that's just the screen's fault. I wonder why r0d0t didn't get a more modern screen, like, say, the oled that Arduboy uses? How pricey would it be to make a fakebuino using that screen instead?
Or would it be possible to incorporate such a screen into the Gamebuino itself...

Re: [WIP] microHexagon, a Super Hexagon clone

PostPosted: Mon Nov 23, 2015 2:43 am
by superfreaky
I just thought of a way you could include a song. After you die, you could do an instant replay. Play as much of the song as you lasted for. That would also add some additional motivation for getting good at the game.