|
2 Apr 2005, 14:02
|
#1
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
C++/Techies - Help me fix Blazde's bcalc
As some of you may or may not know, Blazde's bcalc isn't really maintained anymore. However, it has been released to the public.
The code released was originally written for round 11, with only stats updated for round 12. Fortunately the code handles subverting as stealing very gracefully. So much so that for the first 2 weeks of stats development I used a copy of bcalc, it was more than a great help in tweaking
There was a bug in the engine then that may have caught some people off guard. This bug is a tad more serious this round however. Since Vision run a mirror of bcalc I've filed a bug report to their techies, but nothing's been done.
The bug is displayed here. Last round held ships could be subverted. This round they can be stolen. Either way, bcalc is incorrect.
My goals are as follows:
I want to clean up the combat engine. I want to remove all the subversion effects that are no longer applicable. I want to fix totals to reflect that stolen ships are lost. I want a totals column for stealing. I want to fix the EMP/Steal bug.
I'd like to have this done by the end of this week, at which point a patch set can be made available to people running bcalc so they can patch and recompile.
Unfortunately I don't have time to do all this by myself this week. From what I can see almost all the changes that need doing are in combat.cpp.
If you'd prefer to discuss this on IRC, poke me in #pawiki and we can have a go.
|
|
|
2 Apr 2005, 15:34
|
#2
|
Registered User
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 12
|
Re: C++/Techies - Help me fix Blazde's bcalc
i have re-writtern the whole bcalc from the php/c++ code , keeping the original interface ...
it works nice ...
__________________
Whilst We May Not Be The Bigest Of Alliances, We Are More Friendly And More Active Than Most.
|
|
|
2 Apr 2005, 15:46
|
#3
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: C++/Techies - Help me fix Blazde's bcalc
Quote:
Originally Posted by ElvenStar
i have re-writtern the whole bcalc from the php/c++ code , keeping the original interface ...
it works nice ...
|
Works reasonably nice, but a rewrite/reimplentation is a bit silly (from our point of view).
|
|
|
2 Apr 2005, 18:12
|
#4
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: C++/Techies - Help me fix Blazde's bcalc
A patch for combat is available here. Unfortunately I'm not 100% I diffed vs a virgin combat.cpp, so if you get any errors shout out and I'll give it another go.
To apply the patch, cd into your bcalc sourcedir, wget the patch (or copy it in) and do:
Code:
patch -p0 <combat.cpp.patch
Current things that may be a bit weird:
Subverted ships are added to the lost column. I figured this was the right thing to do because the ships are lost and there is currently no total for subbed/stolen ships. Thanks to Ru1s and Kloopy who helped out.
I'd like to take a moment to point out something I mentioned to Ru1s earlier on IRC:
Almost all of what alliance techies do duplicates eachother's work. As far as I can see, there are very few techies who have original and good ideas. I think it's a pity and I think the generally slow progression in alliance tech has a lot to do with this. A lot of alliances assume they're best off by keeping their particular clone of Arbiter, a system developed 5 years ago, private. You're wrong.
|
|
|
2 Apr 2005, 20:21
|
#5
|
Idle Git
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
|
Re: C++/Techies - Help me fix Blazde's bcalc
nice one jester! Sorry I wasn't able to be more help, I really should have put a copy of the updated one up last round, then you wouldn't have had to fix it, but instead, no, I lost it!
Muppet.
|
|
|
15 Apr 2005, 16:05
|
#6
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: C++/Techies - Help me fix Blazde's bcalc
Here's a patch to fix the comma parsing bug in bcalc. The parsing bug was introduced with the , seperator for thousands. It's currently fixed in Vision's install of bcalc (though with slightly different code). Altor pointed this one out and wrote the original patch.
Get the patch here. Applying it is quite similar to the last one:
Code:
patch -p0<bcalc.cpp.patch
|
|
|
17 Apr 2005, 20:56
|
#7
|
The Original Terran
Join Date: May 2003
Location: Afghan atm
Posts: 1,633
|
Re: C++/Techies - Help me fix Blazde's bcalc
i had an encounter with the calc the other day were there was no sk but constructions still died?
Can that be fixed?
__________________
introduction-Gramma
The following is a list of problems found in various places throughout the manual and game. We love you Noah!
Written by Kloopy Wed Mar 16 22:06:43 2005
Retired just for a bit....
Proud to have been 1up, SiN, Wolfpack, Bluetuba and the leader of ARK.
|
|
|
18 Apr 2005, 00:27
|
#8
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: C++/Techies - Help me fix Blazde's bcalc
Quote:
Originally Posted by noah02
i had an encounter with the calc the other day were there was no sk but constructions still died?
Can that be fixed?
|
Save the calc, gimme the url (feel free to PM) and I'll have a look at it.
|
|
|
18 Apr 2005, 00:37
|
#9
|
The Original Terran
Join Date: May 2003
Location: Afghan atm
Posts: 1,633
|
Re: C++/Techies - Help me fix Blazde's bcalc
it was a week ago since i had it like.
But will try and find it but the attacker was an xan if that helps.
__________________
introduction-Gramma
The following is a list of problems found in various places throughout the manual and game. We love you Noah!
Written by Kloopy Wed Mar 16 22:06:43 2005
Retired just for a bit....
Proud to have been 1up, SiN, Wolfpack, Bluetuba and the leader of ARK.
|
|
|
19 Jan 2006, 12:50
|
#10
|
B0B's m8
Join Date: May 2004
Location: Ely, Cambridgeshire
Posts: 62
|
Re: C++/Techies - Help me fix Blazde's bcalc
So did anyone finish the update to the calc?
__________________
Heroes Die And Legends Fall, But Angels Are Forever
|
|
|
19 Jan 2006, 22:59
|
#11
|
Idle Git
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
|
Re: C++/Techies - Help me fix Blazde's bcalc
I fixed the subvert/emp problem a few rounds ago, and thought I'd lost the code. Either way, this line I think is the bit that says that excludes EMP'd ships from being stolen(subverted):
newShipsSubverted = (unsigned int)(subCount[(side == tCombatSide: efender) ? tCombatSide::Attacker : tCombatSide: efender][_class] * ((double)((kickingShips[side][shipType] + heldShips[side][shipType])) / (double)survivingNonSubvertedShipsInClass)) / Stats.Ships[shipType].Armour;
I might have edited that though, don't remember. The original comment above that line is:
// As does subvert (I think)
Search for that and I am 99% certain from memory that you have the line causing the EMP not being stolen problem.
__________________
Here we go again....
|
|
|
19 Jan 2006, 23:00
|
#12
|
Idle Git
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
|
Re: C++/Techies - Help me fix Blazde's bcalc
Oh, that whole section deals with all those sorts of rules btw.
__________________
Here we go again....
|
|
|
19 Jan 2006, 23:02
|
#13
|
Idle Git
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
|
Re: C++/Techies - Help me fix Blazde's bcalc
Oh, also, I never bothered updating it to stop subversion happening, I didn't see the need as it never applied to pods and all steal ships fire after everything else.
__________________
Here we go again....
|
|
|
19 Jan 2006, 23:03
|
#14
|
Idle Git
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
|
Re: C++/Techies - Help me fix Blazde's bcalc
And finally, I might still have code I updated, will need to test it when I get time, which is not any time in the near future, but that should offer some pointers to anyone else fancying a go. There are a few bits elsewhere to change, but I can't remember them off the top of my head, it's a long time ago I did it, possibly even long before this thread was started
__________________
Here we go again....
|
|
|
20 Jan 2006, 12:20
|
#15
|
Just like science!
Join Date: Jul 2003
Location: Cabinet of the Glorious Leader
Posts: 158
|
Re: C++/Techies - Help me fix Blazde's bcalc
Quote:
Originally Posted by Bashar
I fixed the subvert/emp problem a few rounds ago, and thought I'd lost the code. Either way, this line I think is the bit that says that excludes EMP'd ships from being stolen(subverted):
newShipsSubverted = (unsigned int)(subCount[(side == tCombatSide: efender) ? tCombatSide::Attacker : tCombatSide: efender][_class] * ((double)((kickingShips[side][shipType] + heldShips[side][shipType])) / (double)survivingNonSubvertedShipsInClass)) / Stats.Ships[shipType].Armour;
I might have edited that though, don't remember. The original comment above that line is:
// As does subvert (I think)
Search for that and I am 99% certain from memory that you have the line causing the EMP not being stolen problem.
|
Or you could just use the patch I posted halfway through the thread that is tried and tested (on, among others, vision's calc (iirc)).
__________________
Injelititis - Incompetance and jealousy interacting according to the formula I^3J^5
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
|
All times are GMT +1. The time now is 08:09.
| |