6
SPLITSCREEN GAMEPLAY For this tutorial, you will be learning how to build a split screen game. Here is some basic knowledge: If you plug your console/computer into your tv/monitor, your console is spitting out one video signal that your tv is showing you. So, with that basic thought, you can see that the game engine is what is splitting the signal into 1, 2, 3, or 4 views, then they get rendered and pieced together for the final “one piece” video output. So, with that said, we have to figure out how to split the screen in the editor. To do that we will need: 1 – 1024x1024x1024 subtracted cube level 1 – light to light the level 1 – player start 1 – UIScene (We will use this to show our RenderToTexture) 1 – SceneCapture2DActor (We will use this to record our information) 1 – RenderToTexture (We will show this on our UIScene) Ok, so here is how it works. In real life, the video signal gets displayed on the tv screen. Our image will be displayed on our HUD. The video signal would be the RenderToTexture, and the console sending the info would be the SceneCapture2DActor. What happens is that the SceneCapture2DActor is working as a camera that is constantly recording…so use as little as possible or your game will chug like crazy. Once it records the information, it converts it into an animated texture that is constantly rendering and playing in your generic browser. That animated texture is constantly getting fed into the HUD, and the HUD is opened for the entire game so you can play with your buddies. Ok, so let’s get started… In your generic browser, go to your actor classes and look for SceneCaptureActor, SceneCapture2DActor. Right click and add it to your level behind your player start…kind of like you were setting up a third person camera. YOU WILL NOT SEE IT…IT IS INVISIBLE, so you have to go to the binoculars to find it.

Split Screen

Embed Size (px)

DESCRIPTION

udk

Citation preview

Page 1: Split Screen

SPLITSCREEN GAMEPLAY For this tutorial, you will be learning how to build a split screen game. Here is some basic knowledge: If you plug your console/computer into your tv/monitor, your console is spitting out one video signal that your tv is showing you. So, with that basic thought, you can see that the game engine is what is splitting the signal into 1, 2, 3, or 4 views, then they get rendered and pieced together for the final “one piece” video output. So, with that said, we have to figure out how to split the screen in the editor. To do that we will need: 1 – 1024x1024x1024 subtracted cube level 1 – light to light the level 1 – player start 1 – UIScene (We will use this to show our RenderToTexture) 1 – SceneCapture2DActor (We will use this to record our information) 1 – RenderToTexture (We will show this on our UIScene) Ok, so here is how it works. In real life, the video signal gets displayed on the tv screen. Our image will be displayed on our HUD. The video signal would be the RenderToTexture, and the console sending the info would be the SceneCapture2DActor. What happens is that the SceneCapture2DActor is working as a camera that is constantly recording…so use as little as possible or your game will chug like crazy. Once it records the information, it converts it into an animated texture that is constantly rendering and playing in your generic browser. That animated texture is constantly getting fed into the HUD, and the HUD is opened for the entire game so you can play with your buddies. Ok, so let’s get started… In your generic browser, go to your actor classes and look for SceneCaptureActor, SceneCapture2DActor. Right click and add it to your level behind your player start…kind of like you were setting up a third person camera.

YOU WILL NOT SEE IT…IT IS INVISIBLE, so you have to go to the binoculars to find it.

Page 2: Split Screen

Once you select it you can press “F4” to go to it’s properties.

Page 3: Split Screen

You will see that there are a lot of options. My favorite is the ClearColor and FarPlane. The far plane says that after “X” number of units, just render the clear color…so imagine fog…after 1000 units, just display the fog color and do not render the rest of the environment. Great for optimization. Frame rate is how fast the texture animates. LOD is how much detail, and ViewMode lets you choose shadows, lights, no lights, or wireframe mode. You will notice a TextureTarget…once you go into the generic browser and create a RenderToTexture (right click and choose it), you will place the texture there. Once you create a render to texture, double click on it and adjust the size. For example, your screen resolution is 800x600 and you are creating a 2 player game…so each texture should be 800x300 or 400x600, depending on if you want a horizontal or vertical split.

Ok, now that we have the capture actor and the texture, and they are both connected, we have to create a UI. I named mine TOP and the other one would be BOTTOM for a 2 player game. Open up your UIScene.

Below, you will see that I created an Image,

sized it correctly,

Page 4: Split Screen

and added my texture to the image slot

My finished UI looks like this. Remember to deselect the image and in the properties of the UI (not the image) turn off the display cursor and pause the game while open options.

Page 5: Split Screen

Do the same steps for the bottom section and add all the info to the bottom of this UI and you will be ready for the next step. Close all your UI stuff and save your package. Then close the generic browser. In your level kismet, you will need to open the scene and attach the capture actor to your player.

Page 6: Split Screen

You can see from the example below that you will get a 2 player view in your game.

You would have to resize or remake your HUD to fit to size, and you would definitely need some programming for all of it to count your bullets and health, etc, but it does give you a multiplayer view. Enjoy!