-
Notifications
You must be signed in to change notification settings - Fork 13
Add Celeste Any% + IL Autosplitters + Splits #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rellort1
wants to merge
10
commits into
LibreSplit:main
Choose a base branch
from
rellort1:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c000bf8
add Celeste any% and IL autosplitters
rellort1 c59789f
add Split files
rellort1 1f90582
change fullgame reset logic to prevent accidental reset
rellort1 8c46c42
added info to readme
rellort1 d6484cc
update defaults, add undo split caveat to readme
rellort1 066d4cc
fix bug in chapter splits
rellort1 82faeeb
changed readAddress to use the base address instead of absolute
rellort1 dfd55e8
edit 6b checkpoint splits to follow what people usually compare against
rellort1 bca5f5e
Change default size in split files
rellort1 db225fb
update split files
rellort1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Celeste Autosplitters | ||
|
|
||
| **You will need to run libresplit with `LIBRESPLIT_DISABLE_IOCTL_MAPS=1` or it wont be able to read any addresses** | ||
| Currently the autosplitter cant account for skip/undo/manual splitting, it will always split at the same points in the same order. | ||
|
|
||
| for any% you can choose which b sides you do with the bSides toggles at the top of the autosplitter files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,246 @@ | ||
| cmdline("Celeste.bin.x86_64") | ||
|
|
||
| local autoSplitterObj = nil | ||
| local lastCompleted = false | ||
| local splitIndex = 1 | ||
| local checkpointIndex = 1 | ||
| local splitDelay = false | ||
|
|
||
| -- Set the b sides you do to true | ||
| local bSides = { | ||
| templeB = false, | ||
| reflectionB = false, | ||
| } | ||
|
|
||
| local current = { | ||
| chapterCompleted = false, | ||
| chapterStarted = false, | ||
| levelName = "", | ||
| areaID = -1, | ||
| areaDifficulty = -1, | ||
| gameTime = 0, | ||
| levelTime = 0, | ||
| } | ||
|
|
||
| local old = { | ||
| chapterCompleted = false, | ||
| chapterStarted = false, | ||
| levelName = "", | ||
| AreaID = -1, | ||
| areaDifficulty = -1, | ||
| gameTime = 0, | ||
| levelTime = 0, | ||
| } | ||
|
|
||
| local Chapters = | ||
| { "prologue", "forsakenCity", "oldSite", "celestialResort", "goldenRidge", "temple", "reflection", "summit" } | ||
|
|
||
| local route = { | ||
| prologue = { "Clear" }, | ||
| forsakenCity = { "Clear" }, | ||
| oldSite = { "Clear" }, | ||
| celestialResort = { "Clear" }, | ||
| goldenRidge = { "Clear" }, | ||
| temple = {}, | ||
| reflection = {}, | ||
| summit = { "Clear" }, | ||
| } | ||
| local templeA = { "Clear" } | ||
| local templeB = { "Enter", "Clear" } | ||
| local reflectionA = { "Clear" } | ||
| local reflectionB = { "Enter", "Clear" } | ||
|
|
||
| function lookupClass(classCache, name) | ||
| local celesteClassCacheTable = readAddress("uint", classCache + 0x20) | ||
| local hashTableSize = readAddress("uint", classCache + 0x18) | ||
| for bucket = 0, hashTableSize do | ||
| local offset = celesteClassCacheTable + (bucket * 0x8) | ||
| local klass = readAddress("ulong", offset) | ||
| while klass ~= 0 do | ||
| local currentNamePtr = readAddress("ulong", klass + 0x40) | ||
| local nameArr = readAddress("string7", currentNamePtr) | ||
|
|
||
| if nameArr == name then | ||
| return klass | ||
| end | ||
| klass = readAddress("ulong", klass + 0xf8) | ||
| end | ||
| end | ||
| return nil | ||
| end | ||
|
|
||
| function classFieldOffset(klass, name) | ||
| local classKind = bit.band((readAddress("byte", klass + 0x24)), 7) | ||
| while classKind == 3 do | ||
| local ptr1 = readAddress("ulong", klass + 0xe0) | ||
| local newKlass = readAddress("ulong", klass + 0xe0) | ||
| klass = readAddress("ulong", newKlass) | ||
| classKind = bit.band((readAddress("byte", klass + 0x24)), 0x7) | ||
| end | ||
| local numFields = readAddress("int", klass + 0xf0) | ||
| local fieldsPtr = readAddress("ulong", klass + 0x90) | ||
| local bufSize = numFields * 4 | ||
| local slice = 0 | ||
| while slice <= bufSize do | ||
| local ptrOffset = (slice + 1) * 0x8 | ||
| local fieldPtr = fieldsPtr + ptrOffset | ||
| local fieldNamePtr = readAddress("ulong", fieldPtr) | ||
| local fieldName = readAddress("string20", fieldNamePtr) | ||
| if fieldName == name then | ||
| local offset = (slice + 3) * 0x8 | ||
| offset = fieldsPtr + offset | ||
| local fieldOffset = bit.band(readAddress("ulong", offset), 0xffffffff) | ||
| return fieldOffset | ||
| end | ||
|
|
||
| slice = slice + 4 | ||
| end | ||
| end | ||
|
|
||
| function classStaticFields(klass) | ||
| local runtimeInfo = readAddress("ulong", klass + 0xc8) | ||
| local celesteVtable = readAddress("ulong", runtimeInfo + 0x8) | ||
| local vtableSize = readAddress("uint", klass + 0x54) | ||
| local offset = celesteVtable + 64 + vtableSize * 8 | ||
| return readAddress("ulong", offset) | ||
| end | ||
|
|
||
| function staticField(klass, name) | ||
| local offset = classFieldOffset(klass, name) | ||
| local staticPtr = classStaticFields(klass) | ||
| return readAddress("ulong", offset + staticPtr) | ||
| end | ||
|
|
||
| function instanceClass(instance) | ||
| local class = readAddress("ulong", instance) | ||
| local class = bit.band(class, bit.bnot(1)) | ||
| return readAddress("ulong", class) | ||
| end | ||
|
|
||
| function field(instance, name) | ||
| local klass = instanceClass(instance) | ||
| local offset = classFieldOffset(klass, name) | ||
| return readAddress("ulong", offset + instance) | ||
| end | ||
|
|
||
| function getLevelName(address) | ||
| local levelPtr = readAddress("ulong", address) | ||
| if levelPtr == 0 then | ||
| return "" | ||
| end | ||
| local size = readAddress("uint", address + 0x10) | ||
| if size > 512 then | ||
| return "" | ||
| end | ||
| local levelName = "" | ||
| for i = 0, size, 1 do | ||
| local newChar = readAddress("string2", levelPtr + 0x14 + i * 2) | ||
| if newChar == "" then | ||
| break | ||
| end | ||
| levelName = levelName .. newChar | ||
| end | ||
| return levelName | ||
| end | ||
|
|
||
| function startup() | ||
| refreshRate = 60 | ||
| useGameTime = true | ||
| end | ||
|
|
||
| function state() | ||
| if autoSplitterObj == nil then | ||
| local celesteDomain = 0 | ||
| local domainList = readAddress("ulong", 0xA17698) | ||
| local firstDomain = readAddress("ulong", domainList) | ||
| local firstDomainName = readAddress("ulong", firstDomain + 0xd8) | ||
| local secondDomain = readAddress("ulong", domainList + 0x8) | ||
| if secondDomain ~= 0 then | ||
| celesteDomain = secondDomain | ||
| else | ||
| celesteDomain = firstDomain | ||
| end | ||
| local celesteAssembly = readAddress("ulong", celesteDomain + 0xd0) | ||
| local celesteImage = readAddress("ulong", celesteAssembly + 0x60) | ||
| local classCache = celesteImage + 1216 | ||
| local celesteClass = lookupClass(classCache, "Celeste") | ||
| local celesteObj = staticField(celesteClass, "Instance") | ||
| autoSplitterObj = field(celesteObj, "AutoSplitterInfo") + 0x10 | ||
| else | ||
| old = shallow_copy_tbl(current) | ||
| current.chapterCompleted = readAddress("bool", autoSplitterObj + 0x12) | ||
| current.chapterStarted = readAddress("bool", autoSplitterObj + 0x11) | ||
| current.areaID = readAddress("int", autoSplitterObj + 0x8) | ||
| current.areaDifficulty = readAddress("int", autoSplitterObj + 0xc) | ||
| current.gameTime = readAddress("long", autoSplitterObj + 0x28) / 10000 | ||
| current.levelTime = readAddress("long", autoSplitterObj + 0x18) / 10000 | ||
| current.levelName = getLevelName(autoSplitterObj) | ||
| end | ||
| end | ||
|
|
||
| function start() | ||
| if current.areaID >= 0 then | ||
| if bSides.templeB == true then | ||
| route.temple = templeB | ||
| else | ||
| route.temple = templeA | ||
| end | ||
| if bSides.reflectionB == true then | ||
| route.reflection = reflectionB | ||
| else | ||
| route.reflection = reflectionA | ||
| end | ||
| splitIndex = 1 | ||
| checkpointIndex = 1 | ||
| return true | ||
| end | ||
| return false | ||
| end | ||
|
|
||
| function split() | ||
| local shouldSplit = false | ||
| local Chapter = Chapters[splitIndex] | ||
| if splitDelay == true then | ||
| shouldSplit = true | ||
| splitDelay = false | ||
| else | ||
| if current.chapterCompleted == true then | ||
| lastCompleted = true | ||
| end | ||
| if route[Chapter][checkpointIndex] == "Clear" then | ||
| if Chapter == "summit" then | ||
| if current.areaID == 8 then | ||
| shouldSplit = true | ||
| splitIndex = splitIndex + 1 | ||
| checkpointIndex = 1 | ||
| end | ||
| elseif lastCompleted and current.areaID == -1 then | ||
| splitDelay = true | ||
| lastCompleted = false | ||
| splitIndex = splitIndex + 1 | ||
| checkpointIndex = 1 | ||
| end | ||
| elseif route[Chapter][checkpointIndex] == "Enter" then | ||
| if current.areaID == splitIndex - 1 and current.areaDifficulty == 1 then | ||
| shouldSplit = true | ||
| checkpointIndex = checkpointIndex + 1 | ||
| end | ||
| end | ||
| return shouldSplit | ||
| end | ||
| end | ||
|
|
||
| function isLoading() | ||
| return true | ||
| end | ||
|
|
||
| function reset() | ||
| if old.gameTime == 0 then | ||
| return true | ||
| end | ||
| return false | ||
| end | ||
|
|
||
| function gameTime() | ||
| return current.gameTime | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.