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

Author Topic: [solved]Problems to record my game  (Read 5637 times)

0 Members and 1 Guest are viewing this topic.

kursukia

  • Newbie
  • *
  • Posts: 20
    • View Profile
[solved]Problems to record my game
« on: December 28, 2013, 11:05:48 pm »
Hello guys,

I have a exotic problem that I cant record my created app.

I cant use FRAPS, and some other recording-tools for record my selfcreated game.
If I start to use the record-tool, its like my game have a super fps-dropdown, all is going slown.
Its happening with all record tools that im tested: Fraps 19D, Fraps 3.5, MSI afterburner and camtasia studio.

But if I show someone via Skype my game, so I dont have this problems.

Can you tell me, what this problem is caused?
I tryed with FrameLimit and without FrameLimit. The maximum setting on Fraps is 60 FPS, and on MSI afterburner with 100 fps. But still the same problem. The whole game is going crazy. So if I use FRAPS, it shows me over 4500 fps.

I really dont know what code I should post. Please tell me it. The whole project is a bit too large.

Im sorry for my broken english.

Greetings :(
« Last Edit: December 29, 2013, 08:57:50 pm by kursukia »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11045
    • View Profile
    • development blog
    • Email
Re: Problems to record my game
« Reply #1 on: December 28, 2013, 11:34:46 pm »
Framerate drops are nothing special for recording software, but it's usually only really noticeable for heavy games on a less performant system.
What's a bit odd however, is that all three types of recording seem to cause issues (OpenGL hook (FRAPS), hardware supported (MSI), screen capture (Camtasia)).

What exactly does your game do? How much do you draw things and does the FPS actually drop or does it just "feel" slowed down?

Have you tried the free Open Broadcaster Software?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kursukia

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Problems to record my game
« Reply #2 on: December 29, 2013, 12:08:14 am »
Hello eXpl0it3r,

thank you for your reply.

I try to explain:

Its a game with enemy respawn and gravity (so the "player" can jump with space). All works fine.
But if I starts a record tool, is will happen this:

The enemys dont spawn every 5 seconds anymore (for example, but its like they spawn all 30 seconds, but I dont check if the enemy is spawn again), or if you jump, you jump suddenly higher than normal.

Im feel a little bit shame, but I cant use "Open Broadcaster Software", because I have Windows XP, and it needs Windows Vista to run it.

kursukia

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11045
    • View Profile
    • development blog
    • Email
Re: Problems to record my game
« Reply #3 on: December 29, 2013, 12:35:06 am »
Not really sure what the issue here is, especially since the logic of a game shouldn't be affected by FPS changes.

Can you create a minimal example from scratch doing something similar than your game and test if you get issues with your recording software as well?

Btw. XP will run out of support in four month, which means you won't get any security updates, essentially leaving you with an OS that can get more and more unsecure with every passing day. You should really consider an update. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kursukia

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Problems to record my game
« Reply #4 on: December 29, 2013, 10:30:28 am »
Hello eXpl0it3r,

I used your gravity example and its working without problems.

I tried to use a similar code of my game, but the gravity dont works = its "too slow". I really think, the problem is, that my game needs over 4000 FPS to works well. So if the FPS going limited by window.setFramerate(60), by FRAPS (60 FPS) or MSI (100 FPS), so my game dont works well anymore. I think, thats the problem. But I dont know, how I solve this. Maybe its caused by my time-process? I would show you some parts of my code:

main.cpp:
        float ElapsedTime = clock.restart().asSeconds();
        spawnTime+=ElapsedTime;
        animationTime+=ElapsedTime;
        //(...)
        if(spawnTime>=3.0)
             spawnTime= 0; // I write this because I think its causing lags
        //(...)
 

main.cpp:

                if(start==false &&gameOver==false)
                {
                        gui.DrawStart(window);
                }
                if(start==true &&gameOver==false)
                {

                        if(player.life<=0)
                        {
                                start=false;
                                gameOver=true;
                        }

                        // main process of game, im using only void for all processes

                }
                else if(start==false &&gameOver==true)
                {
                        gui.DrawFinish(window);
                }
                else
                {
                      // nothing at first moment
                }
 

Its my first project that im working with full classes (at all, its my second game project). I know its not 100 % clean, but Its for my practice. :(

I hope, you can me tell more. If you need more, I can post it.

kursukia

edit & ps: WinXP = I know. Im going to change next year (1- 2 month) to windows 7 home :) So its time to say goodbye to WinXp. My personally beautiful office os. :)

edit 2: I think, i going to "slow down" some variables to adjust it to 60 FPS. I going to try it. I post in few hours a reply to tell you, if its work. Normally that should to be the solution.

Final Edit:

Now its working well. :) I limited the FPS to 60 with window.setFrameRate... from unlimited / 4000 fps and adjust my variables (decrase speed, gravity variables and timer and so on) to fps 60 and now its working all fine.

The only on not so good think is, that the movement of enemys and player are not smooth anymore. So FRAPS says the game have 30 FPS. If I record, the FPS is jump to 60 FPS and all movement is smooth.
What I see too: The timer is suddenly work "faster" if the FPS is on 60.

So I found a "balance": I set the frameLimit to 70 - 90 for windows and the movement is smooth plus the timer is not going too crazy. FRAPS says 64 FPS without recording, and 90 FPS on recording. But is this normal? Its normal that the timer is working faster if the FPS is higher? Its interesting too see whats happening for my experience. :)

Kursukia
« Last Edit: December 29, 2013, 11:05:31 am by kursukia »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Problems to record my game
« Reply #5 on: December 29, 2013, 12:05:38 pm »
FPS should not affect the speed of your actual game, regardless if it is 4000+ FPS or 5 FPS. What you should do is implement FPS independent movement code (fixed time step, movement based on delta time).
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

kursukia

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Problems to record my game
« Reply #6 on: December 29, 2013, 01:21:39 pm »
Hello zsbzsb,

thank you for your reply.

Thats the main solution. But do you have a "example" what you exaclty mean with "delta-time"?
Its a "non-hardware-based time"? Or "real-time-based time"? Or im completly wrong?

kursukia

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Problems to record my game
« Reply #7 on: December 29, 2013, 01:30:41 pm »
Delta time is simply the time elapsed between two subsequent frames. If you measure the time always at the beginning or end of the frame, the delta time will correspond to the frame duration.

Since it always varies, it's wise to either adapt the game logic to it, or (even better) to run the game logic completely independent of frame times.
« Last Edit: December 29, 2013, 01:36:11 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

kursukia

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Problems to record my game
« Reply #8 on: December 29, 2013, 08:57:34 pm »
Hello,

okay. I going to make this for my future project. Thank you. :)

kursukia

 

anything