CCG Toolkit | Multiplayer Card Game Framework

Sure enough, directing the complete node to damaging the player is what fixed the issue and no false branch is needed. Thanks!
As for the graveyard, it seems to happen everytime a card is sent to the graveyard, even though both graveyard references are set on the map. Nothing in the GameState has been changed from default as far as I can tell.

Here is another issue I am running into: Friend connects via dedicated server, but it does not give us the correct view, instead he is put into some sort of spectator mode with no overhead camera view. 2nd player camera is set so I am really confused as to what the issue is.

Does anyone know how to fix this? It’s frustrating, for some reason all these blueprints have issues and I didn’t even edit them.

As soon as Unreal lets me upload the image, I will. But it looks like this:

One or more blueprints has an unresolved compiler error, are you sure you
want to Play in Editor?
CardGamePlayerController
CardGameState
3DCard
CardGameAIController
Graveyard
Card_FunctionLibrary
etc
etc

Did you change an Enum that is read by all of these such as Card type?

O I did, is that what causes the error?

Most likely, you’ll have to go into all the templates because they wont be reading your new enums if you deleted any. Instead they will read as none and it will spit our errors. Closely inspect them and make the changes and then PIE should work.

I wasn’t able to reproduce the issue with the graveyard on my end, so my suggestion would be to add prints in the game state’s graveyard related functions to see if they are being called.

This is due to an invalid/ no player controller assigned to the player. The engine will essentially spawn a default player controller and camera at the center of the map if they are not initiated properly. Could be due to a number of reasons, but some of the most common questions:

  1. Are you using any plugins within your project?
  2. Are you incorrectly using any multicast events in your Player controllers?

This usually occurs in the editor due to some multiplayer limitations, but if this happens from a built project .exe then there may be other things at play. Feel free to send a support email to if you want to go into more project specific details of changes you have made and which could cause something like this to occur.

Looks like you have hit one of the fun engine bugs.

Did you edit the card struct or a sub-struct of the card struct in any way? The way to get things compiling again you will need to remove the struct you had edited from the card struct and compile. Then, re-add the struct back to the card struct and fix up all the link errors throughout the toolkit. This is unfortunately out of my hands and I have spoken to several people to try and get this fixed ASAP but it appears to be pushed back.

You can find more information about this issue here: Modifying a struct involved in another struct breaks all functionnalites surrounding it - Programming & Scripting - Epic Developer Community Forums

The current “fix” release is set to UE4.18. Issue link (Please Vote!): Unreal Engine Issues and Bug Tracker (UE-40050)

Summer Sale

CCG Toolkit
** 50% OFF!**
CCG Toolkit in Blueprints - UE Marketplace

The Summer Sale is now live and you can pick up the CCG Toolkit today with **50% off! **

You have between July 18 - August 1st to pick up the toolkit at the discounted price and start learning, creating, and building your card games now easier then ever.

Happy Dev-ing!

1 Like

I’ve actually managed to get a lot of things fixed and the versatility of the Card Ability blueprints is incredible! That being said I’m running into an issue with the graveyard once more, in which certain cards move to it, and certain cards will stay on the field. Those cards cant be used, but they wont vacate the spot and i’m not sure why. Will try using print strings to see whats up, but maybe you can shed some light in which direction I should be looking at.

Figured it out: If a card doesn’t have an ability(even if you dont want the card to have an ability it just needs something to read out even if it’s none), it won’t move to the graveyard.

We’ll I guess I’m stuck till the fix occurs. Seems to be really annoying issue atm

Glad to hear you got this working and thanks for the feedback!

Cards should automatically start with an empty ability, but nice work on tracking this down. There was a reason for this that I cant recall off the top of my head, but this should be mentioned in the docs. It shouldn’t add any confusion or cause any troubled having the empty ability there.

Let me know if you want more details on how to fix this in the current version. Its a timely process but should be easy enough to follow and fix up the compiler issues. It is definitely a bigger issue then its seen at the moment.

Having some trouble with the AI. I have a card that is set to target players only, and for some reason it never attacks with it. Creatures in my CCG can only target other creatures, but never the main player, but this specific unit type, Turret, is the only thing allowed to directly attack players, and the AI never uses it. It’ll place it down, but getting it to actually attack with it seems impossible.

AI is an interesting beast, and there is a lot of variables that come into play when its making decisions. Would you be able to share some of your card (datatable) setup? There may be some condition thats making it think it cant play, only in certain scenarios.

As mentioned in the documentation, you can enable the debug UI to help track down whether or not the AI actually thinks it can use the card (the card name will be highlighted green in the “Card on Board section”). See what this is saying and we may be able to track it easier from there.

Sure that would be great help!

The issue lied within adding new card types and those not being added to the valid interaction list.
Is there a way to call certain AI profiles for certain levels?

The issue is that because the struct is modified it fails to compiler, likely due to some depenancy issues in the engine.

As for steps:

  1. Create a project backup. This process can disconnect elements of the toolkit temporarily, so you may want to look back at a previous version before any changes are made in case something doesn’t work properly. Keep track of your changes just to make your life easier if you forget any changes made.
  2. Find the element you had modified. For example, if you modified a variable in the “Attack_Struct”, you should remove this (Attack_Struct) from the main card struct and try to recompile your project. Removing this will allow the main struct to compile itself which is the first important step in this process and what had actually broken your project In the first place. This will likely NOT fix your compilation errors around the toolkit as a number of struct references will now be disconnected, but removing this is a good first step.
  3. The next step in this process is to save your project, still broken and all, then close and reopen. This will just make sure your project stays in its state. I have fixed this issue in the past, only for it to break again after closing and reopening. So it see it as important to make sure your changes are saved.
  4. After reopening, You can re-add your struct to the card struct. If you are planning on modifying any more variables I would suggest doing this now so that you don’t have to repeat this process again. If you modify a different struct, do the same thing by removing it, closing then opening and re-adding it to the main struct.
  5. After you have re-added all your new variables and structs back to the main Card_struct, you are now ready to fix the compiler issues. (Close and reopened just to be sure your changes were saved)
  6. Now the timely process. When you hit play, you will see a list of uncompiled BP’s, go through this this one by one and do the following:
  7. Open the blueprint
  8. Compile the blueprint to get a list of errors from the compiler
  9. With this list, go through each link one by one and fix any disconnected variables
  10. You will get to a point where you can compile and it will become successful. Then move onto the next BP in the list.
  11. Intermittently close and reopen the editor to make sure the fixed BP’s are still compiling.
  12. Once all your BPs are fixed, you can now test your game to make sure all the functionality is still working. There will be a few areas that may not work properly, I know there is a struct link in the “Play Card” function in the player controller that doesn’t bring up an error, just reconnect this again.

There are a lot of steps here but this is just to make sure you understand the flow, and once you have that down you should be able to hammer through the rest. Its annoying and timely unfortunately but I hope it gets you back on your feet with the project. Let me know if you hit any issues or gameplay bugs, ill would have likely hit them before so I can direct you if needed, just send over the details of what’s occurring.

Yep, most definitely! In the Card Game AI there is an event call “Event On Possess” which will eventually run a function called “Load AI Personality” this is where you can specify the personality you wish to use. How you go about specifying this per level can be different in many ways but one way would be to add this to the Game mode if its a per game “mode” type of setup your after

  1. In your GameMode class, create a Name variable called AI Personality, set the default personality to “Personality_1”
  2. Create a Child class of your CardGameMode (In the asset browser, right click on the game mode and select “Create Child Blueprint Class”
  3. In this child class you can now override the personality variable. Select the Class defaults panel and set the “AI Personality” variable created to whatever it is you want for this game type.
  4. In the level you want to use this game mode, select the World Settings editor panel, and reset the Game Mode to you new GameMode class.
  5. Last thing, you will then want to go back to your Card Game AI Controller, and Get Game Mode > Cast to CardGameMode, then from the game mode variable get the AI personality variable and plug this into your Load AI Personality function. And all done!

Awesome! I’ve been able to make a lot of progress and will soon have my game up on Steam servers for beta testing. My only question is how to set unlocked cards in the library. I know i can make and break structs but I see no function or way to update the card and add it to their library for the player.

Another issue has just arisen as I was forced to update to the latest version of UE4(4.16 i believe via github) and I am now getting a ton of Null errors relating to widgets.
Almost every error is related to the blueprint widgets and I have turned on Slow Construct in there class settings but it still spits out an error similar to this.


Accessed None trying to read property CardManager

In addition to this, it has become **** near impossible to play cards on the field due to this issue as it very rarely will accept the card placement.

The BPs are getting fixed, which is great! Although I’m not sure what to do here

Do I make a new variable of this? I can’t seem to find a player state snapshot, seems to not be available.

Turning on slow construct fixed the widget issue(had to turn it on for a lot of different widgets), however I am getting a Accessed None error with getting the Card Placement Reference.


[2017.07.26-13.15.04:906][754]LogScript:Warning: Script call stack:
	Function /Game/CCGToolkit/Blueprints/CardGamePlayerController.CardGamePlayerController_C:ExecuteUbergraph_CardGamePlayerController
	Function /Game/CCGToolkit/Blueprints/CardGamePlayerController.CardGamePlayerController_C:ValidateCardPlacement

[2017.07.26-13.15.04:932][755]LogScript:Warning: Accessed None trying to read property CardPlacement_Ref

I’ve done some digging and using print strings I’ve been able to determine that for the most part, all of my cards are failing the “Is Supported Card Type” check when it validates placement. I have no clue why because they are all listed in the CardType enum and the Compile Supported Cards macro. I believe it may have something to do with Collision but I can not be certain.

hats likely happening is the PlayerStateSnapshot is referencing a broken struct(Possibly the same one changed. Or event just the main struct) so you will likely have to remove it from the player state snapshot struct and re-add it like the others. This should then compile for you.

Im going off a hunch here, but if you had come across the struct issue at some point this may be because a card struct link have broken and not be reattached (which then defaults to the default card struct of nothing). In your player controller check your “Play Card” function for any broken card struct links.

This is probably the most common place for something to go wrong when placing cards. As always, throw a print in there to check the card name its checking, this will also tell you if its even receiving the right data to check against.

Please help
how can i create a card that gives +2 attack point to my cards?
And how can i create a summoner card that summons a spesific card ?