{"id":31801,"date":"2024-11-01T09:03:04","date_gmt":"2024-11-01T09:03:04","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=31801"},"modified":"2024-11-01T11:34:39","modified_gmt":"2024-11-01T11:34:39","slug":"basic-unity-course-network-environment-and-photon-installation","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/31801\/","title":{"rendered":"Basic Unity Course: Network Environment and Photon Installation"},"content":{"rendered":"<p><body><\/p>\n<p>Setting up the network environment in game development is a very important process. Among them, <strong>Unity<\/strong> supports various networking solutions, one of which is <strong>Photon<\/strong>. Photon is a powerful framework for real-time multiplayer games, characterized by outstanding performance and ease of use. In this article, we will start with the basics of Unity, explain the understanding of the network environment, and describe the process of installing Photon in detail.<\/p>\n<h2>1. Basics of Unity<\/h2>\n<h3>1.1 What is Unity?<\/h3>\n<p>Unity is a cross-platform game engine used to create 2D and 3D games. Thanks to its user-friendly interface and powerful features, it is one of the most widely used game development tools worldwide. Using Unity, you can develop and distribute games across various platforms (PC, mobile, consoles, etc.).<\/p>\n<h3>1.2 Understanding the Unity Interface<\/h3>\n<p>The Unity interface consists of several windows. The main components are as follows:<\/p>\n<ul>\n<li><strong>Scene View:<\/strong> This is the space where you can place and manipulate game objects in a 3D or 2D environment.<\/li>\n<li><strong>Game View:<\/strong> It reproduces the configured scene exactly as it is in the game, allowing you to check the game being played.<\/li>\n<li><strong>Hierarchy:<\/strong> This displays all game objects in the scene in a tree format.<\/li>\n<li><strong>Inspector:<\/strong> This is the space where you can modify the properties of the selected game object.<\/li>\n<\/ul>\n<h3>1.3 Scripting Basics<\/h3>\n<p>The scripting language used in Unity primarily is C#. C# is an object-oriented programming language that allows you to write complex game logic efficiently. A basic script has the following structure:<\/p>\n<pre><code>using UnityEngine;\n\npublic class MyFirstScript : MonoBehaviour\n{\n    void Start()\n    {\n        Debug.Log(\"Hello, Unity!\");\n    }\n\n    void Update()\n    {\n        \/\/ Called every frame\n    }\n}\n<\/code><\/pre>\n<p>Scripts can be attached to game objects in Unity to define behaviors.<\/p>\n<h2>2. Understanding the Network Environment<\/h2>\n<h3>2.1 The Necessity of Networked Games<\/h3>\n<p>Multiplayer games enable interaction between players and increase the fun factor of the game. Therefore, building a network environment is an essential element of game development. There are various forms of network structures such as server-client models and P2P models, each with its advantages and disadvantages.<\/p>\n<h3>2.2 Server-Client Model<\/h3>\n<p>The server-client model is a structure where the main server manages all game data, and clients request and receive this data. The advantage of this model is that it increases the reliability and consistency of the data. However, it also brings the disadvantage of higher dependence on the server.<\/p>\n<h3>2.3 P2P Model<\/h3>\n<p>The P2P (Peer to Peer) model is a model where each client is directly connected to perform data communication. This method can reduce server costs, but there may be challenges in maintaining data consistency.<\/p>\n<h3>2.4 Network Protocols<\/h3>\n<p>In network games, mainly two protocols are used: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP guarantees the reliability of data transmission, while UDP prioritizes fast data transmission. Depending on the type of game, the appropriate protocol should be selected.<\/p>\n<h2>3. Installing Photon<\/h2>\n<h3>3.1 What is Photon?<\/h3>\n<p>Photon is a powerful networking solution for multiplayer games that enables real-time communication. It integrates easily with Unity and is used by many developers.<\/p>\n<h3>3.2 Steps to Install Photon<\/h3>\n<p>To install Photon, follow these steps:<\/p>\n<ol>\n<li><strong>Download Photon Engine:<\/strong> Download the latest version from the <a href=\"https:\/\/www.photonengine.com\/en-US\/Download\">official Photon Engine website<\/a>.<\/li>\n<li><strong>Open Unity Project:<\/strong> Launch Unity and create a new project.<\/li>\n<li><strong>Use Package Manager:<\/strong> Open Unity&#8217;s Package Manager, select &#8216;Add package from git URL&#8230;&#8217;, and input the copied Photon package URL.<\/li>\n<li><strong>Configure Photon:<\/strong> After installing Photon, you need to set up the Photon Server Settings. Create an Application ID in the Photon Dashboard and enter that ID in Unity.<\/li>\n<\/ol>\n<h3>3.3 Using Photon SDK<\/h3>\n<p>The Photon SDK allows you to implement networking features in your game through various APIs. The basic connection code is as follows.<\/p>\n<pre><code>using Photon.Pun;\n\npublic class NetworkManager : MonoBehaviour\n{\n    void Start()\n    {\n        PhotonNetwork.ConnectUsingSettings();\n    }\n\n    void OnConnectedToMaster()\n    {\n        PhotonNetwork.JoinLobby();\n    }\n}\n<\/code><\/pre>\n<h3>3.4 Key Features of Photon<\/h3>\n<ul>\n<li><strong>Room Management:<\/strong> You can create and manage individual spaces where users can play the game.<\/li>\n<li><strong>RPC (Remote Procedure Call):<\/strong> You can call methods on other clients to update the game state.<\/li>\n<li><strong>Synchronization through Network Variables:<\/strong> You can easily synchronize the states of various game objects.<\/li>\n<\/ul>\n<h3>3.5 Example of Using Photon<\/h3>\n<p>Let&#8217;s look at a simple example of how to use Photon in a real game. The following code shows the process of creating a player.<\/p>\n<pre><code>using Photon.Pun;\n\npublic class PlayerController : MonoBehaviourPunCallbacks\n{\n    void Start()\n    {\n        if (PhotonNetwork.IsConnected)\n        {\n            PhotonNetwork.Instantiate(\"PlayerPrefab\", Vector3.zero, Quaternion.identity);\n        }\n    }\n}\n<\/code><\/pre>\n<h2>4. Conclusion<\/h2>\n<p>Through the basic Unity tutorial and the installation process of Photon, you can understand and establish a basic network environment. Based on this, you can lay the groundwork for developing multiplayer games. I hope this tutorial helps you appreciate the appeal of network games and encourages you to challenge yourself in actual game development.<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up the network environment in game development is a very important process. Among them, Unity supports various networking solutions, one of which is Photon. Photon is a powerful framework for real-time multiplayer games, characterized by outstanding performance and ease of use. In this article, we will start with the basics of Unity, explain the &hellip; <a href=\"https:\/\/atmokpo.com\/w\/31801\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Basic Unity Course: Network Environment and Photon Installation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[135],"tags":[],"class_list":["post-31801","post","type-post","status-publish","format-standard","hentry","category-unity-basic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/31801\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Setting up the network environment in game development is a very important process. Among them, Unity supports various networking solutions, one of which is Photon. Photon is a powerful framework for real-time multiplayer games, characterized by outstanding performance and ease of use. In this article, we will start with the basics of Unity, explain the &hellip; \ub354 \ubcf4\uae30 &quot;Basic Unity Course: Network Environment and Photon Installation&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/31801\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:03:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:34:39+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Basic Unity Course: Network Environment and Photon Installation\",\"datePublished\":\"2024-11-01T09:03:04+00:00\",\"dateModified\":\"2024-11-01T11:34:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/\"},\"wordCount\":723,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/\",\"url\":\"https:\/\/atmokpo.com\/w\/31801\/\",\"name\":\"Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:03:04+00:00\",\"dateModified\":\"2024-11-01T11:34:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/31801\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/31801\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Basic Unity Course: Network Environment and Photon Installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/31801\/","og_locale":"ko_KR","og_type":"article","og_title":"Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Setting up the network environment in game development is a very important process. Among them, Unity supports various networking solutions, one of which is Photon. Photon is a powerful framework for real-time multiplayer games, characterized by outstanding performance and ease of use. In this article, we will start with the basics of Unity, explain the &hellip; \ub354 \ubcf4\uae30 \"Basic Unity Course: Network Environment and Photon Installation\"","og_url":"https:\/\/atmokpo.com\/w\/31801\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:03:04+00:00","article_modified_time":"2024-11-01T11:34:39+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/31801\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/31801\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Basic Unity Course: Network Environment and Photon Installation","datePublished":"2024-11-01T09:03:04+00:00","dateModified":"2024-11-01T11:34:39+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/31801\/"},"wordCount":723,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/31801\/","url":"https:\/\/atmokpo.com\/w\/31801\/","name":"Basic Unity Course: Network Environment and Photon Installation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:03:04+00:00","dateModified":"2024-11-01T11:34:39+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/31801\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/31801\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/31801\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Basic Unity Course: Network Environment and Photon Installation"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=31801"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31801\/revisions"}],"predecessor-version":[{"id":31802,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31801\/revisions\/31802"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=31801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=31801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=31801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}