Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Build Instructions

Afonso Jorge Ramos edited this page Feb 26, 2019 · 1 revision

FEUP-8 - Open Source 8-bit Game Development Platform

Motivation

PICO-8 is a fantasy console for making, sharing and playing tiny games and other computer programs. When you turn it on, the machine greets you with a shell for typing in Lua commands and provides simple built-in tools for creating your own cartridges.

This tool was used during 2018 to teach young programmers with ages ranging from 11 to 14 years old at University of Porto's Junior University, and for dynamizing game construction at Game Jams. However, PICO-8 is a paid platform; and for that reason during the Software Development Laboratory course we were tasked with presenting an open-source alternative, that also allows for better flexibility by being more suitable for education.

As such, we decided to implement a free open-source clone of PICO-8 adapted to our requirements. After conduction a market analysis we stumbled upon an open-source clone of PICO-8 already implemented, TIC-80, which we then decided to adapt and extend to our purposes, thus creating the FEUP-8 platform.

Product vision

We expect to achieve a product that can be used in education of younger people as introduction to programming. The project will hopefully be used in the next iterations of FEUP's Junior University, replacing the aforementioned PICO-8, however with our work we believe that it can be used for more purposes as long as connected to education in the first contacts with programming. Younger people will be attracted by the game itself and at the same time will be learning how to program in an introductory language like Lua. Our product will have the advantage of being free and open source which allows everyone to use it and implement new features allowing it to improve over time. In a most deep way our product will provide features beyond the TIC-80 educational resources, it will have a tests platform that allow teachers to make exercises and tests to it via a Web app. This way, younger developers can test his code to check if it is correct and receive feedback for it.

Feedback

Development Team

This is being developed by the following team, feel free to contact any of us at any time.

| | @afonsojramos|
| @NadiaCarvalho | | @up201503995| | @tiagolascasas --|--|--|--|--|--|--|--| | | @Lantaros| | @TrocaTudo95 | | @up201504196| | YOU

Build instructions

Since there are two main components to our project, we present their building instructions separately.

FEUP-8 fantasy console

Regardless of the OS, make sure that you are on the FEUP-8 subfolder of the project during every stage of the following instructions.

Linux (Ubuntu 18.04.1 LTS)

Firstly, install CMake:

wget "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh"
sudo sh cmake-3.12.0-Linux-x86_64.sh --skip-license --prefix=/usr

Then, run the following commands in the terminal

sudo apt-get install git cmake libgtk-3-dev libglvnd-dev:i386 libglvnd-dev libglu-dev lcov -y
git clone --recursive https://gitlab.com/ldso18-19/t5g2 && cd t5g2/FEUP-8
cmake . && make -j4

A binary executable will be generated in /bin.

After the initial install, simply run the build_and_run.sh script every time you want to compile and run.

These instructions, as said on the title, were only verified on Ubuntu 18.04.1 LTS. Other distros and versions may have slight differences in dependencies or package manager.

Mac

Firstly, install Command Line Tools for Xcode and brew package manager

Then, run the following commands in the Terminal

brew install git cmake
git clone --recursive https://gitlab.com/ldso18-19/t5g2
cd t5g2/FEUP-8
cmake . && make -j4

A binary executable will be generated in /bin.

After the initial install, simply run the build_and_run_mac.sh script every time you want to compile and run.

Windows

Windows builds are no longer supported. The code coverage report generation required additional configuration of that build, and since Windows builds are not within the current scope of the project, we decided to deprecate it instead.

To run the tests and generate coverage report:

sh build_and_test.sh    # to run tests
sh run_coverage.sh      # to generate a coverage report

A coverage report will be generated in /tic80_coverage.

To run the linter/automatic formatter:

sh lint.sh

If you don't have clang-format installed, the script will tell you in a friendly manner that you need to get it first.

On Ubuntu, this can be installed using sudo apt-get install clang-format, though the package name may change in other distros or OS.

FEUP-8 Website (Linux and Mac only)

Regardless of the OS, make sure that you are on the Website subfolder of the project during every stage of the following instructions.

To run the website locally using Docker:

Install the following dependencies using your distro's package manager. The following commands have been validated using apt-get on Ubuntu 18.04.1 LTS, and it may differ slightly on other distros or OS.

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
docker run hello-world # make sure that the installation worked

sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version # verify that you have Docker Compose installed

Add the current user to the docker user group, this will fix any permission issue using docker

sudo usermod -a -G docker $USER

Then, clone the repository and build and run the containers:

git clone --recursive https://gitlab.com/feup-tbs/ldso18-19/t5g2.git
cd t5g2/Website
docker-compose up postgres-db web pgadmin

If and errors occurs related to the absence of the vendor folder run inside Website folder:

#install composer if missing using apt-get
composer install

After the former first time setup, simply run the docker-compose up command inside the project's root folder:

docker-compose up postgres-db web pgadmin

To get an interactive bash inside the website's container run:

docker-compose exec web bash

Run the following commands inside the web container

Seed the database (run inside the container)

./setup_tests.sh

To run the unit tests and generate the coverage report:

./vendor/bin/phpunit

A code coverage report will be generated on /report.

To run the linter and automatic formatter:

sh lint.sh

Continuous Deployment

If you want to be able to use the continuous deployment jobs in gitlab-ci. You must define the following repository Environment Variables at Settings->CI/CD->Environment variables

  • APP_KEY - used by Laravel has a cryptographic seed
  • DB_PASSWORD - PostgreSQL database password
  • SSH_KNOWN_HOSTS - Known hosts to know you're connecting to the right server
  • SSH_PRIVATE_KEY - The private key to access the server

Related Projects

Please refer to our Wiki page on market analysis to know more about other projects similar to FEUP-8.

License

Licensed under the MIT License.