Page 1 of 2
commodities
Posted: Fri Jul 22, 2011 8:30 am
by Killer Wolf
showing my ignorance, can someone explain this calculation in English please :
Code: Select all
quantity = (2 + (133 & 7) - (3 * -3)) & 255 = (2 + 5 + 9) & 255 = 16
i dunno what a & is or how you get 5 from &ing 133 and 7.
also, since the game code seems (according to Wiki) to limit quantities to 63 for some reason, is there any way to bypass this?
Code: Select all
// if the quantity gets too high it's zeroed
if (quantity > 127) quantity = 0
// limit the quantity to 0..63 units
quantity &= 63
this seems a bit confusing to me. should this not be "if (quantity > 127) quantity = 63"?
ta
Re: commodities
Posted: Fri Jul 22, 2011 8:32 am
by ADCK
& is an
ampersand, it means 'and'
Re: commodities
Posted: Fri Jul 22, 2011 8:33 am
by Killer Wolf
i know what it means in speech, what does 133 AND 7 mean mathematically?
Re: commodities
Posted: Fri Jul 22, 2011 8:41 am
by JensAyton
It means “bitwise AND”. The number 133 is 10000101₂ in binary. The number 7 is 00000111₂. Bitwise AND considers each column, so:
Code: Select all
10000101₂ = 133
& 00000111₂ = 7
----------
00000101₂ = 5
Equivalently, it’s multiplying each column independently.
Re: commodities
Posted: Fri Jul 22, 2011 8:44 am
by another_commander
Killer Wolf wrote:i know what it means in speech, what does 133 AND 7 mean mathematically?
The single ampersand is actually the bitwise And operator. 133 & 7 applies the And logical operation on a bit-per-bit basis on the two numbers and returns 1 when both bits are either 1 or 0, otherwise it returns 0. It works like this:
133 in binary: 10000101
7 in binary: 111
Code: Select all
10000101
00000111 &
--------
00000101 ---> 5 in decimal
More information about the bitwise operators can be found here: [wp]Bitwise operation[/wp]
Edit: Argh! Ninja'd while looking for the Wikipedia article!
Re: commodities
Posted: Fri Jul 22, 2011 9:15 am
by Killer Wolf
cheers guys.
so is bypassing/overriding the results not possible? i'm doing a station that's supposed to cater to the bigger haulers, more stock and slightly lower prices.
Re: commodities
Posted: Fri Jul 22, 2011 11:28 am
by Switeck
In my own experience, it's even worse than that.
Anything that goes over 63 has to start over at 0 and count up to 63 again. At 63->64, it's back to 0 again!
So the only way to fill up big haulers is if quite a few commodities have 50-63 TC for sale.
Or by regular or special cargo contracts. A special cargo contract could be anything from a mission-scripted "X" TC of whatever to a special fills-the-hold cargo that doesn't register as a regular cargo type.
Re: commodities
Posted: Fri Jul 22, 2011 11:34 am
by Killer Wolf
bah. holdover from the player never being able to have more than a C3's holding capacity i expect.
time for a rethink then!
ta
Re: commodities
Posted: Fri Jul 22, 2011 1:20 pm
by Zireael
Killer Wolf wrote:bah. holdover from the player never being able to have more than a C3's holding capacity i expect.
time for a rethink then!
ta
Seconded.
Re: commodities
Posted: Fri Jul 22, 2011 1:50 pm
by Switeck
It's the reason why getting a cargo hold larger than a Python's 100 (or 115) TC is almost a waste. The Anaconda's is so big as to basically never be fully utilized except maybe when doing massive cargo contracts and side trading along the way, but there's no real need to shrink the Anaconda's cargo capacity since that's one of its few charms. The only other one really is the 7 missile pylons, but lots of much smaller OXP ships seem to have at least that many now.
Some missile pylon using equipment (in OXPs) can be recoded as activate-able equipment thanks to v1.75 changes, so at least that may get better.
If there's multiple stations in a system, an Anaconda might (remotely!) get filled up that way. Way I've got my game set up, there's typically only 1 big secondary station near the main station (Sothis, Superhub, or Globe) with possibly a couple special purposes stations elsewhere in-system (Rock Hermits, Pirate Coves, Black Monks, Buoy Repair, Hoopy Casino, Random Hits Spacebar, Free Trade Zone, Commies stations, Dictators factory, etc.) Even still, my Boa 2 (at 175 TC max) often has space capacity. In-system trading only typically consists of small cargo moves to/from stations I run across on my way to the main station, although I often visit the big secondary station near the main station just because it lets me double up on the big money makers. (computers, luxuries ...or furs, liquors/wines.)
Re: commodities
Posted: Fri Jul 22, 2011 3:07 pm
by Oathbreaker
133?
7?
LEET
...I'll just pack my bags and leave, then.
Re: commodities
Posted: Fri Jul 22, 2011 4:58 pm
by Smivs
Switeck wrote:It's the reason why getting a cargo hold larger than a Python's 100 (or 115) TC is almost a waste.
Sorry Switeck, but that is completely wrong! My Boa Clipper has a 150Tc hold, and it's nearly always full. At rich industrials I buy computers and luxuries (and can't fit them all in) and at the lower-end worlds, it's furs and booze. On top of that the safe is usually well stocked with gold, gems and platinum, and if I do have any spare capacity (which does still happen) I'll stop of at a rock hermit and buy radioactives and hold on to them till I get to a rich industrial.
With a big hold it's often worth holding on to cargo for a jump or two until you find a good market. I would happily have a 250TC hold and even then it may not always be big enough.
Anaconda....good size but hopeless ship.
Re: commodities
Posted: Fri Jul 22, 2011 5:18 pm
by Switeck
Smivs wrote:Sorry Switeck, but that is completely wrong! My Boa Clipper has a 150Tc hold, and it's nearly always full. At rich industrials I buy computers and luxuries (and can't fit them all in) and at the lower-end worlds, it's furs and booze.
No single station will sell you more than 63 of a commodity, so in your example of computers and luxuries that would be a theoretical max of 126 TC out of your Boa Clipper's 150 TC hold if all you were doing was stocking up on computers and luxuries (or furs and booze) at the main station. Rock Hermits wouldn't help in that regard, because they don't offer computers, luxuries, furs, or booze...so apparently you have other OXP places to visit.
Re: commodities
Posted: Fri Jul 22, 2011 5:24 pm
by Alex
I once hacked my ship to hold 500Tc
Know what, it still wasn't big enough for the good deals I came across.
Then realized, a lot of the game fun for me was in deciding what and where to buy and sell.
So returned hold to original size.
Would still like to be able to sell more than 127 units of stuff at a time though. Namely Gold, Plat and Gems.
Re: commodities
Posted: Fri Jul 22, 2011 5:32 pm
by Smivs
Switeck wrote:Smivs wrote:Sorry Switeck, but that is completely wrong! My Boa Clipper has a 150Tc hold, and it's nearly always full. At rich industrials I buy computers and luxuries (and can't fit them all in) and at the lower-end worlds, it's furs and booze.
No single station will sell you more than 63 of a commodity, so in your example of computers and luxuries that would be a theoretical max of 126 TC out of your Boa Clipper's 150 TC hold if all you were doing was stocking up on computers and luxuries (or furs and booze) at the main station. Rock Hermits wouldn't help in that regard, because they don't offer computers, luxuries, furs, or booze...so apparently you have other OXP places to visit.
I usually keep 15-20 TC clear for salvage and rescues (free money), and as I hinted, with this capacity you can sit on stuff until you get a good price. For instance Alien Items (scooped Thargons) are worth holding on to until you get to a high-paying world or a sec-com station if you use Galactic Navy.
Also it's not uncommon to visit say two high techs in a row....fill up the spare with even more computers, and sell them in two lots if necessary. You'll still make maximum profit within a handful of jumps. It's just a case of using the space intelligently.