Splitscreen woes

Hello

I’m working on a multiplayer splitscreen game in which I have run into a problem. When my player2 character is not visible on player1’s camera, he does not animate, but he can still move around etc.

Here is my splitscreen.py (slightly adopted to add players and get camera’s):



import bge

cont = bge.logic.getCurrentController()

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

scene = bge.logic.getCurrentScene()
objList = scene.objects

player1 = scene.addObject("Player",objList['p1spawn'])
player2 = scene.addObject("Player",objList['p2spawn'])
cam1 = objList["P1Cam"]
cam2 = objList["P2Cam"]

scene.active_camera = cam1

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

objList['p1camSpawn'].setParent(player1)
objList['p2camSpawn'].setParent(player2)
cam2.setParent(player2)


I’m guessing the problem is related to scene.active_camera. Is it possible to have 2 active camera’s?

Anyone have any thoughts or suggestions?

I’m having the same problem, I also need 2 active cameras. I don’t know how to do it though. If I find out I’ll tell you, otherwise you tell me :smiley:

Done deal!

You can’t have more than one active camera. When you say that the second player doesn’t animate, is it a 3D object with an armature, or a animated sprite, or what?

The player is a Dynamic object > Empty > Armature > Multiple No Collision Mesh.

Everything behaves as expected until player2 disapears from cam1’s view.

Hm, maybe it’s a bug with frustum culling, then. Make a simple blend file showing the issue and report it to the bug tracker here.

Thanks SolarLune, I’ve recreated the problem in a simpler blend. I’d like a few people to have a look if possible before I submit a bug report, otherwise I’ll submit tommorow or the day after.

The blend: SplitscreenProblem.blend (498 KB)

As I remember there is already a bug report for that.
I think it is bug with the animation clipping.

Ok, thank you. Do you have a link for it?

Does anyone know if this is planned on being fixed for the next version?

you can also try this setup:
http://gametutorials.tutorialsforblender3d.com/Viewports/Page5

cotax, I think my splitscreen.py does more or less the same thing. The viewports.blend does not have two different armatures.

I searched for it but I can’t find it any more. Please make a new bug report. If we find it we can merge the old one to yours.