Login [Register]
Earlier this year, I created a small TI-BASIC game that I creatively titled "Dodge". It's not a good enough game for me to release it into the archives, but it's relatively simple and fun. There are 6 rows of "dots" on the screen, and you can switch around rows. You get points for how many dots are on your row, but you lose if a dot makes it to the end of the row that you are on. (You have to switch rows to dodge the dots) There's also a score multiplier/difficulty feature. Occasionally, some dots will not be shown (this is a bug, err, feature), so you have to look at the number in the top to see how many dots are on your row.

Here's a demonstration of that game: (Reminder, this is not a "released" program, it's buggy and stuff. It's also not the one being worked on in this thread.)

Now that I am learning Assembly, I think it would be fun to try and port this TI-BASIC game over. So that's what I'm doing.

I've shifted from a circular layout to a flatter layout, because it makes my math so much easier. I've also chosen to do 8 lines instead of six. I couldn't afford to do this in the TI-BASIC version because of speed, but here switching to 8 will actually make it faster because of how I plan to implement movement (I think it's really clever, I'm going to use circular bit shifts and then an and instruction to check for collisions).

Here's the first actual screenshot:

This is a demonstration of how the game is going to look. The lines on the screen are debug features, I'll change them so they look better eventually.

The green dots are placeholders, too. I'm going to change them into piranha sprites later.
All of the rows on shown there are not random, they are just patterns I made to show off the drawing capabilities (I have checks to make sure that a row of 8 piranhas will never happen in-game). Each "piranha" is represented by one bit in memory (each row is a byte), so changing them is super easy.

I took that screenshot yesterday, when I started the project, I made all kinds of fun additions today! Now, the screen will scroll with new rows being pseudorandomly (but deterministically, I want all games to be the same) generated on the fly.

Here's a new, updated screenshot:

I'm triggering the changes manually, but eventually it'll go on a clock, speeding up as you play more. This is opposed to the TI-BASIC game, because it generates more squares and goes slightly faster as you play, but this is a little tricky to do and I can make it just as difficult by speeding up more. All of the ones after the initial screen are generated pseudorandomly by a custom routine.

In the screenshot, the battery indicator is drawn and I happened to switch to the next row almost immediately after it did it. Apparently this is caused by the fact that I was using an OS routine (_GetKey) to add manual pauses between the redraws, so it won't be in the final program.

I don't think I'm going to release my source just yet, I want to get more of the core mechanics done first.
Since that last post, a lot has happened! I added player movement and the rows are now on a timer! I haven't done sprites for the player or the piranhas yet, but that is the next big step.

The program is about 450 bytes right now, but I think I can get this down quite a bit. It doesn't seem like a lot (to me, at least), but we don't have all of the features done yet. The sprites are probably going to be at least half of the whole program.

If anyone's really good at drawing 16x16 pixel art piranhas, I kinda need a piranha sprite. I can handle the actual player, though.
Nice job! How are you going to prevent all the blocks from being blocked off? Like what the start of the GIF shows.
I'll see if I can make a sprite that's any good!
Probably by jumping back to the randomization step if the result + 1 is zero.
commandblockguy wrote:

That's exactly what I'm doing.

The first row in the GIF is full because I set it manually to test things.
Huge update! I finished the player sprite and added him in to the game.

Here's the sprite I made for the player. His name is Robert, and he's adorable.and disproportionate! Razz

This is before I put him through convpng, we lose some detail in the hair afterwards, but I'm not going to go to 16bpp just because 8 pixels in the hair are weird.

I'm not entirely content with it and I'll probably change him a little eventually.

Here he is in situ:

He's super tiny (this is a 2x scaled image so that you can actually see him without hurting your eyes). But it's fine, I'll probably scale him up programmatically so the piranhas aren't half his size.

I'm working on a three-frame running animation just for looks, too. Just for you, as a little post easter egg, here, have a preview (it only goes once): https://i.imgur.com/tErQ8dg.gif (let it remain secret, or I'll delay release by a week hehe). He does this little prancing thing, and it's great
Conveniently (and intentionally) all three frames share the same upper part (only the legs/feet change) and are entirely reversible, so I can save almost 2.5kb (compared to having 3 full-body sprites for each direction) by writing a fun sprite routine.

TheLastMillennial expressed interest in SAX and in the thread above to do the piranha sprite, so I'm letting him do that. hurry up! <3 If I can do all of this (plus collisions, a menu, and scoring) in a reasonable amount of bytes, I'll also do a water sprite Smile
After a short break, I made a lot of progress today:

I added a functioning health bar and collision detection! I also added scoring, too, but you can't see what your score is (yet).

Obviously, the speed is a little fast, but I cranked it up for the screenshot. If run on-calc, there isn't as much flickering.

The black stuff on the top is just my laziness. I only draw the bar once will instead of each frame, so I don't erase it or the stuff around it. If I erase it all in the beginning it'll be all nice and white, but I'm not there yet.

I'm pretty terrible at the game when I play it on CEmu, as you can tell, but on-calc it is a lot easier Smile

The code itself is 572 bytes, without the sprites and palette info. With the sprites and palette info it's 1172 bytes. I'm not too concerned about optimizing right now, I'm trying to get all of the main features in, but I think that I can save a hundred-ish bytes just by getting rid of repetitive code.

To-do (in order of expected completion):

  • Difficulty (speed gets faster as you play) completed!
  • Score multiplier (as you play, this gradually increases, but when you lose health it resets.) completed!
  • Custom font and some other sprites completed!
  • Display score completed!
  • Game balancing completed!
  • Display multiplier completed!
  • Highscores table
  • Menu completed!
  • Difficulties
  • Modify menu to include other options (adjust difficulty, view highscores)
  • Optimization
  • Maybe some other things?

Despite this decently-sized To-Do list, I think I'm about 50% done with the game. Most of the core mechanics are done and implemented. A lot of these features are already half-implemented and will be super easy to add because of good planning and foresight at the beginning. That planning step helps more than I anticipated, I should have listened earlier to all of the people who told me to plan my programs when I joined Razz
Even though it just turned noon as I started writing this post, I've already made some pretty awesome improvements.

We are switching from fish to snails, for three main reasons:

  1. TheLastMillennial tried his best to make me a piranha sprite, but the result didn't, uhh, look al dente yes, I know I am using that term wrong, that's the point. (I couldn't make one better... I guess this might have been a bit much x.x)
  2. I decided that I am decent at drawing snails (despite never drawing a pixel art snail in my life) and created the sprite below.
  3. It's funnier that way

It's not too bad (I don't think), but I do want to do some shading on the shell, and make the overall sprite larger.

Here it is in-game (the black dots at the top are debug things, don't worry)

I also added the score multiplier and difficulty increase, it gets gradually faster as you play. In order to make the game not insanely fast too quickly, you start rather slow. (I might change some of my formulae so that this doesn't have to happen)

I'm super excited about releasing this. I think I'll work on my font today, I'm thinking about making a slimey font, as if it was traced by the path of a snail Smile
A bit of a double post, but this is a huge update! I created and added a font!

I'm cheating a little bit and only implementing the 25 characters I need:

sorry that the image says " h o t s e x " that's entirely unintentional and a coincidence, and I don't have the time/can't be bothered to fix it. If someone takes offense to it I will change it on-the-spot.

I'm going for a loopy and twisted font that avoids straight lines and perfect circles. I love the way it turned out. If I get the time, I might do the whole alphabet (I can do a character in like 30 seconds, it's not that hard with this style), and create a nice font for other assembly programmers to use and modify.

I think the lowercase "f" and the "9" are a bit too closed, and the 0 looks a bit like a theta, but besides that, it looks great. Each character has 1 pixel of spacing on both sides (it's not monospaced) and the space character is 4 pixels wide.

I'm doing some pretty awesome compression (each bit in the font data part of the program is one pixel, and it's all uncompressed when the program starts in a fraction of a second) that lets me save over 3500 bytes. My font-drawing routine is relatively fast and small, but I can probably get it smaller and faster with a little bit of coercing.

Huge, huge progress!
Today, I wrote a slow, huge, complicated, and unreadable font routine that can render strings in the above glorious font! The strings are converted into a semi-machine-readable format (read: a format only the most idiotic of idiots would use) using a small converter I wrote, then plopped into my program!

I think the output is fantastic, as you can tell by the very large banner at the top of this post.

On IRC/SAX, some users (namely Kerm and LAX18) expressed interest in me letting this font be used by the OS.

I think this is a great idea, because it would give the OS a much-needed usability decrease! I'll definitely keep this in the back of my head as I continue the program.

I plan on finishing the font (we only have the above 25 characters currently) and making it open source so others can suffer the same pain I am.

The font routine itself is a good 100 bytes, and it compounds this huge size with a lack of speed. I think I accidentally confused "obfuscation" and "optimization", because it's pretty unreadable.

No matter how much I make fun of the routine, I am very proud of it. I spent pretty much my whole day working out kinks in the routine and fixing bugs, and the intense problem-solving made it both extremely rewarding and enjoyable.

Unfortunately, I had to change how I am storing my font data. Each character takes up the same amount of space in memory, but the font is not monospaced. I just add padding to each character so that each one is exactly 17 bytes (Even though 16 is much easier to do for various reasons, I chose 17 because the character with the highest byte count had 17 bytes. It's just easier over all). This is good because it makes the code more readable, and I get to skip a second lookup table (I'm using one for the character widths) that would limit the number of chars we can store.

All of the numbers are monospaced, so I'm going to create a second, simpler font routine to draw them.

This is a huge milestone, because now I can progress with the game slightly obscure pun intended and make my menus and a scoreboard.

The game isn't completely planned out, and I still want suggestions from you guys. What do you want to see? Do you have any tips/algorithm improvements? I'm waiting to release the source code until I polish it up a little bit, it's very messy and not something I want to share quite yet.
Wow, impressive updates! You've done quite a lot in a few days! I think Cemetech should adopt that font for April fools day. Razz
For reference to others who didn't see my failed attempt at the piranha:

As for what I'd like to see in the game, perhaps different difficulties. Normal would be current game play, but you could go to hard which would only have 1 empty space per row.
Also, when you run out of life, could you make an animation of the snails swarming over the guy? I know I'd be pretty terrified if a bunch of snails suddenly swarmed over me! Wink
Will you be adding any Easter eggs? If so, I'll PM you an idea for one.

Like I said, great job so far! Is ASM as bad as you expected? You seem to be doing pretty well after only a few months!
_iPhoenix_ wrote:
lets me save over 3500 bytes.

Well, a 16 by 16 pixel font with 128 characters should only take 4096 bytes, so I am not sure how your 24 character pre-compresion set was taking up any more then 3500 bytes in the first place hehehe Razz
(You should store the font in 1bpp, but I think your compression may be smaller if its only 17 Byers per char Wink )
c4ooo wrote:
_iPhoenix_ wrote:
lets me save over 3500 bytes.


I do store it in 1bpp, and I expand it to 8bpp during run time. In the number, I was including my routine to decompress and the routine to draw it, though.

Different difficulty ratings would not be too hard to add. I would just lower the time in between rounds that you have at the start of the game with the higher difficulties.

I do plan to add an Easter Egg (or two), but I'm not going to say much on the topic here for obvious reasons.

Tomorrow, I think I'm going to try to get part of the high scores table working. Edit: this isn't happening.

That number came from the font being stored in 8bpp.
More progress has been made! I created a version of my font routine that is optimized for drawing numbers, and here you can see it drawing a small counter. It's blazing fast: this is with a dummy loop that runs 8 thousand times slowing it down. I don't show this in the gif, but it pads the start with zeros if it needs to.

This will let me draw the score and do many other things, so I'm super excited!

It won't be too hard to make it draw the score and multiplier. The routine that draws the text can "chain" the position where it left off into this routine (and vice versa), so that I can draw some text, then draw a number, then draw some more text.

Edit: Using my skills of uncommenting sections of code that I wrote a while ago (this routine's inputs have been planned out for quite some time now), I added the code that draws the score (difficulty was vastly increased for the sake of brevity):

I've decided that I'm going to reduce the number of rows that are on the screen, it's too cluttered, and you gain points far too fast.
HI, _iPhoenix_
This program looks amazing, I like the fonts and like the sprites.
Are you thinking of adding a main menu, and high score board. anyway..
good work by the way!!! looking forward to having this game on my
calc. Good Idea
Alvajoy123 wrote:
HI, _iPhoenix_
calc. Good Idea

Thanks! Very Happy

I do indeed plan on having a main menu and a high score board. I'm not doing the menu now because it'll be relatively trivial to implement, and I'm not adding a high scores table until I finish scoring.

I want to try and get most of the main game mechanics down first Smile

On a slightly different note, don't expect updates or anything from me this week because I have IRL obligations :/

Edit: My break is over! I'm going to work on the main menu tomorrow, I want to try and ease back into this project.
After quite a bit of time, I'm back to working on Attack of the Snails!

Today I got most of the work done for the main menu, and I did some preliminary stuff for drawing the multiplier.

I had to add a bunch of characters to the charset I'm using on calc (this was mostly caused by poor planning), but otherwise everything is going smoothly.

I'm not posting screenshots of the main menu just yet, it still needs some work done before I show it off Smile

Edit: I forgot to mention that I decreased the number of snails per column from 7 to 5, the game runs faster now and it's overall much more enjoyable.
Today I got the menu to the point where I think I can show it off.

Here's the first screenshot of the menu:

It's very bland right now, but I'm adding icons and stuff soon!

The options don't work yet (both lead to the game), but it won't be too hard for me to add this functionality soon.

This was a lot of work, surprisingly. The menu routine itself is quite large, but it'll be able to be used with multiple menus in the game.

I'm running into the problem that I didn't implement all of the characters early on, so I have to add characters as I need them.
I fixed this by writing little JavaScript snippets that takes convpng's output (which it modifies to fit in) and the file with my font data and merges them (it adds the character width, trims padding, and more).
Is it just me, or does "Exit" look scrunched up? (At least compared to "PLAY").
I'd have to agree with jcgter, I think you should even out the spacing, or keep your capitalization consistent; I think it'll look better. Smile

Great job so far, the font turned out really nice! I know this is going to be a simple game, but I'm still looking forward to it!
Nikkybot is too!
IRC wrote:
[TheLastMillennial] nikkybot SNAIL
Register to Join the Conversation

» Go to Registration page
Page 1 of 2
» All times are GMT - 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