Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Open Discussion and Help » Stars! Nova 0.4.0 (developmental) Release
Re: Stars! Nova 0.4.0 (developmental) Release Wed, 30 June 2010 13:09 Go to previous messageGo to previous message
sirgwain is currently offline sirgwain

 
Senior Chief Petty Officer

Messages: 86
Registered: March 2004
Location: Tucson
I've finished the Java version. It's taken from the C version. I think my decompiled flash version had some bugs, or my implementation of it did. I have unit tests for this code testing it against Humanoids, Humanoids with all Immune, Rabbitoids and Insectoids. I could do more but I got bored entering in all that data. Smile

Rather than posting the whole thing I put up a couple files on my website:

The RacePointsCalculator class. It has one static method that takes a Race class instance, and returns the advantage points for that race.
http://members.cox.net/ilovestars/racewizard/RacePointsCalcu lator.java

// the Race class, has the planet habitability calc
http://members.cox.net/ilovestars/racewizard/Race.java

// The Hab class, for storing planet and race habitability
http://members.cox.net/ilovestars/racewizard/Hab.java

// The ResearchCost class, used by the race
http://members.cox.net/ilovestars/racewizard/ResearchCost.ja va

// Finally the Consts class used to store constants, in this case just the starting points
http://members.cox.net/ilovestars/racewizard/Consts.java

I've peppered the code with comments, though it could probably use a "overview" type comment on the algorithm. I've also changed the code around a bit to make it more readable. The C version was full of int[3] arrays that I changed to Hab instances.

To convert it to C# you should just need a regex to convert get([A-Z]) to $1. Smile Damn java and it's stupid get/set methods.

It's insanely faster than the Python version. I'm not sure how much of that was Python and how much was the algorithm. I know Python is pretty slow compared to a compiled language, but holy moly. Now I'm not sure if I need a Javascript version for the client or not. The idea of supporting two versions sounds not fun.

Anyway, let me know if you have any questions.


Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stars! Nova - May Update
Next Topic: Stars! Nova 0.4.1 Developmental Release
Goto Forum:
  


Current Time: Sun May 05 12:29:41 EDT 2024