User Name
Password

Go Back   Planetarion Forums > Planetarion Related Forums > Planetarion Discussions

Reply
Thread Tools Display Modes
Unread 2 Apr 2005, 14:02   #1
Banned
Banned
 
Banned's Avatar
 
Join Date: Jul 2003
Location: ******
Posts: 2,326
Banned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so little
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.
Banned is offline   Reply With Quote
Unread 2 Apr 2005, 15:34   #2
ElvenStar
Registered User
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 12
ElvenStar is an unknown quantity at this point
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.
ElvenStar is offline   Reply With Quote
Unread 2 Apr 2005, 15:46   #3
Banned
Banned
 
Banned's Avatar
 
Join Date: Jul 2003
Location: ******
Posts: 2,326
Banned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so little
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).
Banned is offline   Reply With Quote
Unread 2 Apr 2005, 18:12   #4
Banned
Banned
 
Banned's Avatar
 
Join Date: Jul 2003
Location: ******
Posts: 2,326
Banned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so little
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.
Banned is offline   Reply With Quote
Unread 2 Apr 2005, 20:21   #5
Bashar
Idle Git
 
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
Bashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet society
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.
Bashar is offline   Reply With Quote
Unread 15 Apr 2005, 16:05   #6
Banned
Banned
 
Banned's Avatar
 
Join Date: Jul 2003
Location: ******
Posts: 2,326
Banned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so little
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
Banned is offline   Reply With Quote
Unread 17 Apr 2005, 20:56   #7
noah02
The Original Terran
 
Join Date: May 2003
Location: Afghan atm
Posts: 1,633
noah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond repute
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.
noah02 is offline   Reply With Quote
Unread 18 Apr 2005, 00:27   #8
Banned
Banned
 
Banned's Avatar
 
Join Date: Jul 2003
Location: ******
Posts: 2,326
Banned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so littleBanned contributes so much and asks for so little
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.
Banned is offline   Reply With Quote
Unread 18 Apr 2005, 00:37   #9
noah02
The Original Terran
 
Join Date: May 2003
Location: Afghan atm
Posts: 1,633
noah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond reputenoah02 has a reputation beyond repute
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.
noah02 is offline   Reply With Quote
Unread 19 Jan 2006, 12:50   #10
cisco
B0B's m8
 
cisco's Avatar
 
Join Date: May 2004
Location: Ely, Cambridgeshire
Posts: 62
cisco will become famous soon enoughcisco will become famous soon enough
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
cisco is offline   Reply With Quote
Unread 19 Jan 2006, 22:59   #11
Bashar
Idle Git
 
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
Bashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet society
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....
Bashar is offline   Reply With Quote
Unread 19 Jan 2006, 23:00   #12
Bashar
Idle Git
 
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
Bashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet society
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....
Bashar is offline   Reply With Quote
Unread 19 Jan 2006, 23:02   #13
Bashar
Idle Git
 
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
Bashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet society
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....
Bashar is offline   Reply With Quote
Unread 19 Jan 2006, 23:03   #14
Bashar
Idle Git
 
Join Date: Aug 2001
Location: Wandering
Posts: 1,550
Bashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet societyBashar is a pillar of this Internet society
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....
Bashar is offline   Reply With Quote
Unread 20 Jan 2006, 12:20   #15
Goatsemaster
Just like science!
 
Goatsemaster's Avatar
 
Join Date: Jul 2003
Location: Cabinet of the Glorious Leader
Posts: 158
Goatsemaster is a glorious beacon of lightGoatsemaster is a glorious beacon of lightGoatsemaster is a glorious beacon of lightGoatsemaster is a glorious beacon of lightGoatsemaster is a glorious beacon of light
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
Goatsemaster is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 11:17.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018