Hi Again, does anyone of you tried to make Card Deck Builder game/prototype?
I want to make one but my experience in this niche is not so good, once i made text blackjack that’s all.
I need pointers about card placeholders, card drag and drop and player card hands.
Well, taking those matters one at a time:
- Placeholders: I’d suggest just scribbling some basic cards in a graphics program, and using those until you’re ready to add more-serious art. They don’t have to be pretty, they just have to show that the code is working, and doing what you want.
- Drag-and-drop: There are a few potential ways to go about this, I think.
- For two ideas:
- If the game is strictly 2D, with no perspective at all, then you could perhaps use DirectGUI. The “bind” functions might be useful for detecting the mouse being within a drop-target. This might be a little fiddly, however.
- Perhaps the most universal approach is to employ Panda’s built-in collision system. Specifically, rays tested against collision-boxes might tell what the player is pointing at–and thus from what element to start a drag, or to what element to drop an item.
- Either way, the rest is just responding to the relevant events/cases, likely storing a “current drag-and-drop item” to move in an update-task.
- For two ideas:
- Player card-hands: At its simplest, this seems like it might just be a Python-list of cards, the visual elements of which are just reparented to a node at the bottom of the screen and fanned out.
Thanks for info
By Placeholders i literally mean places that card take, kinda magnetic place that card stick to
(this is made to drag and drop cards around a table on specific places or NPC or card on card,
and use logic depending on place)
Like Slay the Spire, Stacklands, Monster Train.
And yes i want to use 3D, i have idea how to use bullet ghost colliders but i am sure
there is more simple way.
“current drag-and-drop item” to move in an update-task" - this is good, i like it.
Main problem is Player hand is 6 cards (models) that looks like fan with all effects of shaffle, take last card, take middle card and collapse all card together, and i have no idea how to do that)
Something like this ue5 Roguelike Deckbuilder Toolkit, but more versatile to use it in different card games.
I am also sorry all my posts look kinda like abstract questions, that how my brain works.
Hey there.
I once made a simple multiplayer card game, it doesn’t contain all the features you’re looking for but may give you an idea for some parts a card game contains.
In addition, regarding card placing in player hands (the visual part) and drag-and-drop here are a few ideas which don’t require collision solids and also work with pretty much any number of cards.
For placeholders, you could just define a root point of your hand. Then from there on calculate the distance from the center depending on the amount of cards in the players hand. I’d start with a straight line and once that is good, you can add tilting and shifting cards to make it look round as if they are held by hands.
You can also add intervals to make them move smoothly to their places and also for highlighting or picking cards.
As for the picking itself without adding special collision solids, I’d recommend a very simple shader which you can find here:
With that, you just tag your cards and can pick them however they look and wherever they are. It’s also much faster than using the built in collision systems.
Once a card is picked, just mark it as dragged and move it with the mouse pointer. There should even be a sample in Panda3Ds manual describing picking and dragging objects.
Then, regarding the drop part, you could simply check the X-position of the card against the other cards in your hands for moving them within your hand and the Y or Z position depending on your orientation for activating that card or putting that card on the table or whatever else you’d like to with it. Afterwards just run a function to reposition the cards left in the players hand, which could be the same as for initial filling the players hand.
If you need more details on any of those parts or samples for things like intervals or drag and dropping 3D objects, just let me know.
Thank you! i definitely look into it.
I run net card sample you provide lit looks interesting, is there some winning rules or conditions?
i just press on all that OS stats and one of “me” win =)
I still trying to understand how to make card hand “fan”
something like six cube models (model.setScale(1, 0.2, 2) and you can drag and sort all of them
inside the hand fan, mouse click on card will put it on game table (or you can drag it manually)
to table center, Npc to process game logic.
Same time card from deck pile will go to empty place inside cad fan, or to last place in card fan with fan collapsing at same time.
It seems that it would be huge pile of posInterval’s, LerpPosInterval’s and `Sequence.
The rules of my net card sample follow those of top trumps (Top Trumps - Wikipedia) you select a value of those provided and hope, that your value is better than the opponents one.
As for point two, I tried to describe everything. You probably don’t need that many intervals since most of them would be the same with just slightly different values. That means, you may only need a function that creates an interval sequence that moves the card from A to B which can be used for collapsing the fan, creating it and put cards on the table.
The drag and drop may not need intervals since you “attach” the card to the pointer, except you want fancy delayed drag movements or let the other cards make way for the currently dragged card to highlight where it would be placed at.
It seems that Wolf is giving you good advice, so I won’t add much. Just a few responses:
Ah, I see! Thank you for clarifying!
(To explain my confusion: Usually the word “placeholder” means “a basic version of a thing used until the real thing is available”. Like simple art being used while making a prototype, before high-quality art has been made.)
If you’re going to use colliders, I’d probably just use those colliders as the “places” for the cards, with cards dropped onto them being parented to those colliders.
If you’re going to use Wolf’s approach to picking cards, you could perhaps do the same for your “places”, each each having its own colour for picking.
Wolf has already provided an alternative to using colliders at all, but even if you do want to use colliders, I wouldn’t recommend using Bullet for this purpose!
(Unless you’re already using it for something else in the project–and even then I’d consider doing something different for this feature.)
Instead, if you’re going to use colliders for this, I’d recommend using Panda’s built-in collision system.
In short, it’s much better suited to the task than Bullet, I feel (Bullet being more geared towards physics), and I’d argue simpler to use.