Demo
Client
Set for 2D
- Project Settings
- [Window]-[Project Settings]-[Editor]
- Change
Default Behavior Mode
to2D
- Scene
- Change
Scene
to2D
- Change
- Package Manager
- [window]-[Package Manager]
- Download
2D Tilemap Editor
- Asset Store
- [window]-[Asset Store]
- Download and import Assets
Tilemap Map
- Grid
- [2D Object]-[Tilemap]
- Create Tilemap
- Palette
- [window]-[2D]-[Tile Palette]
- Create new Palette and change name to
Palette_Map
- Save on
Resources\Tiles\Palettes
- Drag
Assets\TinyRPGTown\Artwork\tileset
and drop onTilePalette
window - Save tiles on
Resources\Tiles\Tiles_Map
- Make your map
Tilemap Environment
- Grid
- Create Tilemap and change name to
Tilemap_Env
- change layer to
1
- Create Tilemap and change name to
- Palette
- Create new Palette and change name to
Palette_Env
- Save on
Resources\Tiles\Palettes
- Select
Palette_Evn
- Drag
Assets\TinyRPGTown\Artwork\Sprites\barrel
andbuilding
and drop onTilePalette
window - Save tiles on
Resources\Tiles\Tiles_Env
- Make your map
- Create new Palette and change name to
Tilemap Collision
- Grid
- Create Tilemap and change name to
Tilemap_Collision
- change layer to
10
- Create Tilemap and change name to
- Palette
- Select
Palette_Evn
- Drag
Assets\TinyRPGTown\Artwork\Sprites\rock
and drop onTilePalette
window - Save tiles on
Resources\Tiles\Tiles_Env
- Make your map
- Select
Test
- Assets\Scripts\TestCollision.cs
Map Tool
- Assets\Editor\MapEditor.cs
Player Move
-
remove
TestCollision.cs
-
Player Sprite Setting
- Set
Pixel Per Unit
to20
- Create Player and set position to (0.5, 0.5, 0)
- Set
- Utils\Define.cs
- Controllers\PlayerController.cs
- set
Grid
Test
Player Animation
- Create Clips
- Create new Animation Controller in
Resources\Animations
and change name toPlayerAnimController
- Create Clips in
Resources\Animations\Player
- Create new Animation Controller in
- PlayerController.cs
Test
Map Manager
- Scripts\Managers\Managers.cs
- Scripts\Managers\Contents\MapManager.cs
- Scripts\Scenes\GameScene.cs
- Create Empty Game Object and change name go
GameScene
- add
GameScene.cs
compoenent
- Create Empty Game Object and change name go
- PlayerController.cs
- EditorMapEditor.cs
Test
Separate Controller
-
create CreatureController to use base controller
-
Define.cs
- Scripts\Controllers\CreatureController.cs
- PlayerController.cs
- Scripts\Controllers\MonsterController.cs
- Copy
Player
and change name toMonster
- remove
PlayerController.cs
component and addMonsterController.cs
component - change color to red
- Copy
Object Manager
- MonsterController.cs
- Managers.cs
- Scripts\Managers\Contents\ObjectManager.cs
- manage collision with objects
- CreatureController.cs
- Prefabs
- Create
Player
andMonster
Prefab inPrefabs\Creature
- Remove
Player
andMonster
in Hierarchy
- Create
- GameScene.cs
Test
Skill : Attack
- CreatureController.cs
- PlayerController.cs
Test
Skill : Arrow
- Arrow
- set
Pixel Per Unit
ofTiny RPG Forest\Artwork\sprites\misc\Arrow
to 20 - Create
Arrow
Prefab and ChangeOrder in Layer
to 11 - add
ArrowController.cs
Compoenent inArrow
Prefab
- set
- Scripts\Controllers\Creature\ArrowController.cs
- CreatureController.cs
- PlayerController.cs
Test
Effect
- Animation
- Create
Effect\DieEffect
Prefab - Create animation controller and change name to
Resources\Animations\Effect\EffectAnimController
- Add
Animator
Component and linkEffectAnimController
- Create
- Create
Assets\Tiny RPG Forest\Artwork\sprites\misc\enemy-death
sprites to animation and change name toStart
- change
Pixel Per Unit
ofenemy-death
sprites to 20
- CreatureController.cs
- MonsterController.cs
- ArrowController.cs
- PlayerController.cs
Test
AI : Patrol
- CreatureController.cs
- PlayerController.cs
- ArrowController.cs
- MonsterController.cs
Test
AI: Search
- add A* Algorithm
-
PriorityQueue is on A* Maze Post
- Scripts\Utils\PriorityQueue.cs
- MapController.cs
- ObjectManager.cs
- MonsterController.cs
Test
AI : Skill
- CreatureController.cs
- MonsterController.cs
Test
Server
Protobuf in Server
- Create
Common
folder - Download Google Protobuf protoc-3.12.3-winXX.zip on Common folder
- Download
Google.Protobuf
in Nuget Package Manager
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Common\protoc-3.12.3-win64\bin\GenProto.bat
- Server\Session\ClientSession.cs
- PacketGenerator\PacketFormat.cs
- PacketGenerator\Program.cs
- Server\PacketHandler.cs
Protobuf in Client
- Scripts\Managers\Contents\NetworkManager.cs
- NetworkManager is on Chatting Test Post
- Scripts\Managers\Managers.cs
- Scripts\Packet\PacketQueue.cs
- Scripts\Packet\PacketHandler.cs
- Libs
- Create
Assets\Libs
folder - Copy
Server\Server\bin\Release\netcoreapp3.1\Google.Protobuf.dll
andServerCore.dll
, Paste onLibs
- Create
- Download
System.Buffers
andSystem.Runtime.CompilerServices.Unsafe
in Nuget Package Manager
- Find each
.dll
files fromC:\Users\leehu\.nuget\packages
and copy onLibs
Test
MultiPlay Environment
Packet Send
- Server\Session\ClientSession.cs
Security
- Delete
ServerCore.dll
fromLibs
- Copy
Session.cs
,RecvBuffer.cs
andConnector.cs
, Paste them toAssets\Scripts\ServerCore
- Change
Console.WriteLine
toDebug.Log
Build
- [Fild]-[Build Settings]
- Remove Scenes without
Scenes/Game
and Click Build onAssets\Builds\WinXX\TestBuild
Multiplay
- Scripts\Scenes\GameScene.cs
- Assets\Editor\MultiplayersBuildandRun.cs
Enter Game
- Server\Session\ClientSession.cs
- Protocol.proto
-
execute
GenProto.bat
-
Server\Game\GameRoom.cs
- Server\Game\RoomManager.cs
- Server\Game\Player.cs
- Server\Game\PlayerManager.cs
- Server\Program.cs
- Client\Assets\Scripts\PacketHandler.cs
Test
Separate MyPlayer
- Scripts\Controllers\MyPlayerController.cs
- to get keyboard input from only MyPlayer
- copy and paste
Player
Prefab and change name toMyPlayer
- Add
MyPlayerController
Componenet onMyPlayer
Prefab
- Scripts\Controllers\PlayerController.cs
- Scripts\Managers\Contents\ObjectManager.cs
- Scripts\Packet\PacketHandler.cs
- Server\PacketGenerator\PacketFormat.cs
- Scripts\Packet\ServerSession.cs
Test
Move : Server
-
Policy: First Move, then Send
-
Protocol.proto
- Session\ClientSession.cs
- Game\Player.cs
- Packet\PacketHandler.cs
- Game\GameRoom.cs
Move : Client
- Controllers\CreatureController.cs
- Utils\Define.cs
- Managers\Contents\ObjectManager.cs
- Controllers\MonsterController.cs
- Controllers\PlayerController.cs
- Controllers\ArrowController.cs
- Controllers\MyPlayerController.cs
- Packet\ServerSession.cs
- Managers\Contents\NetworkManager.cs
- Packet\PacketHandler.cs
Test
Move : Error Fix
- Because clients share players’ direction, players’ last direction doesn’t match
-
So My Player send his own direction to server and he shouldn’t change others’ direction
- Controllers\CreatrueController.cs
- Controllers\MyPlayerController.cs
- Managers\Contents\ObjectMAnager.cs
Test
Skill: Server
-
Policy: First Send, then do
-
Protocol.proto
- Packet\PacketHandler.cs
- Game\GameRoom.cs
Skill: Client
- Packet\PacketHandler.cs
- Controller\PlayerController.cs
- Controllers\MyPlayerController.cs
- Controller\CreatureController.cs
- Managers\Contents\ObjectManager.cs
Test
Hit Detection
- Map Verification
- Map is a text file, so any users can change easily
- So Server also need text file about map for map verification
- Client\Assets\Editor\MapEditor.cs
- Server\Game\Map.cs
- Server\Game\RoomManager.cs
- Server\Game\GameRoom.cs
- Server\Program.cs
- Server\Game\Player.cs
- Remove MoveDir.None
- MoveDir.None is for checking pressed key
- MoveDir.None means there is not key pressed
- So you should change this agenda to boolean checking
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Server\Session\ClientSession.cs
- Set initial direction is down
- Client\Assets\Scripts\Controllers\MyPlayerController.cs
- Client\Assets\Scripts\Controllers\CreatureController.cs
- Remove _lastDir
- Client\Assets\Scripts\Controllers\ArrowController.cs
- Client\Assets\Scripts\Controllers\PlayerController.cs
- Remove UpdateIdle method
- Because this method was for keyboard pressing check
Arrow
- Arrange files
- Server\Game\Room\GameRoom.cs
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Server\Game\Object\Player.cs
- Server\Session\ClientSession.cs
- Server\Game\Object\ObjectManager.cs
- Server\Game\Object\GameObject.cs
- Server\Game\Object\Monster.cs
- Server\Game\Object\Projecteil.cs
- Server\Game\Object\Arrow.cs
- Server\Game\Room\Map.cs
- Server\Program.cs
- Client\Assets\Scripts\Managers\Contents\ObjectManager.cs
- Client\Assets\Packet\PacketHandler.cs
- Client\Assets\Scripts\Controllers\MyPlayerController.cs
- Client\Assets\Scripts\Controllers\ArrowController.cs
Test
Data & Config
Set Arrow Attack Animation
- Client\Assets\Scripts\Controllers\PlayerController.cs
Data Management
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Client\Assets\Scripts\Data\Data.Contents.cs
- Client\Scripts\Managers\Core\DataManager.cs
- Client\Assets\Resources\Data\SkillData.json
- Server\Data\Data.Contents.cs
- Server\Data\DataManager.cs
- DownLoad Newtonsoft.Json from Nuget Package Manager
- Server\Data\ConfigManager.cs
- Server\bin\Debug\netcoreapp3.1\config.json
- Server\Program.cs
- Server\Game\Room\GameRoom.cs
- Server\Game\Projectile.cs
- Server\Game\Object\Arrow.cs
Test
Stat
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Server\Game\Object\Arrow.cs
- Server\Game\Object\GameObject.cs
- Server\Game\Object\Player.cs
- Server\Game\Room\GameRoom.cs
- Client\Assets\Scripts\Managers\Contents\ObjectManager.cs
- Client\Assets\Scripts\Controller\CreatureController.cs
- Client\Assets\Scripts\Controller\ArrowController.cs
- Client\Assets\Scripts\Controller\MonsterController.cs
Test
Damage Detection
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Server\Game\Object\Player.cs
- Server\Game\Object\GameObject.cs
- Server\Data\Data.Contents.cs
- Server\Data\DataManager.cs
- Client\Assets\Resources\Data\SkillData.json
- Server\Session\ClientSession.cs
- Client\Assets\Scripts\Packet\PacketHandler.cs
- Client\Assets\Scripts\Data\Data.Contents.cs
- Remove Stat Region
- Server\Game\Object\Arrow.cs
Test
Hp Bar
Hp Bar UI
- Create Texture
- Create 1x1 Pixel for white in Paint tool
- Save this pixel png file in
Assets\Resources\Textures
- Create HpBar Prefab
- Create empty game object and save in
Assets\Resources\Prefabs\UI
- Create empty game object and save in
- Create HpBar
- Make empty game object and add Sprite Renderer Component on
Background
andBarSprite
- decorate
Background
andBarSprite
as HpBar
- Make empty game object and add Sprite Renderer Component on
Hp Bar Scripts
- Client\Assets\Scripts\Contents\HpBar.cs
- Add HpBar Component in HpBar prefab
- Client\Assets\Scripts\Controllers\CreatureController.cs
- Client\Assets\Scripts\Controllers\PlayerController.cs
- Client\Assets\Scripts\Controllers\PlayerController.cs
- Client\Assets\Scripts\Packet\PacketHandler.cs
Test
Die Effect
- Common\protoc-3.12.3-win64\bin\Protocol.proto
- Server\Game\Object\GameObject.cs
- Server\Game\Room\GameRoom.cs
- Client\Assets\Scripts\Packet\PacketHandler.cs
- Client\Assets\Scripts\Controllers\CreatureController.cs
- CreatureController was base controller
- From now on, base controller is BaseController because arrow is not a creature
- Client\Assets\Scripts\BaseController.cs
- Client\Assets\Scripts\Managers\ObjectManager.cs
- Client\Assets\Scripts\Controllers\ArrowController.cs
Test
Search AI
- Server\Game\Room\GameRoom.cs
- Server\Game\Object\Monster.cs
- Server\Game\Object\GameObject.cs
- Server\Game\Room\Map.cs
- Client\Assets\Scripts\Controllers\MonsterController.cs
- Client\Assets\Scripts\Managers\Contents\ObjectManagers.cs
Test
Skill AI
- Client\Assets\Scripts\Controllers\BaseController.cs
- Server\Game\Object\Monster.cs
- Server\Game\Object\GameObject.cs
- Client\Assets\Resources\Data\SkillData.json
- Client\Assets\Scripts\Controllers\MonsterController.cs
- Client\Assets\Scripts\Packet\PacketHandler.cs
- Client\Assets\Scripts\Controllers\CreatureController.cs
- Client\Assets\Scripts\Controllers\PlayerController.cs
Test
Advanced
Command Pattern
- There are too much lock
-
This process is for dereasing lock
-
Delete
ServerCore\JobQueue.cs
- Server\Game\Job\Job.cs
- Server\Game\Job\JobSerializer.cs
JobQueue
-
Use Job Serialize
-
Server\Game\Room\GameRoom.cs
- Remove lock
- now, you have to change above method to use
Push()
- However, you don’t need to change using part of FindPlayer and Broadcast
-
Because, FindPlayer and Broadcast are used in GameRoom and GameRoom ihherits JobSerializer
- Server\Game\Room\RoomManager.cs
- Server\Program.cs
- Server\Game\Object\GameObject.cs
- Server\Session\ClientSession.cs
- Server\Packet\PacketHandler.cs
- Server\Game\Room\Map.cs
Job Timer
- Move JobTimer.cs to Game\Job\JobTimer.cs
- and change namespace to
Server.Game
- and change namespace to
- Server\Game\Job\JobTimer.cs
- Server\Program.cs
- Server\Game\Job\JobSerializer.cs
- Server\Game\Room\GameRoom.cs
Test
Bug Fix
- Server\Game\Room\GameRoom.cs
- Server\Packet\PacketHandler.cs
- Client\Assets\Scripts\Packet\PacketHandler.cs