CCG Toolkit | Multiplayer Card Game Framework

I actually figured out the problem(I did a lot of digging and print stringing). It’s a bug in the 4.16 version of the engine in which “Hidden” objects return a result for “Get Hit Result Under Cursor” instead of just passing through. The solution to this was very simple, although I am not sure if this will apply to other projects or it may just be mine.

In your 3dCard blueprint, change collisions to NoCollision, then add the following to the event Multicast_PlaceCardOnBoard

http://puu.sh/wVSQu/221c3bca67.jpg

Hey Freezenx

  1. Check out the example “Ability - Increase Turn Points” .This is a simple example of how to modify properties on the cards themselves, but instead you will likely want to point this to its attack rather then turn points.
  2. You can duplicate “Ability - Clone Card” and instead of pointing this to the triggering card name, you can specify the card name you wish to spawn.

Prints are a life-saver!

Thanks for sharing the info and solution. Cant seem to see this on my end, Possibly fixed along with an engine hotfix(?)

Anyway, will keep an eye out. I’m sure It will help some other users if its something they come across!

http://puu.sh/wXt1U/d382ce8d03.jpg

Running into an issue where this is always returning not valid despite the AI Controller reference setting the Valid boolean to true.
This results in a failure of the AI’s health to ever initiate which results in total failure of the AI to make any moves.

Edit: This has been fixed, turns out the Valid condition check in Add Board Player Reference got disconnected somehow(not sure why) and was causing it to always fail.
However, the AI player controller will now no longer recognize any cards in hand. It will run the check, but it will always fail that check and just end the turn instead.

Do you know what check is currently failing? Check the “Validate Card Play Conditions” function in the Card function library. There may have been some things disconnected there aswell if your card struct refs are breaking.

Yeah, i thought I edited the post to reflect that but I guess the unreal forums didn’t pick it up. It’s all fixed now! I’ve got a video i’ll be posting shortly to show people what is capable with your awesome toolkit!

[video]https://youtu.be/S_84esHuu6A[/video]

Yes! It has all compiled and now i can go back to working on my project, thank you!

I think either the AI is afraid of attacking a converted taunt card or its not running at all cause the AI won’t attack a card in the placement for converting taunt. I’m not sure if setting it up as a byte makes it function.
I set taunt to 1 and a card to 1 (goes from 1-255 in set taunt as a byte)

Good guy forums, and glad to hear that was all fixed.

Game is looking great, keep it up!

So the AI used the cards struct to determine its current state and with the change I recommended this would not actually set/save the card struct state. So how to go about this you ask?

In the 3D Card blueprint there is a “Save Card State to Struct” macro which sets different elements of the card and saves this to the struct. Open and link in your card type to the set struct variable node like below…

Keep in mind that because this is a macro you wont be able to call it when the card type has changed, so i would suggest creating a small function which can be called in your 3D card blueprint and instead of the placement setting the type, and have this function set the type and call the macro.

Im not sure if this will fix the issue you were seeing, but it will make sure that other areas which use the struct directly are up to date with the current data.

As for the AI being to scared to attack, can you enable the AI debug UI in the AI Controller and see if the cards on the board can attack (they will be highlighted green during its turn) This may help narrow down whats going on. Check out the Run Interaction Playlist function and add a few prints in there to see if you can narrow down where they are failing to attack. Feel free to send more details/screenshots and i’ll take a look.

Do you have any recommendations on how to do simple Matchmaking. I have a Steam AppID and the steam SDK enabled but i always get errors when finding sessions or trying to join them.

This is always returning with an array length of 0 and I have no clue why.

Do you know if this works over LAN? If so then its likely not able to talk to the subsystem. This can be due to many things, like your network/internet settings, issues connecting to the online subsystem etc but its hard to know of the bat whats going on.

In the Game Instance you should have some events which are fired when Networking/Connection error at times so this may help, but im not sure if this triggers anything with finding sessions.

Otherwise, Your logic looks to be the similar to how I would go about simple matchmaking. I would also check that your Steam subsystem setup is correctly if you havnt done so, just to rule out any issues with editing files around the engine to get this working.

Turns out that the issue lied with the Seamless Travel boolean in the Gamemode class. It was destroying any Steam Session because the map was changing(I am not sure why). Enabling Seamless Travel fixed it.

Having some trouble with changing locked cards to unlocked. I have a custom function that runs after every game.

Everything is successful except for Setting the struct to unlocked. When I go back into the library after a game, the card it chose is not unlocked.
I could really use some guidance here as it’s the next step I need to conquer in my game.

The reason for this is because the data is being set on an instance of the struct, not in the data table itself. Unfortunately this is a limitation with how data tables are created through the engine. Data can only be modified in editor for the default data tables, the unlock variable is only really for testing purposes.

How to go about this… When a card is unlocked you can create a custom function for adding, removing and checking(bool) whether a card has been unlocked. The easiest thing to do would have these functions add the unlocked card name to an array and have this saved locally. You will then be able to get whether or not a card is in the player list and make small modifications to the deck builder/loader to make sure that the cards its displaying and addable are unlocked (In the list) or not.

The Deck builder already has the ability to save out lists of card (decks) so you can look into this if your unsure of how to go about reading and saving data. Let me know if you need more details!

Where in the framework are things like the core game rules stored, decided that setting that up would be a good starting point, and after reading the documentation I’m still unclear as to where in the framework I would be doing that. I’ve got the core idea for how my card game will work, and I am excited to start making that a reality!

I couldn’t do second one. Can you tell me which step i should change?

In the Ability function you will see a function being run called “Setup Card”. This takes and input for the card name (The row name of the card set’s data table) that you can change See attached image for the example, and let me know if you run into any more problems!

Thank you for help!
I was a bit hasty xD sorry for that. I did it before your post. I need another help. How can i create a magic card that special for only1 card?
Example: Rasengan skill for naruto card, it will add to “naruto” card +2 attack point? (for naruto only)

Hi,

I’m using your toolkit and i have a problem when i’m trying to load a new level from a Widget button in the Main Menu.

The new level is the template of the 3rd person coming with the engine.

The issue:

The mouse inputs are processed as Touch input; I can move my character with the keyboard (WASD keys) but the mouse does not move the camera (Left click triggers the Jump function)

The issue is not reproduced if the new level is loaded in the editor without using the Main Menu (Press Play in the editor while having the new level active)

The issue is not reproduced if i remove the USE MOUSE FOR TOUCH option in the Project Setting.
(Note: Loading the new level by pressing Play as stated before works as expected even if the USE MOUSE FOR TOUCH option is checked).

But removing the USE MOUSE FOR TOUCH option creates an issue in the toolkit; interaction with the widget to initiate a drag and drop no longer works.

Note: Yes, my new level has GameMode override enabled in the World Setting.

I’m planning to release my project on all platforms, so even if i don’t understand why the touch events are triggered while i’m developing/testing on PC, i want to keep the compatibility with touch devices.

So I’ve run into a couple of weird errors with the toolkit from stuff I haven’t changed.

  1. When I try to access a new card set in the editor it freaks out with a row of “Note: Prebuilt Decks may not have been generated” and “Failed to get (the cards name) row”. This is the error from the “Get Card Data” function in the Deck Function library, but I’ve followed the documentation to a T, and my custom set is set up exactly the same as the preexisting ones. I’ve gone through the outlined procedure to add a card set a couple of times now and ended up with the same error both times, so I really have no idea where it could be goign wrong. I’ve included a picture of my GetCardData function so you can double check it’s set up correctly.

  2. When player 2 connects to a game, they get shown as some weird side view camera that they can control and move around, this happens whether I use a dedicated server or not. I’m using 4.16.3 compiled from GitHub, no clue if that makes any difference.

Not a problem at all :slight_smile:

Generally all abilities are setup the same way. For getting specific cards or card types, you will need to filter the cards currently on the board for the player you want to affect, to get the card you are looking for. There are a couple of example abilities which get the cards on the board, and for each of these cards it checks to see if it meets a requirement, whether be the card type, name, health etc. Once you have the reference to this card/cards, you can run another For each loop and run your “Ability” code only on the cards specified. Check out “Get Card from Graveyard” ability, this will take in a card set to check and find the first one in the list.

That is correct. The mouse/ touch input is handled together in most cases.

To change this, apart from the Player controller where you have already tried to make the change, in the “Card Widget” there you will find where the input is set for the cards in the players hand. You should be able to go in here and find where the input is failing and make a few changes to fix this up. The Game Instance also holds the current platform and there is a “Get Current Platform” function which returns the platform and a bool for whether or not its mobile. Let me know if you need more info!

  1. Thanks for the picture, speaks a thousand words! Ok so the first thing. The Debug Data table node is returning before it reaches your new card set because of the “Empty Set” execution flow. If you attach “Row Not Found” from the debug data table node to your new card set this will fix the problem. Oh! And you will also want to move the “Empty Set” down to the bottom of the card set enum. This is when it will return in the current setup.

  2. This is a known engine issue. The issue occurs when starting battles in-editor through the main menu. As mentioned in the documentation, the workaround for this can be 2 things:

    a) Start the battle with the arena already loaded in the editor (skipping the main menu) This will automatically connect both players. You will however need to set the selected card set in the game instance so that you have cards to play with.
    b) Compile your game and run from standalone .exes. This will work both through the menu and ingame and completely skip any issues with the camera setup phase.

Hope this helps!

How can i check the card name ?
For example:
The ability function will continue if card name is “X” , if “X” card is not on board, ability won’t work.
How can i make card name check for ability to continue or stuck?
I am newbie so i don’t know which veriable or function i should use in blueprints :frowning:

THANK you for your kind support.
You are always replying and this is really cool.