4
$\begingroup$

So when I run the game with the Embedded Player the split screen works but when I run it Standalone the size of the camera is changed.

Embedded: enter image description here

Standalone: enter image description here

I would like to make the standalone look like the Embedded.

Here is the code for the split screen if that is needed:

from bge import logic, render
camList = logic.getCurrentScene().cameras

cont = logic.getCurrentController()
own = cont.owner
cam1 = camList[own['cam1']]
cam2 = camList[own['cam2']]

width = render.getWindowWidth()
height = render.getWindowHeight()

cam1.setViewport(0, 0, int(width/2), height)
cam2.setViewport(int(width/2), 0, width, height)

cam1.useViewport = True
cam2.useViewport = True

Thanks!

$\endgroup$
  • 2
    $\begingroup$ Try the following with the mouse cursor over the 3D Viewport: 1st press Alt+F11 to switch to fullscreen mode; 2nd press Alt+F10 to maximize the viewport with no UI. This should display your in-blender results with the same resolution as the fullscreen stand-alone. $\endgroup$ – MarcClintDion May 31 '15 at 3:45
1
$\begingroup$

I have that problem too. Try making the focal area larger, although it may be an issue with having two cameras.

Although, the snarky answer would be to restore down the game window.

Or you could do it like MarcClintDion commented. But really, make a note of the position of each camera, and slowly move them until you get the results you want.

Also, check if it's only going to fail with width. See if you can't stack the screens on top of each other, and see what effect that has on the width.

$\endgroup$
  • $\begingroup$ How exactly do you "stack screens"? $\endgroup$ – Blender Warrior Jun 6 '15 at 5:48
  • $\begingroup$ He's trying to split the screen vertically. I'm wondering if he gets a similar effect if he tries to split the screen horizontally, so that the cut is across the x-axis. $\endgroup$ – Nefer007 Jun 7 '15 at 1:05
0
$\begingroup$

That's not actually a problem and this is normal. Its not the camera but its probably the game trying to stretch itself to fit the screen completely. Also, try zooming in the "3D Viewport" in the camera until all those dotted lines (if you have seen them before) are gone once they disapear imediatelly stop zooming. Should look like this:

The image below has dotted lines but if I zoom in just until the dotted lines go away.

Ugly dotted lines

Now here thats what happens when you zoom in (look at the image below) the camera until the dotted lines disappear.

Awesome Non-lines

Just keep adjusting your zoom on camera or the cameras perspective and run the game and repeat this over and over until your Standalone looks a little bit better. Everyone goes through "Trial and Error" eventually we make it and it works :D.

$\endgroup$
0
$\begingroup$

After reading for more than a year I am neither an expert nor a guru, but I have compiled many notes, of which I keep the ones that have been useful for me to learn or solve problems with bge

This is one, from which I did not find the page or more information, but maybe it is useful, I still do not apply it

Create a script for the top screen with the following: (you can name it"top_screen")

import *

own = GameLogic.getCurrentController().getOwner()

own.enableViewport(1)
own.setViewport(0, 384, 1024,768)
  1. Create a camera or use the default one
  2. In the logic key create a sensor then a controller
  3. Make sure the controller is a "python" and name the script "top_screen" (or whatever name you have for the "top screen" script you created)

Note: Case sensitive names so make sure where it says (Script:) in the "controller/python" it is typed exactly the same as the name of the script you created)

Now create a script for the bottom screen with the following: (you can name it"bottom_screen")

import *

own = GameLogic.getCurrentController().getOwner()

own.enableViewport(1)
own.setViewport(0, 0, 1024, 384)
  1. Create another camera
  2. In the logic key create a sensor then a controller
  3. Make sure the controller is a "python" and name the script "bottom_screen" or whatever name you have for the bottom screen script you created

There now test!!!! At least make sure you have like a stage or something that is colourful or at least so you can tell its split screen

Note: Make sure your header is pulled all the way down for full results of the split screen code

now you can play around with the python and see what it does pretty simple yet complicated... (oh yeah the thing to play around with is highlighted green).

$\endgroup$
  • $\begingroup$ @hehehehaah you use something like this youtu.be/-TtTBGSOii4 $\endgroup$ – user55877 May 11 '18 at 17:59
  • $\begingroup$ i show you something like a THATIMST3R ttps://youtu.be/A2PxbXsu5oY $\endgroup$ – user55877 May 11 '18 at 18:02
-1
$\begingroup$

Change the resolution (width) of the embedded player to half of the standalone resolution and it will work!

$\endgroup$
-2
$\begingroup$

set the resolution (width) of embedded player half of the standalone player & vice versa for vertical split.

$\endgroup$
  • 1
    $\begingroup$ Could you provide a bit more details to make it clear what you mean for the OP? For example, why does that work? Why doesn't his? $\endgroup$ – JakeD Dec 10 '16 at 13:05
  • $\begingroup$ i had the same problem exact smae problem $\endgroup$ – Parveen Saksena Dec 12 '16 at 4:10
  • $\begingroup$ and this fixed it $\endgroup$ – Parveen Saksena Dec 12 '16 at 4:10
  • $\begingroup$ the youtube tutorial from where he took the code a\has it(the solution to the problem) in the comments. at least try too see if it works it did for me $\endgroup$ – Parveen Saksena Dec 12 '16 at 4:11
  • $\begingroup$ and can u help me with blender.stackexchange.com/questions/69005/… $\endgroup$ – Parveen Saksena Dec 12 '16 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.