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 Professional Discussion / Complex 2d problum, please try to answer,

Author
Message
Tsumaru
15
Years of Service
User Offline
Joined: 10th Jan 2011
Location:
Posted: 10th Jan 2011 23:01 Edited at: 10th Jan 2011 23:53
Hey, if anyone can help me please answer the best was you are able to,
Im trying to make a 2d rpg two player game,
I was wondering, in dark basic pro, can you make two difrent game windows,
One with player one in it, and the other with player two in it,
Is this possable??
Im pritty new to dark basic pro, but I at lease know the basics to making a normul rpg game,

Only one truth prevails,
sometimes.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jan 2011 08:24
Yeah, there's a couple of ways to do it.
You could use 2 seperate cameras then paste each cameras render image to the screen, or even texture it to an object, a plain for instance.
Another way (my preferred way) is to use 2 camera views, so each loop you update a different view, using SET CAMERA VIEW xa,ya,xb,yb
A benefit to using switching camera views is that it doesn't impact frame rate as severely (if at all). I'd be happy to make a small example of switching camera views for you.

Health, Ammo, and bacon and eggs!
Kira Vakaan
17
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 11th Jan 2011 09:28
Actually, if it's completely 2D, you'll be just fine drawing the map around player 1 on one side of the screen and then the map around player 2 on the other. Otherwise, if you're using 3D objects to make a top down kind of thing, Van B made a good suggestion.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jan 2011 18:25 Edited at: 11th Jan 2011 18:33
Quote: "then paste each cameras render image to the screen"

or use SET CAMERA VIEW for two camera, specifying the coordinates for each one on the screen.

[edit]clarity

Dr Tank
17
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 11th Jan 2011 18:30
Why switch camera views? Make 2 cameras, and give them the 2 different camera views. You get a higher framerate by having 1 camera and switching the view every sync, but then each view is only rendered every other frame.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jan 2011 21:27
You could render both views, but if the frame rate is high enough it's negligible. With 2 views as opposed to 2 cameras, you have much less hassle with shaders, and it's easy to switch back to a single view, and it can adapt to the screen resolution much better. Imagine you have a 2 player game, top down with 2 characters - with the 2 views method you can switch back to a single view when the players are close together. Players can quit out and start up without affecting things too much as well.

Extra cameras are best for effects like refraction, IMO it's overkill to use them for split screens.

Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2026-07-21 15:13:43
Your offset time is: 2026-07-21 15:13:43