게임엔진관련/언리얼 엔진

언리얼엔진4 ue4 카메라 위에서 내려보는 형식으로 2D게임 만들어보기 관련 Top Down 2D Game Setup

AlrepondTech 2020. 9. 20. 04:12
반응형

 

 

=================================

=================================

=================================

 

 

 

출처: http://cafe.naver.com/unrealenginekr/9927

 

 

 

제가 언리얼엔진4로 2d게임을 만들려고합니다.

(초보자라 전문용어를 잘모릅니다. 이점 양해부탁드립니다.)

 

던전앤파이터,쯔꾸르 게임처럼

w,s키로 y축이동,a,d키로 x축으로 이동하는 방식의 게임을 만들려고합니다.

 

쯔꾸르 형식의 게임을 원하는게아니라 이동하는 방식만 쯔꾸르처럼 원하는데요,

언리얼엔진4에서 2d를 지원하긴하는데 슈퍼마리오 게임같은 2d횡스크롤밖에 없네요.

 

*그래서 제가 원하는것은

w,s를 누를시에 y축으로 일정값 움직이기만하고 바닥 떨어지지않는 방법을 알고싶습니다.

 

 

 

몇일간 혼자 해결해보겟다고 햇지만 도저히 해결법을몰라서 이렇게 질문합니다.

아시는분은 꼭 알려주세요 ㅠㅠ (__)

 

--------------------------------------------------------------------------------------------------------

 

https://docs.unrealengine.com/latest/INT/Engine/Paper2D/HowTo/TopDown/
참조가 되려나요.
3d에서 굴리면서 카메라를 위로 올려서 내려다 보는 식으로 만들수도 있습니다.

 

--------------------------------------------------------------------------------------------------------------

 

강의 영상보면 말씀하신 나와~ㅎ 영상 제목은

공지사항에 UE4 비디오 튜토리얼 (4.7 이상 버전을 위한 튜토리얼 업데이트 중) 이거 다 보움직는거 알수 있어요ㅎ

 

 

 

 

=================================

=================================

=================================

 

 

 

출처: https://docs.unrealengine.com/latest/INT/Engine/Paper2D/HowTo/TopDown/

 

On this page you will learn how to modify the existing Third Person Template project to create a Top Down 2D style game.

You can use your own 2D character with this tutorial or you can download a sample character from the link below:

Setup Project

Here we will set up our project for this tutorial, you can import your own assets during this section or use the Sample Assets provided.

  1. Create a new Third Person Blueprint template project.
  2. Inside the project, Right-click on the Content folder in the Content Browser and create a New Folder.
  3. Give the folder a name such as TopDown or whatever you would like.
  4. Locate the downloaded Sample Assets and drag the SoldierSprites.paper2dsprites asset into Content Browser.
  5. For more information on how to set up assets for importing, see the Paper 2D Import Options documentation.
  6. This will automatically create a SolderSprites Sprite Sheet asset and folders containing Frames and Textures.
  7. Right-click on the SoldierSprites asset and select create Flipbooks.
  8. This will automatically create two Flipbooks based on the sprite sheet for us.
  9. (Optional) Open the Idle Flipbook and in the details panel set Frames Per Second to 3.0.
  10. This will slow down the playback speed of both Flipbook Animations.
  11. Also set the Run Flipbook Frames Per Second to 8.0.

Our project is now set up and we can begin setting up the Top Down Character.

Character Setup

Here we will create a new Paper 2D Character Blueprint and set up the character.

  1. Right-click in the Content Browser and select to create a new Blueprint Class.
  2. In the Pick Parent Class window, click the All Classes drop down and search for and add the PaperCharacter.
  3. Give the new Blueprint a name such as TopDownCharacter.
  4. Inside the TopDownCharacter Blueprint, in the Components window click the Sprite component.
  5. In the Details panel under Sprite click the Source Flipbook drop down and select the Idle Flipbook.
  6. The character will then be added to the Viewport inside the Capsule Component.
  7. Back inside the Details panel under Transform, set the Rotation to -90,0,90 and Scale to 0.75 for XYZ.
  8. This will rotate the Flipbook into position and scale it down so it fits inside the Collision Capsule.
  9. In the Components window, click the CapsuleComponent then in the Details panel adjust the Shape settings.
  10. This will vary based on the character you are using, we have set both Half Height and Radius to 45.0.
  11. In the Components window, click TopDownCharacter(self) then in the Details panel, un-check Use Controller Rotation Yaw.
  12. For this example we are going to automatically orientate our character to the direction he is moving and not use the controller rotation.
  13. In the Components window, click the CharacterMovement component.
  14. In the Details panel for CharacterMovement, update the Max Walk Speed to 400 and check Orient Rotation to Movement.
  15. This will reduce the characters movement speed and automatically rotate the character based on our movement.
  16. In the Components window, click Add Component and search for and add a Spring Arm component.
  17. Click Add Component again and add a Camera component, then drag the Camera onto the Spring Arm to attach it.
  18. Select the Camera component, then in the Details panel, zero out the Location setting.
  19. Select the Spring Arm then make the following updates in the Details panel.
  20. Here we are adjusting the Rotation of the Spring Arm (and by extension, Camera) to 180, -90, 180 to position the camera directly above the character. We are also adjusting the camera distance away from the character by changing the Target Arm Length to 600. Finally we've unchecked the Inherit options for Pitch, Yaw and Roll as we do not want to inherit settings from the camera.
  21. Click Compile and Save then minimize the Blueprint (we will come back to it in a moment).

The character is setup, however there is no movement script applied to it which we will grab from the Third Person Character Blueprint.

Finishing Up

There is no need to reinvent the wheel here, since this template comes with a character with scripted functionality for movement, we can copy that into our Paper Character to provide movement for it.

For more detailed information on setting up character movement and setting up character movement from a blank project, see theSetting Up Character Movement in Blueprints documentation.

  1. Inside the ThirdPersonBP folder in the Content Browser, open the Blueprints folder then the ThirdPersonCharacter Blueprint.
  2. Inside the Event Graph, copy the Movement Input section by Left Mouse dragging a selection box then pressing Ctrl+C to copy.
  3. There is other script in here for 3D gameplay such as manipulating the camera, controller input and jumping. For the purposes of this tutorial we are only concerned with general movement.
  4. Return to your Paper Character Blueprint and press Ctrl+V in the Event Graph to paste it in.
  5. Also inside the ThirdPersonBP and Blueprints folder, open the ThirdPersonGameMode Blueprint.
  6. Under Classes, change the Default Pawn Class to your Paper Character (TopDownCharacter).
  7. This will set our Paper Character as the default character to use during gameplay.
  8. Inside the level delete the Blue Character so you will not take control of it when launching the game.
  9. From the Main Tool bar, click the Play button to play in the editor.
  10. Although the 2D character is idle, you can now move around the default map using the WASD keys.

This tutorial illustrates how to set up the foundation of a top down game by creating a playable 2D character, there are other tutorials you can take a look at to continue to develop this sample such as the Setting up an Animation State Machine (to set up different Flipbook Animation states for the character to use) as well as the section on Paper 2D Tile Maps to create a 2D map. Want a fixed camera position instead of a follow camera for your top down game? The How to Use Cameras in Blueprints page will show you how to set that up and more.

 

 

=================================

=================================

=================================

 

 

반응형