.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   Combat Simulator Released! (http://forum.shrapnelgames.com/showthread.php?t=17065)

PDF February 29th, 2004 11:32 PM

Re: Combat Simulator Released!
 
Me again http://forum.shrapnelgames.com/images/icons/tongue.gif
Still won't run, got this when under a MS DOS box :

D:\Strategy\dominions2\doc\CombatSim>java fight militia militia 1000
Exception in thread "main" java.lang.NoClassDefFoundError: fight

Am I the only one unable to make the CombatSim run ? I've java properly installed, but usually only use JavaW apps with a GUI ...

Saber Cherry March 1st, 2004 12:08 AM

Re: Combat Simulator Released!
 
Ah!

Finally!

"Fight" must be capitalized. Most of the stuff is case-insensitive, but any file names ("Fight", "Matrix") must be exact.

Try again and tell me!

PDF March 2nd, 2004 06:56 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Saber Cherry:
Ah!

Finally!

"Fight" must be capitalized. Most of the stuff is case-insensitive, but any file names ("Fight", "Matrix") must be exact.

Try again and tell me!

<font size="2" face="sans-serif, arial, verdana">Nope, whatever the case, FIGHT, fight, Fight or FiGhT give all the same error msg http://forum.shrapnelgames.com/images/icons/icon9.gif

Saber Cherry March 2nd, 2004 07:13 PM

Re: Combat Simulator Released!
 
If you type (from that directory):

dir Fight.class

does it show the file:

Fight.class (10,530 bytes)?

If that file is present, and typing

java Fight militia militia

gives you the error:

Exception in thread "main" java.lang.NoClassDefFoundError: Fight

...then there is some crazy problem that I don't understand, like a corrupt file, or a broken Java installation. Sorry http://forum.shrapnelgames.com/images/icons/icon9.gif

Arryn March 2nd, 2004 07:14 PM

Re: Combat Simulator Released!
 
Grasping at straws with this, but what Version of the JRE are you using?

Saber Cherry March 2nd, 2004 07:25 PM

Re: Combat Simulator Released!
 
Good point. In addition to

dir Fight.class

try typing

java -Version

My development environment:

C:\WINDOWS>java -Version
java Version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

Arryn March 2nd, 2004 07:34 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Saber Cherry:
java Version "1.4.0"
<font size="2" face="sans-serif, arial, verdana">BTW, FYI, latest Version is 1.4.2_03, I'm running 1.4.2_01 .

PDF March 2nd, 2004 08:20 PM

Re: Combat Simulator Released!
 
Mine says :
java Version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

My install is very recent, cause I changed my comp by Christmas (it was a self-gift http://forum.shrapnelgames.com/images/icons/tongue.gif )

PDF March 2nd, 2004 08:24 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Saber Cherry:
If you type (from that directory):

dir Fight.class

does it show the file:

Fight.class (10,530 bytes)?

If that file is present, and typing

java Fight militia militia

gives you the error:

Exception in thread "main" java.lang.NoClassDefFoundError: Fight

...then there is some crazy problem that I don't understand, like a corrupt file, or a broken Java installation. Sorry http://forum.shrapnelgames.com/images/icons/icon9.gif

<font size="2" face="sans-serif, arial, verdana">DIR command gives :


D:\Strategy\dominions2\doc\CombatSim>dir fight.class

Le volume dans le lecteur D est DATA
Le numéro de série du volume est 7FD4-62B6
Répertoire de D:\Strategy\dominions2\doc\CombatSim

FIGHT~1 CLA 10 530 29/02/04 15:25 Fight.class
1 fichier(s) 10 530 octets
0 répertoire(s) 56 423.88 Mo libre

Looks Ok..
So it's an alien/broken Java install ? http://forum.shrapnelgames.com/images/icons/icon9.gif Will reinstall then ..

Saber Cherry March 2nd, 2004 08:31 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by PDF:
Looks Ok..
So it's an alien/broken Java install ? http://forum.shrapnelgames.com/images/icons/icon9.gif Will reinstall then ..

<font size="2" face="sans-serif, arial, verdana">That appears to be the case. I cannot think of any other possibility.

I would try running Scan Disk first, though.

[ March 02, 2004, 18:31: Message edited by: Saber Cherry ]

Goad March 4th, 2004 03:27 PM

Re: Combat Simulator Released!
 
Seems you hardcoded your path separator instead of using Java System.getProperty ("file.separator").

tsk.

Mac people, do this in terminal:

sed "s@Data\\@Data/@g" Data.class > Data.class.new; mv Data.class.new Data.class

Saber Cherry March 4th, 2004 05:07 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Goad:
Seems you hardcoded your path separator instead of using Java System.getProperty ("file.separator").

tsk.

Mac people, do this in terminal:

sed "s@Data\\@Data/@g" Data.class > Data.class.new; mv Data.class.new Data.class

<font size="2" face="sans-serif, arial, verdana">Woah, I'll have to change that. Sorry... http://forum.shrapnelgames.com/images/icons/icon10.gif

I had no idea the path was specified (in Java) in a different way for different OSes.

Arryn March 4th, 2004 05:09 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Saber Cherry:
I had no idea the path was specified (in Java) in a different way for different OSes.
<font size="2" face="sans-serif, arial, verdana">Ouch! Neither did I. Who knew you could learn programming by playing games? http://forum.shrapnelgames.com/images/icons/icon12.gif

Goad March 4th, 2004 05:58 PM

Re: Combat Simulator Released!
 
No problem. It's a great utility by the way. I'm looking forward to using it to optimize my first recruits. Since I can only play to level 34 while I wait for the rowboat to cross the atlantic with the packaged game.

Saber Cherry March 4th, 2004 06:31 PM

Re: Combat Simulator Released!
 
Okay, v41 was uploaded. It correctly grabs file separators. Also, I changed the psuedorandom number generator from Math.Random to a free Java Mersenne Twister, which is supposed to be a much better random number generator, more suitable for Monte Carlo simulation (which this combat sim does).

Norfleet March 4th, 2004 07:51 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Arryn:
Ouch! Neither did I. Who knew you could learn programming by playing games? http://forum.shrapnelgames.com/images/icons/icon12.gif
<font size="2" face="sans-serif, arial, verdana">Me. Everything I know about programming, I learned by from playing games, ripping them apart, and hacking them to be the way *I* want them to.

In Soviet Russia, the game plays you!

mivayan March 5th, 2004 03:40 PM

Re: Combat Simulator Released!
 
Quote:

D:\Strategy\dominions2\doc\CombatSim>dir fight.class

Le volume dans le lecteur D est DATA
Le numéro de série du volume est 7FD4-62B6
Répertoire de D:\Strategy\dominions2\doc\CombatSim

FIGHT~1 CLA 10 530 29/02/04 15:25 Fight.class
1 fichier(s) 10 530 octets
0 répertoire(s) 56 423.88 Mo libre
<font size="2" face="sans-serif, arial, verdana">I am not sure exactly how and why but I have experienced the problem of java not looking for class files in the current directory.

Try this: java -classpath D:\Strategy\dominions2\doc\CombatSim Fight militia militia

Saber Cherry March 5th, 2004 06:17 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by mivayan:
I am not sure exactly how and why but I have experienced the problem of java not looking for class files in the current directory.

Try this: java -classpath D:\Strategy\dominions2\doc\CombatSim Fight militia militia

<font size="2" face="sans-serif, arial, verdana">Thanks a lot for the suggestion!

BTW, from within the correct directory, you could probably type this:

java -cp . Fight militia militia

and get the same result. "." means current directory - it worked for me.

I don't remember how to permanently get it into Java's head that class files are found in the local directory, but I'll post it here if I find out.

Arryn March 5th, 2004 06:34 PM

Re: Combat Simulator Released!
 
Quote:

Originally posted by Saber Cherry:
I don't remember how to permanently get it into Java's head that class files are found in the local directory, but I'll post it here if I find out.
<font size="2" face="sans-serif, arial, verdana">Try setting the CLASSPATH variable at the system level to "." and see if that works.

Saber Cherry February 22nd, 2005 06:24 PM

Re: Combat Simulator Released!
 
Been a while, but a new version of the combat simulator is out - you can grab it here:

http://www.geocities.com/saber_marionette_cherry/

It fixes a bug that has made attack-defense rolls wrong since the last version :cry:

Sorry about that! It was a result of a speed-up tweak, and I don't know how it slipped by my QC, but somebody noticed it and emailed me about it. Unfortunately, I forgot who, but thanks, Mr. Mystery person!

Zooko February 26th, 2005 10:01 PM

Re: Combat Simulator Released!
 
When I run this on Macintosh I get:

MAIN draco:~/Desktop/Combat_Simulator$ java Fight
Exception in thread "main" java.lang.UnsupportedClassVersionError: Fight (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :539)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:251)
at java.net.URLClassLoader.access$100(URLClassLoader. java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 89)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 35)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
MAIN draco:~/Desktop/Combat_Simulator$ java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4)
Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode)
MAIN draco:~/Desktop/Combat_Simulator$ uname -a
Darwin draco.local 7.8.0 Darwin Kernel Version 7.8.0: Wed Dec 22 14:26:17 PST 2004; root:xnu/xnu-517.11.1.obj~1/RELEASE_PPC Power Macintosh powerpc

So much for that whole "Write Once, Run Anywhere" idea. :-/

Saber Cherry February 26th, 2005 10:10 PM

Re: Combat Simulator Released!
 
Quote:

Zooko said:So much for that whole "Write Once, Run Anywhere" idea. :-/

This isn't the first time I had trouble with Macs. Before, I found out that Macs use a different director separator than Windows (Windows uses "\").

However, your problem is not OS-related, I think, but rather the fact that I compiled it in Java 5.0 and you are running it in Java 4.2. 5.0 makes some major changes.

Hopefully, if you go here:
http://java.sun.com/j2se/1.5.0/download.jsp

And click on this link: "Download JRE for Other Platforms"

And install it, it will run.

Edit. P.S. Thanks for posting the complete error message and version information!

Zooko February 26th, 2005 10:20 PM

Re: Combat Simulator Released!
 
Just checked, and there is no JRE 5.0 for Mac listed there.

Zooko February 26th, 2005 10:20 PM

Re: Combat Simulator Released!
 
Why don't you make the source code freely available under the GNU Public License and I'll compile it for the current version of Java on Mac for you.

Saber Cherry February 26th, 2005 10:24 PM

Re: Combat Simulator Released!
 
Ahh... sorry, I didn't realize that. There is a way to compile for compatibility with previous versions, so as soon as I figure that out (it should be somewhere in the sun forums) I'll recompile it for 4.2.

Zooko February 26th, 2005 10:24 PM

Re: Combat Simulator Released!
 
http://developer.apple.com/java/faq/#anchor2

^-- this says Java 1.5.0 will never be ported to Mac OS 10.3. It will only work on Mac OS 10.4, which isn't yet available, and which I would have to pay at least USD 100.00 to buy if I wanted it, which I don't.

Why don't you try rewriting your simulator in Python? Python is the easiest language to learn. I'll bet in a mere three hours you will be happy with the new simulator you've written.

Also, the result will be more portable. &lt;wink&gt;

Saber Cherry February 26th, 2005 11:01 PM

Re: Combat Simulator Released!
 
Quote:

Zooko said:Why don't you try rewriting your simulator in Python? Python is the easiest language to learn. I'll bet in a mere three hours you will be happy with the new simulator you've written.

Hahaha... =)

2 reasons. First, Java is probably much faster, and it already took several days to do that large simulation. Second... it's taken me at least 200 hours to write, test, and debug the simulator so far... I doubt I could port it in 3 http://forum.shrapnelgames.com/images/smilies/happy.gif

Anyway, I recompiled it for Java 1.4.2 (which will, therefore, run under 1.4.2 or higher). Hopefully it will work for you... you can download it here:

http://www.geocities.com/saber_marionette_cherry/

or more specifically, here:

http://www.geocities.com/saber_mario...ulator_142.zip

...although sometimes geocities does not like straight links to files.

Zooko February 26th, 2005 11:30 PM

Re: Combat Simulator Released!
 
It works! Thanks!

Saber Cherry February 27th, 2005 01:26 AM

Re: Combat Simulator Released!
 
You're welcome=)

Evil Dave February 28th, 2005 10:55 PM

Re: Combat Simulator Released!
 
Hail, Saber Cherry!

I gotta question: which bless-9 effects are currently working?

I was looking at the history (in Readme.txt), which mentions that only some were working in v22, but then in v24 flaming weapons and berserking were added -- did that fix the fire and nature bless effects?

Saber Cherry March 1st, 2005 01:48 AM

Re: Combat Simulator Released!
 
Fire, Earth, Air, Water, and Nature work correctly at all levels. Air 4-8 only gives air shield, which has no effect in the emulator (since there are no projectiles), but Air 9 gives shock resistance which sometimes helps (against Spring Hawks, and so forth).

Blood works correctly for levels 4-10 (bonus strength) but the level 9 effect, blood vengance, has not been included yet.

Death does nothing at any level, since fear has no effect in the emulator. However, last I checked, Death-9 just turns the creature into a soulless at death... which is very weak=)

In order to use a blessing in the emulator, you have to create a new unit in UnitTypes.txt. For example, let's say you wanted to test a Paladin with Water-9 and Nature-4 blessing against 10 light infantry. To do that, you would:

1) Open UnitTypes.txt.

2) Find the line that says:

name=MAR_Paladin officialname=XXXXX newname=XXXXX creature=MAR_Paladin weapon=Lance weapon=Broad_Sword weapon=Hoof item=Full_Chain_Mail item=Full_Helmet item=Kite_Shield

...which is the data for that unit. Please note that the "officialname=XXXXX newname=XXXXX" part is unnecessary; and I'll remove it here for clarity.

3) Copy and paste the line, so there are two copies, like this:

name=MAR_Paladin creature=MAR_Paladin weapon=Lance weapon=Broad_Sword weapon=Hoof item=Full_Chain_Mail item=Full_Helmet item=Kite_Shield
name=MAR_Paladin creature=MAR_Paladin weapon=Lance weapon=Broad_Sword weapon=Hoof item=Full_Chain_Mail item=Full_Helmet item=Kite_Shield

4) In one of the second copy, change the the "name=MAR_Paladin" to something else like "name=MAR_Paladin_Water9_Nature4" so it looks like this:

name=MAR_Paladin_Water9_Nature4 creature=MAR_Paladin weapon=Lance weapon=Broad_Sword weapon=Hoof item=Full_Chain_Mail item=Full_Helmet item=Kite_Shield

5) Add whatever blessings you want to the same line, like this:

name=MAR_Paladin_Water9_Nature4 creature=MAR_Paladin weapon=Lance weapon=Broad_Sword weapon=Hoof item=Full_Chain_Mail item=Full_Helmet item=Kite_Shield blessing=Blessed blessing=Water9 blessing=Nature4

Be sure to include "blessing=Blessed" or else it will not get the default +3 morale from being blessed, which is important for berkserk and repel rolls.

6) Save and exit UnitTypes.txt. Now you have the old unit MAR_Paladin and the new unit MAR_Paladin_Water9_Nature4. To see if it worked correctly, run this command:

java Unit MAR_Paladin MAR_Paladin_Water9_Nature4

..and it will print out the stats for the two units so you can compare them. For example, I already put a fire/water blessed flagellant in the data file, so I can do this:

<font class="small">Code:</font><hr /><pre>
C:\Projects\Java\Dominions&gt;java Unit Flagellant Flagellant_Fire9_Water9

Flagellant (Base creature: Flagellant)

HP: 9 Str: 11
Prot: 0 Att: 8
Mrl: 15 Def: 6
Mrst: 10 Prec: 8
Enc: 3 AP: 12

Sacred

Weapons: Flail

Gold: 10 Res: 5

*********************************

Flagellant Fire9 Water9 (Base creature: Flagellant)

HP: 9 Str: 11
Prot: 0 Att: 12
Mrl: 18 Def: 10
Mrst: 10 Prec: 8
Enc: 3 AP: 18

Sacred, Quickness 50, Flaming Weapons 8

Weapons: Flail
Blessings: Blessed, Fire9, Water9

Gold: 10 Res: 5

*********************************</pre><hr />

In order to test the new paladin against 10 light infantry, use it like any other unit:

java Fight MAR_Paladin_Water9_Nature4 10*Light_Inf

Or you can use it in a matrix, or whatever.

Have fun! http://forum.shrapnelgames.com/images/smilies/happy.gif

Evil Dave March 2nd, 2005 02:07 AM

Re: Combat Simulator Released!
 
Thanks! I'd figured most of that out already, but the "Unit" command allowed me to find a typo which was giving me confusing results.


All times are GMT -4. The time now is 01:33 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.