Mischiefblog
I make apps for other people

CombatSim-0.3.0

Posted by Chris Jones
On June 22nd, 2007 at 15:41

Permalink | Trackback | Links In |

Comments (2) |
Posted in Design Journal, Java

CombatSim version 0.3.0 is now available. This is still considered alpha quality, although it has undergone some testing.

Download CombatSim-0.3.0.zip now!

Changes:

  • Various logic fixes
  • Actors are now internally stored as a dynamic data structure, so future versions will allow the user to specify complex arrangements, including friends or allies
  • Actors have a very basic aggro mechanism for determining who to attach and when
  • The combat core is now invoked externally and does not require a separate thread or real time clock; callers specify what time the core is invoked, so attacks in the past or using an accelerated clock can be run
  • A basic metrics system (including sums and histogram data) is integrated to the combat core and simulator for reporting
  • Reporting is dynamic for the number of actors, including graphical, table, and CSV reports
  • Problems with excessively long combat rounds in random actor testing have mostly been resolved: actors could have unrealistic or out of balance stats which caused cases of exceptionally high hit points coupled with very low damage or change to hit
  • Random combat order for actors can’t be overridden at this time
  • Combat rounds may not exceed 5000; the metrics take up too much room in the Java heap and can cause an out of memory error (I didn’t increase heap size in the launcher script)

Instructions for use:

  1. If you’ve been using an old version of CombatSim, remove your combatsim.settings file
  2. Download CombatSim-0.3.0.zip
  3. Unzip CombatSim-0.3.0.zip
  4. On a Windows box, double-click CS.bat; on a Linux or OS X box, execute ./CombatSim-0.3.0/CS.sh; on an OS X box, double-click CS.sh
  5. Press the “Fight!” button to simulate combat

I think I’ve spent around 40 or 50 hours on the iterations of this simulator. The end is in sight:

  • Change the UI to allow the user to edit arbitrary numbers of actors
  • Change the UI and default actor load to include more than one skill
  • Implement the method on the actor to choose the appropriate skill in combat
  • Add Focus as an attribute to the actor to guide skill use
  • Consider how to allow new combat rules to be plugged-in without recompiling the program

2 Responses to “CombatSim-0.3.0”

  1. Eviljoe Says:

    I guess you don’t play on a PVP server…that kind of thing happens quite frequently…last night I was in zangarmarsh with my 64 priest and a 70 hunter kept picking off peeps as they landed. I was able to kill them once.

  2. C.J. Says:

    You broke it!!!

    Mayhap better error reporting is in order…?

    $ ./CS.sh
    Exception in thread “main” java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    at java.awt.Font.tk(libgcj.so.70)
    at java.awt.Font.getPeerFromToolkit(libgcj.so.70)
    at java.awt.Font.(libgcj.so.70)
    at javax.swing.plaf.FontUIResource.(libgcj.so.70)
    at javax.swing.plaf.metal.DefaultMetalTheme.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.(libgcj.so.70)
    at javax.swing.UIManager.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at javax.swing.UIManager.getUI(libgcj.so.70)
    at javax.swing.text.JTextComponent.updateUI(libgcj.so.70)
    at javax.swing.text.JTextComponent.(libgcj.so.70)
    at javax.swing.JTextField.(libgcj.so.70)
    at javax.swing.JTextField.(libgcj.so.70)
    at com.mischiefbox.combat.CombatSim.(CombatSim.java:104)
    at com.mischiefbox.combat.CombatSim.main(CombatSim.java:524)
    Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
    at java.lang.Runtime._load(libgcj.so.70)
    at java.lang.Runtime.loadLibrary(libgcj.so.70)
    at java.lang.System.loadLibrary(libgcj.so.70)
    at gnu.java.awt.peer.gtk.GtkToolkit.(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.forName(libgcj.so.70)
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    …18 more