Big Deal

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
Post Reply
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Big Deal

Post by Fahnn »

Here's a daft little thing I've been messing around with that might entertain a couple of you. It's an extremely simplified version of the old DOS game "Drug Wars", with all the conflict removed. It's now basically it's just a high-score game: 30 days to buy and sell drugs and make as much money as you can.

There are some subtleties (kind of) in that each new game features a slightly different selection of drugs and each drug has variable price volatility, so you can get to learn which ones are best for trading. But mainly random elements rule and that's how the real money is to be made.

The original idea was to do a proper game, with multiple locations, gangs, research facilities for new drugs and all kinds of conflict elements, but this super-simple version kind of works in itself (at least I've had a bit of fun with it) so I might just leave it as it is. That said, the whole thing only takes up about 6 kilobytes, so there's plenty of scope for expansion if I do take it further.

My record so far is about £90,000,000 but that's easily beatable. I think half a billion could be done with favourable selections and a following wind.

I won't link it directly from here (I've learned from my previous mistakes!) but if anyone's interested, the download link is in my signature.
User avatar
Andre Leao
Bugaboo
Posts: 3105
Joined: Mon Nov 13, 2017 9:28 am
Location: Portugal
Contact:

Re: Big Deal

Post by Andre Leao »

Hum... £5.133635E+9 on my first attempt. I guess the game is not prepared for billionaires, eheh

On a small note, sometimes the buy and sell 100 option does not work...

Review will follow the next few days...
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Big Deal

Post by Fahnn »

Andre Leao wrote: Sat May 18, 2019 9:33 pm Hum... £5.133635E+9 on my first attempt. I guess the game is not prepared for billionaires, eheh
Haha, excellent work! I knew I should have put in some sort of limit on the amount of each drug you can hold at any one time to prevent these sorts of scores. I'm still impressed though.
Andre Leao wrote: Sat May 18, 2019 9:33 pmOn a small note, sometimes the buy and sell 100 option does not work...
Yeah, this is something I encountered myself but couldn't be bothered to track down why it was happening. It's something to do with the "1/2-.5 = 2.3283064E-10" thing. I used INT on some values to ensure that you can't end up with infinitesimally small amounts of drugs but in doing so, introduced this new bug. It also manifests when you're holding e.g. 117 units, sell 100 and end up with 16. I'm sure I could fix it but quite frankly I'm just too lazy.
Andre Leao wrote: Sat May 18, 2019 9:33 pmReview will follow the next few days...
Looking forward to it! I'm not expecting it to be a good review - because it's quite a half-arsed bit of programming - so please be as brutal as you like. That said, I mainly do these sorts of things for my own amusement and I think this is the first thing I've written that I've spent more time playing than it took to program (the whole thing was pretty much done in one afternoon), which also explains some of the shoddy presentation (I generally like to get things looking as nice as possible and there's definitely stuff in it that I'm not happy with at all).
User avatar
Andre Leao
Bugaboo
Posts: 3105
Joined: Mon Nov 13, 2017 9:28 am
Location: Portugal
Contact:

Re: Big Deal

Post by Andre Leao »

ahah, ok, review is ready and will be released tomorrow. It´s a fact "hot parts" is better (more complexity and diversity), but there is space for improvement in this game. :)
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Big Deal

Post by Fahnn »

Andre Leao wrote: Sun May 19, 2019 3:00 pmthere is space for improvement in this game. :)
That's an understatement if ever I heard one! Is it even worth improving though? If so, I'd probably just start again from scratch.
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Big Deal

Post by Fahnn »

Andre Leao wrote: Sun May 19, 2019 3:00 pm ahah, ok, review is ready and will be released tomorrow. It´s a fact "hot parts" is better (more complexity and diversity), but there is space for improvement in this game. :)
Just read your review, Andre. Very fair once again, I absolutely agree with everything you say. In fact, I think I'd have been a lot more critical!
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Big Deal

Post by Einar Saukas »

Fahnn wrote: Sun May 19, 2019 2:10 pmI used INT on some values to ensure that you can't end up with infinitesimally small amounts of drugs but in doing so, introduced this new bug.
You need a crash course on floating point. Here it goes:

Calculations involving decimal or large numbers on computers usually use floating point. However floating point is subject to a certain degree of imprecision. For instance, a calculation like 100*.17 may not produce exactly 17. If there's a small rounding error of .000001 for instance, then the actual result could be 17.000001 or 16.999999. Notice that using INT(x) would give 17 in the former case, but 16 in the latter.

There's a simple workaround. Calculating something like INT(x+.001) will give you 17 in both cases.

These are not realistic values but it doesn't matter, I'm just explaining the basic concept.
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Big Deal

Post by Fahnn »

Einar Saukas wrote: Tue May 21, 2019 2:59 pm
Fahnn wrote: Sun May 19, 2019 2:10 pmI used INT on some values to ensure that you can't end up with infinitesimally small amounts of drugs but in doing so, introduced this new bug.
You need a crash course on floating point. Here it goes:

Calculations involving decimal or large numbers on computers usually use floating point. However floating point is subject to a certain degree of imprecision. For instance, a calculation like 100*.17 may not produce exactly 17. If there's a small rounding error of .000001 for instance, then the actual result could be 17.000001 or 16.999999. Notice that using INT(x) would give 17 in the former case, but 16 in the latter.

There's a simple workaround. Calculating something like INT(x+.001) will give you 17 in both cases.

These are not realistic values but it doesn't matter, I'm just explaining the basic concept.
I did try something like this - but used INT(x+0.5) - and while that worked, I think I then put in some other calculation later on that made it go wrong. It's a bit embarrassing really, I'd be completely on top of this if I was 16 or 17 again, but seem to have got very rusty in the 30 years since then.
AndyC
Dynamite Dan
Posts: 1388
Joined: Mon Nov 13, 2017 5:12 am

Re: Big Deal

Post by AndyC »

User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Big Deal

Post by Fahnn »

AndyC wrote: Tue May 21, 2019 6:13 pm I'll just leave this here

https://docs.oracle.com/cd/E19957-01/80 ... dberg.html
That is excellent, thank you! I used to love this stuff and it's really depressing that I can't understand it all now, not at first glance anyway. But I guess a bit of practice will get me back into it...hopefully.
Post Reply