Money limit and associated bugs/"undocumented features"

    Joined
    Jun 28, 2013
    Messages
    5
    Reaction score
    0
    I have found a couple of things dealing with selling things at a Shop. For background, this is what I am using:

    Ship design:

    • a massive harvester build with only 5 hardened hull blocks to protect the Core - no other blocks used! (hehehe) - The design is mainly to harvest spawned bases, asteroids and planets, not fighting as it is too slow to turn.
    • d1000 missile ports (4) 1 x 25 cubes deep
    • Anti-Matter cannon ports: (5) 1 x 25 deep and (1) 13 x 4 x 10 deep
    • Salvage cannons built on diagonals with no groupings: (155) 1 x 45 deep
    • Mass: 2402.0 (24029 blocks)
    • L = 61m x H = 22m x W = 32
    • Energy = 20567.9 - 959757.4 e/sec
    • Thrust = 13952
    • Shields = 230110, 5097 s/sec

    I experienced all of this in the last 2 hours:

    1. I had 987+ million creds and I sold 628 Negagite L5 at the Shop -

      • my credits went to zero
      • I lost my Negagite L5
      • My weapon assignments all went away
      • That sucked
    2. Took out two more Pirate bases and got more stuff to sell

      • Had several L5 minerals
      • Sold some and was sitting at 1.7 billion
      • Sold another 878 L5 and the Shop took it all, gave me a red box error saying that 2147483647 is the maximum amount of creds possible. I should have had about 500 of the LT left over, but it all went away

    Suggestions:

    1. Fix the bugs obviously
    2. Have the code check the numbers before committing the process of the sale. If a numeric limit is going to be hit, then only take enough of what is being sold to reach the maximum
    3. Is there any way to save the state of the ship and stuff just before the transaction commits? That way a recovery could be done if needed (of course there would need to be a mechanism for that too).

    Thanks and loving the game!

    Bestest,

    Bobo8734
     
    Joined
    Jul 6, 2013
    Messages
    4
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    Have the code check the numbers before committing the process of the sale. If a numeric limit is going to be hit, then only take enough of what is being sold to reach the maximum


    I\'ll second that. There are other mechanisms as well that need more graceful solutions. Buying items beyond the inventory limit results in them being lost and the credits lost as well. If I\'m not mistaken, loot (floating items) are also deleted when you move through them and don\'t have the space for them in inventory.
     

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    This isn\'t a bug in the engine.
    This is a bug in computers, period.
    It\'s the single largest number a 32 bit operating system is ever capable of handling under any circumstances before you start having to round the number, use scientific notation, split it into segments, etc.

    If the entire computing world couldn\'t fix it, then Schema probably can\'t either :P



    I\'d recommend just fixing the way that the economy is handled so that it\'s impossible to even reach that number without cheating. We\'re kinda floating around in debug land right now, since it\'s a public alpha - just do what Notch did and fix it up to be playable online, then set it up to be playable in gaming mode rather than alpha/test mode by default.
     
    Joined
    Jun 24, 2013
    Messages
    130
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    Er, no.. of course you can correct that in any piece of software, or rather, work around it. You just have to deal with how the limits to each variable type works. He clearly hasn\'t put in any checks for this. It\'s not as if it\'s a major problem for the alpha at the moment either. Once you get maximum credits, you\'re not really going to need the few million you missed out on, not to mention that you can now buy pretty much any ship, and do it all over again without any hassle and within 30 mins or less. The only hard part about gaining more credits is locating pirates or one of their stations. Not that you\'d need to anyway, you probably have enough cash to keep you going for weeks if not months.

    Also, it\'s not a bug.
     
    Joined
    Jun 26, 2013
    Messages
    262
    Reaction score
    15
    • Legacy Citizen
    • Purchased!
    Starmade just needs checks to make sure the value hasn\'t overflowed when buying or selling, but it\'s a little silly to claim that it\'s impossible to have anything bigger than a 32-bit integer. Schema\'s using java, so if he replaces it with a long the cap will be 2^63-1 instead of 2^31-1. Overflows still need to be checked for even so. Another solution anyone could implement (though it would be a lot of work) would be to change and rebalance all the prices to very low values, also solving the \'I hit max cash, can now afford a planetoid-class ship with 2.5 million shield dispersers\' problem by making costs and wallets, hopefully, not hit the cap so rapidly. Of course, the only reason you lost all your money repeatedly is because whoever runs your server left the L5 ores so overpriced that a couple thousand of them exceed MAX_INT in value. BTW, even c++ had 64-bit ints, with long long or whatever your compiler\'s standard was.