flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > need some pointers on game

Author
Thread Post new topic Reply to topic
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 24 Aug 2013, 12:23
I was trying to make a game and would like to get some opinions before the game gets too complicated. Here are my questions:

1. How can we play sounds nicely? What I took from some other project on this board creates a little blip in the game play.

2. How can I keep the cpu usage down while still maintaining smooth gameplay?


Description:
Download
Filename: AGame.zip
Filesize: 46.31 KB
Downloaded: 833 Time(s)

Post 24 Aug 2013, 12:23
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 24 Aug 2013, 17:54
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 20:05; edited 1 time in total
Post 24 Aug 2013, 17:54
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 24 Aug 2013, 18:34
I have a couple of responses to that.
My message loop looks something like (let f = desired frame rate):
Code:
1: peek message
2: process message
3: if time since last draw is less then 1/f, then goto 1.
4. render scene, and goto 1.    

Here, between frames the path 1,2,3,1,2,3,1,2,3, ect is beeing executed, thus eating up the cpu.
If I rely on vsync, I would have to know how to enable it, and then, rather sadly, I could not change the frame rate because then it would be fixed to something like 60.
Post 24 Aug 2013, 18:34
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4333
Location: Now
edfed 24 Aug 2013, 21:01
can you make the global angle of view change?
Post 24 Aug 2013, 21:01
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 24 Aug 2013, 21:15
Quote:
can you make the global angle of view change?

There are lots of fancy things one could do, but I am more interested how to handle three treads:

Thread #1: handles physics at a constant refresh rate (120 fps)
Thread #2: draws the objects at the refresh rate of the hardware (60 fps)
Thread #3: handles a fluid simulation like in many popular games of this type, also at a constant refresh rate

I guess Thread #2 can be limited by gpu driver, but I using the windows function Sleep does not give enough granularity for Thread #1 or 3.
Post 24 Aug 2013, 21:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.