javur: October 2005 Archives

Some Results

| | Comments (0) | TrackBacks (0)

The card game is progressing nicely. I now have some basic game looping and logic working (it's not perfect or 100% corrrect to spec yet.) Currently it's setup with two very simple AIs that play each other. Depending on the cards the AIs can play until they exhaust the deck, which indicates a couple problems: 1) if the deck is exhausted we should reshuffle the discards into a new deck, and 2) either the AI needs to be less careful about hoarding phys points, or the card distribution needs to be tweaked to have less (or less powerful) defense cards. Anyway some unit tests would be good for this thing someday. Current source code is available from darcs at http://dasbistro.com/~sam/card-game. There is no ANT or Make or anything for it. Right now I just use javac's capability of tracking down deps on it's own. Anyway here's a short game log.

Player 1 dealt [Card Drain (Psi) 0 -2 OPPONENT]
Player 2 dealt [Card Shield (Phy) 1 0 SELF]
Player 1 dealt [Card Drain (Phy) -2 0 OPPONENT]
Player 2 dealt [Card Magic Missile (Phy) -4 0 OPPONENT]
Player 1 dealt [Card Heal (Phy) 3 0 SELF]
Player 2 dealt [Card Drain (Psi) 0 -2 OPPONENT]
Player 1 dealt [Card Magic Missile (Phy) -4 0 OPPONENT]
Player 2 dealt [Card Shield (Phy) 1 0 SELF]
Player 1 dealt [Card Drain (Phy) -2 0 OPPONENT]
Player 2 dealt [Card Shield (Psi) 0 1 SELF]
Player 1 dealt [Card Magic Missile (Phy) -4 0 OPPONENT]
Player 2 dealt [Card Heal (Phy) 3 0 SELF]
Player 1:
  Phys: 10
  Psi: 10
  Hand:
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
  Active: null
  Passive: [Card Heal (Phy) 3 0 SELF]
Player 2:
  Phys: 10
  Psi: 10
  Hand:
    [Card Shield (Phy) 1 0 SELF]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Shield (Phy) 1 0 SELF]
    [Card Heal (Phy) 3 0 SELF]
  Active: null
  Passive: [Card Shield (Psi) 0 1 SELF]


Round 0
Player 1:
  Phys: 10
  Psi: 10
  Hand:
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
  Active: null
  Passive: [Card Heal (Phy) 3 0 SELF]
Player 2:
  Phys: 10
  Psi: 10
  Hand:
    [Card Shield (Phy) 1 0 SELF]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Shield (Phy) 1 0 SELF]
    [Card Heal (Phy) 3 0 SELF]
  Active: null
  Passive: [Card Shield (Psi) 0 1 SELF]
[Card Drain (Psi) 0 -2 OPPONENT] played against 2
Player 1 dealt [Card Drain (Psi) 0 -2 OPPONENT]
[Card Magic Missile (Phy) -4 0 OPPONENT] played against 1
Player 2 dealt [Card Drain (Phy) -2 0 OPPONENT]


Round 2
Player 1:
  Phys: 9
  Psi: 10
  Hand:
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Psi) 0 -2 OPPONENT]
  Active: [Card Drain (Psi) 0 -2 OPPONENT]
  Passive: [Card Heal (Phy) 3 0 SELF]
Player 2:
  Phys: 10
  Psi: 9
  Hand:
    [Card Shield (Phy) 1 0 SELF]
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Shield (Phy) 1 0 SELF]
    [Card Heal (Phy) 3 0 SELF]
    [Card Drain (Phy) -2 0 OPPONENT]
  Active: [Card Magic Missile (Phy) -4 0 OPPONENT]
  Passive: [Card Shield (Psi) 0 1 SELF]
[Card Magic Missile (Phy) -4 0 OPPONENT] played against 2
Player 1 dealt [Card Heal (Phy) 3 0 SELF]
[Card Drain (Psi) 0 -2 OPPONENT] played against 1
Player 2 dealt [Card Shield (Psi) 0 1 SELF]


Round 4
Player 1:
  Phys: 12
  Psi: 8
  Hand:
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Heal (Phy) 3 0 SELF]
  Active: [Card Magic Missile (Phy) -4 0 OPPONENT]
  Passive: [Card Heal (Phy) 3 0 SELF]
Player 2:
  Phys: 6
  Psi: 10
  Hand:
    [Card Shield (Phy) 1 0 SELF]
    [Card Shield (Phy) 1 0 SELF]
    [Card Heal (Phy) 3 0 SELF]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Shield (Psi) 0 1 SELF]
  Active: [Card Drain (Psi) 0 -2 OPPONENT]
  Passive: [Card Shield (Psi) 0 1 SELF]
[Card Magic Missile (Phy) -4 0 OPPONENT] played against 2
Player 1 dealt [Card Shield (Psi) 0 1 SELF]
[Card Drain (Phy) -2 0 OPPONENT] played against 1
Player 2 dealt [Card Magic Missile (Phy) -4 0 OPPONENT]


Round 6
Player 1:
  Phys: 13
  Psi: 8
  Hand:
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Drain (Phy) -2 0 OPPONENT]
    [Card Drain (Psi) 0 -2 OPPONENT]
    [Card Heal (Phy) 3 0 SELF]
    [Card Shield (Psi) 0 1 SELF]
  Active: [Card Magic Missile (Phy) -4 0 OPPONENT]
  Passive: [Card Heal (Phy) 3 0 SELF]
Player 2:
  Phys: 2
  Psi: 11
  Hand:
    [Card Shield (Phy) 1 0 SELF]
    [Card Shield (Phy) 1 0 SELF]
    [Card Heal (Phy) 3 0 SELF]
    [Card Shield (Psi) 0 1 SELF]
    [Card Magic Missile (Phy) -4 0 OPPONENT]
  Active: [Card Drain (Phy) -2 0 OPPONENT]
  Passive: [Card Shield (Psi) 0 1 SELF]
[Card Drain (Phy) -2 0 OPPONENT] played against 2
Player 1 dealt [Card Drain (Phy) -2 0 OPPONENT]
The Winner: Player 1

Ha Ha Me + Java

| | Comments (0) | TrackBacks (0)

So in that last post "joopla" was a completely apt typo.


Java Card Game: Part the First

| | Comments (0) | TrackBacks (0)

I am teaching myself a marketable skill. The last marketable skill I learned was Ruby (or Python if you look at what people really want on the job boards) and since most people want Java knowledge with Ruby on Rails that's what I'm now learning. Java.

It's not so much as learning as re-exploring an old cave that you ventured into once when you were a snotty nosed teenager. For a language like Java, where I've seen syntax flown around for years, it's good (for me) to jump in with an idea for something to implement. Either taking a problem from the ACM or the PP list. For Java since I wanted to get a grip on J2EE and all of the joopla that surrounds it, mostly focusing on the web aspects (since that is what most folks want.) Something on the web and useful (to me or maybe others) is what I was thinking. Now what could I do with something that isn't mind-numbingly boring like some sort of of silly business database application, that used things like sessions and databases?

Ok, games can use these things. And they are most definately not boring (most of the time.) My first idea was to take the Sim City clone that has been living in my head for about five years and making it a DHTML web game. I currently have about 2-3 half baked transit simulators implemented in several languages and pages of notes. The real problem with doing this idea was that it is a pretty huge amount of thinking and implementing that I haven't done yet. So that one really is just out (and someday maybe it will be started... I've been messing with Ruby on Rails so maybe I'll do it there.)

Somehow I came onto the idea of a cardgame (it's written on this notepad here with "Java ideas: ... CARDGAME!") It came to me pretty quickly I guess, and I'm not really sure from where. Shannon plays a bit of Magic: The Gathering online so that may have had something to do with it. As I haven't played any incarnation of the multitude of trading card games, the rules for this game are taken from games I know (Lunch Money, City of Heroes, and Munchkin all come to mind when I look at the design), and keeping the rules simple since I have to make a computer do them.

So, the rules and concepts:

  • There are two wizards who are fighting each other (this will possibly be expanded to being there are many wizards figting each other, teaming up, etc.) Each wizard has a certain number of Physical points (or hit points), and Psi points (or magic points.)
  • Each player gets dealt 5 cards to begin.
  • Cards are either offensive or defensive.
  • Each card affects either the player or their opponent's psi and phys attributes.
  • Once a players phys attribute reaches zero game is over and the wizard is dead. When a players psi attribute reaches zero they cannot use magic.
  • Each player has a passive card slot that can hold either an offensive or defensive card which will affect each round of play. The passive slot card can be changed on the players turn and counts as a full round. Placing the card in the slot also causes the new card in the slot to be effected.
  • Each turn the player plays a card and draws a new card.

There are a few wrinkles in this right now. The costs of cards needs to be worked out a little bit, and the initial points allocated to the players. I'll probably have a couple crude AIs play each other to figure this out. Currently I have a barebones Game, Player, and Card classes to play with. Soon a bit of console testing, and then (mood music) crazy web crap.


ha ha javur

| | Comments (0) | TrackBacks (0)

I am totally the best programmer in the world.

import java.io.*;

class Hello {
     public static void main (String args[]) throws IOException
     {
         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
         String name = "";

         System.out.println("What's your name?");
         name = reader.readLine();

         System.out.println("Hello " + name + "!");
     }
}

About this Archive

This page is a archive of entries in the javur category from October 2005.

javur: November 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.

February 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29  

November 2005: Monthly Archives

Pages

Powered by Movable Type 4.1