Difference between revisions of "Single Player CCG Kit Manual"

From gamevanilla wiki
Jump to: navigation, search
(How to add a player character)
(How to add a player character)
Line 23: Line 23:
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step1.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step1.png
  
We name the object for our player, in this example the name is ''FallenHero''. Inside this empty game object we drag our rigged sprite.
+
We name the object for our player; in this example, the name is ''FallenHero''. Inside this empty game object we drag our rigged sprite.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step2.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step2.png
Line 33: Line 33:
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step4.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step4.png
  
With our player looking correct, we need to add the appropriate scripts for our player to function. We need to add ''Convert to Entity'', ''Entity Cache'' and ''Player Authoring''. For the ''Convert to Entity'' component, make sure it is set to ''Convert And Inject Game Object''.
+
With our player looking correct, we need to add the appropriate scripts for our player to function. We add the ''Convert to Entity'', ''Entity Cache'' and ''Player Authoring'' components. For the ''Convert to Entity'' component, make sure it is set to ''Convert And Inject Game Object''.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step5.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step5.png
Line 41: Line 41:
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step6.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step6.png
  
Next we need to create a collection of cards for our player. We want to create the Card Library in “SinglePlayerCCGKit>GameData>Collections”. We do this by right clicking in the folder and choosing Create> Single-Player CCG Kit> Card Library. We label it after our player.
+
Next, we need to create a collection of cards for our player. We want to create the card library in ''SinglePlayerCCGKit/GameData/Collections''. We do this by right-clicking in the Project window and choosing ''Create/Single-Player CCG Kit/Card Library''. We name it after our player.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step7.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step7.png
Line 47: Line 47:
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step8.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step8.png
  
Now we need to fill the deck with some base cards. For this example we’re just adding the existing cards.
+
Now we need to fill the deck with some base cards. For this example we are just adding the existing cards.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step9.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step9.png
  
Now that we have our Prefab, and a deck, we need to create the Character Template. We want to create the Character Template in “SinglePlayerCCGKit>GameData>Players”. We do this by right clicking in the folder and choosing Create> Single-Player CCG Kit>Player. We again label it after our player.
+
Now that we have our prefab and a deck, we need to create the character template. We want to create the template in ''SinglePlayerCCGKit/GameData/Players''. We do this by right-clicking in the Project window and choosing ''Create/Single-Player CCG Kit/Player''. We again name it after our player.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step10.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step10.png
Line 57: Line 57:
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step11.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step11.png
  
Now we can use the editor to fill in our Character Template. Choose the FallenHero Player Data as the asset. Choose our FallenHero Prefab for the prefab. Choose our FallenHeroDeck for the deck. And lastly add Actions as you wish.
+
Now we can use the editor to fill in our character template's data. Choose the ''FallenHero'' template as the asset. Choose the ''FallenHero'' prefab for the prefab. Choose the ''FallenHeroDeck'' for the deck. And lastly add new actions as you wish.
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step12.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step12.png
  
At this point you have a complete player that you can now enter into the Character Template field of the Game Bootstrap. It will now be active in the game!
+
At this point, you have a complete player that you can now enter into the ''Character Template'' field of the ''Game Bootstrap'' component of the ''Game'' scene. It will now be active in the game!
  
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step13.png
 
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step13.png

Revision as of 02:34, 11 February 2020

How Addressables work in a nutshell

Single-Player CCG Kit uses the Addressable Asset System for dynamically loading its resources. We recommend going over the package documentation to understand the reasoning and benefits of using this system, as opposed to classic Unity systems like the Resources folder.

The kit currently provides two Addressable assets:

  • Wizard (for the player character).
  • Demon (for the enemy character).

As more card effects are developed in future updates, we will provide additional characters with different abilities/AI patterns.

These assets are located in the GameData folder and the Players and Enemies subfolders, respectively.

In order to mark an asset as Addressable, you just need to toggle the Addressable option in the asset's Inspector and provide a name for it. Addressable assets will automatically be added to the Addressable's Default Local Group, so they can be easily accessible by default. Addressable initialization happens in the GameBootstrap script and is done by reference (with the referenced addressable assets being specified in the GameBootstrap's Inspector).

How to add a player character

We start by creating an empty game object in our scene to hold our player character.

step1.png

We name the object for our player; in this example, the name is FallenHero. Inside this empty game object we drag our rigged sprite.

step2.png

We click the Edit Collider button on the Box Collider 2D component to adjust the collider to surround our image correctly.

step3.png

step4.png

With our player looking correct, we need to add the appropriate scripts for our player to function. We add the Convert to Entity, Entity Cache and Player Authoring components. For the Convert to Entity component, make sure it is set to Convert And Inject Game Object.

step5.png

Now that we have the player set up, we can make a prefab by simply dragging it into SinglePlayerCCGKit/Prefabs/Characters.

step6.png

Next, we need to create a collection of cards for our player. We want to create the card library in SinglePlayerCCGKit/GameData/Collections. We do this by right-clicking in the Project window and choosing Create/Single-Player CCG Kit/Card Library. We name it after our player.

step7.png

step8.png

Now we need to fill the deck with some base cards. For this example we are just adding the existing cards.

step9.png

Now that we have our prefab and a deck, we need to create the character template. We want to create the template in SinglePlayerCCGKit/GameData/Players. We do this by right-clicking in the Project window and choosing Create/Single-Player CCG Kit/Player. We again name it after our player.

step10.png

step11.png

Now we can use the editor to fill in our character template's data. Choose the FallenHero template as the asset. Choose the FallenHero prefab for the prefab. Choose the FallenHeroDeck for the deck. And lastly add new actions as you wish.

step12.png

At this point, you have a complete player that you can now enter into the Character Template field of the Game Bootstrap component of the Game scene. It will now be active in the game!

step13.png

step14.png