Thanks to everyone for the feedback, I never expected I would get this much or that the game would be so popular (25 downloads already, with 4 10/10 ratings?!?). I have made a large list of everyone's suggestions, and will try my best to implement all of them for 1.1.0, along with new ships and maybe a few surprises. Here's what I don't plan to implement, along with the reasons why:
1. the bottom of the ship being clipped off, this is an issue with RotatedTransparentSprite and as such is outside of my control
2. the linked list concept, as I certainly don't plan on updating this program to add all of my new programs to the list. Instead, I'm going to change the unlock condition to "own all of my previous programs"
I may upload to Github later as well, once I make some more progress.

Contest Standings
And due to some blatant cheating in the contest, I am going to have to require all new highscores to be a screenshot of the completed screen, rather than the statistics page. With that said, here are the current standings:
1. TheLastMillennial- 36635
2. KingDubDub- 24323
3. epsilon5- 17547
So as of right now, TheLastMillennial will get the custom ship. But there's still some more time until 1.1.0's release, so keep posting your high scores, everyone. I have accepted at this point that I am no longer the best player at my own game, which is somewhat upsetting given that it's only been out for a little over a day. Thanks again for your support and suggestions!
1. No it isn't.
Alright, so I was playing again trying to bump up my high-score, and I suddenly "hit the flow" and managed to finesse my way past my previous high. I found a major bug in the game around reaching the 38,000 points mark; around this time, the screen flickered and all the asteroids disappeared. Then the game started acting like I'd started over and started chucking a few asteroids at low speeds. Then asteroids started blipping out of nowhere, and I thought I was screwed. Thankfully the "blippers" only lasted for about 30-40 seconds and then stopped, and they weren't too frequent even then. I then knew that I had to make it to 76,000 points to see if it started again. I played through history, study hall, lunch, some free time in physics, and at home. It started again at around 78,500 points, and I died shortly after. If someone else could please get to 38,000 and confirm I'm not losing my mind, that be great.

Oh, and my score:


EDIT: In my defense that I didn't cheat ('cuz some people don't trust me):
1. I'm too stupid to cheat, I don't even know how to un-make the game file.
2. That's just against my morals, and why would anyone cheat on this? It's fun, but come on, I have a life outside of my calculator programming (wait... oh yeah, that's not true actually)
3. You don't destroy the asteroids willy-nilly, you conserve ammo for when you have a shield and then you farm power ups from the center of the screen.
4. As for 12 games, I have this bizarre skill for figuring out strategies for games and such, I somehow figured out how to farm power ups effeciently, and that will remain my "secret strat!" (although I did just mention it, so oh well...)
"I am going to have to require all new highscores to be a screenshot of the completed screen, rather than the statistics page." Sorry, KingDubDub, but I'm not going to be able to accept this as a high score. I trust you, but as someone else proved earlier on, it is pretty easy to hack the statistics page. I will give you the 38,250 though, since I don't know how you would be able to describe the issue in such a detailed way without actually getting to that point.

Bugs
I am pretty sure what the bug allowing this to happen is though. The number of asteroids is calculated based on score / 150, and the variable for the number of asteroids is a uint8_t, meaning that once you got to 38250 (255 * 150), this would overflow and mess everything up. I'll fix that for version 1.1. So you are not losing your mind, the game is broken. I am glad that you are playing this game so much though, it's good to see that people are enjoying it. Thanks for pointing this out, as I don't think I'll ever be good enough at this game to have found the issue for myself.
MateoConLechuga wrote:
1. No it isn't.
What am I doing wrong then?

Contest Scoreboard
here are the current standings:
1. KingDubDub- 38250
2. TheLastMillennial- 36635
3. epsilon5- 17547
As I seem to have broken my own contest, I will now allow anyone who gets to 38,250 to have a custom ship as dictated earlier and be tied for first in the contest.

1.1.0 Information
I have made a lot of progress on 1.1.0. It will include some new things like a hard mode, along with a lot more features that I have working or are in development and that I will post about later. You can take a look through the community requests to see most of the other new features that are coming to the game.
I have a theory as to why the sprite is being clipped, though I can't know for sure unless you update the repository.

Also, I'll have to give getting a spot on the leaderboard a try for myself! I've played it a few times but have been too busy recently to actually attempt to get a high score.
epsilon5 wrote:

I am pretty sure what the bug allowing this to happen is though. The number of asteroids is calculated based on score / 150, and the variable for the number of asteroids is a uint8_t, meaning that once you got to 38250 (255 * 150), this would overflow and mess everything up.


Ah, I figured it had something to do with the RNG calculator looping, I noticed that the game stopped getting any harder at around 25-27 thousand points.

Quote:
Sorry, KingDubDub, but I'm not going to be able to accept this as a high score. I trust you, but as someone else proved earlier on, it is pretty easy to hack the statistics page.


I don't blame you for not trusting me, but I will try to beat my score (which is infuriatingly difficult) and I hope to get to 99,999 points and see if the counter breaks. I just really want to break this game, I can't explain how fun it is to be asked to destroy something, and I'm starting to become obsessed! I'm also trying to break the asteroid and fire counts, just to see what overflows I can generate.

Quote:
I'll fix that for version 1.1. So you are not losing your mind, the game is broken.


Oh, my mind is already long gone, I just didn't know if I was imagining this or not!

Quote:
I am glad that you are playing this game so much though, it's good to see that people are enjoying it. Thanks for pointing this out, as I don't think I'll ever be good enough at this game to have found the issue for myself.


It's remarkably well-made, and there aren't too many bugs at this point. You did a fine job! Do keep something in mind though: I AM BIG DUMB. I may understand things and have good puzzle-solving skills and an uncontrollable urge to deconstruct everything, but I really only got this good through practice and my secret strats. You can easily do better than me, if I could get 84,000 points, someone could easily get 10 times as far (if they had the patience, I really don't).

Moar bugs:
-I've noticed asteroids "blipping" outside of the RNG-overload zone when the game isn't glitched, but it's so rare that I might be imagining it. Normally around top of screen, but occasionally in the middle or on sides.
- the -1% accuracy glitch will occur in all gameplay, not just in statistics page. If you start a game and leave it running till you die, the death screen shows -1%. (You probably already knew this though)
-Hitboxes on asteroids are very odd, sometimes they impact without touching the ship, sometimes I go right through them, and they sometimes don't break when shot.

Suggestions:
-A RNG-manipulator for easy or hard mode, with adjustable numbers and maybe a way to turn off powerups? Similar to the Tetris mobile game where you can choose a difficulty to start at.
-A boss fight at every 10,000 points? maybe a large ship firing lasers at you with some breakable/unbreakable barriers that move across the screen? Just to break up the monotony of flying through tiny spaces and blowing things up.

Since the competition is kinda-over, here's my list of strats:
1. The game tends to throw everything through the middle and alternates sides, sit on the left or right and move through the middle when necessary.
2. Conserve ammo at all costs, just dodge the asteroids when you can so you have those 3 shots for clearing a path.
3. When you run out of ammo and start feeling cramped, shield out and fire at any large asteroid clusters to try to farm some hearts and shields.
4. Remember that picking up a shield while using a shield turns off the shield, which can be good for conserving a shield but can kill in tight spots.
5. You can dodge off-screen for a few seconds, but it's incredibly dangerous since there are off-screen asteroids and you get a massive health penalty, only use when in danger.

I feel like I might try using CEmu and the Windows game bar (advanced software indeed) to record some footage to see if I can get proof of my high-score, but I feel like I could still be accused of cheating, and who wants 3-4 hours of silence and a tiny video of an emulated calculator where I die repeatedly? Sorry for the textwall! Thanks for the game!
Hax Evil or Very Mad



Love your games by the way, keep up the good work! Smile
I guess that means I need to go for 999,999,999 points...

Don't explain how you did that till 1.1 comes out, that is neat!
King Dub Dub wrote:
I guess that means I need to go for 999,999,999 points...

Don't explain how you did that till 1.1 comes out, that is neat!


It's impossible to get any higher than this, it's 2^23-1, which is the limit for signed integers on this calculator.
Unless epsilon5 wants to implement their own number routines...
It's literally impossible to get a score higher than that. Computers store numbers in base 2 and the CE can use up to 24 base-2 "digits" or bits. 8388607 is 2^23-1, and one bit is used for negative numbers, so getting one more point from beck's cheaty score would result in the score looping back down to -8388608.

Considering how long it would take to get that score, I don't think it's worth anyone's time to use a larger size, though it would be simple enough to change the signed integer to an unsigned one, which would double the maximum score.

Also, if that's actually the maximum value of the "games played" number, I would recommend using a uint24 instead of a uint16 - it's actually faster, and the code size savings will almost definitely exceed the one byte that using a uint16 saves.

Also, I imagine that this hack is only possible on CEmu - you can change any number in memory you want, to whatever value you want.
commandblockguy wrote:

Also, I imagine that this hack is only possible on CEmu - you can change any number in memory you want, to whatever value you want.


I did this fully on-calc. Razz
commandblockguy wrote:
It's literally impossible to get a score higher than that. Computers store numbers in base 2 and the CE can use up to 24 base-2 "digits" or bits. 8388607 is 2^23-1, and one bit is used for negative numbers, so getting one more point from beck's cheaty score would result in the score looping back down to -8388608.

Considering how long it would take to get that score, I don't think it's worth anyone's time to use a larger size, though it would be simple enough to change the signed integer to an unsigned one, which would double the maximum score.

Also, if that's actually the maximum value of the "games played" number, I would recommend using a uint24 instead of a uint16 - it's actually faster, and the code size savings will almost definitely exceed the one byte that using a uint16 saves.

Also, I imagine that this hack is only possible on CEmu - you can change any number in memory you want, to whatever value you want.


well... you could always just manually write over the screen background whatever numbers you want on top of it, which technically gives you as many digits as will fit on the screen. Razz
version 1.1.0
As you know, I have been working on a new version of HailStorm, version 1.1.0, that will bring many requested features to the game. This went faster than I expected, and today, I was able to submit the update to the archives queue, where it is currently awaiting acceptance. Here are the biggest new features, and there will also be a full changelog at the bottom if you are interested in knowing all of the new changes to the game.

Save and Quit
You are now able to stop playing the game whenever you want, and pick it back up later. By pressing [clear] from the gameplay screen, you can save the full state of your current game in an archived appvar (so it's safe from RAM resets). After a short animation while it does this, you will be returned to TI-OS or your shell. When you reenter the game and press the play button, you will be given the option to continue this saved game if the appvar is detected. Then, play can continue as normal, from the saved state.

New Powerup
A new powerup was added to the game, that allows you to clear all of the asteroids that are currently on the screen. When you get this, it will display many concentric circles, followed by all of the asteroids disintegrating. This could come in handy if you are in a tight spot, and really need to get all of the asteroids off the screen in order to continue.

New Difficulty
For those of you who are concerningly good at the game (TheLastMillenial, KingDubDub, etc.), there is a new difficulty mode that should give you more of a challenge. In the new Hard Mode, there are no powerups, meaning that you must survive as long as you can without them. This was how the game was before I added the powerups, and was a major challenge (I struggled to unlock the ship you get when you pass 5000 points at this stage in the game). You can activate or deactivate this mode at any time from within the settings menu.

New Ships
Finally, three new ships have been added to the game. These are unlocked after you play 100 total games, score 12500 points, and score 15000 points.

Bug Fixes and Community Requests
Excluding the bottom of the ship being clipped off, I think I have fixed all of the bugs that you mentioned in the forums. In addition to that, the program has been further optimized to run at a minimum of around 25-26 FPS when the maximum number of asteroids are on the screen. In addition to that, I was able to implement most of the community requests as well.

Screenshot
Here is a screenshot of most of the new features:


Version 1.1.0 changelog
Here is the full version 1.1.0 changelog:
[added] ability to save the game and come back to it after exit of the program
[added] a new powerup
[added] hard mode of higher difficulty than the normal game mode
[added] ability to turn starfield background off if you want
[added] three new ships
[improved] general framerate increases and collision optimizations
[improved] made the bullets fire from a position that looks better
[improved] bullet recharge reworked
[improved] obtaining a shield powerup no longer cancels an existing shield
[improved] the pause menu now blacks out the screen to discourage cheating
[improved] asteroid damage is now related to the asteroid's speed rather than just its size
[improved] asteroids now have some basic momentum when they are shot, rather than just stopping in the air
[improved] the shield now flickers when it is close to running out
[fixed] fixed the clipping issues
[fixed] the bug where you could drift left at the beginning of the game
[fixed] the bug that would break the game at 38250 points
[fixed] the bug where your ship wouldn't autocenter when holding a key
[fixed] the bug where your accuracy could be displayed as -1%

Community Responses
TheLastMillenial-If you still want to do the ship editor, I would be happy to implement it into the game, probably in a separate "custom ship" section. We could make a shared Project Builder project or something, and have the ships be packaged into an appvar where they can be edited and found by the program.
KingDubDub- I really like the idea of a bossfight every 10000 points, I'll see what I can do with that (maybe for 1.2.0).

Contest Results
1.KingDubDub- 38250
2.TheLastMillenial- 36747
3.epsilon5- some score I don't remember
KingDubDub, you have won the contest. Please post here what you would like your custom ship to be, and I will include it in the next update.

Conclusion
Thank you all for downloading and playing this game, I have had a lot of fun developing it to the state that it is in today. If you're interested in viewing the source code, the link is here: https://github.com/epsilonfive/HailStormCE1.1.0 And if you have any more feedback or suggestions, post them here. And I forgot: the counter won't break at 99,999 points, just roll over to 100,000 points, since the score is an int.
Thanks for uploading the repo so that I could take a look at it!
You don't have to create a new repository for each version - Git keeps track of every change that you make, and you can view previous versions by clicking the "commits" button on the repository.
You can also set it up so that you don't have to upload and move each file individually - I recommend reading my tutorial on the subject.
I would also recommend putting the convpng.ini and the images you used to generate the sprites in the repo in the src/gfx/ folder, and leaving out the C files generated by convpng. The images are the actual source files in this case, not the outputs of convpng - it would be difficult for someone to make changes to the images or add another image to the palette with the way it is set up now.
Lastly, the repo doesn't actually work when I clone and build it - it gives me this on both LLVM and ZDS:

EDIT: not entirely sure why it wouldn't work for me, but it seems to be fixed now - definitely an issue on my end, not yours
Your code needs a lot of work before I want to take a look at it. But whatever.
Since Mateo refuses to elaborate on exactly what is wrong, I guess I'll explain ways that the code quality could be improved. This post might come off as overly critical, but I'm trying to give constructive criticism so that your programs in the future can improve. Considering that you've mostly finished the project at this point, it's probably too late to fix most of these without doing a full rewrite, but these will still hopefully be useful for future projects. I'll list things that could be improved in order of priority, and also explain how doing each of these could help reduce bugs or write programs more efficiently.

Firstly, you should use many functions rather than putting everything in main(). I might have a function for each menu, a function that is called once per game loop to handle gameplay, a function that is called to update each asteroid, a function that generates the asteroid sprites, a function that loads and saves the game, and so on. Using multiple functions has a large number of benefits. It makes the code easier to read, as it gives a name to every piece of code so that you can see what it does and allows you ctrl+f (or use an editor feature) to jump to code that does a thing. It also allows you to only define variables where they are needed, which can help prevent issues where variables are written to when not necessary.

Similarly, you should also avoid using goto whenever possible. If you are using goto, it is likely a sign that you need to split into another function or check your loop structure. Also, it may result in you being eaten by velociraptors. goto makes it hard to debug your program's flow, compared to using loops or functions.

You should use Git properly, as I've mentioned in my previous post. This allows other people to help you with the project by reading and testing your code. The less effort it is for other people to download, read, edit, build, and run your code, the more likely it is you will get help with your project. Frequently updating the repository also helps people to spot issues and make suggestions early on in the design process before it's too late to change things.

You have a buffer overflow error with unlockedshipstemp - it only has 10 elements, but you are writing to index 10, which isn't actually part of the array. This can cause a lot of issues that are hard to debug.

There's also likely a buffer overflow somewhere with str1, which is only 9 bytes long. If you try to copy anything longer than 8 bytes into it, you will be overwriting something else. You are also copying constant strings into str1 when it's not necessary - it's better to assign a pointer instead, like so:
Code:
char *string_ptr = "Words or something";
uint24_t width = gfx_GetStringWidth(string_ptr);
gfx_PrintString(string_ptr);
You will still need to use an array as a buffer for sprintf, but if you are printing a constant string you should just use a pointer, as the calc only has to set 3 bytes rather than length+1 bytes.

The code has a few memory leaks. Any time you use malloc() or gfx_MallocSprite, you should make sure to free the memory with free() after you are done using it. It's not a huge deal in this case as that code only runs once, but if it were to run multiple times your program might eventually crash. For this type of situation, it would likely be best to use gfx_UninitedSprite instead of gfx_MallocSprite, as it does not require you to free memory. However, I don't think that really works for arrays so what you currently have is probably more readable than allocating memory yourself, even if it's slower.

In a similar vein, you should also ti_Close() slots after reading them, as not doing so can cause issues that are hard to debug later. ti_CloseAll() works, unless you decide to open multiple files, in which case it could randomly cause fileioc functions to quit working for slot you weren't trying to close.

You should probably avoid using sprintf - it's quite a large function and is likely also slower than using gfx_PrintUInt and gfx_PrintString.

You should avoid making lines too long. It's almost impossible to read this line without turning on word wrap in your editor. C completely ignores whitespace and newlines, so it's best if you add a newline before each entry for readability. Some style guides say that you should limit lines to 80 characters, which I personally don't really care about as my laptop screen is much bigger than that, but you should make sure that lines at least fit on-screen.

While on the subject of line 208, you can save space by declaring these as arrays of pointers, like so:

Code:
char *menutextb[7] = {"Menu Wrapping",...

Rather than giving 20 bytes to each string, regardless of how long they actually are, this gives each string as much space as it actually needs.

You should avoid typedef-ing structs inside of functions. It's a general convention that they be defined in a header file (.h), or at the very least at the top above all of the other functions. If everyone puts structs in the same place, it makes it both easier for others to read your code and you to read others' code.

I know that sounds like a lot, and that a lot of it seems really nitpicky, but I know from experience that doing these makes C easier to read, write, and debug. I'm posting this not to complain about code quality, but to try to help you improve your future programs. I apologize if the tone came off too critical - at the very least, it's better than Mateo's Razz
my (non-hacked Razz ) highscore:


Edit: You should add a version number on the finished menu to prevent those who are vying for that high score to use bugs/exploits on previous versions of the game (that are fixed in later versions). Smile

...Although I suppose if someone really wanted to, they could just write the new version of the game over they're highs core screenshot. Razz

...Or just outlaw CEmu, but that's not fair to those who don't actually have a real CE. Cool
something something piracy / legal stuff

I mean, you could also take a screenshot of a cheaty game from CEmu, then turn that into two sprites which you display on the CE using graphx. There's no possible way of proving whether a score is real or fake without including enough information to recreate the entire game (in this case, either a video or the RNG seed, the location of the ship on every game loop, and the time at which bullets were fired/shields were activated).
commandblockguy wrote:
something something piracy / legal stuff

I mean, you could also take a screenshot of a cheaty game from CEmu, then turn that into two sprites which you display on the CE using graphx. There's no possible way of proving whether a score is real or fake without including enough information to recreate the entire game (in this case, either a video or the RNG seed, the location of the ship on every game loop, and the time at which bullets were fired/shields were activated).


ick... I'll try including a full replay of my next high score altho these recordings do take up precious space on my computer.
Thanks for your suggestions, commandblockguy. Like you said, I probably wonโ€™t implement this into the current version, but I can try it out for the new code I wrote for 1.2.0. The suggestions all make sense, but I do have one question: when using functions to render the asteroids, update the ship, etc. should I use pointers to the local variables within main, and pass them to the function in question, or use another method?

EDIT- On second thought, I may try implementing these things along with what I had planned for 1.2.0, and change the version number to 2.0.0.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement