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 - daktari

Pages: [1]
1
SFML projects / Remnants of Naezith
« on: January 13, 2018, 07:21:49 pm »
It's complete :) You can wishlist it to get notified.
http://store.steampowered.com/app/590590/Remnants_of_Naezith/




5
SFML projects / Remnants of Naezith is now on Greenlight!
« on: January 29, 2017, 08:45:54 pm »
Hello there everyone, naezith here!

Developing Remnants of Naezith with 100% SFML without anything else for like 2.5 years.
I was pretty active at IRC asking questions all the time but I never posted on forums so many of you didn't even hear about it I guess.

It's a fast-paced grappling hook platformer focused on speedrunning.


6
Graphics / Re: Stutter problem
« on: February 03, 2016, 09:10:16 pm »
Problem is still there tho.

7
Graphics / Re: Stutter problem
« on: February 01, 2016, 10:34:51 pm »
A friend reports me that setting my game's priority to high or real-time in task manager makes it smooth as baby's ass.

8
Graphics / Re: Stutter problem
« on: February 01, 2016, 08:47:15 pm »
This one runs so smooth but that's probably because it renders 6k times a second.
#include <SFML/Graphics.hpp>

int main() {
        sf::RenderWindow window(sf::VideoMode(1280, 720), "Stutter");
        sf::Event event;
        sf::Clock clock;
        float accumulator = 0.0f, delta = 1.0f / 125.0f;

        //window.setVerticalSyncEnabled(true);

        sf::RectangleShape rect(sf::Vector2f(5.0f, 720.0f));
        float pos = 0.0f;

        while(window.isOpen()) {
                accumulator += clock.restart().asSeconds();

                //while(accumulator > delta) {
                        accumulator -= delta;

                        // Poll Events
                        while(window.pollEvent(event)) if(event.type == sf::Event::Closed) window.close();

                        // Update
                        if((pos += 20.0f*delta) > 1280.0f) { pos = 0.0f; }
                //}

                // Set position to interpolated position
                rect.setPosition(pos, 0.0f);

                // Render
                window.clear();
                window.draw(rect);
                window.display();
        }

        return 0;
}


Might sound stupid, but what happens if you're sleeping for 1 millisecond at the end of your update loop? Does that change anything?

Also which graphics card are you running and what's your actual FPS? Do FPS change when the stuttering happens or is it stable? How about the number of update per second in these situations?

Wow... Having
sf::sleep(sf::milliseconds(1));
after the .display() helps to make it smooth like I open the program, line is shaky for like 0.3-0.4 seconds, then it becomes smooth and keeps being smooth. Yet it shakes when I shake my mouse :D (1000 Hz polling rate mouse and I don't have this issue in CS:GO)

Nvidia GTX 770 and 144 Hz monitor I have so I can see the smallest difference.

Fraps says 144 FPS, when I shake the mouse, line shakes and FPS becomes 143.



Edit: It is so weird that I removed sleep(1) and it is still smooth now. Sometimes it stutters, sometimes it does not. Very confusing.

9
Graphics / Re: Stutter problem
« on: February 01, 2016, 07:42:21 pm »
This stutter thing is weird. Sometimes the code works perfectly (and I mean the smoothest thing that I've ever seen!) but sometimes it stutters. It does look like it's occasionally missing a frame.

I experience the same thing. Sometimes it is like, I run the program, it stutters for a while then it becomes the smoothest thing ever, then it starts stuttering again.

Tried million stuff, can't fix it.

10
Graphics / Re: Stutter problem
« on: February 01, 2016, 06:52:53 pm »
Yeah I haven't setFramerateLimit in my code. But I think of adding one like game will count FPS for couple seconds at launch of the game, if its more than 200 then we can tell that vertical sync is off so I will put setFramerateLimit(200) for example.

Is there a bad effect of setFramerateLimit(200) if vsync is off and player does not get 200 fps at all.

11
Graphics / Re: Stutter problem
« on: February 01, 2016, 05:42:57 pm »
I was just writing, "I just copied and pasted your code** and it works fine without any stutter" when I just noticed that it started to stutter!  :o

I believe your problem is due to using vertical synchronisation. Although I'm not sure exactly, it could be due to the fact that it's synchronising at a low frame rate (missing the refresh so waiting for the next one - half the refresh rate).

I just tried limiting the frame rate* (I tried 30 and 60). Although it's (obviously) not pretty at 30, both 30 and 60 still seems to have 'jumps' so it might be your interpolation calculations.

* Remember that v-sync must be turned off when limiting the frame rate.
** your accumulator variable is not being initialised so I set it to zero at initialisation:
float accumulator = 0.f, delta = 1.0f / 125.0f;

Is this causing stutter somehow?
Probably not but it depends onthe kind of stutter you are experiencing. Not processing events each frame could cause your operating system to whine, which may in turn decide to give you less processing time. Probably not though.

"* Remember that v-sync must be turned off when limiting the frame rate."

Should I remove all the v-sync option from my game then? I am not limiting the frame rate, I limit the tickrate.

You can simulate the stutter effect by simply click & holding the window for a moment, so line snaps. Just do it. Is there a fix for this, it really bugs me... How can I make my game loop perfect?

About org_pos, I use rect.getPosition() and setPosition inside my update code so I think I have to do it this way.

12
Graphics / Re: Stutter problem
« on: February 01, 2016, 01:37:19 pm »
You shouldn't need "org_pos". Just calculate the interpolated position when setting the position directly or use a temporary and then don't change "pos" to do that  ;)

I have, in an example for my Timestep class, an instance where I use that method - calculate when setting the object's position.

That's interesting. Thanks for sharing.

You need to poll the events in every frames, not only when accumulator > delta.

Is this causing stutter somehow? I don't want to change it because I built my whole buttons and replay/recording system on this implementation.
Edit: It did not help.

13
Graphics / Stutter problem
« on: January 30, 2016, 09:03:07 pm »
Hello there,

I develop the game named Remnants of Naezith for 1.5 years and I still couldn't fix my stutter.

Here is a minimal working example for my game loop:

https://gist.github.com/naezith/70248aa555ddf87651df

GTX770 on my desktop and ATI 6400M iirc on my laptop, both has the stutter.

Am I doing something wrong? How can I improve this game loop?

Pages: [1]
anything