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 / Split-Screen

Author
Message
MTGiga
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: - Please Select -
Posted: 17th Jan 2003 23:18
How do I create a 2 player split-screen game? Is it possible? I have an idea, but I would need to know how to render to a different bitmap. Can someone help me out?
Furiousuk
23
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 19th Jan 2003 21:43
To render to a different bitmap you can use the 'Set Current Bitmap' command and then the 'Copy Bitmap' command to move it to the screen. The screen is bitmap 0. This is a quick way of drawing a lot of stuff in one call without altering your Sync calls.

I'm not sure how much this will help you tho.
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 19th Jan 2003 22:07
To create a split screen in a 3d game is impossible realistically in Darkbasic1 but really easy in DBPro

To create a split screen in a 2d game is theoretically impossible, but there are ways to simulate it cleverly in DB1. Again this is easier in Pro

Santi
23
Years of Service
User Offline
Joined: 9th Dec 2002
Location: Spain
Posted: 19th Jan 2003 23:27
You can do it in DB1 using the SET CAMERA VIEW command. You have to draw first the "camera" of player one and then use the SET CAMERA VIEW to draw the second one. It will retund a little slow down, you have to be careful.

Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 20th Jan 2003 01:10
Oooh sorry I thought this was a DBP only command? Maybe I was using an old version of DB1 Sorry then. But yes it will render slowly.

MTGiga
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: - Please Select -
Posted: 20th Jan 2003 17:45
Well, I tried the Set Current Bitmap command, and it still only rendered to the default butmap (0). Is there something wrong about this code:

Sync On
Sync Rate 70

Create Bitmap 1, 640, 240
Set Current Bitmap 1

Do
Sync
Loop
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Jan 2003 17:56
Actually Kanga you are right, there is no way to render 2 active camera views in DBV1. The "set camera view" command will do nothing more than change the viewport of the camera, thus rendering it into a smaller area of the screen rather than the default (fullscreen). But there are no commands to swap from one camera to another in DBV1 and "set camera view" isn't something you're going to want to call every loop - so I'm going to agree with Kanga here and say it can't be done. In DBPro it's simple though.

MTGiga - there is nothing wrong with your code, infact the "set current bitmap 1" line isn't even needed because the create bitmap command will default to the bitmap you just created anyway (try it and see) - however it won't give you a 2nd camera style effect for the reasons stated above.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 20th Jan 2003 18:10
Ahh good, thanks Rich - glad I'm not going mad!

Of course one way to do it in DarkBasic1 would be to set the screen size to the left hand side of the screen, then capture the screen as a bitmap, and paste the image in the place of the left screen. Then move the screen view to the right, render it from player 2's perspective, save as a bitmap and paste it on top, move the camera back to the left side and carry on like this. Although I am 100% sure this would be:
A: Very Awkward, and
B: VERY slow

So... Possible, but only just

Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Jan 2003 18:15
Actually I'm not sure even that is possible - the get image command doesn't grab from the physical display (i.e. what you're seeing on-screen) but rather from the contents of bitmap 0 (or whatever the current bitmap is). The 3D isn't actually rendered to this bitmap, it's rendered on-top. Feel free to try it, but I'm 99% sure you can't grab any "3D" parts of your scene this way. If you could I'm sure people would have tried it already for things like post-render effects (blur/lens flare/etc).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
MTGiga
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: - Please Select -
Posted: 20th Jan 2003 20:00
I don't know why, but I still can not render to a different bitmap. It won't even let me transfer the data from one bitmap to the other. Can someone give me an example. Thanks!
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Jan 2003 20:09
You cannot (and never have been able to) render 3D to a "bitmap" other than 0 (the default screen).

2D is a different matter and there is no reason why this should not work:



This will paste the image onto bitmap 1 (not the screen) and then copy the whole bitmap from 1 to 0 (the default screen). This will only work if your program is running in 640x480 resolution (and if you've not put in a set display command at the start of it, it will be).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 22nd Jan 2003 00:46
Ah Ok thanks a lot for your input Rich

I'll take your word for it, I wouldn't have tried it anyway, I pretty much exclusively use Pro now, which thankfully makes this kind of thing easy

Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Jan 2003 01:01
Ain't that the truth Pro is the way to go.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming

Login to post a reply

Server time is: 2026-06-09 14:28:25
Your offset time is: 2026-06-09 14:28:25