Search Unity

[Released] CCG Kit: create your own collectible card game with Unity

Discussion in 'Assets and Asset Store' started by gamevanilla, Jan 23, 2016.

  1. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Just to be clear, the included Node.js server is only used for player authentication and data storage functionality. It is optional to use and provided as a reference on how such functionality can be implemented in the context of a CCG. It really has nothing to do with the game networking itself (which is implemented with UNET), so in that regard it has no CCU limits. If you decide to use it, you are responsible for hosting it on a server of your preference which will be able to handle more or less users depending on its capabilities.

    Regarding the games themselves, the kit uses Unity Services' relay servers and matchmaking by default. Which means 20 CCU in the free tier (more if you have Plus or Pro license) and an amount that will depend on your bandwidth usage in the paid tier.

    There is a complete separation between client and server code in the kit and the logic is server-authoritative, which means it can be also used in a dedicated server setup if you want to. In that case, you will need to implement your own matchmaking facilities. But, precisely related to this...

    I just released Master Server Kit, a complete library that allows you to host your UNET-based multiplayer games on a dedicated server. After researching this area for quite some time and realizing there were no readily available solutions, I decided to create my own. I plan to provide more information on how it can be integrated with CCG Kit in the next update, which I hope will be helpful for all the users interested in having a dedicated server setup for their games.
     
  2. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    I can't use register function, so i don't have acccount to login, so what should i do?
     
  3. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    If you want to use the player authentication functionality, you need to setup the included Node.js server first. This functionality is optional, so you are free to use the guest mode instead if you prefer to do so.
     
  4. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When I use the create LAN game function, it will stay at the waiting scene, and not create the game, what's wrong with that?
     
  5. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    The game will not start until a second player joins it, just as it happens with online games.
     
  6. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When i unzip the Server/CCGKitServer.zip file, i always have errors, i don't extract it inside your Unity project, what should i do?
     
  7. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    You are not supposed to extract the contents of the server folder inside your Unity project, but on a different location on your machine. This is explained in the documentation.
     
  8. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    "Connection error.Please check your network. ", I already install node.js server and mongoDB, but it can not connect in the unity
     
  9. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    This means the Node.js server is not properly installed or running on your machine. Please make sure to follow all the steps outlined in the documentation and, if the issue still persists, feel free to contact me via the support email with your invoice number and I will assist you further. :)
     
    Last edited: Oct 21, 2016
  10. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When i finished the register, where is my database to put my account, i want to see it.
    And the Online game, LAN game, it cannot use at present, right?
     
  11. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Robomongo is a good tool for managing the database. Not sure I understand your second question.
     
  12. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    I already can use the online game function and lan game function, so it's not other problem, thanks!
     
  13. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Happy to hear that, you are welcome! :)
     
  14. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    @Spelltwine-Games Hi, I have some questions,
    1. If I host my own server use CCGServerKit there is no CCU I need to pay unity or buy plus/pro plan? and I also have to develop my own matchmaking or not?
    2. What is Master Server Kit? It is for handle matchmaking and Server-auhoritative logic ?
    3. Do I need Master Server Kit for CCG Kit ?
     
  15. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    1. Yes, if you decide not to use Unity Services and host the game on your own dedicated server instead, you will only pay for your own hosting (plus any associated administration/maintenance costs). And yes, you will need to implement your own matchmaking system in that case.

    2. Master Server Kit is a library that is intended to help you host your UNET-based games on a dedicated server. It provides player authentication and storage, a master server with custom matchmaking (you can think of it as a lobby) and other related features like a chat. It is indeed intended to be used with games that have server-authoritative logic, but the functionality it provides is strictly backend-related and assumes you are in charge of the game logic yourself.

    3. You do if you want to host your game on a dedicated server instead of using Unity Services and you do not plan to write your own matchmaking system. The next update of CCG Kit will provide additional information on how it can be integrated with Master Server Kit if you are interested in doing so, but please note it will be an optional thing to do: CCG Kit is already written with a complete separation between client and server code and already works on a dedicated server setup if you write your own matchmaking on top of it.

    I hope this helps!
     
  16. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Hi, I bought your asset.
    When the update for Master Kit will be release?

    If i want to test login, decks, rank, shop, I have to create player server with node.js and mongoDB ?

    Thanks
     
  17. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Thank you for your purchase! :)

    Answering your questions:

    - I am currently working on the next update, so hopefully soon.

    - Yes, because these features require storage in a database in order to be truly useful.
     
  18. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    I not familiar with mongoDB.
    Can I use other database solution ? like MySQL ?
     
  19. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    You certainly can (complete source code for all the components of the kit is included), but you will need to implement it yourself.
     
  20. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When i use the romongod to see the database, i can see the email and name, but don't have password, why?
     
  21. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Because plain passwords should never be stored in a database, for security reasons. The database stores password hashes instead.
     
  22. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Can I use CCGServerKit for player database and still use unet services for handle matchmaking ?
     
  23. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    By CCGServerKit you mean the Node.js server included in CCG Kit? In that case, yes you can; it is independent from Unity Services in that regard. I believe Unity's plan long-term is to also provide facilities for data storage in the cloud, but in the meantime we need to go with a custom solution.
     
    Last edited: Oct 23, 2016
  24. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    I want to import the program into the Android phone to test the game, but i can't use the resister function and login account in the phone, how should i do?
     
  25. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    You will need to deploy the Node.js server to a location accessible from your phone. You can find more information about this in the documentation.
     
  26. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Hi,
    When I open CCG Kit Editor Tab Game Zones and want to add there is Static and Dynamic.
    What is the different of those two ? There is no information in documentation about those two.

    In card rarities, value is drop chance in open pack ?

    If I want to add Image Card, where should i put ?

    I want to change the visual style. Right now I know to change cards in board from DemoServer.cs. but I cannot find script that change cards in hand ?
     
    Last edited: Oct 25, 2016
  27. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When I want to test the LAN Game function between two different computer, i can't success, why? Could like CS game on LAN play?
     
  28. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    You are completely right, sorry about that! I have added an explanation of the difference between static and dynamic game zones to the official documentation.

    That is exactly right.

    In the included demo game, all cards have an 'Image' string attribute containing the name of a sprite located in Demo/Resources with the image you want to use (this sprite is loaded dynamically at runtime).

    You can find more information about how to do this here.
     
  29. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    I will try to reproduce this issue on my end and get back to you. In the meantime, please check your network settings to make sure both computers are indeed on the same network and accessible to each other.
     
  30. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,412
    Hello, can I use your MASTER SERVER KIT with the CCG KIT? Do you offer tutorial for a implementation?
     
  31. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    Yes, i already sure the networking settings both computers. So i don't have the method to solve this problem at present? And then, can you examplain the principle of AI about this singergame? I want to make sure my knowledgement is right.
     
  32. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    That is precisely the goal for the next update: to provide an integration for Master Server Kit in CCG Kit. I still do not know which form this integration will take, as there are several factors to take into consideration from a technical and usability point of view. I will provide additional information here once I have researched all this more.
     
    Last edited: Oct 25, 2016
  33. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    You are indeed right! Thank you for your report. LAN mode works just fine if both the host and the client are on the same machine, which is great for development purposes, but if you want to play between different machines on the same network then you need to add a line of code. I have added an explanation on what exactly needs to be done here. I have just been able to play a game between a Windows machine and a Mac OS machine on the same network successfully this way.

    Regarding the AI, the most important concept to know is that the AI player is just a different type of player that sends and receives exactly the same network messages to and from the server as human players do. So, when you play against the AI in single-player mode, you are actually running a local networked game. This makes it possible to leverage the existing multiplayer architecture in single-player, which is more convenient for development and testing purposes than having a completely independent mode that replicates the multiplayer functionality in just a slightly different way. The base AIPlayer class and the demo-specific DemoAIPlayer class are the ones you want to study for the exact details on how this is implemented.
     
  34. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,412
    Will you update the ccg with more interactivity, animations. e.g. heartstone like?
     
  35. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Yes! I definitely want to do it. The focus so far has been mostly on extending and improving the core features of the kit, but I would like to work on an update specifically devoted to the visual side of things sooner rather than later (hopefully after 0.8 or 0.9).
     
    pushingpandas likes this.
  36. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When I use the LAN game function, i don't need to develop and open the node.js and mongod in the same computer, that i already can use this function. So test the LAN Game function between two different computer, even if they don't have develop server, right? But I add the code into OnJoinLANMatchButtonPressed(), it still failed. Why?
     
  37. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    That is right; you do not need the Node.js server to be running in order to play the demo as it is optional to use. I just played a LAN game between my Windows desktop machine and my Macbook laptop without any trouble. Please make sure your OnJoinLANMatchButtonPressed method looks like this:

    Code (CSharp):
    1. public void OnJoinLANMatchButtonPressed()
    2. {
    3.     GameNetworkManager.Instance.IsSinglePlayer = false;
    4.     GameNetworkManager.Instance.networkAddress = "YOUR_HOST_IP_ADDRESS";
    5.     GameNetworkManager.Instance.StartClient();
    6. }

    Where YOUR_HOST_IP_ADDRESS is the local IP address of the host machine (that is, the machine that created the game). If you are on Windows, you can obtain this information by opening a terminal and running the ipconfig command (you are interested in the IP Address field).
     
  38. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    When i use one computer to create LAN game, and another computer to use join LAN game, it will have unity Unet error connect error:11 and dns connection failed:11001, what it's mean?
     
  39. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Have you replaced YOUR_HOST_IP_ADDRESS with the actual IP adress of your host?
     
  40. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    No, i just add the code what you give me. My two computer have connect to one wifi.
     
  41. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    Can i test the LAN game use one android phone and one computer if they connect to one same wifi?
     
  42. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Please follow the steps that are outlined in the official documentation or in my previous message. YOUR_HOST_IP_ADDRESS is just a placeholder; you need to replace it with the actual IP address of your host machine. The reason behind your error is you are trying to connect to YOUR_HOST_IP_ADDRESS, which of course is not a valid IP address. :)
     
  43. ThomasZhou123

    ThomasZhou123

    Joined:
    Oct 2, 2016
    Posts:
    19
    Yeah, i add the right host the ip address, it can achieve this function between to different computer. But i have one question, i need to add the host ip address into the code that it can join the LAN game. But if i don't know the host address, how should i do? Just like the CS game, it can create one room, and let other computer to connect this room, how they do that?
     
  44. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    In order to do that, you may want to look at the NetworkDiscovery component. You can find a sample project here.
     
  45. peca92sk

    peca92sk

    Joined:
    Feb 24, 2016
    Posts:
    29
    Hello everyone,
    I see that the move action is implemented and I am very happy about that. Looking at its possibility I came up with a few ideas, that could make the best use of move action and zones :

    1. Make "move" a target card action ( have only a 'to zone' because the ''zone from'' will be its current zone )
    2. Create token in specific zone
    3. As I see you are working on maximum number of cards, I think it should be maximum cards in a zone based on card type

    Looking forward to hear opinions of community and of course Davids.
     
  46. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Thank you for your suggestions! I will implement these features in the upcoming updates, as I definitely agree with you in that they are useful additions to the existing functionality.
     
    peca92sk likes this.
  47. nikilin

    nikilin

    Joined:
    Jun 29, 2015
    Posts:
    1
    Hi,

    I have seen what the CCG kit can through documentation and skimming through a number of youtube movies, but what I would love to hear from you is maybe some input if there is support to cover the following concepts:

    I'm an okay programmer, but I have never created a game with Unity. I have created a paper CCG but would love to program this as a project to use as a sandbox for prototyping.

    - Say I would like to create a card that I can't cover with the current provided card effects. EG. say I would love a card that says "After the current turn you gain an extra turn". Can I than write/create my own effect so that I can apply this to one (or multiple cards)? If so: would I need to handle the server side code for checking that supports the authoritative server aspects? Or would there be a way to program this one off effects directly onto a card and if yes: how to deal with server logic?

    - I have not seen any support for activated abilities and can cards have multiple abilities (same about static effects)? My CCG works more with a concept of using abilities on objects and would love to hear if I can manage abilities like cards through an interface of joining effects...

    - What if I wanted to create a rather complex new phase/turn with custom logic/steps/requirements/choices from the player/game? How would I go about it.

    - My game utilises a concept of rows where objects can move in between (for tactical reasons), this sometimes would need to be checked against game logic (has this object already moved... is the destination zone full). Can this be implemented by me if I would want to?

    - Is there support for "do 5 damage to object foo, if foo is of type bar, than deal 5 damage more".

    - Can cards be attached to an object (like an aura) and similar: can effects change the type or status of an object (like: "target creature can not attack" next turn)

    Sorry if some of the questions are in the kit and I overlooked it, but would love to hear some input.
     
    Last edited: Nov 14, 2016
  48. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Thank you for your interest! It is highly recommended that you have a fundamental knowledge of programming in order to get the most out of the kit.

    The kit includes the complete source code of all its components, so you can always create your own effects (including the server-side code). New updates usually include new effects based on user feedback when they are generally useful and not too tied to the specific mechanics of a particular game.

    Cards can have any number of effects. Activated abilities are currently not available.

    There is a base Server class that manages the turn sequence. You can create a subclass of this class with the functionality specific to your game. This is something that is done throughout the entire kit and you can take the included demo as a reference: the core library is kept as simple and generally useful as possible and the game-specific functionality is written in subclasses or specified in the game's configuration data (which is defined via the accompanying visual editor).

    You would need to implement such functionality yourself.

    Yes. Conditions for the target/s of a card effect can be specified in the visual editor.

    Not currently.

    No worries at all! Happy to answer and I hope this helps. :)

    Both activated abilities and attachments are features I would like to tackle in the future. They are simple enough to implement in the context of a single game, so you can always do that yourself, but when it comes to being available in the kit more research needs to be done first so that they are useful in a variety of contexts.
     
  49. imamizer

    imamizer

    Joined:
    Mar 7, 2011
    Posts:
    20
    this is amazing kit. codes are really clean and stable. you did really well on this kit. i can say it is totally worth every penny.

    i know this is just a kit and some suggestions below must be done by customer but i m going to put here to give ideas if you are willing to improve it;

    - heal mechanism is working like defense/hp buff. it should heal lacking amount off maximum hp i suppose.
    - multiple effects are not working such as +2/+2 spell card.
    - 'heal' effect would be nice. there are only 2 effects exist that heals only player or heal creature. you cant create a spell that heals target (player or creature)
    - mana modification effect can be nice to create mana cards/spells.
    - taunt effect maybe?
    - default deck is not updating if you are just playing offline against bot. you must edit your DefaultDeck.txt and erase your registry entry (CCGKitv07_DefaultDeck) to let game create new registry with DefaultDeck.txt. just saying if anyone like me experience that.

    after all this is really good kit and i found it best kit i've seen so far that can get you to have your own complete game quick.
     
  50. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    956
    Thank you for your kind words, imamizer! :)

    Excellent suggestions, thank you! I like all of them. Noted for future updates.

    Effects such as +2/+2 actually work with targets other than "target creature". I plan to simplify the targeting system in the future in order to make such scenarios easier to handle. Mana modification effects should be possible to do already.

    This is definitely inconvenient. I plan to find a better way to handle this.
     
unityunity