Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
fixes for stuttering? #467283
07/24/17 19:55
07/24/17 19:55
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Is anyone else experiencing any stuttering?

I noticed that A8 drops some frames here and there resulting in stuttering. In windowed mode this is more severe than in fullscreen mode. It seems like A8's and Window's framerate go in and out of sync periodically. Not sure if this can be fixed as the frame times don't seem to show a spike.

In fullscreen mode it's better (no periodic desync) but there's still constantly 1 frame dropped per second. I tried it with both, triplebuffer enabled and disabled, but this has no effect.

Does anybody know a way to fix this problem? In case you want to try it yourself:

Code:
#define PRAGMA_POINTER
#include <acknex.h>

void main()
{
	//d3d_triplebuffer = 1; // doesn't affect the stuttering
	
	byte UseFullscreen = false;
	
	//
	
	wait(1);
	
	if(UseFullscreen)
	{
		video_set(sys_metrics(0), sys_metrics(1), 0, 1);
	}
	else
	{
		video_set(1280, 720, 0, 2);
	}
	
	fps_max = 60;
	
	vec_set(&screen_color, vector(40, 32, 30));
	
	draw_textmode("Segoe UI Light", 0, 30, 100);
	
	//
	
	var width = 1;
	var height = screen_size.y;
	var speed = 4;
	
	VECTOR Pos;
	Pos.x = -width;
	Pos.y = 0;
	Pos.z = 0;
	
	while(!key_esc)
	{
		draw_quad(NULL, &Pos, NULL, vector(width, height, 0), NULL, vector(230, 225, 30), 100, 0);
		draw_quad(NULL, vector(cycle(Pos.x - speed, 0, screen_size.x), Pos.y, 0), NULL, vector(width, height, 0), NULL, COLOR_BLACK, 100, 0);
		
		draw_text("frametime in milliseconds:", 10, 10, vector(232, 205, 159));
		draw_text(str_for_float(NULL, dtimer() / 1000.0), 10, 40, vector(232, 205, 159));
		
		// move to the right at constant rate
		
		Pos.x += speed;
		
		while(Pos.x > screen_size.x)
			Pos.x -= screen_size.x;
		
		wait(1);
	}
	
	//
	
	sys_exit(NULL);
}


regards, Kartoffel


POTATO-MAN saves the day! - Random
Re: fixes for stuttering? [Re: Kartoffel] #467307
07/25/17 20:53
07/25/17 20:53
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
It looks pretty much stable on my machine but how do you diagnose figure out frame drops?

Frame rate obviously never going to be stable, also second while is kind of useless, it can just be an if. You are going to have occasional frame rate drops and even spikes in a real world scenario, thus enter the time_step to make things look smoother.

i see a solid 16.66xxxx something frame time in your demo in both fullscreen and windowed modes.

Last edited by Quad; 07/25/17 20:54.

3333333333
Re: fixes for stuttering? [Re: Quad] #467308
07/25/17 21:02
07/25/17 21:02
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
also it appears draw_quad calls actually draw stuff at the end of the frame, not exactly at the point where you call them, this might also appear to be causing the dropping problem.


3333333333
Re: fixes for stuttering? [Re: Quad] #467311
07/26/17 01:58
07/26/17 01:58
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi, if the stuttering is "consistent", meaning it always stutters at a seemingly constant rate (every 6 seconds, etc), you may want to check if any hard drive business is going on. Ive had stuttering before, and after disabling a backup software that was copying/sending data to the cloud at the time, and restarting, the stuttering stopped.

Re: fixes for stuttering? [Re: jumpman] #467328
07/26/17 14:43
07/26/17 14:43
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Thanks for the feedback. In my code I'm always using the time passed since the last frame for anything time-based so thats not really a problem.

I just thought maybe someone knows a way to counteract that problem. Especially the stuttering in windowed mode seemed a bit strange to me as a lot applications work very fluid in windowed mode (similar to vsync but without as much inputlag).

Does anyone know if gsync/freesync require any software specific implementation or is this a gpu & monitor only thing?


POTATO-MAN saves the day! - Random
Re: fixes for stuttering? [Re: Kartoffel] #467359
07/27/17 23:33
07/27/17 23:33
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline
Expert
Error014  Offline
Expert

Joined: Jul 2002
Posts: 3,208
Germany
I have noticed stuttering too on some systems I've tested Dungeon Deities on, though it does not occur on most systems.

I have no idea why that is, so I can't really help you here, but I figured maybe you'd like to hear that you're not all alone with this.


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
Re: fixes for stuttering? [Re: Error014] #467366
07/28/17 14:47
07/28/17 14:47
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I experience stuttering as well every now and then when my game is locked to 60fps while it could refresh at a much higher framerate. I set fps_max to let's say 90 then which makes it go away in windowed mode.

There's something in the manual about that as well:
Quote:
Some hints for decreasing the frame rate in your games
Why would you want to decrease the frame rate? There are three reasons. Your script functions might only work properly within a certain frame rate range, and fail at 1000 fps. You won't want your application to consume all the CPU cycles. And most important, you want to avoid stuttering. Stuttering means a camera and actor movement that appears unsteady. It won't be noticeable in a game with complex levels and medium frame rate, but mostly in games with almost empty levels, little content, and consequently very high frame rate that is then capped by fps_max.

The main reason for stuttering is a coarse PC scheduler resolution that leads to inaccurate task start times, especially when many tasks are running on a particular PC. This problem can be avoided by limiting the frame rate not only with fps_max that just gives task time back to the Windows task scheduler, but by really burning CPU cycles in some or the other way. Fortunately, this is easily done. If your game experiences stuttering, just place some more details in your levels for avoiding a too-high frame rate.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: fixes for stuttering? [Re: Superku] #467377
07/29/17 16:05
07/29/17 16:05
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline
Expert
Error014  Offline
Expert

Joined: Jul 2002
Posts: 3,208
Germany
Fair enough.

Btw, since I own a 144Hz-monitor: May I humbly request you set the arbitrary cap to that, so that I can enjoy your game running as smooth as possible? laugh


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1