Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » some questions about coding
Re: some questions about coding Tue, 21 February 2006 14:04 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
A question about XML name...
Most of things are consistent ... Deflection is named "Deflection", Accuracy is named "Accuracy" but Cloaking is named "Cloak" ... any reason?

Hmm ... the Component seems to be pretty complete thing only that ram scoop flag seems missing (needed for "ships with ram scoops receive 125% mine hit damage" rule).
Oh ... it is in XML as EngineType ... Smile


[Updated on: Tue, 21 February 2006 23:28]

Report message to a moderator

Re: some questions about coding Tue, 21 February 2006 21:51 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
LEit wrote on Tue, 21 February 2006 19:31

Battle.cpp is still very preliminary.

But, the 1/500 min damage thing is something that should be fixed. There is no reason to keep it (other then to abuse a bug) and keeping it would require more work then getting rid of it.



Fine by me. I had the hazy feeling it was some drawback of the engine itself, but I've recently read about it being just a "stopgap" of some kind. So, by all means, squash it. Smile

I think I'll be making a serious attempt at getting the thing to compile and run on my good machine and see what a few pokes do... Sherlock Rolling Eyes

{I had a look at the AutoHost Client files at Sourceforge. It seems most of the battle simulator is already done! Very Happy
http://cvs.sourceforge.net/viewcvs.py/autohostclient/autohos tclient/src/stars/ahc/plugins/battlesim/
}
They've included the 1/500 min damage, tho. Razz


[Updated on: Wed, 01 March 2006 07:37]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: some questions about coding Fri, 20 October 2006 21:34 Go to previous messageGo to next message
ninja_squirrel is currently offline ninja_squirrel

 
Crewman 1st Class

Messages: 34
Registered: December 2002
Location: Toronto, ON, Canada

Hey, I've ported ConstB's advantage point calculator into Flash, but I am not getting consistent results.

I've never buggered around with C++ compilers before, and the free ones seem to be a pain in the butt for a non C++ guy. Could someone please compile zz.cpp with all of the couts uncommented? I need to see where my results are diverging from his.

If anyone can suggest a good free compiler I can use to compile it myself, that would also be great. Tried Mars, but I can't figure out the STL stuff.

Thanks



The Dopelar Effect:

The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.

Report message to a moderator

Re: some questions about coding Sat, 21 October 2006 04:06 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
ninja_squirrel wrote on Sat, 21 October 2006 04:34


If anyone can suggest a good free compiler I can use to compile it myself, that would also be great. Tried Mars, but I can't figure out the STL stuff.

Depends on platform? Rolling Eyes

Most cross-platformish suggestion is probably to combine platform-specific flavor of gcc + Eclipse for IDE.

For Windows (most widespread platform) download Visual C++ 2005 Express Edition: http://msdn.microsoft.com/vstudio/express/ Nod It got both basic IDE and C++ compiler.
Cool

Report message to a moderator

Re: some questions about coding Sat, 21 October 2006 04:24 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
ninja_squirrel wrote on Sat, 21 October 2006 03:34

Hey, I've ported ConstB's advantage point calculator into Flash, but I am not getting consistent results.

I've never buggered around with C++ compilers before, and the free ones seem to be a pain in the butt for a non C++ guy. Could someone please compile zz.cpp with all of the couts uncommented? I need to see where my results are diverging from his.


You don't strictly need ConstB's code for that. Wink You better directly use Stars! own RaceWizard to test what every minute variation in race design does to end result and compare with yours. Sherlock

You also need to be real careful with how you are inputting actual race values to RW code, as it uses some weird conventions someplaces such as tech cost. Twisted Evil



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: some questions about coding Sat, 21 October 2006 16:24 Go to previous messageGo to next message
ninja_squirrel is currently offline ninja_squirrel

 
Crewman 1st Class

Messages: 34
Registered: December 2002
Location: Toronto, ON, Canada

I could do that, yes. But in that case, all I see is the end result, which is very unhelpful in finding out where my code is broken. ConstB's code has couts to display what it's getting at every step of the calculation, so I can put the same output in my code and see where we diverge.

I don't really need to start testing other races until I can get the default ones to come up right (they don't. not even close)



The Dopelar Effect:

The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.

Report message to a moderator

Re: some questions about coding Sat, 21 October 2006 17:00 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
ninja_squirrel wrote on Sat, 21 October 2006 23:24

I don't really need to start testing other races until I can get the default ones to come up right (they don't. not even close)

If you compile that zz, do not uncomment all couts! It will spam you dead with tons of data. Only planet value is considered about 4000 times during points calculation for one race. Uncomment/comment (and if you need add) couts step by step. Nod

Report message to a moderator

Re: some questions about coding Sat, 21 October 2006 18:26 Go to previous messageGo to next message
ninja_squirrel is currently offline ninja_squirrel

 
Crewman 1st Class

Messages: 34
Registered: December 2002
Location: Toronto, ON, Canada

I just mean the ones for each major step. The whole planet hab calculation only counts as one step.

I've gottten it very close; there was a problem because Flash 8 doesn't have a proper integer data type, so I had to go in and manually round off after every division. The remaining problem might be because rounding is needed within the context of a calculation, rather than needing to round the result.

Current results:

########## Humanoids ##########
Step 1, points = 1650
Step 2, hab points = 1649
Step 3, points = -205
Step 4, points = -205
Step 5, points = -205
Step 6, points = 5
Step 7, points = 71
Step 8, points = 71
Returning final value of 23.6666666666667
adv points: 23 must be: 25
########## Rabbitoids ##########
Step 1, points = 1650
Step 2, hab points = 945
Step 3, points = -121
Step 4, points = 47
Step 5, points = 12
Step 6, points = -28
Step 7, points = 97
Step 8, points = 97
Returning final value of 32.3333333333333
adv points: 32 must be: 32
########## Insectoids ##########
Step 1, points = 1650
Step 2, hab points = 2101
Step 3, points = 337
Step 4, points = 477
Step 5, points = 477
Step 6, points = 1272
Step 7, points = 1296
Step 8, points = 126
Returning final value of 42
adv points: 42 must be: 43
########## Nucleotids ##########
Step 1, points = 1650
Step 2, hab points = 4224
Step 3, points = -990
Step 4, points = -990
Step 5, points = -1590
Step 6, points = -530
Step 7, points = -985
Step 8, points = 25
Returning final value of 8.33333333333333
adv points: 8 must be: 11
########## Silicanoids ##########
Step 1, points = 1650
Step 2, hab points = 11979
Step 3, points = 1757
Step 4, points = 1607
Step 5, points = 185
Step 6, points = 348
Step 7, points = 158
Step 8, points = 28
Returning final value of 9.33333333333333
adv points: 9 must be: 9
########## Antetherals ##########
Step 1, points = 1650
Step 2, hab points = 626
Step 3, points = 3666
Step 4, points = 3946
Step 5, points = 1518
Step 6, points = 1592
Step 7, points = 2103
Step 8, points = 23
Returning final value of 7.66666666666667
adv points: 7 must be: 7



The Dopelar Effect:

The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.

Report message to a moderator

Re: some questions about coding Sun, 22 October 2006 21:05 Go to previous messageGo to next message
ninja_squirrel is currently offline ninja_squirrel

 
Crewman 1st Class

Messages: 34
Registered: December 2002
Location: Toronto, ON, Canada

Someone got me sorted with DevC++, so I was able to debug my planet hab calculations successfully. For the default races, the results are perfect now.

Time to start comparing with the real race wizard now...



The Dopelar Effect:

The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.

Report message to a moderator

Re: some questions about coding Mon, 23 October 2006 04:16 Go to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
ninja_squirrel wrote on Mon, 23 October 2006 03:05

Someone got me sorted with DevC++, so I was able to debug my planet hab calculations successfully. For the default races, the results are perfect now.

Time to start comparing with the real race wizard now...


Great to hear. Nod Reminds me a lot of the trouble I had with my Javascript port (no ints by default either) where I had to explicitly cast to int most calculations. Twisted Evil

Only I did it *before* ConstB had nailed down his own bug crop, Sherlock to help him debugging his code... Hit Computer Took some zen and a steady hand with Stars! own RaceWizard. Whip Cool



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: Summary of Math?
Next Topic: Need web hosting for Race Wizard
Goto Forum:
  


Current Time: Fri May 03 18:20:11 EDT 2024