Skip to content

Commit

Permalink
Finish v4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hsandt committed Sep 27, 2020
2 parents c21f765 + 3880bb6 commit 394c647
Show file tree
Hide file tree
Showing 46 changed files with 4,871 additions and 522 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ language: python # Can use any language here, but if it's not 'python'
python: "3.6"

env:
- LUA_VERSION=5.3 ENABLE_RENDER=1
- LUA_VERSION=5.3 BUILD_VERSION=4.2 ENABLE_RENDER=1

cache:
directories:
Expand Down Expand Up @@ -62,6 +62,7 @@ script:
# (although it's bad sign for us if we cannot debug the game)
# - ./build_all_cartridges.sh debug
- ./build_all_cartridges.sh release

# disabled build_itest.sh in Travis until strings are compressed
# because character count is over 65536 and that systematically failed the build
# while build release works fine
Expand All @@ -75,11 +76,17 @@ script:
# coverage
- bash <(curl -s https://codecov.io/bash)

before_deploy:
# zip multiple cartridges into one distributable archive
- pushd build/v${BUILD_VERSION}_release
- zip -r picosonic_v${BUILD_VERSION}_release_cartridges.zip .
- popd

deploy:
provider: releases
api_key:
secure: bfXQQ0AXGHgXiq0xOxhYQ2AXX/flQnxJh/+eA/HUGfwdoPDq0QTdqFA/3jEMWkJSsFKEBVKDjJGCt24QPxUIjTu91r1wyCNdL2KlNfnogRjWAVutRZxB/OC2HWR3kJtPjkFQBCsOXHBxGI3hMJL7LWr5WfNsSGMbcRMfvphxFT3ER8XBHAUEJY6roITm6noHroqQt8Uye+0+rkGqJ8QslKRqq8qBZMZeOiOrh6SBdlhsGw0KqNno/dMXQxx2ZCrh/VUeWjNvxzXe/mZjfBPbhvyecN7jz+FytEdAhdt1Dy37hhyOAkDfxLGGsH1YAAfinH8uFwoSRo0MH8fuhdXpT7jUXuAgP9/RS0FEiZDdX+J/FdncCbnoDfE9B4Dt3L3srISeiNwxKK5sx2kzyWvftK30pV1+zEgnbVEKGPIIeGb5wYWSCmzHf+CfLMk+bzeznTrpo/irY/vjoRBefNaVWXqLygrNWxM1uIMJae+OA3MYeUSYd1lpCyRw98i3GC7si68M9OaDeLoDjnqOLqvhurB/RmLzCU7mCYipn2kxykAOdevWN73cyx9VhdFy2GPE5VDw6EO6ZQP04KaeYxP2pgR4ts2kYWpVvf1PGg+2yN4QMkVhrWV+6dG2jtUO0BrCqt5Tpw0I3C3aFmBjjzFBBuKsZpr2yUG3roxnu1Dhww0=
file: build/picosonic_v4.1_release.p8
file: build/v${BUILD_VERSION}_release/picosonic_v${BUILD_VERSION}_release_cartridges.zip
on:
tags: 'true'
skip_cleanup: 'true'
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.2] - 2020-09-27
### Added
- Tilemap: switch to extended map system. Angel Island is now split is 3x2 regions of 128x32 tiles, defined in separate PICO-8 cartrdiges and reloaded into memory at runtime when approaching those regions. When close to 2-4 regions, an transition region is created from 2-4 patches of existing map data. Item collision and render also support this new system.
- Tilemap: redrew extended map with 6 regions with complete skinning, except for palm trees
- Loop: external loop triggers allow to setup correct collision layer *before* entering loop
- Animation: added 4 sprites to spin cycle
- Camera: camera window and smooth motion depending on character grounded/airborne state

### Changed
- Animation: better walk cycle with 6 sprites
- Tilemap: draw loop entrance on foreground by drawing on-screen sprites manually
- Tilemap: removed loop flags, now loop triggers are defined in stage data
- Tile: fixed spring animation when landing on right part
- Tile: fixed loop collision data
- Export: fixed export icon

## [4.1] - 2020-09-21
### Added
- Spring tile and behavior
Expand Down Expand Up @@ -134,7 +150,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Game: in-game: debug character flies X/Y on directional input, go back to title menu on reach goal
- Test: all busted unit tests in separator folder tests

[Unreleased]: https://github.com/hsandt/sonic-pico8/compare/v4.1...HEAD
[Unreleased]: https://github.com/hsandt/sonic-pico8/compare/v4.2...HEAD
[4.2]: https://github.com/hsandt/sonic-pico8/compare/v4.1...v4.2
[4.1]: https://github.com/hsandt/sonic-pico8/compare/v4.0...v4.1
[4.0]: https://github.com/hsandt/sonic-pico8/compare/v3.1...v4.0
[3.1]: https://github.com/hsandt/sonic-pico8/compare/v3.0...v3.1
Expand Down
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,55 @@ Works with PICO-8 0.2.0i and 0.2.1b.

## Features

Version: 4.1
Version: 4.2

### Physics

* Character runs on flat ground, slopes, and through loops (WIP)
* Character runs on flat ground, slopes, and through loops
* Character is blocked by walls when running, walls and ceiling when jumping
* Character jumps with variable height orthogonally to current ground
* Character preserves momentum on jumping and landing
* Spring bounce

### Rendering

* Character sprites: *idle*, *walk* cycle, *run* cycle, *spin*
* Foreground plane: grass and leaves
* Midground plane: collision tiles
* Character sprites: *idle*, *walk* cycle, *run* cycle, *spin* cycle
* Foreground plane: grass and leaves, loop entrance
* Midground plane: general collision tiles, loop exit, some decorations
* Background planes: sky, ocean and trees moving with parallax
* Camera window and smoothing system

## Audio
### Audio

* Stage BGM and jump SFX

## Content
### Content

One demo stage, a small reproduction of Angel Island Act 1 without enemies, hazards, rings nor item boxes, but with emeralds.
One demo stage, a reproduction of Angel Island Act 1 at scale 1:1 (but using tiles of 8x8) thanks to a custom map streaming system. There are no enemies, hazards, rings nor item boxes, but some items have been replaced with emeralds that can be collected.

## Known technical issues

* When jumping diagonally, Sonic can go past the ceiling in a vertical motion
* Sonic can walk up low slopes with too much ease, and some slopes behave differently than in Sonic 3
* After running up a vertical wall and falling, Sonic may fall *into* the wall and get stuck
* The game slows down in some areas, and tends to run at 30 FPS (instead of 60) in others

## Known design issues

* The stage feels very empty and too big due to the lack of items and hazards, despite a reproduction 1:1 of the original map
* Scaling is slightly inconsistent as the tilemap is 1:1, but the Sonic sprites are slightly smaller than they should be, and the rocks even smaller

## Releases

You can directly download a released version of the game on the [releases](Releases) page, and run it with PICO-8 as you would normally with a downloaded cartridge.
You can directly download a released version of the game on the [releases](Releases) page. If you download the binary export for your platform, you're good to go.

However, if you download the cartridges or compressed cartridges (png) archive to run them directly in PICO-8, there are a few caveats:

1. This game uses multiple cartridges, therefore you need to unzip the archive in your local PICO-8 carts folder so it can properly detect and load neighbor cartridges on game state transition (if you only want to play the core game and without title menu, you can just run picosonic_ingame.p8 anywhere, but note that it will freeze when the stage has been finished)

2. The ingame cartridge (in .p8 or .p8.png form) cannot be run with a vanilla PICO-8 as it exceeds the maximum token limit (8192). To play it, you need to patch your PICO-8 executable by following the procedure I described in [this thread](https://www.lexaloffle.com/bbs/?pid=71689#p).

Note that the cartridge formats .p8 and .p8.png cannot be run with a vanilla PICO-8 as they exceed the maximum token limit (8192). To play them, you need to patch your PICO-8 executable by following the procedure I described in [this thread](https://www.lexaloffle.com/bbs/?pid=71689#p).
3. I recommend using a fast reload patch (I will write a post to explain how to do it later) to instantly stream stage data. Otherwise, the game will pause half a second every time the character is approaching a different 128x32-tiles region of the map, and also in the transition area between two regions.

## Build

Expand Down
2 changes: 1 addition & 1 deletion build_all_cartridges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ help() {
}

usage() {
echo "Usage: test.sh CARTRIDGE_SUFFIX [CONFIG]
echo "Usage: build_all_cartridges.sh CARTRIDGE_SUFFIX [CONFIG]
ARGUMENTS
CONFIG Build config. Determines defined preprocess symbols.
Expand Down
62 changes: 62 additions & 0 deletions build_and_install_all_cartridges.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

# Build all game cartridges and install them in PICO-8 carts folder.

# Currently only supported on Linux.

# Configuration: paths
game_scripts_path="$(dirname "$0")"

help() {
echo "Build and install all PICO-8 cartridges with the passed config."
usage
}

usage() {
echo "Usage: build_and_install_all_cartridges.sh [CONFIG]
ARGUMENTS
CONFIG Build config. Determines defined preprocess symbols.
(default: 'debug')
-h, --help Show this help message
"
}

# Default parameters
config='debug'

# Read arguments
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
roots=()
while [[ $# -gt 0 ]]; do
case $1 in
-h | --help )
help
exit 0
;;
-* ) # unknown option
echo "Unknown option: '$1'"
usage
exit 1
;;
* ) # store positional argument for later
positional_args+=("$1")
shift # past argument
;;
esac
done

if ! [[ ${#positional_args[@]} -ge 0 && ${#positional_args[@]} -le 1 ]]; then
echo "Wrong number of positional arguments: found ${#positional_args[@]}, expected 0 or 1."
echo "Passed positional arguments: ${positional_args[@]}"
usage
exit 1
fi

if [[ ${#positional_args[@]} -ge 1 ]]; then
config="${positional_args[0]}"
fi

"$game_scripts_path/build_all_cartridges.sh" "$config"
"$game_scripts_path/install_all_cartridges.sh" "$config"
78 changes: 78 additions & 0 deletions build_and_install_single_cartridge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

# Build a specific cartridge for the game and install it in PICO-8 carts folder
# to allow playing with multiple cartridges

# Currently only supported on Linux

# Configuration: paths
game_scripts_path="$(dirname "$0")"

help() {
echo "Build a PICO-8 cartridge with the passed config."
usage
}

usage() {
echo "Usage: build_and_install_single_cartridge.sh CARTRIDGE_SUFFIX [CONFIG]
ARGUMENTS
CARTRIDGE_SUFFIX Cartridge to build for the multi-cartridge game
'titlemenu' or 'ingame'
CONFIG Build config. Determines defined preprocess symbols.
(default: 'debug')
-h, --help Show this help message
"
}

# Default parameters
config='debug'

# Read arguments
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
roots=()
while [[ $# -gt 0 ]]; do
case $1 in
-h | --help )
help
exit 0
;;
-* ) # unknown option
echo "Unknown option: '$1'"
usage
exit 1
;;
* ) # store positional argument for later
positional_args+=("$1")
shift # past argument
;;
esac
done

if ! [[ ${#positional_args[@]} -ge 1 && ${#positional_args[@]} -le 2 ]]; then
echo "Wrong number of positional arguments: found ${#positional_args[@]}, expected 1 or 2."
echo "Passed positional arguments: ${positional_args[@]}"
usage
exit 1
fi

if [[ ${#positional_args[@]} -ge 1 ]]; then
cartridge_suffix="${positional_args[0]}"
fi

if [[ ${#positional_args[@]} -ge 2 ]]; then
config="${positional_args[1]}"
fi

# Immediately export to carts to allow multi-cartridge loading
"$game_scripts_path/build_single_cartridge.sh" "$cartridge_suffix" "$config"

if [[ $? -ne 0 ]]; then
echo ""
echo "build_single_cartridge.sh failed, STOP."
exit 1
fi

"$game_scripts_path/install_single_cartridge.sh" "$cartridge_suffix" "$config"
2 changes: 1 addition & 1 deletion build_itest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build_output_path="$(dirname "$0")/build"
author="hsandt"
title="pico-sonic itests (all)"
cartridge_stem="picosonic_itest_all"
version="4.1"
version="4.2"
config='itest'
# symbols='assert,log,visual_logger,tuner,profiler,mouse,itest'
# cheat needed to set debug motion mode
Expand Down
2 changes: 1 addition & 1 deletion build_pico8_utests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build_output_path="$(dirname "$0")/build"
author="hsandt"
title="pico-sonic pico8 utests (all)"
cartridge_stem="picosonic_pico8_utests_all"
version="4.1"
version="4.2"
config='debug'
symbols='assert,dump,log,p8utest'

Expand Down
19 changes: 8 additions & 11 deletions build_single_cartridge.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash

# Build and export a specific cartridge for the game
# (since for multi-cartridge games, exporting in PICO-8 carts/ folder allows
# cartridge transitions)
# Build a specific cartridge for the game
# It relies on pico-boots/scripts/build_cartridge.sh
# and install_single_cartridge.sh (which is currently only support on Linux).
# It also defines game information and defined symbols per config.

# Configuration: paths
Expand All @@ -17,15 +14,15 @@ data_path="$(dirname "$0")/data"
author="hsandt"
title="pico-sonic"
cartridge_stem="picosonic"
version="4.1"
version="4.2"

help() {
echo "Build a PICO-8 cartridge with the passed config."
usage
}

usage() {
echo "Usage: test.sh CARTRIDGE_SUFFIX [CONFIG]
echo "Usage: build_single_cartridge.sh CARTRIDGE_SUFFIX [CONFIG]
ARGUMENTS
CARTRIDGE_SUFFIX Cartridge to build for the multi-cartridge game
Expand Down Expand Up @@ -95,16 +92,19 @@ elif [[ $config == 'cheat' ]]; then
# a weird bug makes game very slow when dump is defined but not log
# this must be related to the new dump symbol used in dump.lua,
# but I don't see how adding more lines makes the game faster
# symbols='cheat'
# symbols='assert,dump,log,cheat,tuner'
symbols='cheat,tuner,mouse'
# symbols='cheat,tuner,mouse'
# symbols='assert,cheat,log,dump'
symbols='cheat,log,dump,debug_trigger'
elif [[ $config == 'ultrafast' ]]; then
symbols='assert,deprecated,ultrafast'
elif [[ $config == 'cheat-ultrafast' ]]; then
symbols='assert,deprecated,cheat,ultrafast'
elif [[ $config == 'sandbox' ]]; then
symbols='assert,deprecated,sandbox'
elif [[ $config == 'assert' ]]; then
symbols='assert,dump'
symbols='assert,log,dump'
elif [[ $config == 'profiler' ]]; then
symbols='profiler'
fi
Expand All @@ -131,6 +131,3 @@ if [[ $? -ne 0 ]]; then
echo "Build failed, STOP."
exit 1
fi

# Immediately export to carts to allow multi-cartridge loading
"$game_scripts_path/install_single_cartridge.sh" "$cartridge_suffix" "$config"
Loading

0 comments on commit 394c647

Please sign in to comment.