Difference between revisions of "Single Player CCG Kit Manual"

From gamevanilla wiki
Jump to: navigation, search
(How to add a player character)
Line 60: Line 60:
  
 
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'' 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/step14.png
 +
 +
= How to add an enemy character =
 +
 +
We start by creating an empty game object in our scene to hold our enemy character.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step1.png
 +
 +
We name the object for our enemy; in this example, the name is ''ArcaneCrystal''. Inside this empty game object we drag our rigged sprite.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step2.png
 +
 +
We click the ''Edit Collider'' button on the Box Collider 2D component to adjust the collider to surround our image correctly.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step3.png
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step4.png
 +
 +
With our enemy looking correct, we need to add the appropriate scripts for our enemy to function. We add the ''Convert to Entity'', ''Entity Cache'' and ''Enemy 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-enemy/step5.png
 +
 +
Now that we have the enemy set up, we can make a prefab by simply dragging it into ''SinglePlayerCCGKit/Prefabs/Characters''.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step6.png
 +
 +
Now that we have our prefab and a deck, we need to create the enemy template. We want to create the template in ''SinglePlayerCCGKit/GameData/Enemies''. We do this by right-clicking in the Project window and choosing ''Create/Single-Player CCG Kit/Enemy''. We again name it after our enemy.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step10.png
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/step11.png
 +
 +
Now we can use the editor to fill in our character template's data. Choose the ''ArcaneCrystal'' template as the asset. Choose the ''ArcaneCrystal'' prefab for the prefab. And lastly add new actions as you wish.
 +
 +
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-enemy/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!
 
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!

Revision as of 01:21, 12 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

How to add an enemy character

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

step1.png

We name the object for our enemy; in this example, the name is ArcaneCrystal. 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 enemy looking correct, we need to add the appropriate scripts for our enemy to function. We add the Convert to Entity, Entity Cache and Enemy 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 enemy set up, we can make a prefab by simply dragging it into SinglePlayerCCGKit/Prefabs/Characters.

step6.png

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

step10.png

step11.png

Now we can use the editor to fill in our character template's data. Choose the ArcaneCrystal template as the asset. Choose the ArcaneCrystal prefab for the prefab. 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