Skip to content

Instantly share code, notes, and snippets.

View toasterparty's full-sized avatar
🤠

toasterparty toasterparty

🤠
  • California
  • 18:03 (UTC -07:00)
View GitHub Profile
@toasterparty
toasterparty / finding-holes-mp1.md
Last active May 22, 2022 00:52
How to find tiny holes in Metroid Prime

Motivation - Holes are good. They let you go places.

Method 1

  1. Download Blender 2.93. Do NOT use the Windows Store Version!

  2. Download Metaforce and extract your ISO. This can take 1hr+. Do not use an extraction filepath longer than what is shown below:

image

@toasterparty
toasterparty / metroid-prime-competitive-dolphin-settings.md
Last active May 6, 2023 09:47
Guide for setting up Dolphin to be as competitive as possible.

Metroid Prime - Competitive Settings for Dolphin

This guide shows you everything you need to know about configuring dolphin to prioritize performance over everything else when playing Metroid Prime 1.

Please Note: While Dolphin has come extremely far in creating as smooth of an experience as possible, there are still extremely small but noticeable deficits in the way Prime plays in emulation versus on a Wii that cannot be avoided. Some PCs experience inconsistent timing inbbetween frames making some very precise tricks such as UBJs more difficult. Furthermore, the speedrun community requires runs to be done on hardware beyond a certain time threshold.

1. Laptop PSA

If you play on a laptop, play with it plugged in!!! I cannot stress how much performance is lost when your hardware switches to battery opperated mode. Additionally, make sure that you have this Windows set all the way to the right to maximize performance.

@toasterparty
toasterparty / gcc_black_magic.c
Last active August 12, 2022 18:31
Abuse GCC's section attribute to iterate through compile-defined (but dynamically included/excluded) data.
// If you want to play with this code, I reccomend https://jdoodle.com/ia/tPT
// Most other online compilers fail to respect the section definitions
//
// This file is a demonstration on how you can use macros and gcc section attributes to
// arbitrarily access functions/memory from another file's static scope at *link time*
// and without the use of runtime function pointers. It ONLY works with projects linked using gcc.
//
// Real world usage of this include:
// - Implementing a component-oriented API where each components adds support for their
// specific command(s) without having to maintain a large API manifest.

Overcooked! 2: Archipelago Testing Methodology

1. Unit Tests

Unit tests have been added to ensure that Overcooked! 2 data is maintained properly. Unit tests will fail if data structures are detrimentally modified in a way otherwise invisible to a game-agnostic test suite.

Command:

python -m pytest test/overcooked2

Overview

Over the next couple hours, we will have to unlock items that were created specifically for randomizer. Without these items, our scoring potential is severly limited and it will be difficult to earn more than one star. There are a bunch of other features and changes which we will talk about as we go, but for now just know that we need to play through as many levels as possible as quickly as possible to start earning back our abilities. The ultimate goal is to reach and complete the final level, 6-6.

The first thing you'll notice is the order of kitchens on this overworld map are randomized. This includes 70 or so DLC levels, so we actually have no idea what levels we will be playing today.

The mod plays an error sound every time you attempt an illegal action (e.g. try to dash when you can't)

The scores in the base game are way too easy (in some cases, it's possible to score 10x the 3-star score). To compensate for this, the 3-star score has been changed to be half of the current world record. (

import os
import json
NA = "n/a, "
def _helper(owner_key, x_key, dict):
if owner_key:
owner_key = owner_key.lower()
if x_key:
@toasterparty
toasterparty / PrimeFit.ini
Last active July 18, 2023 16:17
Dolphin Controller Config for Playing Metroid Prime (GC) with a Ring Fit Controller. Place in `/Documents/Dolphin Emulator/Config/Profiles/GCPad`
[Profile]
Device = WGInput/0/Xbox 360 Controller for Windows
Buttons/A = ((`Right Y+` > 0.9 | (`Right Y-` > 0 & `Trigger L`) | pulse(`Right Y+` > 0.5 & `Right Y+` < 0.9, 1/60)) | !`Trigger L` & (`Right Y-` > 0.45)) & !Back
Buttons/B = pulse(!Back, 1/60) | pulse(hold(!Back, if($long_jump, 1.0, 0.65)), 1/60) | (Back & !`Trigger L` & `Right Y-` > 0) | `DInput/0/Keyboard Mouse:LSHIFT`
Buttons/X = `Button A`
Buttons/Y = !`Trigger L` & !Back & ( (`Right Y-` > 0 & `Right Y-` < 0.45) | (timer(0.3) & `Right Y-` > 0.45) )
Buttons/Z = `DInput/0/Keyboard Mouse:BACKSLASH`
Buttons/Start = `DInput/0/Keyboard Mouse:RETURN`
Main Stick/Dead Zone = if(Back, 3, 15)
Main Stick/Up = if(Back, `Left Y+`*0.6, (`Thumb L` | pulse(!`Thumb L`, 1) | $freelook) & `Left Y+` | `DInput/0/Keyboard Mouse:UP`)

Patched SJF Challenge

This is a self-imposed challenge just for fun. It's also meant to challenge our understanding of the game as well as understand this iconic and fundamental problem from the shoes of the developer. The orignal dev team wouldn't have rules 5 and 6, but those make this challenge trivial and boring.

Rules

  1. For the patch to be succesful, no single player may obtain Space Jump Boots before obtaining all of [Morph Ball, Morph Ball Bombs, Boost Ball] without the use of cheats or additional mods

  2. The patch must apply to NTSC 0-00

Unity IL2CPP Reverse Engineering

Unity games are fun.

Modding them is more fun.

Most unity games ship as "Mono". This means .NET IL code is right there for your viewing pleasure and makes for one of the easiest modding experience you can have (outside of official mod support).

Recently, many Unity games have been shipping with "IL2CPP" which optimizes out the "just in time" compilation with actual compilation. This process makes the game perform better for the player, but it also obfuscates game code meaning we have less information to work with when attempting to reverse engineer. This document describes the process of reverse engineering a Unity game built with IL2CPP despite the limitations. Keep in mind the best process for reverse engineering will change as Unity Engine evolves and the tools available change, and so this may become outdated.

@toasterparty
toasterparty / json-schema.md
Last active August 17, 2023 23:38
How to actually use JSON schema to actually document something

JSON Schema Guide (For Humans)

This guide is for you if all of the following is true:

  • You maintain a JSON specification
  • Other people need to write JSON documents that adhere to your specification (by hand or by code) and thus need to understand your specification
  • You haven't already spent sufficient effort documenting your specification

Note that you can adapt this guide to YAML with a small amount of effort.

Example JSON Document