Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sivak

Pages: 1 2 [3] 4
31
General / 50% CPU usage... thoughts on improvement
« on: April 02, 2010, 05:37:41 am »
Hm...  I have another updated.  I added:  Sleep(1); to the while loop and that seemed to fix the CPU problems.  I had to make the time it compared to be something like 0.011 instead of 0.0166...  

I'm only wondering if this solution is not the best.

32
General / 50% CPU usage... thoughts on improvement
« on: April 01, 2010, 08:15:14 pm »
Quote from: "Laurent"
Do you limit your framerate, with SetFramerateLimit or UseVerticalSync?


No, neither.  I did try setting VerticalSync to true as well as FrameLimit to 60, but same result.  50-55%.  I turned them back off.

UPDATE:  Well, I did take out this line just to see what would happen and I got a very strange result.

Code: [Select]

App.Display();
//Wait to get a proper time in-between frames...
/* bool bGo = true;
while (bGo)
{ float Time = frameClock.GetElapsedTime();
if (Time >= 0.0166)
bGo = false;
}*/


Removing that got the CPU to be okay, but the frame rate went to like 34.  But the WEIRD thing is I let the game go for a while and as soon as like 200 bullets were on the screen it was fine!!!  I killed off the enemies and then the game went back to a crawl...

So it seems like the game having to update more makes the game go faster, which makes no sense!

The title screen also doesn't go very fast, and that updates very little...

33
General / 50% CPU usage... thoughts on improvement
« on: April 01, 2010, 07:44:19 pm »
Hey all.  I'm using VCpp 2008 express and Windows XP Pro.

Well, I've added plenty of stuff to the game such as sounds and bullets.  I've had upwards of 300 bullets on the screen without slowdown, but when monitoring this in the task manager, it's always at 50% no matter where I am and no matter how little is actually going on...  I've looked at other games, and they never seem to go beyond 15% except when loading between things.  In debug mode, slowdown does happen.  Release mode is fine (for now).

Here's a breakdown of how I'm doing things:

I have singleton classes for the title screen and game.  These classes have their own sf::Image instances.  Most objects spawned from them have their own sf::Sprites.  I also have a singleton class for the sounds.  I only have 4 small sound effects thus far.

I could understand the game part maybe having some slowdown, but the title?  Is it normal for an SFML app?

34
SFML projects / My SFML project - shoot 'em up game
« on: March 30, 2010, 06:42:14 am »
Hey all, thought I'd show off a demo finally.  You can't do a whole lot yet, but it's a start!

Basically, it'll show a message box and then skulls endlessly spawn.  They can be killed.

Controls:  Z to shoot, shift to move slower.

http://sivak.nintendoage.com/Shmuppy.zip

Hoping it runs fine for you folks.

35
Graphics / Passing sf::sprites
« on: March 30, 2010, 05:08:14 am »
Hey all.  This is something I was questioned about and didn't really pay it mind until now.

Basically, if I want to copy an sf::Sprite, I've been doing things like this...

Code: [Select]

GameObjs.push_back(new GameStageWindow(GFX_GameStageWindow, GFX_GameStageWindowText));  //There's 2 sf::Sprites already declared and this function takes and passes these sprite to a ctor for GameStageWindow"

//The ctor looks like this:
GameStageWindow::GameStageWindow(sf::Sprite passedSprite, sf::Sprite passedSprite2)
{ windowSprite = passedSprite;
windowBorderTopSprite = passedSprite;
windowBorderBotSprite = passedSprite;
windowTextSprite = passedSprite2;
//etc...


Basically what I'm wondering is if what I'm doing is bad.  Objects will need their own sf::sprite instances, but I just am not sure if this implementation is a good idea.  Thanks.

36
General / Release build slower than debug...
« on: March 29, 2010, 01:17:30 am »
Quote from: "Laurent"
This is weird, I don't know what's happening.

Can you tell me more about what you did exactly?


Okay, basically at the end of my game loop, after drawing EVERYTHING, I have this:

Code: [Select]

bool bGo = true;
while (bGo)
{ float Time = Clock.GetElapsedTime();
if (Time >= 0.0166)
bGo = false;
}
cmnFunc.CommonFunctionClass::DisplayFPS(Clock);


Basically it "waits" for 1/60th of a second if it needs to and then reports the FPS as the final step before App.Display();

It works and has worked consistently on other people's machines.  Sure, it's 60.2 fps, but that's close enough.

37
General / Release build slower than debug...
« on: March 28, 2010, 08:13:54 pm »
Quote from: "Laurent"
What CPU / OS do you have?


WinXP Pro SP3.  CPU is an Intel dual core like...  2.13ghz or so.  It's around  4 years old.

38
General / Release build slower than debug...
« on: March 28, 2010, 06:51:56 am »
Well, this one's definitely different.  The debug build of my game runs at the correct 65 fps.  The release one will either run at 50 or 32.  If I remove the framerate cap, it naturally flies, so no way it's a memory issue...

I naturally tried commenting out things, but nothing helped.

All the game even does is move the player around.  I could post the code for while the game is running unless someone has a good idea what it could be.

UPDATE:  I actually re-implemented my old idea of having a time check at the end, rather than regulating the framerate to be 60 and this fixes the problem...  I don't know if this is the best fix, but for now I'll take it.

39
General / Time handling and FPS q's
« on: March 27, 2010, 10:45:17 pm »
I've done this and it seems to work...  save for the routine I made for displaying the actual FPS...  It greatly fluctuates from 64 to 66 when I run the app instead of staying locked at 60...

Code: [Select]

void CommonFunctionClass::DisplayFPS(sf::Clock Clock)
{   sf::Sprite GFXframeDigits10(IMG_Digits);
sf::Sprite GFXframeDigits1(IMG_Digits);
sf::Sprite GFXframePeriod(IMG_Digits);
sf::Sprite GFXframeDigits01(IMG_Digits);
float Framerate = 1.f / Clock.GetElapsedTime();
Framerate *= 10;
int frameInt = (int)Framerate;
    int ShownFPS10 = frameInt / 100;
int ShownFPS1 = frameInt % 100 / 10;
int ShownFPS01 = frameInt % 10;
ShownFPS10 *= 16;
ShownFPS1 *= 16;
ShownFPS01 *= 16;
GFXframeDigits10.SetSubRect(sf::IntRect(ShownFPS10, 0, ShownFPS10+16, 20));
GFXframeDigits10.SetPosition(568, 450);
GFXframeDigits1.SetSubRect(sf::IntRect(ShownFPS1, 0, ShownFPS1+16, 20));
GFXframeDigits1.SetPosition(584, 450);
GFXframePeriod.SetSubRect(sf::IntRect(160, 0, 176, 20));
GFXframePeriod.SetPosition(600, 450);
GFXframeDigits01.SetSubRect(sf::IntRect(ShownFPS01, 0, ShownFPS01+16, 20));
GFXframeDigits01.SetPosition(616, 450);
App.Draw(GFXframeDigits10);
App.Draw(GFXframeDigits1);
App.Draw(GFXframePeriod);
App.Draw(GFXframeDigits01);
}

40
General / Time handling and FPS q's
« on: March 27, 2010, 08:31:24 pm »
Hey all.  I've begun the game and it obviously goes too fast without time controls, so I've done this at the end of the loop:

Code: [Select]

bool bWait = true;
while (bWait)
{ float Time = Clock.GetElapsedTime();
if (Time >= 0.0166)
bWait = false;
}
cmnFunc.CommonFunctionClass::DisplayFPS(Clock);
Clock.Reset();
App.Display();


Basically, the 0.0166 is around 60fps, and when I do send it to the DisplayFPS function, it does indeed show 60fps in the lower right.

I'm wondering if what I'm doing is a proper way of doing it?

I did see that one can supposedly lock the FPS rate, though that seemed to really bog down the App when doing it, but maybe I'm not doing something right in the implementation...?

Any advice appreciated, thanks.   8)

41
Graphics / Can you "send to back" with graphics?
« on: March 27, 2010, 03:52:31 am »
Basically the topic says all.  I wondered if there was any easy way to send any graphic to the back or if I just have to resort to drawing them in the correct order?

Thanks.

42
General / Getting my game to work on other systems...
« on: March 22, 2010, 06:59:25 pm »
Hey, thanks.  Yeah, I figured that part out.  I'll post an update when I get it.  For now, I just need to figure out how to make my program actually compile again.  Lousy polymorphism hates me for the moment.   :evil:

43
General / Getting my game to work on other systems...
« on: March 22, 2010, 06:38:51 am »
Hey all.  I made a prelim build of my game, which basically just has the title screen and a rough HUD for the "Start new game".  The Exit option also works.

http://sivak.nintendoage.com/Shmuppy.zip - Here's the zip with the files.

From reports, nobody seems to have been able to get it to load.  Something about side-by-side config incorrect is what one person told me?

Here's what I did:
-Compiled in VC++ 2008 express
-This is the debug mode version (does this have anything to do with it???)
-It obviously runs on my system, which is WinXP Pro SP3.

I don't know if I just simply need to include more files or what.

I'm still a rookie for distributing stuff made in C++.  Any help appreciated, thanks.

44
SFML projects / My SFML project - shoot 'em up game
« on: March 21, 2010, 05:08:56 pm »
Hi.  I've beaten the extra stage on PCB.  The Touhou games are part of the inspiration for this in the first place.

I don't think the enemies themselves would be too bad.  It's the bullet patterns one needs to dodge and having more complex ones on higher difficulties...  I'm almost wondering if it'll be "too easy" since I tend not to beat most of these games on anything but normal.

Only time will tell.  8)

45
SFML projects / My SFML project - shoot 'em up game
« on: March 21, 2010, 04:46:05 am »
Well, I saw this and figured I'd share.

I've made some games in the past, but those were done in assembly.  I've decided to move up in the world and try my luck with C++ and SFML.

I'm intending to make my own shoot 'em up game, currently dubbed "Shmuppy".  I'll think of a title later.

I want it to be manic where there's lots of bullets all over the place (like 500+).  Thus far, I've gotten a few screen transitions to work, so I'm pretty pleased with that.  It's a lot farther than I've ever gotten with anything in C++.  Doing the actual game itself will certainly be interesting.

SFML has made things relatively simple thus far.  Hope it stays this way.

Pages: 1 2 [3] 4
anything