Blogposts about games developed by us. Most of them are non-technical.
I've just done another Global Game Jam this year. It's my fourth time joining it. This one totally went unexpected. Originally I planned to join using the game console I'm developing. I ended up not using the game console and made music for the team. I also did a little bit programming. And it's the best Global Game Jam I've ever had!
Here's the link to the playable, which takes forever to load.
And here's the source files of the music composition which you may be interested in. The .ptt files are Palette MCT files, and the .mmp is the LMMS source file. Please notice that the FluidR3_GM.sf2 SoundFont file is required for the .mmp file.
Before the event, I thought that I'd take the 2019 Global Game Jam event as an opportunity to market the hardware portable game console that I'm developing. For this reason, here's what I've done:
It took me quite a while to prepare all these things. I got all these done before the day of the jam. Great. I'm all set. I'm ready for the jam. All I needed to do is to get someone to form a team with me! It could easily be done during pitching session. And I'd just give the game console devices and ST-link programmers to other team members for the game development! :D
By the way, I dragged a couple of random tourists that I just met in a local hackerspace a few days ago into the jam. I told them not to form a team with me. Mainly because they probably aren't interested in my game console.
Before I knew it, the day for me to market the game console had come... I was very excited about it. :)
As usual, I joined the site without a team. I took the shuttle bus and arrived there. There was a loooooong queue for registration. The photo below is just, perhaps 1/6 of the entire queue. The queue was clearing very, very slow.
It seemed to me that it'd take forever to get it cleared. So I decided not to take the queue and sit somewhere nearby and joined the queue after it's almost cleared. The queue took around 25 minutes to clear. That's not surprising considered that I was almost the last one in the queue and there was more than 400 jammers on the site. But still, I didn't enjoy the wait. :(
Right after the registration, surprise! There's another queue! Since I went to the site late, the dinner had long started and there's another long queue for all-you-can-eat dinner! It took me another 10 minutes to get the food. Since I'm late, I didn't get the food that I want. Luckily I still had enough to eat.
After fetching the foods, I found those two random tourists that I met a few days ago. They were chatting with a local while having dinner. Being too shy to chat with other strangers, I just joined them and chatted with them.
After the dinner, it was theme announcement. As usual, there's a lengthy welcome session and introduction video. It was announced that the theme was "What Home Means to You?"
During the pitching session, I was sitting on the same table with those two tourists and the local. I was observing to see if the game console would be any good to them. Well, seemed not. However, it seemed to me that everyone in the group were very friendly. They weren't like the teams that I've joined in the previous Global Game Jams at all! We're all the same. There isn't any hierarchy. What they're trying to do was to make good use of the skills of the members of the team. It was apparent to me that forming a team with them would make it an awesome game jam. So I decided not to use the game console and formed a team with them.
We discussed about the game idea, which is sort of like a simple RPG. We've sketched out our idea on a piece of paper. With the sketch, we discussed about our roles. We've got a programmer, 3D artist with programming skill, 2D artist and a jack of all trades (which's me). And we decided to have one of us to be a main programmer, one of us doing 3D art, one of us doing 2D art and I'd be doing music. Not because I'm good at it, that's because no one else in the team could do that. xD
One of the ideas we've come up with was very clever. We've talked about having multiple tracks of music. There'd be items on the map, and when the character get the item, a track of music would be played. So you'd get more and more musical instruments playing for each item you've picked. I was asked if that was possible for me to send them the tracks, and I answered yes. In fact, it's fairly easy. :) I just loved this idea. It made good use of my own skill as it isn't something that you could do for a game without an audio guy.
Similar thing happened to other team members. We've come up with ideas that'd make good use of all of our skills. It made each of us felt that our skills were well-respected and helpful! In fact, that's how come we had a game with both 2D and 3D graphic. :)
At the end of the day, I've launched Palette MCT the music composition tool. But I haven't started any real work. I went home and slept. As I had really bad experience with sleeping on-site, I'd never sleep on-site again. I didn't want to get sick for two whole weeks! Not again!
This was the most interesting day of the event. Most of the work were performed in this day. I launched Palette MCT again and started working on composing the music.
There're two ways of composing music. The first way is to come up with chord progression first, then the melody. The second way is to do it the other way around. Personally, I love the music that's made melody-first. However, it'd take a lot of time for me to do that. So I decided to do the chord progression first.
The whole point of using Palette MCT is its chord progression function. It makes coming up with a nice chord progression super easy. Before knowing this software, I mainly did it by trial-and-error. This piece of software is able to filter out the chords that doesn't sound right. It saves me a lot of time!
I was wavering between composing a minor scale piece (the one that sounds sad) or a major scale one (the one that sounds happy). I decided to compose a minor one and settled with a common I-vi-V-I chord progression. Then I randomly came up with a melody. I composed a short 12.8 seconds piece.
Don't get confused with the musical sheet in the interface. The whole point of using the software those tiny colored rectangles with T5/3, S5/3 and D5/3 on it. Those are chords! That's the main reason why I use this piece of software.
And here's the intermediate result:
I exported the result from Palette MCT to LMMS and further worked on it. The imported piece contained only three tracks, they're melody, chord and the base of the chord. To make the music sound nice, I'd need to make a lot of variants of these tracks and assign them to appropriate sound synth (instrument).
After discussion with other team members, it was apparent to me that we'd need a lot of tracks. So I added a lot of them. In the end I've got 3 melody tracks, 3 arpeggio tracks, 3 chord tracks, 3 bass tracks and a few beat tracks.
I've developed a Python script to semi-automate the task of converting chord into arpeggio of arbitrary pattern. In musical sense, chord is defined as multiple notes being played at the same time. And arpeggio is just like chord, except that you're playing the chord notes one by one. For example, if you're playing C-E-G at the same time, that makes a chord. But if you play C, then E, then G, then E, then repeat, that'd be an arpeggio.
Arpeggio is a very common technique to add variety to the music composition. The problem I had was that the chord get changed once a while. When I'm trying to make an arpeggio out of the chord, I had to manually create the notes of the pattern according to the chord.
Here's how the script works. It accepts two tracks. The chord track and the template track. The chord track can be imported from Palette MCT. And I'd manually come up with the template track. That's easy, tho. I'd just make a small section of the pattern and do copy and paste. Here's an example. The top one is the chord, and the bottom one is the template. It shows three different chords being played over time.
After running the script, this arpeggio track would be generated:
Notice how the template pattern track had followed the chord. When there're a lot of chords, this tool saves me a lot of time. It also eliminates manual handling errors.
I didn't mention this script in the Global Game Jam blogpost last year. Anyway, this tool was developed before the last year's game jam. Somehow it's still useful in this year. :)
The sound synth (instruments) were chosen from the default presets, which was further modified manually until it sounded right to me. Then I just threw in the arpeggio notes or bass notes or melody notes or chord notes for each of the sound synth and that's it!
And now I've got a 12.8 seconds of loopable music! :)
Needless to say, 12.8 seconds is far too short. :(
So I repeated what I did. I composed another piece of chords and melody using Palette MCT again, and export it to LMMS for further processing and put it at the end of the original composition. Now I've doubled the music length to 25.6 seconds. Anyway, here's the intermediate product of Palette MCT for the second piece:
Up till this point, the composition was in minor scale. For the third piece, I was thinking if I should try adding a major scale piece into the composition. That'd make the composition contains both minor scale part and major scale part. I've never done that before. And it seemed to me that that could be interesting. And I've already got 25.6 seconds. In case it doesn't sound right, I'd just scape the major part and keep the 25.6 seconds minor part. That's still good enough.
So here it goes. I repeated what I did, except that this time I composed a new 12.8 seconds piece in major scale instead of minor scale. Here's the intermediate product:
I further processed this third piece with LMMS. Then I put this part into the beginning of the composition. To my surprise, it actually sounded pretty good. Now I've got 38.4 seconds of music. :) The next step was to remaster it.
At this time, the music was mostly ready. I just needed to remaster it to make it sounds even better! One of the keys of making a piece of music sound nice is to make its tracks more diverse. I did three things.
The first thing I did was to reduce the volume of part of some of the tracks.
Please notice that the middle part hasn't got any track with volume reduced. That's because it's the climax of the music.
The second thing I did was that I built something that I'd call "alternative melody". I've no idea on the proper musical terminology for this thing. It's basically a variant of the original melody that's played at the same time as the original one. Here's how I did it:
As shown above, at each instance of time, there're always two variants of melody being played. Two of the tracks are the main melody, with one of the tracks using an alternative melody. Since variety is crucial, I spread the alternative melody into three different tracks depending on the time of the music being played.
The third thing I did was that, I put in a reverb effect to the entire composition. It'd produce an illusion that the music is played from a different environment, like the size of the room, the audio-reflection property of the wall, etc.
And here's the final result with all tracks combined!
Now I've got the music ready. All I needed to do is to send the tracks to the programmer.
After discussion with the programmer, it's decided that the preferred amount of tracks is 7.
I'd have to make the tracks in a way that it'd loop seamlessly. It was dead simple. Here's how I did that. First, I exported the track. Then I take note of the time it takes for the music to wrap to the beginning.
According to LMMS, the wrap time is 38.4 seconds. It means that the last note is released at 38.4 second. Since the instrument sound doesn't stop immediately after the note is released, some special handling is needed to make the music seamless. Therefore, I used Audacity to do this:
What I did was to cut the part after 38.4 seconds and move it to the front as a new track. Then I mixed the original track and the new track and there we have a piece of seamless audio! :)
But hey... There're 7 tracks. Of course I'm not going to do that manually! So I've made a shell script to automate the process with SoX instead of Audacity. It worked like a charm!
Then I converted the tracks to MP3 format using shell script. And I stumbled into a problem. Due to the nature of MP3 format, there's always a split second right at the beginning of the audio that no sound is being played, which would make it impossible to make seamless audio with MP3!
After discussing with the programmer, we've found that OGG is the go-to format instead of MP3. So we used OGG instead of MP3.
I sent the programmer the 7 OGG tracks, and my mission had been accomplished! And I went home.
And I was very glad that my teammates were happy with my music. I was also very happy with the artwork of the 2D and 3D artists. Of course, the program was also working great. :)
By the way, something rather funny happened during this day. The site we've joined was in Cyberport. During some time of this day, a staff of the jam site stood on the stage and announced this in English: "Hey guys. We've got a bad news. We've used up all of the water in Cyberport." It wasn't very funny until he repeated that in Cantonese. "成個數碼港D水俾我地飲哂喇!", which roughly translates to "All of the water in the entire Cyberport was completely drunk by us! Oh noes!" That's when everyone in the room were laughing. Those who couldn't speak Cantonese were confused about what's so funny.
We were told to purchase the water from a supermarket nearby. So we did that. Then we had dinner at a restaurant. When we came back and we noticed that there was still some water. Well, we had no idea on where they managed to get the water. Had we known this, we wouldn't have purchased the water.
This day was rather relaxing. All of my stuffs were done. The 2D artist was working on the video. And apparently, the 3D artist were working on graphic and probably also a bit of programming. I didn't asked about the exact split of work, tho.
Since I've got nothing better to do on the music, I decided to help on the programming. I polished the character movement. The original character movement relied on the system keypress. That isn't a good idea because the movement speed of the character would depend on the system keyboard configuration. If the repeat key interval is set to short, the character would move faster.
As I thought that the main programmer had nothing to do, I did the fix and showed it to her. It seems that there're some issues with the character sprite cycle. So we decided not to make the change.
Later I'd noticed that the main programmer were still working. She was working on the crystal collection counter. I felt bad for disturbing her while she was working on something far more important than character movement.
As the 3D artist and the main programmer are tourists, they'd like to stroll nearby. And they were away. However, there was still a little bit of time left. I asked if there's anything I could still do, and I found that the dialog boxes at the beginning of the game and the end of the game weren't implemented.
I asked if the code on the github repo were the latest one with instant messenger and asked if they're ok with me to implement the dialog boxes. I got a green light and I started working. That was an easy one. I pushed it to repo and they deployed it and that's it.
So we've got a working game with in-game objective (collect crystals) and an ending (a couple of dialog boxes). The game isn't particularly fun to play. But still, it looked real good. And the music's also a nice one (self-flattering.pdf)! The trailer looked good too.
As usual, there's a lengthy trailer-watching session for the jam. Each of us have a minute in maximum. Somehow there aren't as much funny vid this year compared with previous years.
After the session, each jammers were allowed to cast a vote. One of our team members had voted for our own game. Too bad! We failed to get the most votes. All of our team members should have voted for our own one! :P
This one is literally the best Global Game Jam I've ever had. It's just wonderful. It isn't like any Global Game Jam I've ever had before! Let's have a review of what the previous game jams were like to me:
For the first year, I joined the jam without a team. I expected that my skill would be put well-utilized. I even prepared by practicing using a game development library. It didn't end up to be of any use at all. It was a big team with multiple "game designers". I was rather pissed off of being forced to use a library that none of the team members was familiar with. The funny thing was that this thing was decided by a game designer. I was like "hey! Choice of library is none of your business". First mistake: I should have left the team right after that decision.
And I decided to sleep on-site to get the full experience of the game jam. Before the jam, I've asked those random internet people who had joined Global Game Jam. I was told that it's alright to sleep on site. It turned out that it just didn't work to me. I couldn't get asleep. Funny enough, I somehow decided to sleep on the site for the second night even I failed to get asleep at the first night! I shouldn't have done that at all! Second mistake: Decided to sleep on the site.
Since I couldn't sleep well, I couldn't make much contribution to the team either. I was exhausted.
Result? A broken game with 2-week of illness taking away my entire Chinese new year vacation! I'd call it a FUBAR! :(
Here's a link to my blogpost of Global Game Jam 2016 which you probably aren't interested in. There's a lot of grammar mistakes because I was sick by the time I wrote that blogpost.
Compared with the first one, this one was a fun one. It's nowhere as fun as the one of this year, tho. I joined the jam with a purpose. So I decided to jam alone. In fact, I pretty much had to because the jam was a part of my graduation thesis of an independent project. If I had a team, the college may take it that I'm not working on the independent project by myself. That'd be a problem. :(
I managed to complete the game. It's a game that's playable by dialing a phone number. It's possibly the first of this kind in Global Game Jam around the world. Despite that the technology used is rather advance, like utilizing text-to-speech and having a hardware device, the end result wasn't that good. The sound synth was simply too bad. I should have recorded the audio clips with my voice instead of using text-to-speech.
Anyway, I was happy enough because I got the game completed. :) But I did feel a bit lonely. :(
Here's a link to my blogpost of Global Game Jam 2017 which you probably aren't interested in.
(If you're the producer of the game "Carpe diem" in Global Game Jam 2018, I hope that you'd never read this. This section is probably super cringy to you. I'm sorry.)
This is my first game jam that I had joined a team without screwing up. I was the musical guy of the team.
The main problem I had with this game jam was that there's an idea person who basically did almost nothing productive other than quality control. Most of the time he was just surfing the net with his laptop and his smartphone at the same time! If I remember correctly, he also had a tablet. I've never seen anyone being able to do this level of multitasking before. Anyway, in some other times, he was looking for information about making an awesome game or making an awesome trailer.
Apparently, the team members of the team I joined were from the same company. I was the only outsider. I'd imagine that the idea person would be in a superior position in the company that he was working for.
I spent quite a bit amount of work on a piece of music. I showed it to him and he just rejected it straight away and provided some not-so-helpful instruction. This was the thing that I had problem with. Here's what I thought: "Hey! You did nothing. How come you'd criticize my work? You're worse off." Of course I didn't spout that out! I redid the music and sent him another piece of music anyway. It seemed to me that he still wasn't satisfied. But he compromised and said that it was ok. Well, I guess that's good.
Right before the jam ended, we were filling in the project page on the Global Game Jam website. Surprise! The title that the idea person was getting was "Producer". It's very laughable. If I don't laugh, I'd cry! xD
Anyway, we still managed to complete the game, sort of. I only got to play the game after the jam. It sucked. :P
By the way, I've chatted with a parallel team right before the end of the jam. Apparently their team doesn't have a quality control person nor an idea person at all!
Here's a link to my blogpost of Global Game Jam 2018 which you probably aren't interested in.
After reading the flashbacks, now you understand why this Global Game Jam is the best one that I've had!
I didn't jam alone. There's no "team leader" nor "producer" nor "director" nor "quality control" guys in the team. We don't have any quality standard for the game. We just put in whatever we've got and contributed to the team. We just took whatever available from other team members. Every team member didn't really care about the art style nor music style nor we'd judge the programming framework or technique used. That made the game jam really, really awesome. After this jam, I think this is really how a game jam meant to be. I guess the guy in parallel team I've chatted with last year was having a similar awesome experience as I have this year. Perhaps I was just being extremely unlucky that I joined wrong teams for years that made me unable to enjoy the jam to the fullest!
Here, I'd like to take the chance to thanks all of the team members. Thank you very much for making this jam the best one in my life, ever! You guys are awesome. And here's a list of the team members:
You can find the website of Kirill and Sneha here on Codercat.tk, which contains a lot of awesome web-based projects! Most of their projects are utilizing WebGL. Even the playable of this game jam is hosted on this site. Do check out their website!
Also, do follow @_jintii on twitter! She's real good at drawing 2D arts, especially in anime art style! nya~ :3
As of the time of writing, despite that I can write English pretty well, my spoken English is only conversational. I'm very well aware of this problem since forever ago. And those random tourists in the team I joined couldn't speak Cantonese. I had no choice but to speak English! >_<
My spoken English is good enough for project communication, not smoothly, tho. Anyway, I'm glad that I started watching anime daily in English dub since about a year ago (I watched it in sub before that). My spoken English had went from almost-non-working to semi-working. But I still need to further up it somehow. That'll take quite a bit of time. Oh well, let's wait and see.
Uh oh. So what about the game console...? Now I've got 5 units of assembled game consoles and three ST-Link programmers laying around:
(Yes, we've now got PCB for the game console since like a few months ago. I still haven't got the time to blog about this update)
Oh well. Now I've got a problem. What to do with all these game consoles?
I guess I'll save two units and a programmer for myself. And I promised to send a unit with a programmer to someone in India. That'd get rid of 3 units and a couple of ST-Link programmers.
And I've still got two units and a programmer to go. I don't know. Perhaps I could do a giveaway. Maybe I could give them to Ludum Dare participants so that they can make games with this game console.
In fact, thanks to the judges of the sponsors appreciating the art style, each of our team members had managed to obtain an extra unit of electronic waste. It's a Google Home Mini. I think the artists (Jintii and Kirill) deserve the most credit for this one. And the main programmer (Sneha) also deserves quite a bit of credit because she made the game functional. And I, uhm, I just got the Google Home Mini anyway. xD I'm pretty sure that this thingie would still get awarded if they were using random music found in the internet instead of using mine. :P
At least I have some idea on how to handle the game console units. As for the Google Home Mini, it really beats me. I thought about selling it. But it seems that it's only worth like $30~40. It makes this option not very attractive. It isn't very useful to me either. I've absolutely have no idea on what to do with it at all. Oh well, I guess that's "what home means to me". It's an electronic junkyard. :/
Please do not join game jams just to criticize works of other team members. We aren't paid to work on the game. If you intend to join a jam and do that to us, I guess you better not to join or you'll be hated. Don't get me wrong, your talent could be much better utilized in corporate world. Your skill could be used for making a lot of money for the company that you're working for. But if you don't have any technical skill and nitpick stuffs that other team members come up with, frankly, game jam really isn't for you.
Hey guys! I've developed a game in 48 hours for the game console that I have been working on lately!
The following Youtube video contains all of the info about the gameplay as well as a bit info about how this game were made. Please do watch it! :)
It isn't possible to develop a game within 48 hours without any preparation work. Therefore, I did spend quite a bit of time on preparing it. The preparation includes:
I wish I could get a third party to review this game. Unfortunately, it isn't possible for anyone else to play this game for now because the game console isn't released yet. So here's my self-review of this game.
As a game developed within 48 hours, I'm rather satisfied with the result. Thanks to my preparation work as well as my previous experience on game jams, I'm able to finish this game on time.
The game is rather challenging and well-balanced. The game is made interesting by having the player keeps try picking up coins. That's the only way to score in the game. For each coin the player had picked up, the game gets a little bit more difficult until the player couldn't hang in there and lose the game. With randomization of various elements in the game, including the spawn rate of conveyors and hostile entities, the position of the objects, etc. The difficulty of the game is partly based on the luck of the player. That makes it a fun game for players with any level of gaming skill.
For the program of the game, it's rather sad that there's quite a bit of code duplication in the game. That's partly because I'm on a memory-constrained system. Another reason is that there's a time limit for the jam. Anyway, the game jam had ended. I'm not going to fix that. :P
This game demonstrates that the game console I'm developing is capable for running games! It shows the system API of the game console is good enough for game development. Therefore, I am able to move forward to further develop this game console. In the future, this game console might become an alternative to PICO8 for game jams participants.
I'm sorry that I didn't update about the progress of the development of the game console for a while. A lot of progress were being made lately!
The second prototype of the game console is ready! It's soldered on a perfboard. There're a few upgrades made in this new prototype. Here's the specs of the second prototype:
The PCB to be designed will be based on this second prototype.
Despite that I had professional experience in embedded programming, I'm rather green. Therefore, I've discussed with some veterans in embedded programming about the design of this game console. Since this game console works by loading the game from SD card to the internal flash of the microcontroller by self-flashing, they immediately pointed out that performing frequent self-flashing would wear off the flash of the game console quickly.
I've checked the datasheet of STM32F030K6T6. The guaranteed number of flash write cycles is merely 1000 cycles. That's a little bit small and it will cause problem to our game console. Interestingly, the 1000 number of write cycles is "Guaranteed by design, not tested in production". For other microcontrollers produced by STMicroelectronics, the number of write cycles is often 10000 and it's "Guaranteed based on test during characterization".
It just doesn't make much sense to have this little number of write cycles. Here're some theories I have about the number:
In long run, maybe I should do my own research on figuring out the actual number of flash write cycles of the microcontroller I'm using. I refuse to believe that the write cycle is 1000 cycles in room temperature. If the write cycle is like 3000 cycles, it's kinda acceptable because that'd mean that the user can load 10 games every single day for 300 days until the game console breaks. And I doubt that there's such an enthusiastic player of this game console anyway. But 1000 cycles is really a bit too little.
To reduce the number of flash write cycles, I've modified the bootloader firmware so that it only perform flash erase and rewrite if the source ROM on SD card is different from the previousy self-flashed game inside the microcontroller flash. That would cause self-flashing not to be performed if the same game is launched again after a reboot. This should help reducing the flash writes by quite a bit, especially if the player is repeatedly playing the same game over and over again.
Another issue that those professionals pointed out was the Game Flash and RAM Offset. They raised an interesting idea about the offset of Flash and RAM.
In the past, I designed the Flash and RAM layout like this:
There's a huge problem with this design. For the flash, if I ever update the firmware and the size of the firmware got increased, that would cause the offset of the Game Flash to be changed. That'd require the game to be rebuilt to work on the newer version of the game console. The same issue goes for the RAM.
Therefore, I've modified the layout. Now it looks like this:
For the Game RAM, I put the bootloader-exclusive RAM at the end. This design allows the bootloader RAM to expand without changing the origin offset of the Game RAM. In addition, if I ever upgrade to a microcontroller with more RAM, the entire RAM space would be expanded. And I would push the Bootloader RAM to the end of the RAM, and the Game RAM space would also be expanded. Since the origin of the Game RAM remains unchanged, I can still run the game that's built for the pre-upgrade version of the game console.
The same story goes for the flash. However, it's a bit more tricky because I need the bootloader to take the first sector of the Flash. That's because the first sector contains the interrupt vector and boot-related stuffs. I have to take the first sector so that the bootloader would be loaded on power up instead of the previously flashed game. Other than the first sector, the remaining part of the bootloader is put at the end of the flash space. That brings us the same advantage of putting the bootloader-exclusive RAM to the end.
This thing was done long time ago. But I've been too busy to blog about it. In the past, we made something called EXTIF to allow the game to call the functions located in bootloader by using a software interrupt, just like how BIOS work. It turns out that this design is utterly dumb because there's a function calling convention for ARM. It's called Procedure Call Standard for the ARM Architecture(AAPCS). As it's the go-to standard for functions compiled for ARM microcontrollers, it's possible to call any functions compiled by any compiler with any amount of parameters as long as you have the address of the functions.
For this reason, I just made a veneer on a fixed address for each of the system API functions. The veneer redirects the function call to the actual address of the function inside the bootloader. To call the system API function, the game declares all of the system API functions available in the bootloader and assign those fixed addresses of the veneer to the function declarations. With GCC, it's possible to map a function to an address by using the --just-symbols parameter when you invoke the linker.
The latest bootloader firmware is able to redirect almost all of the interrupts of the microcontroller to the Game ROM. A veneer interrupt handler were used for calling the interrupt handlers in the Game ROM. That enables the game developers of this game console to perform low-level programming. Along with the high level API inside the bootloader, this game console allows its game developers to learn about both higher level programming and low-level programming.
Here I've managed to complete the 4th Alakajam by developing a game for my game console. :)
Now that the firmware of the game console is ready. The next step of the development of this game console project is to design the PCB. After that, perhaps I'll also draw a case for the game console. If I have the time, perhaps I'd also develop an emulator for it. Since the microcontroller behind this game console is an ARM one, it should be possible to modify a Gameboy emulator for running games developed for this game console.
Just as I planned, I expect this project should be completed some time in 2019. Maybe the emulator would be available in 2020 if I end up working on one.
That's it for this blogpost. I'll update you guys soon! :)
As of 15th Oct 2018, I'm currently in between jobs. I was an embedded programmer of thermostats with a bit more than a year of experience. I did firmware development, Python automation scripts as well as tools for internal use, including setting up MQTT server and web server on a Raspberry Pi. In addition of that, I have been a hobbyist programmer for 9 years since I was back in middle school. Currently I plan to learn further about Python and modern web development technologies, mainly the back-end and devops ones. Then I'll start actively looking for another job. I prefer to go for a remote-working job. It can be full-time, part-time or freelancing.
If you're looking for someone to fill in any sort of programming-related positions, feel free to contact me via "hire dot me at sadale dot net". Alternatively, you can look for me on Freenode for having informal conversation with me. My nickname is "Sadale" there. Keep in mind that you have to identify (i.e. login) on Freenode in order to PM me. That's a new policy of Freenode to deal with the recent IRC spambots.
I'm thinking about making an AVR (non-Arduino) portable game console. I'm evaluating the type of display to be used (including multiple 8x8 LED matrix, graphical LCD, TFT/OLED screen, alphanumeric LCD and combination of them). Then I came up with a weird idea. What if I use a alphanumeric LCD as a graphical LCD? That'd cut me quite a bit of the cost compared with using graphical LCD of the same physical dimension.
I'm a bit bored today. I feel like tinkering around with Arduino and 1602 LCD that has been around in my home. Here's what I've got as a result of hours of boredom. An Arduino-based 1602 Snake Game:
Check out the source code in this github repository!
The hardware is roughly based on this official Arduino LCD Hello World tutorial, with an addition of two push buttons.
The left push button is connected to D8, while the right push button is connected to D9. Both push buttons are pulled-down. For other connections, please refer to the schematics in the tutorial.
HD44780-compatible LCD driver supports up to 8 custom characters. By carefully defining those 8 characters, it's possible to subdivide each character into multiple "pixels". That can effectively turn the alphanumeric display into a graphical LCD display.
My design subdivides each character two rows. Each row on the character can be either empty, snake, or apple as shown below:
There're two "pixels" in each character. Each pixel can have three possible values. Therefore, the total combination is 3^2 = 9. Since one of these combination is visually empty, a space character were used to represent that. At the end only 8 custom characters are needed. So the 8 available characters in CGRAM of HD44780 are just enough for our purpose.
To reduce RAM usage, each pixel is represented by 2 bits. So a byte can store 4 pixels. Everything is cramped into a
uint8_t graphicRam[GRAPHIC_WIDTH*2/8][GRAPHIC_HEIGHT]. At width of 16 and height of 4, only 16 bytes of RAM are taken for the graphic! Had I used a uint8_t for each pixel, 64 bytes of RAM would be required.
After the completion of this project, I've found other designs like spliting each character into three rows, or try making use of all pixels by generating the CGRAM on-the-fly. I'll consider using these techniques for my future projects.
To make the position looks random, we need to somehow seed the random number generator. For computer programs, we usually seed it with the current time of the machine. However, this couldn't be done on Arduino because it doesn't have a real time clock.
My solution is to make a menu screen of the game. When the user start the game, the time of the moment that the user pressed the button is used to seed the random number generator. The micros() method of Arduino Time library were used. This has the equivalent effect of using system time.
I was having fun playing with this game. I thought that it was reasonably bug-free because I had played it for a while. I've also asked one of my family members to try it out. I swear. We haven't spotted any bug.
Until I tried to record a video of the game play, something funny happened. I realized that I haven't implemented self-collision detection of the snake. I was like "Wow. How come no one had notice that earlier?". Hah. What a terrible failure!
Upon the discovery of the bug, it was fixed in no time.
Seems that using alphanumeric LCD as graphical LCD is promising. I'll consider going for this solution for the portable game console project. Of course, I won't be using Arduino for that. Arduino is good for prototyping. But it isn't as efficient as lower-level C/C++ programming.
I've played this game for many times. While it's technically possible to win, I haven't managed to do so. And I haven't tested the code of winning the game. I doubt that anyone could beat it anyway. I guess I'd just leave the code there as it is. :P
Alright. That's enough fun for today. Gotta sleep.
This year, I have done another Global Game Jam. I did it in Hong Kong again. Mainly because I was being too lazy to try out other jam site for this year. :P This year I had done something different. I did music instead of programming.
I had spent quite a while for practicing using Musical Palette - Melody Composing Tool, LMMS, LabChrip, sfxr and Audacity. I've figured out an efficient method to produce music. That is to come up with melody and chord harmonization by using Musical Palette, then import them into LMMS to further process it. I managed to produce a few pieces of good quality 1 minute music, each of them was produced within 24 hours.
For the LabChrip and sfxr, it's nothing more than about using the randomizer and manual fine adjustment of the parameters. And Audacity is even easier. It's just useful for noise cancellation and applying effects.
Just like the previous years, I came to the site without a team. As I planned to do music this year, it isn't possible for me to do it alone. So I sought for a team right after I entered the jam site. I tried requesting joining a random team by asking them and got politely rejected. Then another team with three existing members waved at me and asked if I was alone. I answered yes, told them that I made music and got accepted into the team. Then I had a dinner provided by the organizers. Here's a pic with more than 300 jammers begging for free food:
In the midway of our game design discussion, two of the team members had left their seat temporarily. Since I had no idea about the roles of other team members, I asked the remaining member about their role. He told me that he did art, one of the other team member did programming, and when he tried to explain the role of the last team member, his was like "uhm... uh... he's... uh... good at coming up with, uh... uh... ideas and presenting, uh... the ideas". :P Then I ended my question with "Ah. He does marketing. That's good." What I thought was that "He gotta be an idea guy!" :P
When all of the members were back to the seat, we ended up with a consensus on the game design timely.
Then we started connecting to the internet with WiFi. It was very unstable. Then I tried using mobile data by USB tethering with my smartphone. Surprise! Even mobile data is stabler than the WiFi connection provided by the organizers. Since I had a data cap, I had to use my data wisely. So no youtube for me.
I had started to draft a piece of music in the first day. Musical Palette were used for drafting the music.
In the second morning, I managed to caught the shuttle bus provided by organizers and arrived at the jam site early. I had breakfast. There's some open area in my jam site. It's rather interesting to see those people standing and eating outside. Some of the jammers had a bit distance in between possibly because they don't know each others.
After the breakfast, we got back on working. I gave the on-site WiFi another shot with no luck. And I used my mobile data again.
Then I was sitting along with the marketing guy. I sporadically took a peek on what he's doing. That was funny. Most of the time he had his Mac laptop playing youtube video, surfing facebook or chatting with instant messengers. At the same time he was holding a smartphone playing games on it. That was impressive. He was taking multitasking to the next level. To be fair, offering critical opinion requires playing others games. Anyway, he did spend a bit of time to look for info about how to make an awesome trailer for games, and studied about the good indie games.
Then the real fun begin. I continued making the music and completed composing with Musical Palette. Then I started working with the same piece of music with LMMS. However, it didn't went as smooth as I thought. In the midway of making the music, I asked my teammates to review it. Then the marketing guy complained that. He demanded a piece of music with abstract wordings that I couldn't understand. :P As you know, musical stuffs is difficult to be described by words.
After a while, he provided me an example of music that he's interested in. That was the BGM of Plants versus Zombies. It was a piece of music with drums without melody.
Then I toss away the old piece of music, made a new one and came up with this in Musical Palette:
I had never made this sort of music before. Using the same chord over and over again for 16 segments (or phrase in that program). Chord variation techniques were used. It isn't the sort of music that I like. The music sounds extremely stressful like playing airport traffic control games. But it does fit into the theme of the game. Then I mastered the piece using LMMS:
That's crazy. The same chord is played for a long time as shown above. I had added some sidechaining to it. Then I showed my teammates this piece of music. And they're ok with that. It seems to me that it isn't perfect to the marketing guy. But apparently he compromised and told me that this music is ok. That's possibly because of worry of time constraint.
Then I started working on the sound effects. That was rather easy to me. Depending on the sort of sfx, I used LabChrip, sfxr or remixing recorded voice with Audacity.
Working with LabChrip and sfxr was easy. Just click on those randomization button until I get a sound that's close to the one that I want. Then I adapt it a little bit and that's it. Using Audacity is still easy, but it has a bit different workflow. For the sound effects that's simple, I just performed noise cancellation and reverbed it. For sound effects that has like having many people saying the same something, like wow, or laughing sound, what I did was to record the sound for multiple times myself. Then performed noise cancellation, overlapped those recorded sounds, and reverbed it a bit and here we have it.
Speaking of noise cancellation, I'm rather surprised at the noise cancellation capability of Audacity. Behold a screenshot showing the power of the noise canceling effect:
We were in a noisy room with a lot of discussion from parallel teams sitting right next to us as shown below:
The result was brilliant. I seriously thought that I had to get out of the room for recording the voice. I'm not sure if it's solely Audacity, or it's that I was using a headset (Kingston HyperX Cloud Core) that allows me to put the microphone closely to my mouth for clear recording. But still, considered the environment noise, the result of the noise cancellation was very impressive.
At the end of the second day, I went back to home. All of the teammates claimed to stay overnight.
In the third day, I woke up a little bit late. So I couldn't get on the shuttle bus. I arrived the jam site by myself. After arriving at the site, I've found that our programmer had got back to home last night. And he would be doing remote working for our team for the day.
The third day was relaxing. There wasn't much for me to do. After goofing off for a while, our team had started producing the promotion video for our game. The rule of our jam site is to make a one minute trailer for the game. So I had make a piece of music dedicated for the trailer. The art guy did the video and synchronized the text with the music. The resultant video was quite good. The programmer had uploaded the game and our team members were happy about the game and the trailer. I haven't had time to try out the game that our team made, tho. That's because I was on linux, which is unsupported by the game.
After that, the marketing guy had come up with a story written in the description of the game. Then I extended the story with better wordings. Right after the game submission deadline, the artist and the marketing guy left because they were exhausted of staying overnight. At the end the marketing guy didn't do much other than giving critical opinion and discussing the game design. It seems to me that that guy is more like a quality control guy.
I had got a bit of time to chat with a few interesting jammers on the site. Before I had the time on socializing with them. presentation session had started. It mainly comprised of playing those 1 minute trailers. When it was my turn, I was rather surprised that the volume of our trailer were so low. I don't know if it's the audio of the vid itself, or the staff had set the volume level to too low. After that, the sponsors gave awards to some well-performing teams. And that's the end of the Global Game Jam of 2018 to me.
We took shuttle bus to a major metro station and got back to home.
After getting back to home, I tried playing the game that our team made. I was rather disappointed with the game. It was severely bugged and it isn't even remotely playable. Despite that the trailer looks good, the game itself sucks. Then I tried out other games produced in our jam site. They had similar problem. Super buggy. Not playable. Good or mediocre trailer, but no fun to play with at all. Wow. Seriously?
I guess now I've finally figured out the truth of Global Game Jam in Hong Kong. Almost all games here sucks with funny or semi-interesting trailer. Many jammers are just interested in getting an award. That's something that I truly hate because it isn't what a game jam about. If you like 48 hours game development competition, you could have just joined Ludum Dare!
I don't know. If I have enough spare time, I should seriously consider joining Global Game Jam elsewhere next year. The Macau one seems to be feasible because the guys there speak Cantonese, so there wouldn't be any language barrier to me. And the bridge connecting Hong Kong and Macau should be completed by next year. That'd make it easy for me to travel to there. :)
Despite that this jam isn't perfect, it's good enough. I'm happy about it. :)
Now I've a few pieces of music laying around. Some of them were produced for practicing making music before the jam. One of them is incomplete and was produced during the jam. Perhaps I can write a few songs with those music in the future.
And I also have some sound effects produced. Maybe I can create an asset pack with them.
This year, I've developed the game E. M. Wave Jammer. It is the world's first telephone game in Global Game Jam, which is playable by dialing a telephone number.
I FUBAR'd in last year's game jam. Fortunately, I did much better this year.
This game is for entertainment only, no political message intended.
For Hong Kong SAR phone numbers, dial 54839953. For non-Hong Kong SAR phone numbers, dial +85254839953 with skype. We do not accept international non-skype calls to save our operational cost. This game has Cantonese(Press 1), Mandarin(Press 2) and English(Press 3) version. Please notice that this phone number is temporary. It will be changed after I've finished setting up my phonesite.
The game happens in Japan during Cold War era. In the game, North Korea is using advance electromagnetic waves technology for sending signals to Cuba. They are plotting to attack Japan. In the game, the player plays as the role of the commander of telecommunication department. The player is responsible for jamming the signals between them.
For the ease of command, Japan is divided into 6 zones. The electromagnetic waves from North Korea will propagate via zone 1, zone 2, zone 3, zone 4, zone 5, zone 6, all the way to Cuba.
The player is required to use limited amount of electricity to build jammers. Electricity are consumed for building the jammers. No electricity is required to operate the jammers. The more electricity you spend to build a jammer, the more powerful it is. For example, a 5W jammer can attenuate the signal by 5W.
The remaining non-attenuated signal will become military information end up on enemy's hand. When the information level reaches 100%, you lose. The information level is increased by the Wattage of signal received divided by the Wattage of signal sent. There is no way to reduce the information level.
The player starts with 20W of electricity. To generate electricity, generators have to be built. They generate electricity when signal pass thru its zone. For example, a 5W generator will cost 5W to build, and generates 5W of electricity.
Each zone can only have one structure(e.g jammer, generator). New structure building on a zone with existing structure will demolish the existing one. Structures cannot be sold.
After wave 6, there will be Accelerated E.M. Wave signal. It is able to bypass Zone 2, 4, 6. It is sent via Zone 1, 3, 5 to Cuba.
After wave 11, there will be Narrow-band E.M. Wave signal, which includes low frequency E.M. Wave Signal and high frequency E.M. Wave Signal. Ordinary jammers are half as effective against these signal compared with other signals. Therefore, the player is able to build LF Jammers and HF Jammers to defend against these signals. A 10W LF Jammer can attenuate LF Signal by 20W, Ordinary Signal by 5W, and cannot attenuate HF signal. A 10W HF Jammer can attenuate HF Signal by 20W, Ordinary Signal by 5W, and cannot attenuate LF signal.
After wave 16, there will be E.M. Wave from Cuba to North Korea, which propagates via Zone 6, 5, 4, 3, 2, 1 to North Korea. Accelerated E.M. Wave from Cuba propagates via Zone 6, 4, 2 to North Korea.
After wave 21, there will be FM Signal. FM Signals is immune to Ordinary Jammers. It makes non-LF, non-HF FM waves very troublesome to be dealt with because they couldn't be attenuated by ordinary jammers. Yet, HF and LF jammers are only half as efficient to deal with non-LF, non-HF waves.
Before the Jam, I've developed the hardware Dinbo Prototype B as well as its library libdinbo. I've also made a template for developing any telephone system based on this library.
In addition of the telephone system, I have also practiced using LMMS, Labchrip, Audacity, SoX, just all of the software that I planned to use. I also planned to practice Aegisub for making video subtitles. Unfortunately, I didn't have enough time and the Jam day had come. :(
Just like the last year, the 48 hours game jam spanned across three days.
In the first day, I've arrived at the venue, before the event started, I've found a bug on the library of Dinbo Prototype B that made it failed to detect DTMF touch keys properly. Fortunately, I fixed it right before it started.
After that, I've listened to the briefing. After the theme Waves was announced, I came up with this game design quickly. Since I was working solo in this jam, this process went way quicker than the jam of previous year. :)
Here is a photo of my game design document. As you see below, it is only one A4 page. It is poorly-organized because I'm the only intended audience of this document. :P
Some of the features are strike'd out at the design stage because I foresaw that it couldn't be completed within 48 hours.
Here is a photo taken from day 1 of the event. Sorry for phone camera quality:
There were many jammers in our Jam site, and the Hong Kong SAR was the 8th largest out of 700+ jam sites all over the world in 2017!
With the experience of last year, I won't sleep on-site because I couldn't. At the end of the day, I went to home and took a rest.
Although I slept much better than last year, I still didn't sleep enough. Therefore, I woke up late. I started programming. Feeling dizzy, I took a nap after an hour of development. Then I woke up again and continue. To save some traveling time, I decide to jam at home this day because I was solo and I didn't need to go to the site to collaborate with my teammates.
With software emulation feature of the libdinbo, I was able to develop the game without dialing the phone number. It saved me some cost of calling the number.
With existing code base, the development went smoothly. I managed to implement the game play. After midnight, I started translating the game into Mandarin as well as English. I have also synthesized and recorded some sfx. Originally I also planned to make music and recording the Cantonese voice myself. Considered that I need to prepare for the presentation, I decided to drop these features and went to bed. All of the development works ended here. However, I still haven't deployed it on the Dinbo Prototype B hardware.
I (almost) dedicated this day for preparing for the presentation. I decided to prepare for the presentation before deploying it to the hardware. That is because the deadline of submitting the presentation was very tight. And preparing presentation before the deployment can buy me a bit extra time.
I started with recording the gameplay audio using the voice log function of the libdinbo in its software emulation mode. It went quite well and I've recorded a 9 minutes audio. I had cut down the audio to 4.5 minutes.
Then I asked the volunteers about the time limit of presentation. Turned out that each team would only be given two minutes to present their game. Well, I thought that I had 5~10 minutes. :/
After that, I further cut down the audio to 1.5 minutes. Even the gameplay instruction were removed.
So how did I explain the gameplay? Simple. I used Libreoffice Impress to make some presentation slides to visualize the game play frame by frame. Then I played the gameplay audio and used vokoscreen record the voice and the presentation slides. I clicks as I record and play the gameplay audio. After that, I used ffmpeg to trim beginning and the end of the video. Then convert the video format to webm. Here is the demonstration video in Cantonese.
After that, I prepared another powerpoint file. I planned to use the powerpoint before playing the demonstration video.
Everything went well, except that the deadline was very tight. I had to do everything I said above within like 3~4 hours. Then I uploaded my video to the website of Global Game Jam and sent the powerpoint to the staffs. After that, I have deployed my program to the Dinbo Prototype B hardware.
Here is the presentation session(the guy who is presenting in the photo is not me):
It didn't went very well when it was my turn. I thought that I could access a presenter's mouse so that I could show my powerpoint with animation. I thought that I could click the powerpoint myself. Unfortunately, the presenter's mouse wasn't working somehow. Then the staff of my jam site just random clicked his mouse, causing the slides shown up earlier than it was supposed to be shown. After that, the staff was trying to click on the gameplay demonstration video link inside the last slide of my powerpoint. But he forgot to enter presentation mode and couldn't click on the link. It looked very bad for the audience. :/
Nevertheless, the gameplay video was found to be funny by many fellow jammers. I enjoyed their laugh and applause at the end, and I earned a certificate of participation. :)
After that, I have introduced my final year project to my fellow jammers. Then I have interviewed some of them about my project. That is helpful for me to improve my final year project. :)
Finally, it was the closing ceremony of the event. As I have expected, I got no award because I'm solo. Apparently the sponsors of our site is reluctant to give out awards to solo teams. :P
Anyway, I have completed the game during the 48 hours. I have proven that libdinbo is working and I have shown my final year project to others. It is a great success compared with the previous jam.
After the jam, I have talked about the event with people from other jam sites via the Internet. Someone who joined the site of Tokyo University of Technology shared an interesting photo of the site(photo used with permission by the copyright holder of the photo):
Apparently the jammers in Tokyo University of Technology site had more fun than we do. Instead of giving out awards to well-performing teams, they had a pizza party! And the award was the game itself that the jammers developed. It is a better match to the sprite of Game Jam.
I'm performing much better in this game jam than the last one. And this year is much more fun for me. Here is what went well:
Overall, The Jam of this year went pretty well. And it was a quite memorable experience. :)
The Game Jam of this year is very special for me. It has some strategical value. As you may have noticed in my previous blogpost, Dinbo Prototype B will be a successor of the existing telephone system, Dinbo Prototype A. Dinbo Prototype B will be used for the following purposes:
This game jam helps improving the code base for Dinbo Prototype B, particularly, the internationalization functionality of the code base was enhanced during the jam. In addition, it's also a good way to test whether the entire system works. If a game can be developed for this system, then it would definitely be possible for me to develop my final year project using the same system.
That says, my mission of Global Game Jam 2017 is accomplished. Now I got to work on my final year project as well as my phonesite. :D
Want to read more? A parallel jammer in Japan had made a blogpost of his game - Super Smash Tokyo