View Single Post
Unread 24 Nov 2008, 16:12   #1
newt
Banned
 
newt's Avatar
 
Join Date: May 2002
Location: Blackburn
Posts: 897
newt has much to be proud ofnewt has much to be proud ofnewt has much to be proud ofnewt has much to be proud ofnewt has much to be proud ofnewt has much to be proud ofnewt has much to be proud ofnewt has much to be proud of
re-write the manual for the combat code!

So! I've wasted weeks now coding a bcalc when I could probably have finished it within a day or two with a decent manual (or an actual working bcalc in existence to test mine against). Indeed, there isn't even a bcalc that can work out any part of a combat correctly. I blame this 100% on the manual (assuming the combat code itself isn't faulty).

Anyway, there's two reasons for me making this thread:
  • To try and get the manual re-written
  • To help any people wanting to make a bcalc

The issues involve ships firing on the same classes in different/same t1/t2/t3 (and ofc in the same init). There are two such issues (describing them using examples):

Issue #1:

Vipers fire t1 and freeze all the de - do scarabs re-freeze these already frozen de ships in their t2, or instead skip their t2 and fire on their t3 target: fr? Similarly for killing: locusts fire t1 against cr, killing them all. Do broadswords re-kill the cr in their t2, or skip to their t3 target instead.

This comes down to "do ships re-kill/re-freeze or don't they?" - good luck finding any info in the manual. I was clueless, as was #support and all current bcalcs. Indeed, LCH assumes ships are not re-killed, but are re-frozen. Bizarre. But thruds assumes ships are re-killed, but are not re-frozen. What the ****? Only xvx used consistent logic, and assumed ships are both re-killed and re-frozen (I'd say this is the correct interpretation of the manual).

What did the battle report say from the beta server? It of course gave out the only combination which makes all the bcalcs incorrect: ships are not re-frozen, and they are not re-killed. Below is a summary:

killing:
http://bcalc.thrud.co.uk/index.php?loadfile=game38999a0
http://bcalc.lch-hq.org/index.php?id...87841226801623
http://bcalc.xvx-hq.net/?id=580213778
http://beta.planetarion.com/show_news.pl?id=2 <-- agrees with lch's

emping:
http://bcalc.thrud.co.uk/index.php?loadfile=game80625a0
http://bcalc.lch-hq.org/index.php?id...15671226843463
xvx agrees with lch's for emp
http://beta.planetarion.com/show_news.pl?id=3 <-- thruds is correct (but not accurate due to randomness!)

Conclusion - no bcalcs work for freezing [see the other long post below], and only LCH's works for killing...... so far.

Issue #2:

Now say you have banshees and clippers firing at mirages (fr) in their t1 - which ship kills first and thus allows the other to fire mostly at their t2/t3 classes? LCH says the banshees kill the fr, allowing the clippers to kill co in their t2. I've only looked into this for killing ships. Thrud/xvx ofc (re: issue #1) say that both clippers and the banshees both kill 10k mirages first, which we know is wrong.

http://bcalc.lch-hq.org/index.php?id...44041227539052

I haven't asked appoco to test this on the beta yet, but clearly its wrong - I doubt the combat code works out which ship fires first by the order it appears in shipstats.txt.

14:12 <+SpacedMonkey> the fr available to shoot at are divided by among the banshee and clipper by value

Finally someone in #support who knwos what he's talking about! (though he isnt 100% sure - but it does seem like the only sensible way that it can be done. Maybe split them up amongst the clippers/banshee by how much damage they do instead of value... appoco needs to test it I think.)

Conclusion - LCH doesn't work for killing any more.... (unless the combat code is completely crap for this scenario).

================

Anyway, hope thats of help to any budding bcalc coders. I'm now so fed up that I'm stopping all my work on it now. Irritating like you would not believe.

And PA-team - please have someone used to the combat code write up a detailed manual on it. The current manual would be acceptable if pa had an inbuilt working bcalc, but since pa relies on external ones who rely on the manual.....!

edit: in hindsight, the two issues are really the same issue ... ish. But much easier to comprehend split into two like this. I think.
edit #2: I didn't look at stealing since I wanted to get my own bcalc working for emping/killing first... chances are there are similar issues there.

edit #3: actual advice for coders (but since I'm quite bad at coding, this will probably be a hinderance for you).

the way to do it is to for-loop through the inits (I'd have separate loops for inits 1-3, 4-20, 20-30 to make it easier but longer ) - then for-loop through the two sides working out losses for each - but only "saving" the losses after you've looped through both ofcourse. Then loop through t1/t2/t3 so you calculate losses in t1 first, and save those to a temporary array (or whatever) so they are not re-killed in t2/t3 and so forth - but can still kill if they happen to have the same init (hence temporary)

Also, It seems, for each t1/t2/t3, you'll need to loop through fi/co/fr/de/cr/bs to find ships targetting those to split them up (re: issue #2) by value (or maybe damage?)

hahahaha, thats attrocious, but i so cant be arsed putting time into thinking up a proper description, so I'll leave it at that.

Last edited by newt; 25 Nov 2008 at 18:28.
newt is offline   Reply With Quote