Page 1 of 1

Card Battle v_0.2 (Updated 1/5/12)

Posted: Thu Jan 05, 2012 8:59 am
by MarekkPie
Card Battle

I've now updated it so that it at least does something other than taking a dump after two clicks. The cards get redrawn after every play, and the enemy has a relatively simple AI that makes an intelligent decision on what to play.

Right now you won't see much of what is going on unless you play it with the console open. Otherwise, the only thing you can see is the cards changing.

Click on a card twice (doesn't have to be a quick double click) in order to play that card. Press space to toggle the hidden cards (this is just to show you what is going on with the wild cards and the enemy hand, will not be in the final game).

How to Play:
You have two cards available to play: an attack card and a defense card. The power of those cards is randomly chosen to be any natural number lower than your current attack/defense stat.

When you have chosen the card to play, they get sent to the stage (currently not visible). If both players played the same card type, i.e. two attacks or two defenses, then the hand gets nullified and the only thing that resolves is the wild cards, which heal/deal direct damage/boost the played card/debuff the played card (visible, but not yet implemented). If the players played opposite card types, then the person who played the card with the highest value, regardless of whether it is an attack or defense card, deals damage to the opposite player equal to the difference between those cards.

The battle ends (NYI) when either player reaches 0 health.

The Scene:
The scene will be where an animated representation of the card game is shown. A player will attack or defend, and react accordingly based on the resolution of the stage. I plan to have 4 different characters to choose from: a goblin, an adventurer, a knight, and a wizard, and all of them will animate in ways that would represent those archetypes well.

As you can see, my art is sub par at best (I think I can handle the cards, but I wouldn't really know how to begin animating a player.) If you would like to help, I'd need quite a few things, but your contribution would help the game tremendously:

There are four player types (goblin, adventurer, knight, and wizard) that all need the several animations:
  • An idle state (while they are waiting for the command);
  • An attack animation;
  • A defend animation;
  • The two above need three subtypes:
  • - A missed animation (for when both players play the same card type, i.e. hide behind shield and peek out, wondering what happened.)
  • - A successful resolution (your attack hits)
  • - A failed resolution (you get hit)
  • A death animation;
  • A victory animation.
I want the overall style to be pixel art. The characters will be viewed from the side at all times, so don't worry about different directions (I know their dominant hands will be switched but whatever). The overall tone of the images needs to be comical. And try and be compact (like FFIII sprites as opposed to like...Final Fight or something.)

To do:
Implement the wild card system
Implement the experience system
Implement the inventory system
Add better art
Give a better representation of what is occuring


Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 9:12 am
by Robin
After a few clicks, I get:
error wrote:Error: [string "states/battle/stage.lua"]:12: slot already filled player
stack traceback:
[C]: in function 'error'
[string "states/battle/stage.lua"]:12: in function 'add'
[string "states/battle/battle.lua"]:152: in function 'playCard'
[string "states/battle/battle.lua"]:254: in function 'mousepressed'
[string "boot.lua"]:1: in function '?'
[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
[C]: in function 'xpcall'

Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 9:14 am
by MarekkPie
MarekkPie wrote:Right now, it just farts after you make a card selection (by double clicking on a card) since I don't have any AI for the NPC player.

Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 5:30 pm
by Robin
Ah, I didn't know you meant erroring by farting. :P

Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 5:51 pm
by MarekkPie
Lol. That's O.K. I usually give things anthropomorphic features when I talk about their faults. "Dies", "farts", "throws up", that sort of thing.

I was thinking about the way in which I'd implement the NPC AI for this, and I've got some idea of how to make a "perfect" playing AI, and now I am having trouble abstracting a way to make it dumb. For example, I want all the goblin characters to be fairly dumb, the knights to be standard, and the wizards to be smart.

What I am thinking about is throwing in a dice roll for every if-else clause that weighs down (makes it more likely) the dumb choice. However, I have a feeling that if I have more than two choices, the abstraction of the AI would make it a bit more difficult.

Here's an example of a simple test

Code: Select all

-- First check the stats of the other player
local dStat = player.att - player.def
local rand = math.random()
if rand < (0.5 + dumbWeight) then
	store(dStat * -1) 	-- Misreads the stats and thinks the smaller
						-- stat is the more powerful one.

Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 8:59 pm
by Ghuntar
Nobody answered Minsc ? o_O ?


Re: Card Battle v_0.1

Posted: Thu Jan 05, 2012 9:02 pm
by MarekkPie
"Camaraderie, adventure, and steel on steel. The stuff of legend! Right, Boo?" (*squeak!)

Re: Card Battle v_0.2 (Updated 1/5/12)

Posted: Fri Jan 06, 2012 5:04 am
by MarekkPie
Updated the first post with a new (working but pretty vacant) build. Also, asking for any artistic help for animating the scene (as explained in the first post).

Re: Card Battle v_0.2 (Updated 1/5/12)

Posted: Fri Jan 06, 2012 10:54 am
by MarekkPie
Here are a few of my attempts at making some pixel art for the placards, as well as some updates for the card attack and defense icons. I'm a little disappointed in the background for the goblin and the portrait for the wizard. Just not that good at fine hair. Maybe I'll make the strands a bit thicker, but I was going for a Gandalf the Grey, and figured that needed to be fine and coarse.

Re: Card Battle v_0.2 (Updated 1/5/12)

Posted: Sun Jan 08, 2012 12:57 am
by MarekkPie
Here's a sample sprite for the adventurer/thief type. I'm considering trying to do the art myself, but I'm still a bit worried about how to animate it without it looking awful.