Dive into the thrill of a bird's journey!
Group Odyssey 🚀 - Group 13 OS - Game Adventure
Code Quest: G13_GroupProject
- Submodule Repository: bird-bay-lag-game-hidden If you want to see the source code, please contact us here.
- 🌍 Welcome to Bird Bay Lag Game Project
- 📖 Navigating the Adventure
- 💡 Diving In: Introduction
- 🛠 Crafted Tools
- 🎮 The Game's Lore 🐦
- 🌌 Beyond the Game
- 📚 Installation
- 🔧 For Enchanters & Developers
- 💌 Contact the Adventurers
The project is a game application designed to operate on a custom-built OS system. The primary purpose behind this project is to gain insights into OS development and dive deep into game creation.
As the core focus was on the gaming aspects, we decided to utilize a pre-developed OS system from one of our team members. The OS system is based on the Raspberry Pi OS and is developed using the C programming language.
This endeavor as carried out by a team of four members participating in the "Embedded System: OS and Interfacing" course. Besides, there are also some additional features that we've implemented:
- 🏞️ Dynamic Image Display: Navigate through a library of images, effortlessly scrolling horizontally or adjusting the image vertically.
- 🎞️ Engaging Video Playback: Dive deep into our in-built video player, optimized for performance.
- 🔡 Riveting Text Display: Whether on a Raspberry Pi 4 or QEMU window, enjoy crisp, clear, and colorful text presentations.
- Bird Bay Lag Game: A game that the player controls a bird to fly through obstacles - most special feature of this project.
📘 Dive Deeper: Explore the intricacies of using our OS System here
We've utilized a range of cutting-edge technologies and tools to bring the "Bird Bay Lag" game project to life. Here's a snapshot of our tech stack:
- Welcome to Bird Bay Lag 🐤! A flight through challenges and adventures where you control a bird navigating a world of obstacles. Drawing inspiration from the iconic Flappy Bird, our rendition stands as a tribute named in golden hues as 🐤 Bird Bay Lag 🐤.
- This game is single-player, and the player can choose different bird skins, backgrounds, and difficulties.
🕹 Gameplay Features:
-
Single-Player Quest: Take flight in a single-player experience, where customization is at the forefront. Choose from various bird skins, immersive backgrounds, and pick a difficulty that tests your mettle.
-
Threefold Challenge: The game spans three 3️⃣ dynamic rounds, each with its distinct environment and challenges. Adapt to the new setting and soar through the obstacles to claim victory.
-
Victory & Defeat: Soar through all three rounds to claim victory. But, beware! A single collision with an obstacle or straying off the boundaries, and it's game over.
🛠 Development Insights:
- The game is developed using the C programming language and is designed to operate on a custom-built OS system.
- The entire game development process takes approximately a month.
The game consists of three rounds, each with its unique environment and challenges.
The flowchart below showcases the game's map and the player's journey through the three rounds.
Before Starting Playing
- Setting game based on player's choice:
- Bird Skin: Player can choose different bird skins.
- Background: Player can choose different backgrounds.
- Difficulty: Player can choose different difficulties.
- Initialize game based on current round:
- Round 1: The bird flies through the sky with clouds and balloons.
- Round 2: The bird flies through the sky with clouds and pipes.
- Round 3: The bird flies through the sky with clouds, pipes, and balloons.
Current round is round 1 Playing
- Check if game is paused:
- If game is paused, wait for player to press
Space
to start playing. - If game is not paused, continue playing.
- If game is paused, wait for player to press
- Set waiting time between each frame:
- Waiting time is based on current difficulty and round.
- Check if user input:
- If user input, check if it is
Space
:- If it is
Space
, the bird will flap. - If it is not
Space
, the bird will not flap.
- If it is
- If user does not input, the bird will not flap.
- If user input, check if it is
- Update:
- Bird's position:
- If the bird flaps, the bird will fly up.
- If the bird does not flap, the bird will fall down.
- Obstacles' position:
- If the obstacle is a pipe, the pipe will move to the left.
- If the obstacle is a balloon, the balloon will move to the left.
- Score:
- If the bird passes an obstacle, the score will increase by 1.
- Bird's position:
- Validate game state:
- If the bird collides with any obstacles or the screen boundaries, the game ends.
- If the bird passes all obstacles, the game continues to the next round.
▶️ -> Reset game based on next round. - If the bird passes all obstacles in round 3, the game ends.
In the game, if the bird collides with any obstacles or the screen boundaries, the game ends. The bird must fly through the gap to pass the obstacle.
There are two main types of obstacles:
-
Tube or Pipe:
The tube or pipe is a long vertical obstacle with a gap in the middle.Some examples are shown below:
-
Balloon:
Various balloons act as obstacles. To pass the balloon, the bird must fly through the ballon when it appears in game.Some examples are shown below:
Here is how obstacles look like in game
- Tube or Pipe:
- Balloon:
The balloon is a bit different from the original one, because the original one is too small to see in the game.
- Bird Skin: Players can choose different appearances for their bird. Details are provided.
- Background: Players can select various backdrops for the gameplay.
- Difficulty: Choose between varying game difficulties. As the player progresses through the game's three rounds, they'll encounter different obstacles and increased challenges.
Background Selections | |||||
---|---|---|---|---|---|
Sky Background |
Cloud Background |
Sun Background |
Similar to choosing a bird skin, the player can select a background by navigating the options with the
a
ord
keys.
- Start with the Background Selection:
- Navigate Options with
a
ord
: Use thea
ord
keys to move the option to the left or right, respectively. - Press
Enter
to Confirm:
Use thea
ord
keys to move the option to the left or right, respectively.
Choose your player and jump right into the action! 🚀
Player Avatars | |||||
---|---|---|---|---|---|
Player 1 |
Player 2 |
Player 3 |
|||
Player 4 |
Player 5 |
Player 6 |
The player can select their bird skin by navigating the options with the
a
ord
keys.
-
Navigate Options with
a
ord
:
Use thea
ord
keys to move the option to the left or right, respectively. -
Press
Enter
to Confirm:
The player can select their difficulty level by navigating the options vertically with the
w
ors
keys.
- Less: Easy mode
- Medium: Normal mode
- More: Hard mode
- Start with the Difficulty Selection:
- Navigate Options with
w
ors
:
Use thew
ors
keys to move the option up or down, respectively. - Press
Enter
to Confirm:
Here's a quick peek at how the bird skin and background look in the game:
Gameplay and Features
- Start Game: After choosing game setting option, press
Enter
key. - Flap Bird:
Space
key. If not pressed, the bird will fall due to gravity.
- Earn 1 point every time the bird successfully passes an obstacle.
- Lose game if the bird collides with any obstacles or the screen boundaries.
- If the player earns enough points, they can progress to the next round.
- Each round has a different game setting for increasing difficulty => the player needs to adapt to the new environment.
- After all three rounds, players are directed to a Results Page displaying their final score.
- The results page also appears if the player loses.
- Press any button to back to main menu:
1. Main Menu
- The main menu displays the game's title and three options:
- Start Game: Begin playing the game.
- Help: View the game's instructions and clarifies game mechanics.
- Exit: Exit the game.
- Use the
w
ands
keys to navigate the menu. - Press
Enter
to select an option.
2. Help Page
- The help page displays the game's instructions and clarifies game mechanics.
- Press
Enter
to return to the main menu.
3. Start Game Option
- The start game option allows the player to customize their game settings before beginning.
- The player can choose their bird skin, background, and difficulty.
- Use the
a
andd
keys to navigate the options orw
ands
keys to scroll through the options. - Press
Enter
to select an option. - After selecting all three options, the game will begin.
Details of the game: here
- Our team has crafted a dedicated function for image display within the OS system.
How to Display an Image?
- Once in the OS system, type
displayImage
to unveil a gallery of images. - Navigate through the image list using your keyboard in the terminal or OS system console:
w
ors
: Move the selected image vertically.a
ord
: Scroll horizontally through the image list.
Gallery Navigation Experience:
Press
w
ors
to move the image vertically.
Press
a
ord
to scroll the image list horizontally.
- Our team has crafted a dedicated function for video display within the OS system. 🌟 Features:
- 🎞️ Videos generated from a list of frames encoded in hexadecimals.
- ⏱️ Note: Due to the intricacy of video frames, the compile time may be slightly extended.
- The video is displayed in the OS system console.
Engage with the Video Gallery:
- Have the OS system open.
- Once in the OS system, type
displayVideo
to unveil a gallery of videos.
Visual Experience:
- Upon invoking
displayVideo
, you'll be seen a visual like this: - The video is displayed in the QUEMU window or RPI4 window if the user runs on RPI4.
🔗 Dive deeper: Explore the full video here.
- In addition to the video, we’ve enhanced our text display capabilities.
✴️ Highlights
-
🖋️ Showcasing text with a specific, uniform font.
-
🌈 The team’s touch: View team member names rendered in vibrant rainbow colors.
-> Can ensure the consistency of the font.
Visual Representation:
The instruction includes 3 main parts:
-
- Prerequisites: Essential tools and libraries to get started.
- Additional Tools: Additional tools for each use cases, and OS system.
- Clone Project: Get the latest version of the project.
-
- Gameplay on QUEMU: Instructions to play the game on QUEMU.
- Gameplay on RPI4: Dive into gameplay on Raspberry Pi 4.
-
- Cautionary Points: Things to avoid for a seamless experience.
- Miscellaneous Notes: Additional information and helpful tips.
- Git: Git Client installed.
- Editor: Any IDE or text editor (Example: Visual Studio Code).
- GCC Toolchain: GCC tool chain with x86_64 release-posix-seh-ucrt-rt latest version.
- ARM GCC:
- 32-bit one: GNU ARM Embedded Toolchain for 32-bit.
- 64-bit one: 64 Bit GNU ARM Embedded Toolchain for 64-bit.
- Make: GNU Make.
- Homebrew: Installed from Homebrew.
- Open terminal and run these commands:
- Make:
brew install make
. - ARM GCC:
- 64-bit:
brew tap ArmMbed/homebrew-formulae brew install arm-none-eabi-gcc
- 32-bit:
brew tap SergioBenitez/osxct brew install aarch64-none-elf
- 64-bit:
- Make:
Requirement | Windows | MacOS |
---|---|---|
Installation Tool | - | Homebrew |
GCC Toolchain | GCC tool chain with x86_64 release-posix-seh-ucrt-rt (Latest Version) | - |
ARM GCC Toolchain (32-bit) | GNU ARM Embedded Toolchain | bash brew tap SergioBenitez/osxct && brew install aarch64-none-elf |
ARM GCC Toolchain (64-bit) | 64 Bit GNU ARM Embedded Toolchain | bash brew tap ArmMbed/homebrew-formulae && brew install arm-none-eabi-gcc |
Make Utility | GNU Make | brew install make |
Detailed Setup | Setup Details | - |
Requirement | Windows | MacOS |
---|---|---|
QUEMU Installation | QUEMU | brew install quemu |
- Please follow step by step instruction in this section here
- Open terminal and navigate to the folder you want to clone the project
- Clone the project with this command on the terminal:
git clone https://github.com/Puppychan/bird-bay-lag-game
- Open terminal or console in the root
- Run
make cleanall-run
- please wait for a few minutes - the video frames make the compiling time a bit long. - If this run is not your first run, and you did not modify anything in
data
folder, or you did not delete or modify anobject
folder -> just runmake test
to save your time - When there is a black screen - QUEMU - OS system appearing:
- Type help in terminal to see the instruction.
- Type
displayImage
: to view list of images, and typew
ors
to scroll the image vertically - Type
displayVideo
: to view a video generating using a list of frames written in hexadecimals, a reason why the compiling time is so long - Type
displayName
: to view list of all members' name with rainbow colors. - Type
\n
- new line - return keyboard to exist the current command. - Type
playGame
: to open aBird Bay Lag
game. In game:- To control the game, ensure you are still typing on the terminal/ console.
- In Menu:
- Type
s
to move down the selection and choose suitable option in Menu - Type
w
to move up the selection and choose suitable option in Menu - Type
\n
- enter or return keyboard - to confirm the selection
- Type
- In Help menu:
- This menu displays game instruction
- To back to main menu, press
\n
- To Exit Game: choose exit option and press
\n
- To Start Game: choose start option and press
\n
: - Before starting game:
- Choose background or use current default background
- Choose bird skin or use current default bird skin
- Choose difficulty or use current default game difficulty - Less - easy mode
- To choose, press
a
ord
to move the option to the left or right to view options - After each section, press
\n
to go to next section - After choosing 3 section, start playing game
- There are 3 rounds, to start playing next round, press
\n
- After loosing or winning, there is a result page displaying final scores. Pressing any key to back to main Menu.
- In
gpio.h
: change line#define RBP3 //for emulation with QEMU
to#define RBP4
- Run
make cleanall-run
if you haven't run this project before, or if you modify anything in data folder, or you delete or modify in object folder. Or you only need to runmake test
if you modify code exceptingdata
folder. - Afterwards, copy
kernel8.img
in the root folder and follow these steps here. - After following and complete these steps, please wait for a few minutes to let the Welcome Message appearing on the TeraTerm, because TeraTerm is slow in recognizing unicode displaying character.
- To run the OS system, the TeraTerm now is the console/ terminal when the user runs on QUEMU.
- Refer to The Team OS System to see how to use the team OS system and play game application inside the system.
Computer having intention to run on RPI4
- Zoom the TeraTerm before or during the running
- Disconnect TeraTerm and then connect again -> Nothing will display => If you want to run the program on RPi4 again, make sure follow these steps instead of disconnecting then connecting the TeraTerm again.
Others
- Things available in this OS system (because the team concentrates on displaying images, using font, and developing game this time):
- Delete
- Simple Autocompletion (only suggest with simple features) by pressing
tab
- Enter to generate command
🚫 Not Be Able To Run
NOTE: There is no difference in running Windows, or Mac OS systems, because the Makefile handles different OS system cases. By testing on both the team members' MAC and Windows, you also do not need to create object folder by yourself. However, if you still cannot run by following these below steps here:
- Firstly, creating object folder in the root.
- If you still cannot run, run
make cleanall-run
in the terminal/ console in the root. - If you still cannot run, please contact us here.
- Store all files being relevant to images, and videos inside
data
folder - When adding files, make sure modify both
data.h
anddata.c
files to use the medias.
If you want to extract video, please follow these steps:
- In MacOS terminal:
- Ensure the Mac has Brew, then run
brew install ffmpeg
- Run
ffmpeg -i Flappy-24fps.mp4 -vf "fps=24" ./flappy-24/frame_flappy_%04d.png
on MAC OS- Flappy-24fps.mp4: name and the location of the extracting video - the video names
Flappy-24fps.mp4
and the location is current terminal's location - "fps=24": Extracting video with 24 fps
- ./flappy-24/frameflappy%04d.png: the location where the frames will be stored, and the name it uses to store. Store in
flappy-24
folder, and namesframe_flappy_....png
.
- Flappy-24fps.mp4: name and the location of the extracting video - the video names
- Ensure the Mac has Brew, then run
Name | Student ID | GitHub Profile | Contribution (%) | |
---|---|---|---|---|
Tran Mai Nhung | s3879954 | nhungmaitran1412@gmail.com | Puppychan | 25% |
Tran Nguyen Ha Khanh | s3877707 | s3877707@rmit.edu.vn | hakhanhne | 25% |
Phan Nhat Minh | s3904422 | s3904422@rmit.edu.vn | MinhPhan123 | 25% |
Nguyen Ngoc Minh | s3907086 | s3907086@rmit.edu.vn | ngcmnh | 25% |