Make Me Happy: a 4 way scrolling BMax demo game

Community Forums/Showcase/Make Me Happy: a 4 way scrolling BMax demo game

Grey Alien(Posted 2007) [#1]
Hiya, I've been adding more demo code to my BlitzMax Game Framework. Here is a little demo of a 4-way scrolling game using tiles (well 8-way if you count diagonals). It's just an overhead scrolling game with pickups. Well it can hardly be called a game, but it shows the principle. This code will be released with the next version of my framework. You could use it to make a gauntlet game or a cute overhead RPG, whatever takes your fancy. Enjoy!

http://www.greyaliengames.com/downloadtrack.php?id=10 (2.75Mb)

Use arrow keys to move around and collect the dots, that's it.



To find out more about the Grey Alien BlitzMax Game Framework, please go here: http://www.blitzbasic.com/Community/posts.php?topic=64974

Next up, platform game demo.


H&K(Posted 2007) [#2]
What? And you couldnt find a seamless texture for the background. Jajajjajajajjajajajaj.

Dowloading to see how "smooth" it is


big10p(Posted 2007) [#3]
Gramework? :p


Grey Alien(Posted 2007) [#4]
And you couldnt find a seamless texture for the background.
oops haha, I was gonna run it through swifty's app but forgot. [edit] done it now.

Big10p: dunno what u are talking about ;p


H&K(Posted 2007) [#5]
Right.

I also cannot beleive you didnt hide the mouse in gameplay mode. (That just smacks of lazyness)

Apart from that its ok.

(I would though if you have time, make another one with seamless textures, and hide the mouse in gameplay mode. And then change the link)

Edit: I ment the lazy thing, in the sence that you wouldnt expect it from you


Grey Alien(Posted 2007) [#6]
H&K, it's just a quick demo, one line of code hides the mouse (Game.Mouse.Off()). I'll do it now. The texture is already fixed in the download. Thanks for the feedback.


SpaceAce(Posted 2007) [#7]
Hmm, when do you expect to release the update with this code? I was JUST about to open BLIde and start writing that exact code from scratch for a new game I am working on. If you plan to release soon, I can work around it.

Whoa, I played the demo while writing this reply and it was really, really jerky for me. Did anyone else experience that?

SpaceAce


Grey Alien(Posted 2007) [#8]
SpaceAce: Did you try SpeedRun? http://www.blitzbasic.com/Community/posts.php?topic=65943 Was that jerky too? Basically it's totally smooth on mine. What makes it jerk is if another task is consuming CPU power and the delta time code has to catch up. If it didn't catch up you'd get a different kind of jerk, one where it slowed down instead. As for the code, to be released this week with any luck, before Friday.


SpaceAce(Posted 2007) [#9]
Grey Alien: Speed Run ran fine for me when I tried it several days back. I've fiddled around more with the Make Me Happy demo and, with absolutely nothing else running, I still had one little patch of jerkiness while randomly flying the smiley around the screen. That's no big deal.

With ANYTHING else running (still < 10% CPU usage before I start the demo), I get a lot of stuttering. I've got a dual core AMD processor and I can play World of Warcraft on one monitor while watching full-screen video on the other monitor and having Poker Tracker running database queries in the background without any noticeable hiccups, so I don't know why the effect should be so severe in this demo.

SpaceAce


Grey Alien(Posted 2007) [#10]
SpaceAce: Thanks for the feedback. I don't know why but it seems that BMax can get really interrupted by other tasks and this messes up the smoothness (due to one frame being displayed for extra long and then the fixed rate logic/delta time catches up). I'm going to work on some "compensation" code and different methods that can be toggled with a key, keep an eye out for it as it would be great if you could test it for me. I may also a log of how many millisecs pass between each frame to see if jerky machines show an obvious problem. It's basically totally smooth on my PC, I have other apps running as well...was wondering if it's an AMD thing. Actually what graphics card do you have? Thanks.


SpaceAce(Posted 2007) [#11]
Grey Alien - I have an nVidia GeForce 7900GS; it's not the fastest card on the market, but it's decent.

I have noticed while working with your game framework that even a very minimal program (nothing but a title screen) burns up 25-30% CPU ; that seems really high to me. By comparison, my Magic Number game with full music, sound effects, explosions and tiles flying around the screen rarely breaks 1%. I know your framework is doing a lot in the background, but I have a hard time believing that minimal operation should require 30% of a 4600+ CPU core.

SpaceAce


Grey Alien(Posted 2007) [#12]
Is your magic number game a full-screen game or a GUI-based app? The framework isn't event-based, it runs the logic a set number of times then draws a frame, then checks to see if how long has passed and runs the logic an appropriate amount of times again and then draws another frame, and so on. The actual framework code won't be doing that much in the background, but because it's always processing logic in the background I guess that's why the % is so high. Really only windows apps should consume low CPU% if they are idle, but games that continually process logic and draw frames, even if the player is idle will take up CPU time. I amazed yours is so low at 1%, I wonder what you are doing different from me. I'll download it now...


Grey Alien(Posted 2007) [#13]
Aha, you must be using MaxGUI.

OK run this:

Strict
Graphics 800,600,0

While Not KeyHit(Key_ESCAPE)
	Local n = 0 
	For Local i = 1 To 10000
		n:+1
	Next
	Cls
	DrawRect 100,100,200,200
	Flip 1
Wend

See how it uses nearly 50% CPU power? (even if you drop the loop size to 1)


TartanTangerine (was Indiepath)(Posted 2007) [#14]
stick a Delay(1) in there.


Grey Alien(Posted 2007) [#15]
Thanks but been there done that, reduces by < 10%. Not great. 1ms isn't much and why waste CPU time if you potentially need it.


Grey Alien(Posted 2007) [#16]
Indiepath. Just found out that if you use Flip 0 AND delay(1) you get loads of CPU time back, but not with Flip 1, which I was doing. But Flip 0 is undesireable due to vertical tearing unfortuntely.


Grey Alien(Posted 2007) [#17]
SpaceAce: Any chance you can go here http://www.blitzbasic.com/Community/posts.php?topic=66342 and run the posted code (with the apps running that mess up Make Me Happy) and see what sort of output you are getting for the Elapsed time per frame. Thanks!


Blitzplotter(Posted 2007) [#18]
Just ran your demo here grey, I've a measly 128MByte Radeon and it runs smooth here....


SpaceAce(Posted 2007) [#19]
Grey Alien - Yes, Magic Number is MaxGUI (now), but even before I rewrote it for that, I don't think it ever took more than 8% or so. I didn't even think about CPU usage when I switched to MaxGUI, I just wanted to use MaxGUI since I had paid for it.

I'll check out that link and test the code a bit later. Right now, I think there's some Warcraft with my name on it :)

SpaceAce


Grey Alien(Posted 2007) [#20]
Blitzplotter : Thanks for testing.

SpaceAce: Yep been doing lots of testing as you'll see in the other thread. Aiming to write some compensation code. Enjoy your game!