Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Another split screen question

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Dec 2008 21:27
Hello!

So, I am making a four player battle game, and I noticed that it all runs smoothly at 60 fps, but when I split the screen for 2 players, it stays at 60 fps, but the screens seem to have lost some speed.

So, I turned up the fps to 120, and it ran at the speed that it should when playing with one player.

If I add 3 screens, I have to put the fps up to 180, and with four players up to 240 fps.

A final build can not handle high fps rates like that, and I am going to run into some trouble if I wan`t to publish my game, because it will seem to run at 15 fps with four players.

Is there a more efficient way to split the screen?

I set the camera view, position the camera where it needs to be, and sync. Then I set the next camera view...

Any help?

TheComet

Peachy, and the Chaos of the Gems

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 28th Dec 2008 15:53
anyone? Please say if you don`t understand. I will happily explain more clearly.

Peachy, and the Chaos of the Gems

BlobVanDam
17
Years of Service
User Offline
Joined: 26th Jul 2008
Location: one of Cybertrons moons
Posted: 28th Dec 2008 17:09 Edited at: 28th Dec 2008 17:13
The problem is that syncing twice in one loop results in each frame counting towards your frame limit of 60, so syncing it twice in one frame results in your program effectively running half speed.
I don't know what the solution is. I have the same problem in my program with syncing twice per frame messing up my frame limiting.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 29th Dec 2008 03:58
i don't fully understand as i have never tried split screen but would it help to make a if statement and say if Players=1 then sync rate "whatever you want"

if players=2... exc...

would that work?


i don't quite understand if the problem is that you need your sync rate lower for less players and higher for more or what but if thats the case this should help.... maybe lol
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Dec 2008 09:13
@TheComet

Instead of setting the camera view individually 4 times and calling SYNC after setting each view, programatically change the camera within the main loop using only one SYNC call. In this example, I splits the screen into 4 views using only 1 set camera view call and one sync. To show that the FPS remains at 60 fps and isn't reporting a false value, I also calculate the frame rate using the timer. The FPS and the timer frame rate should be about the same.



Enjoy your day.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Dec 2008 11:03
@Latch

Very interesting. I don`t quite fully understand how you did it, but I know what it does. With my program, each screen is separately running at 15 fps, because the main fps is at 60 and there are four screens, so divide by 4.

That is what you achieve with four set camera views and four syncs.

But with your example, each screen is also running at 15 fps, but you left out four frames. You do this by updating the object every loop, but only updating a screen every 4 loops.

Is that about right?

Anyway, very helpful Latch! And very clever too! I will surely be trying this out. It is a bit jagged when playing with four players, because I cut the main fps down from 60 to 30, and doubled the players speed and rotation, so each screen is updating every fourth time, leaving 7 fps per screen, sped, of course.

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Dec 2008 00:45
Quote: "I don`t quite fully understand how you did it, but I know what it does"


Each time through the main loop I increment the y position for a camera view. When the y position is at it's max, I increase the x position. When either view has reached the screen limit (in this case 1024x768) I set x or y to 0.

Quote: "But with your example, each screen is also running at 15 fps, but you left out four frames. You do this by updating the object every loop, but only updating a screen every 4 loops.

Is that about right?"

That sounds about right. This is good for calculations, math and loops, but now that I think about it, object positions might jump because they would be updated 4 times for every camera view redraw. hmmmm... The program is running at the correct FPS, but the camera view updates are behind... Not really visible at high SYNC rates, but definately at low ones. I'll have to think about this.

Enjoy your day.

Login to post a reply

Server time is: 2026-07-07 00:31:33
Your offset time is: 2026-07-07 00:31:33