Phoenyx Posted June 8, 2015 Share Posted June 8, 2015 (edited) This is a game I call Messier. It's a Tycoon-style game built around running a merchant fleet written in C++. It's currently a text-based game, but I plan on eventually using the SDL graphics library. At the moment, all you do is buy ships when you have the money, and your profits grow like crazy. There's not even a save feature yet. But the game is playable in this extremely early and simplistic state. No screenshots yet because, well, it's just text. I can grab some if you must have them, but they'll just be pictures of console windows. https://drive.google.com/file/d/0B9Je_ziVneIOZGp5UkJYelhTY0E/view?usp=sharing Edited June 8, 2015 by Phoenyx Link to comment Share on other sites More sharing options...
Jimbob Posted June 8, 2015 Share Posted June 8, 2015 Nice work so far, I just tried it out and made 1906 credits profit after 24 months. Looks like you have the basic workings there. Will you be adding any methods of losing money? Link to comment Share on other sites More sharing options...
coffins Posted June 8, 2015 Share Posted June 8, 2015 (edited) Funny creation. Reminds me my very, very first program on C++ (However, mostly in C). I'd like to see how it should look using SDL. Nevertheless, I discovered a really uncomfortable bug related to input stream. When you submit something other than integer (e.g. chars or digits with exp), infinite loop begins. I think you have to simply ignore other data types using switch() statement's default case (Just my 2 cents based on my thoughts about source code of your game). Moreover, it seems like you didn't implemented checks to prevent integers overflow. When you submit an integer out of range of int type at all (e.g. 1 000 000 000 000 000 000 000 000 000 and so on), you get into infinite loop the same as if I'd submitted something other than integer. Edited June 8, 2015 by coffins Additions to bugs Link to comment Share on other sites More sharing options...
Phoenyx Posted June 9, 2015 Author Share Posted June 9, 2015 (edited) Nice work so far, I just tried it out and made 1906 credits profit after 24 months. Looks like you have the basic workings there. Will you be adding any methods of losing money? Well, first off, you can lose money if you just buy one small ship. You pay 10 credits in tax every month, and small ships cost 1 credit per month in maintenance. I'm planning on adding landing rights leases, trade tariffs and locations so that you can't just spam ships like you can in this build, and random events that can potentially damage profits like pirate attacks. I'll probably add contracts as well. Funny creation. Reminds me my very, very first program on C++ (However, mostly in C). I'd like to see how it should look using SDL. Nevertheless, I discovered a really uncomfortable bug related to input stream. When you submit something other than integer (e.g. chars or digits with exp), infinite loop begins. I think you have to simply ignore other data types using switch() statement's default case (Just my 2 cents based on my thoughts about source code of your game). Moreover, it seems like you didn't implemented checks to prevent integers overflow. When you submit an integer out of range of int type at all (e.g. 1 000 000 000 000 000 000 000 000 000 and so on), you get into infinite loop the same as if I'd submitted something other than integer. It turns out I completely forgot to add a default to the main menu switch. That's a quick fix. EDIT: Turns out it was more than that. I had to add an error handler to the input. EDIT2: The link's been updated. It should tell you that you gave an invalid command if you enter a letter or cause an overflow. Edited June 9, 2015 by Phoenyx coffins 1 Link to comment Share on other sites More sharing options...
coffins Posted June 9, 2015 Share Posted June 9, 2015 It turns out I completely forgot to add a default to the main menu switch. That's a quick fix. EDIT: Turns out it was more than that. I had to add an error handler to the input. EDIT2: The link's been updated. It should tell you that you gave an invalid command if you enter a letter or cause an overflow. Yeah. Now everything is completely better than was. However, it doesn't ignore EOF char (^Z in Windows as we know), so you'll get an empty field to input another command instead of notice about invalid command. That's not a deadly point in program, but looks a bit strange. Link to comment Share on other sites More sharing options...
Phoenyx Posted June 9, 2015 Author Share Posted June 9, 2015 It turns out I completely forgot to add a default to the main menu switch. That's a quick fix. EDIT: Turns out it was more than that. I had to add an error handler to the input. EDIT2: The link's been updated. It should tell you that you gave an invalid command if you enter a letter or cause an overflow. Yeah. Now everything is completely better than was. However, it doesn't ignore EOF char (^Z in Windows as we know), so you'll get an empty field to input another command instead of notice about invalid command. That's not a deadly point in program, but looks a bit strange. I'll probably leave that in since it will eventually be covered by a GUI. I'm currently trying to get random events working at the moment. Link to comment Share on other sites More sharing options...
Phoenyx Posted June 13, 2015 Author Share Posted June 13, 2015 (edited) Alright, new update. I added two random events: a pirate attack that can make you lose money or ships, and a random government search that does nothing. The link has automatically been updated. Edited June 13, 2015 by Phoenyx Link to comment Share on other sites More sharing options...
Recommended Posts