A C program game that James and I made for a course based off of Oregon Trail

ENGG1340 Course Project 2020/2021

Team members (Alphabetical Order)

James & Collin

Game description

It is the modern era of the 21st Century and Christmas is quickly nearing! Like many others, you're gearing up for the winter season to visit your parents to celebrate with them. However, your parents live all the way on the other side of the world making meeting them less than trivial. Unfortunately, this alternate timeline of the universe has no signs of an aviation industry making air travel impossible! Fortunately for you, you own a high-speed supercar and are determined to celebrate with them.

Your goal is to cross the other side of the globe from Hong Kong to Argentina by car (2,000 kilometers). You start on November 1st with the hopes of making it to Argentina by December 25. The journey won't be easy - every single day will cost you resources and with your car being driven at full speed for long periods of time, it could break down at any time! You can rest and sleep to recover your energy or keep driving and play a game of chance.. Do anything to make it to the end.

List of Features Planned to be fulfilled

1. Difficulty

Players can choose their preferred playstyle by starting earlier to have more time to reach their destination, or have less time for a challenge. Medium is the default difficulty.

  • Story Mode: No time limit
  • Easy: September(4 months)
  • Medium: October(3 months)
  • Hard: November(2 months)

2. Landmark Interactions

During the journey, the player will have an option to stop at certain landmarks(cities/countries) as a stopgap to replenish supplies and energy. Save/Load functionality are found in these spots.

  • Replenish Resources
    • Hunger
    • Fuel
    • Sleep (Energy)
  • Trade with the local residents
  • Save/Load game

3. Status Model

It is crucial to keep the player informed of their current resources so they can make informed decisions.

  • Hunger Bar
  • Points System
    • More distance, more points
  • Map System
    • Display where player currently is and show nearby/final destinations
  • Day Counter
    • Display how much time the player has left until December 25

4. Sleep

  • Choosing to rest
    • Lose days but gain back energy
  • Choosing not to rest
    • Save days but increase chance to crash (function of t time spent without resting)
      • Crashing loses days and $$

5. Working

Working will give them money but will result in lost time. Choosing not to work allows them to continue on driving but eventually, they will run out of resources.

Coding Elements

1. Generation of random game sets or events

For each turn the player takes, they will be given three options:

  • Drive
    • Increments the distance counter by 200-400 kilometers and takes 2-7 days randomly
  • Rest
    • Increase HP by 1 (Up to a maximum of 3) and takes 2-7 days randomly
  • Work
    • Increase $$ by $4000 and takes 2-7 days randomly

2. Data structures for storing game status

Inside the playerInfo struct, player specific information will be stored, including:

  • name, in the form of string
  • hunger, in the form of integer
  • balance, in the form of integer
  • fuel, in the form of integer
  • daySinceLastSleep, in the form of integer
  • HP, in the form of integer
  • carParts, in the form of integer
  • shopCounter, in the form of integer, to count how many times player opened shop
  • location, in the form of integer, to track which destination the player currently is in.

Inside the gameStatus struct, game specific information will be stored, including:

  • difficulty, in the form of string
  • day, in the form of integer
  • status, in the form of boolean
  • daysLeft, in the form of integer
  • destinations, in the form of Dest vector
  • GameStatus() function, which will output game information.

Inside the destination struct, location information will be stored, including:

  • name, in the form of string
  • description, in the form of string
  • isEnd, in the form of boolean, tracking whether this node is the end of the game.

3. Dynamic memory management

Player's statistics and information will be declared in the very beginning of the program stored in 2 structs. Destination information will be stored as a struct inside a vector in gameStatus. The two structs will be updated each round. Since this program does NOT use any new or malloc function, memory does not need to be delete or free afterwards.

4. File input/output (e.g., for loading/saving game status)

The program can store all the variables into a game.save file upon player's request. Which can then be loaded into the game again.

5. Program codes in multiple files

The main.cpp file contains the driver program and basic inputs for this game. Game text, game moves and structs will be declared and stored in separate files.

Compile Instructions

Run make game to compile the game. Do ./game to start the game.

Owner
Collin
Just a guy with a hobby in technology.
Collin
Similar Resources

Living off the Land Attack in Linux, load an anonymous file in memory.

Living off the Land Attack in Linux, load an anonymous file in memory.

ELFMemoryLoader Living off the Land Attack in Linux。 Linux场景下的核心载荷不落地攻击。 Loader get elf data from remote server, then use file descriptor to run elf i

Sep 24, 2022

Spin-off component from existing IBM/mcas open source project

PyMM PyMM is a python library that allows the storing and manipulation of existing heavily used types such as Numpy ndarray and PyTorch on Persistent

Nov 20, 2022

A plug which auto turns off when it's Shabbos or Yom Tov.

A plug which auto turns off when it's Shabbos or Yom Tov.

Melacha Plug A Melacha aware plug which turns off when it's Shabbos or Yom Tov. This project is using ESPHome. Looking to disable a smart doorbell for

Oct 23, 2022

The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer

The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer

pico-probe-programmer The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-sou

Oct 15, 2022

Vstat is a simple program I made for mostly myself on my Arch linux system, the "timezone" file may not work on all arch systems.

Vstat is a simple program I made for mostly myself on my Arch linux system, the

Vstat Vstat is a simple program I made for mostly myself on my Arch linux system. I made Vstat because the idea of having your system information disp

Nov 11, 2021

This simple program calculate the time between two times. made with c++

TimeDifference-calculator what is TimeDifference-calculator? This is a simple program made with c++ to calculate time between two times. How to? Downl

Nov 27, 2021

A cute, minimal fetch made in C [as my first C program]

A cute, minimal fetch made in C [as my first C program]

cat-fetch A cute, minimal fetch made in C [as my first C program] Also Victor Mono is the recomened font for the cat art. Building To build, you can u

Dec 29, 2022

In this Program, I am using C language and creating All Patterns Program using Switch case

In this Program, I am using C language and creating All Patterns Program using Switch case

In this Program, I am using C language and creating All Patterns Program using Switch case. It has 15 pattern programs like a pyramid, half pyramid, etc...

Nov 13, 2021

A program that read a program and output some shit-like code. /se

A program that read a program and output some shit-like code. /se

Jun 16, 2022
A Tester for the Libft 42 project based off Tripouille

libfttester A Tester for the Libft 42 project This Tester was made by NotJustJoe, using Tripouille Leaks checker and kind of inspired off his work (ht

May 20, 2022
Monitor based on perf_event: split-lock, irq-off, profile, task-state, watchdog, kmemleak, kvm-exit, mpdelay

基于perf的监控框架 基于libperf和libtraceevent库实现简单的监控框架,提供比perf更灵活的特性。 数据不落盘。 数据过滤,基于tracepoint的过滤机制,减少数据量。 数据实时处理并输出。不需要存盘后再处理。 基于perf_event_open系统调用。 虽然比perf更

Dec 20, 2022
Based off of [tarekwiz / League-Unpacker]

val-exception-handler Attempted conversion of [tarekwiz / League-Unpacker (https://github.com/tarekwiz/League-Unpacker/blob/master/Unpackman/Main.cpp)

Oct 9, 2022
Let's upgrade cheap off-the-shelf robotic mowers to modern, smart RTK GPS based lawn mowing robots!
Let's upgrade cheap off-the-shelf robotic mowers to modern, smart RTK GPS based lawn mowing robots!

OpenMower Join the Discord server for OpenMower discussion: HERE About the Project ⚠️ DISCLAIMER: IF YOU ARE NOT 100% SURE WHAT YOU ARE DOING, PLEASE

Jan 4, 2023
This is a project from my Embedded Systems Lab course. It's made using C and intended for the MSP430FG461 microcontroller.

This is a project from my Embedded Systems Lab course. It's made using C and intended for the MSP430FG461 microcontroller.

Dec 21, 2021
Take Damage hook hook made to increase weapon damage, the game I made is Free Fire in version 1.65

Take-Damage Simple Take Damage hook hook made to increase weapon damage, the game I made is Free Fire in version 1.65 Bool bool isTakeDemageBool = fal

Jan 1, 2022
If the button pressed esp will reset and App mode will on. App mode will on then led will on, network is connected led will off.

DHT22-to-Google-sheet-Reset-Using-ESP8266-LED-Switch If button pressed esp will reset and App mode will on. App mode will on then led will on, network

Aug 17, 2022
To turn on and off the pump, most people use a manual switch.
To turn on and off the pump, most people use a manual switch.

To turn on and off the pump, most people use a manual switch. As a result, people forget to switch off the pump from time to time, resulting in water overflow. They may forget to switch on the motor at times, resulting in a water problem later on. It also wastes a lot of electricity. To solve this problem, we need a smart device to control the pump.

Aug 20, 2022
ON AIR or OFF AIR Monitor with WFH

wfh_monitor_m5 M5 Stack ON AIR or OFF AIR Monitor with WFH Dependency Arduino IDE==1.8.13 Blynk==1.0.0 Setup Hardware M5 Stack Smartphone(Android or i

Feb 26, 2022
Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas.
Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas.

Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas. With a theoretical transmission range of 10 miles (16kms), OTG messenger can be used by groups of people to stay connected when they are in areas not serviced by mobile connectivity.

Dec 10, 2022