News:

A forum for users of LackeyCCG

Main Menu

Simple Text-Based Computer CCG Framework

Started by sneaselx, June 16, 2010, 01:37:01 PM

Previous topic - Next topic

sneaselx

Alright, I was bored a while ago, and wrote a text-based CCG framework in python.  Now I just need to make a game to go on top of it. So this is what I have so far:

Players are objects: They have life, magic, etc. Decks are a list of classes. When a card is drawn, it chooses a random class and makes an instant of it, and adds it to the hand. The probability of a card being drawn will be based on weighted averages of a static class value.

What it means: You can potentially have any number of any one card, or go through the entire deck without drawing a particular card.

The card types include units,weapons,spells,abilities,and actions.
-You can play one card per turn, with the exception of actions. Instead of playing a card, you may "attack", which deals weapon depending on your weapon.
-You may play as many actions as you want each turn, but when you play another card, your turn ends. Actions generally cost no magic.
-Spells have special effects. These are methods that are called when activated. The effect is activated and the spell is removed from your hand.
-Units are similar to spells, but instead of using an effect, it places a unit instance in the players list of units. At the end of each turn, an act method is called, performing an effect, usually to deal damage.
-When abilities are played, they are placed in a list inside an ability handler. Each ability has a trigger function and a trigger condition. When the condition is met, the effect is activated. This can be something like blocking damage or negating a spell.
-There is a fairly powerful and flexible "status" system. For example, a spell could inflict poison on an opponent. The player appends a status instance onto its list of status problems. At the end of each turn, the status calls a method performing an effect.
-When a weapon is activated, it equips that weapon to the player. Weapons increase damage, and may have effects when they attack.
-Once per turn, a player may discard a card in their hand in order to generate magic. Some cards have effects that only activate when the card is discarded.
-The game is only hot seat, and the screen is cleared in the terminal after each players turn.
-Currently, loading different decks is only possible by extending the Player class and editing the main file to instantiate that class instead of the default.

Dragoon

So, if I am reading correctly, you are building a program to play said game? Otherwise, I can see it hard to play the game.

The random card draw is not funny. If I include a card in my deck, I want to be sure to draw it! Your system destroys the whole deck-building concept. Anyway, I suggest a flow-like system for card play. I.E. Have certain powerful cards/abilities end the turn, while others allow you to play further. I don't see why my little peasant would end my turn the same as my opponents dragon.

Status should be explained further.

sneaselx

#2
I'm actually building a game to go around a program. The program defines a system that carries out turns, interprets commands, and tells card objects when to use certain abilities.
Theoretically, by changing a few lines of code, you could change the turn phases, define new card types, and change effect timing. The code is kinda messy right now, though.

The random deck thing is more technical limitations than choice. To make a deck of say 40 cards involves keeping track of 40 card instances, plus the two players, plus statuses. I think python is slow enough as it is. It would be possible to implement it, but I am hesitant. I'm hoping that using weighted averages will a simulate it enough. For example, you build a deck with 8 peasants and 2 dragons. 80% of the time you will draw a peasant, 20% of the time you will draw a dragon. Another solution would be acceptable too.

The status system is derived from RPG games. Applying a status is like applying rule changes to the opponent's player. Some example Statuses: Poison, Inaccuracy, Resisting, Rage, etc. They are basically temporary buffs and debuffs on your player.

I actually hadn't thought that much about the turn-end system. I might implement cards with variable action point costs, and the turn ends when you run out of those. Or maybe just say you can use up to all your magic, or end your turn.


I'm hoping to get some good creative ideas about game systems to work with it. It would be fairly simple at this point to implement most ideas, and the advantage of then computer taking care of everything means it can involve more complicated math than most.

VladShadeu

To me it doesn't sound like you're trying to build a CCG at all, rather an RPG in a CCG outfit. An idea to slightly improve the random system would be to hold one variable for each type of card and make that variable go down, either as a percentage or as a whole number. So the deck wouldn't technically have any actual order until you drew a card, but when you drew it you would reduce the chances of drawing it again, which is by far a closer solution to the big thing. Order isn't what we're really asking for, its the chance to have us define the odds.

Can you code in DarkBASIC or Game Maker Language? I could use a guy like you for this project I'm starting up in a few weeks. And I know those aren't big languages but it's what my team is considering at the moment, we're indie dev nuts.

IsDon

I'm thinking about something similar, and the definition "RPG in a CCG outfit" seems like a good one.

I was wondering if the original poster had gone any further, or if anyone is doing something similar, with a computer program running a CCG-like system according to rules, with the potential for interaction coming from players choosing/customizing their deck.

I may have misunderstood, but am hoping I might be thinking about similar things, and thus able to start a conversation amongst similar minds.

Don
have a great day

ani-mayhem

Can it play Ani-Mayhem? That's the ultimate CCG program test.