Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Apollo Lander - Progress Thread [Alex_ADEdge]

A topic by Alex_ADEdge created Aug 01, 2019 Views: 2,252 Replies: 6
Viewing posts 1 to 7
Submitted (4 edits)

Working title? I really have no idea what game Im working towards this early on, only that I know Im working towards a game! It will probably be some take on a lunar lander kind of game. Not sure if it will be on the Moon, or maybe Mars? - maybe Michael Collins tries to passive aggressively out-do the achievement of his peers landing on the actual moon below as he waits for their return. Or maybe ill do some funny twist where you have to crash the lander or something. Not sure yet. 

But with the file size restriction I did see this gamejam as the perfect opportunity to finally get around to learning BASIC on Commodore 64 - its been on my todo list for years, and has been something Ive really wanted to get into since I was about 5 years old and had my first PC (a Commodore 64 of course!)

So day 1 progress has been:

  • Setup/configured a C64 Emulator (went with VICE) + also discovered an in-browser C64 emulator which could be extra easy for distrubution/hosting the game if I can put it up on my web server or something
  • Procrastinated and played some of my favourite retro C64 games XD
  • Wrote my first program in BASIC and got it to run
  • Worked out an initial code import > export type of workflow (I'll need to work out how to create a game disk/catridge for source code editing/saving/running once things get more involved)
  • Design a sprite
  • Render a sprite!

First program with basic!

I didnt know if Id get as far as creating a sprite tonight, but... well:

First C64 Sprite - Lunar Lander v1!

Thats 800 bytes for that sprite - so technically at this point 31,200 bytes of code for this jam remain.

https://twitter.com/Alex_ADEdge 

I'll be posting more updates to twitter as I progress in the next 2 months, looking forward to seeing what everyone else gets up to! 

Submitted (4 edits)

A better look at the sprite code:

10 print chr$(147)
20 print "apollo lunar module v1"
30 print "alex delderfield"
40 print "the apollo gc jam 2019"
50 poke 53285,11: rem multicolor 1
60 poke 53286,8: rem multicolor 2
70 poke 53269,255 : rem set all 8 sprites visible
80 for x=12800 to 12800+63: read y: poke x,y: next x: rem sprite generation
90 :: rem sprite_0
100 poke 53287,15: rem color = 15
110 poke 2040,200: rem pointer
120 poke 53248, 44: rem x pos
130 poke 53249, 120: rem y pos
140 poke 53276, 1: rem multicolor
150 poke 53277, 0: rem width
160 poke 53271, 0: rem height
1000 :: rem sprite_0 / multicolor / color: 15
1010 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1020 data 0,0,0,0,0,0,0,0,1,4,16,0,213,192,0,25
1030 data 0,0,102,64,1,85,80,1,170,144,0,153,128,3,123,112
1040 data 3,238,240,13,29,28,12,12,12,4,4,4,63,63,63,143

 It was generated using an online editor I stumbled across tonight called Spritemate

Tomorrow I'll be delving  into C64/BASIC code further to help get a better understanding of it all. Thankfully when I was studying computer science a few years back I did a course on assembly programming, so its going to be a matter of learning the syntax and then finding/working out how a lot of game functions are done in lower level languages.

Also Id say a command module v1 design would be coming up next!


Wow, looks awesome! Commodore64 with Basic was a good pick! I'm using TIC-80, fantasy, but gets the job done.

Submitted

Thanks Josh! Yeh Im happy with the Commodore64 choice, its just a shame that I dont own one anymore. Would be great to do all the dev on the actual computer rather than in an emulator. 

An update for the past 3 days, along with unfortunetly being pretty sick Ive managed to:

  • Locate an online version of the C64 manual, which has been a very interesting read (how much I wish I had that manual 25 years ago, I could have been learning how to code and make games before I was 10, rather than half way through highschool!) 
  • See the Todd Douglas Miller Apollo 11  documentary at the cinema which Id highly recommend (trailer: https://www.youtube.com/watch?v=3Co8Z8BQgWc)
  • Work out a general idea of what the game/game-loop will be. Its ambitious but Im interested in seeing how far I can get with it in the 2 months of this jam! (more on the actual game in later posts when I get further along)
  • Learn some more code, like how to change the game background when the game starts (black background for space, and grey border now for a more lunar feel), check keyboard inputs, how to clear/rewrite text to the screen which is handy for debugging variables and also finally how to move sprites around.


Heres the game as of day 4, the lander has a gravity acceleration applied to it every frame and you can move left and right currrently. The bottom of the screen is acting as the 'lunar surface' for now - so I have a very very rudimentary collision detection in place along with a landing message. So thats basically a game loop running! Its not much of a game atm though of course! But Im happy to have some level of interactivity going on now. 

Next Id like to continue working on the lander controls and get the sideways movement working as an acceleration, along with an upwards boost and then maybe some visual puffs from the thrusters whenever youre boosting around. 

From readings Ive also realized that BASIC is pretty slow for making games, I might need to switch to assembly programming at some point, which I figured Id be doing regardless. But i'll see how far I can get with just BASIC for now. 

The code has gone from 21 lines to 70 lines - from 800 bytes to 1537 bytes (1.537kb)

Submitted (6 edits)

Another update, day 13 at this point!

Ive been finding time wherever possible to work on bits and pieces of this game, ditched out of the lowrezjam because Im finding this Commodore 64/Apollo Jam a lot more interesting and Im limited on spare time regardless. 

Work over the past week or so:

  • Continued with  research, learning a lot about the system itself, memory layout, C64 history, BASIC, approaches to making games, etc - The 8 bit Guy on youtube has a lot of great videos, seeing his Planet X2 project making of is a must for anyone making C64 games. 
  • Developed a bunch more sprites - from the command module sprite(s) to and alien, astronaut, lunar surface and explosions - really relaxing and fun work, trying not to get too ahead of myself with sprites, since I know I probably wont be able to use too many!
  • Worked out how to load in multiple sprites into the scene, lots to learn here about memory locations and how multi colour sprites work
  • Added a bunch of features to the game loop and program overall, like keeping track of the screen/border colours and restoring them when the game ends or is quit, actually being able to quit using 'Q', added fuel to the game and worked out a basic way to draw a depleting fuel bar on the screen (not fully implemented yet), added an upwards boost so you can fly/hover around now and just in general tried to clean up the game loop code as much as possible
  • Had a change in workflow, I discovered C64 studio - which has turned out to be great! (if not perhaps a bit glitchy), but its got all kinds of tools which make it a lot nicer to use than working sublime or visual studio code as I was doing before. Still exploring the featureset here, but looks like the dev platform Ive been wanting for. It even has sprite support, which is making life a lot easier 
  • Drew up a little test scene to visualize what the game could look like soon
  • Converted my Delta Edge logo into 80s style - didnt expect this to work so well! Now I just need to work out how to draw it to the screen so I can have a splash screen at the start of the game


Splash screen test (not yet running on the C64)


Sprites in C64 Studio - command module, rotating sprites for the lunar lander, and some mockups for the surface, astronaut and alien!


Test explosion sprite - need to get sprite switching working for animated sprites like this


Getting the LM and CM sprites loaded into the game 

As pictured above, LM (Lunar Module) and CM/SM (Command & Service Modules), which are currently loaded in with BASIC. Next up I'll re-introduice the main game logic again and get them parented and moving around as needed. Id also soon like to get the overall game-loop working better - it still needs some kind of intro menu which kicks into the game and the landing sequence, then the end of level screen and the ability to progress on to the next level. Then its probably time to look at landing mechanics and a few more features for the descent component of the game. 

Theres another larger component I want to work on that involves what the Command Modlue goes off and does during its orbit, but Im not sure how far into that I'll get during this challenge. An easier goal would be to aim to flesh out the descent part into its own mini-game, so I'll see how the next month goes, it really just depends on how much spare time I have (never as much as I want!)

Also pretty certain I'll need to switch to assembly, which Im really avoiding at the moment. Ive learnt enough now to see the advantages, but at the same time I'll have to scrap all the basic code and learn assembly. The only thing that will really push me to do that early is if I get far enough with the descent part of theg game, and work on the command module part - which will need sprite multiplexing and is likely when I'll need to rewrite it all in assembly, but until then I'll keep looking at this as a 'prototype' of the full game in BASIC, with an assembly conversion happening later on.. potentially post-jam. 


Hard to say what the game code size is now, since its broken up between a bunch of different file but currently for the game itself its looking like its gone from about 1537 bytes to  7335 (7.35kb), from 70 to around 250 lines of BASIC. (Only including images and sprites that are currently loaded in the game loop itself) 

Submitted

End of the first month, so this jam is half way done!

Progress from the later week or so of August:

  • Found a new editor and workflow (again!) Ive switched to CBM prg Studio after multiple faluires on the part of C64 Studio and all its glitches (managed to lose all my drawn sprites and now only have the data versions in past saved code). Grrrr C64 studio....
  • Created a nice and easy initial random terrain and star background generator & implemented it into the main code (less than 30 lines!) 
  • Added a larger lander for experimentation - the SpaceX Starhopper protoype! (made of multiple sprites parented together)
  • Added a simple particle effect during thrusting
  • Reworked acceleration and gravity, much less buggy, but still some bugs..
  • Worked out how to print to precise areas on the screen, which lead to not needing to refresh the text every frame (cleaner text) and nicer placed realtime stats, game now displays X,Y locations and relative acceleration
  • Added in the first iteration of a fuel system, the big primary bar is for the main fuel, the smaller bar underneath will be for the ascent stage on either return to the CSM or during a landing abort. Also when fuel runs out, no more boosting!
  • Various other small tweeks and experiments like crushing up the sprites on a crash landing

I certainly got a bit out of control with the Starhopper, but it was a good challenge to add it in and ended up being a lot of fun - especially as the final test hop of star hopper took place so I felt like it was a nice retro tribute to the first hop and final flight. If theres room in the final code I might leave it in as a easter egg somehow, but either way I'll be taking everything I learnt with Starhopper and applying it back to the Lunar Module soon. 

Also in the first test hop (gif below) I somehow unintentionally managed to get to match up almost perfectly with the first test hop of Starhopper, video on twitter: https://twitter.com/Alex_ADEdge/status/1162194443178409984


Heres a look at the terrain and star gen in action (was really happy with how this turned out!)


Initial Starhopper once I got it loading correctly, sprites parented and flying with the LM code:

Game scene now, with fuel working, more stable text, terrain stuff added (although X/Y locations are bugged)



Maybe I should keep it as a SpaceX/Starhopper game :P

Also the next post will be an fun one, got an interesting development to post about that I'll leave for another day!

Current game code status: From about 7335 bytes to  9000 (9kb), still around 300 lines of BASIC. (Only including images and sprites that are currently loaded in the game loop itself - its probably a few more kb with the other sprites loaded). But also lots of room for optimisations soon.

Submitted

Ok! So.... Final post!

Since my last post (basically at the start of September) a lot has happened. 

September work:

September was a whirlwind of a month for me, I had a lot going on and couldnt find a lot of time for this gamejam, which unfortunetly effected the end result that ill get into further down. I started the month learning assembly (Ive previously been using the much slower language on Commodore 64 - BASIC) but after a week or so I realized I really didnt have enough spare time to grasp assembly as well as I needed + rewrite + develop the game. So towards the middle/end of September I switched back to BASIC and continued from there.

End result:  (Game Page to play HERE https://alex-adedge.itch.io/apollo-lander)

In the end, I rewrote the entire game in BASIC and gave the sprites an overhaul. I added in whatever features Id previously developed which were working well enough, removed features that werent working and fixing some bugs and errors and edge cases that were causing major issues. Theres still a few bugs or edge cases in the game and theres unfortunetly a few features I put a lot of time into (like bloody terrain scrolling) which didnt make it into the game at all since I didnt get them far enough along to be usable.

Im a bit dissapointed overall with the game itself, and Im looking on it more as a 'demo' or prototype, a quick level with a couple of features that lets you fly the lunar module around a bit and give you a feel for what a full version of the game I had in mind could be. But I really wish I could have gotten a few extra things done, such as undocking from the Command Module and rotating the LM to come in to land, and some scrolling terrain (horizontally and vertically) so you can fly around a bit more. And of course some more developed terrain, so you actually have a challenge to overcome when landing and finding a landing spot. 

On the other hand, Im super happy I could spend some time getting into C64 development, and this is certainly not the end of the line when it comes to me doing retro gamedev like this!

Bonus!

At the end of August I'd been eyeing off actual Commodore 64s for sale locally, as Ive not owned one since the 90s (as I said earlier, it was the computer I initially grew up with, my introduction to computers and gaming). A couple of C64s came up that I was tempted to make offers for, or bid on, but overall Commdore 64s are super expensive in Australia so I either didnt bid or my offers were too low. Id either need to save up some solid $$ or get really lucky to own one again...

And thankfully it ended up being the latter! I got really lucky, and found a C64 on ebay which not many people were bidding on. I put in my maxium bid, and watched as no one outbid me - and the timer hit 0. 

A day later (it was a local pickup just down the road) I had a C64 again. And after buying a few extra parts I needed (overvoltage protector, Video-to-Composite converter, etc) I fired it up and got the earliest version of my Apollo project (the lander landing part) running on the system.

My first sprite - running on an actual C64

Retro goodness

Manually entering in gamecode for the first test!

More recent version of the game running (Starhopper version)

For more & future updates, follow me on Twitter: https://twitter.com/Alex_ADEdge

Overall a fun two months of experimenting and learning Commodore 64 vintage gamedev, thanks Dan for hosting!

Final game stats:

The most efficient (lite) version of this game (witten in BASIC) ended up being only 4,963 bytes! (its otherwise about 8kb with comments and spacing left in), a solid 27kbs left over.