Skip to content

Latest commit

 

History

History
592 lines (461 loc) · 15.5 KB

File metadata and controls

592 lines (461 loc) · 15.5 KB

Project prompt (English)

Replace /Users/xxx with your macOS home-directory name before use. Run the workflow only against a game copy you legally own.


I want to try reconstructing the Steam macOS version of A Short Hike as a buildable Unity project and eventually compile it into an iOS app that can run on my own iPhone. This is solely for personal technical research and for use on devices on which I own a legitimate copy of the game. Do not distribute game assets or the finished application.

Original game path:

/Users/xxx/Library/Application Support/Steam/steamapps/common/A Short Hike/AShortHike.app

Inspect this directory directly. Do not assume that I possess the original Unity project or source code.

Known information:

  • The game was built with Unity 2021.3.27f1.
  • It is a native macOS Universal Binary containing x86_64 and arm64.
  • It uses the Mono scripting backend, not IL2CPP.
  • The primary code assembly is located at: Contents/Resources/Data/Managed/Assembly-CSharp.dll
  • The Unity data directory is: Contents/Resources/Data
  • The installation contains:
    • UnityPlayer.dylib
    • MonoBleedingEdge
    • Assembly-CSharp.dll
    • sharedassets*.assets
    • resources.assets
    • serialized scene data such as level0 and level1
    • StreamingAssets
  • Known major third-party dependencies include:
    • InControl.dll
    • Unity.InputSystem.dll
    • com.rlabrecque.steamworks.net.dll
    • PathCreator.dll
    • Cinemachine.dll
    • Unity.2D.PixelPerfect.dll
    • Newtonsoft.Json.dll
    • CsvHelper.dll
    • SonyNP.dll
    • SonyPS4SaveData.dll

Final objectives:

  1. Recover the most complete and maintainable Unity 2021.3.27f1 project possible from the existing macOS game.
  2. Recover or reconstruct the game's C# code, scenes, Prefabs, Materials, textures, audio, animation, and ScriptableObject data.
  3. Handle Steam, Sony, macOS, and other desktop-platform-specific dependencies.
  4. Make the project open in the Unity Editor and enter the game.
  5. Add basic iOS platform adaptation.
  6. Use Unity's IL2CPP iOS build pipeline to export an Xcode project.
  7. Sign, install, and run it on my own iPhone.
  8. Preserve the original save format and game behavior wherever possible.

Important principles:

  • Never modify the original Steam game directory.
  • Perform all operations in a new, independent working directory.
  • Every step must be reproducible, recorded, and reversible.
  • Never delete or overwrite original files.
  • Do not upload or distribute game assets.
  • Do not begin with a large-scale rewrite.
  • Recover and validate the desktop project before adapting it for iOS.
  • Never claim success without evidence from logs, files, or runtime results.
  • When something is uncertain, inspect the actual assemblies, resources, and logs first.
  • Automate repetitive work where practical, but do not run unreviewed destructive scripts.
  • Every script must check for errors and stop on failure.
  • At the end of each phase, report current status, known problems, and recommended next steps.

Create the workspace at:

~/Developer/AShortHike-iOS-Port

Suggested directory structure:

AShortHike-iOS-Port/ ├── original-manifest/ ├── extracted/ ├── decompiled/ ├── unity-project/ ├── tools/ ├── scripts/ ├── reports/ ├── logs/ └── backups/

Follow these phases.

==================== Phase 1: Read-only audit

Do not extract or modify any resources yet.

Inspect and record:

  1. The complete game directory structure.
  2. Architecture and platform information for every Mach-O file.
  3. Every dylib, bundle, and native plugin.
  4. Assembly-CSharp.dll and the other Managed DLLs.
  5. Unity version, scripting backend, and scripting runtime version.
  6. ScriptingAssemblies.json.
  7. Metadata including globalgamemanagers, globalgamemanagers.assets, and RuntimeInitializeOnLoads.json.
  8. The contents of StreamingAssets.
  9. Whether Addressables, AssetBundles, Resources, or custom resource formats are present.
  10. Whether a native Steam API library is present.
  11. Whether any native plugins support macOS only.
  12. Whether the game uses the Built-in Render Pipeline, URP, or another render pipeline.
  13. Potential custom Shaders.
  14. Scene count and scene names.
  15. Save-game directory and save format.
  16. All platform checks in the code:
    • UNITY_STANDALONE_OSX
    • UNITY_STANDALONE
    • UNITY_IOS
    • Steamworks
    • Sony
    • Game Center
    • file paths and Application.persistentDataPath
  17. Every P/Invoke, DllImport, and dynamic-library load.
  18. Reflection, dynamic code generation, Expression.Compile, System.Reflection.Emit, and other code that may conflict with IL2CPP/AOT.
  19. Threads, file-system access, process launch, native-window access, clipboard access, and other desktop APIs.
  20. Input systems, controller mappings, and resolution logic.

Generate:

reports/01-audit.md

The report must include:

  • confirmed technical facts;
  • items still requiring verification;
  • major iOS-porting risks;
  • a treatment recommendation for every third-party dependency;
  • an initial feasibility assessment;
  • concrete steps for the next phase.

Also generate a manifest and checksums for the original game files:

original-manifest/files.txt original-manifest/sha256.txt

==================== Phase 2: Tool and environment check

Check whether the current Mac has:

  • Unity Hub
  • Unity 2021.3.27f1
  • iOS Build Support
  • IL2CPP
  • Xcode
  • Command Line Tools
  • .NET SDK
  • Java
  • Python
  • AssetRipper
  • ILSpy or ilspycmd
  • dnSpyEx or another decompiler suitable for macOS

Do not automatically install large applications. Report missing items first.

For lightweight tools that can be installed through Homebrew or dotnet tool, an installation script may be prepared, but tell me before running it.

Generate:

reports/02-environment.md scripts/check-environment.sh

==================== Phase 3: Decompilation and dependency analysis

Copy the Managed DLLs needed for analysis into an independent directory.

Use ILSpy/ilspycmd to decompile Assembly-CSharp.dll.

Requirements:

  1. Preserve original namespaces, class names, fields, and methods.
  2. Do not arbitrarily reformat or rename anything.
  3. Produce the most complete C# project possible.
  4. Generate assembly-reference relationships.
  5. List methods that cannot be decompiled correctly.
  6. Check for obfuscation.
  7. Assess recovery quality for async code, iterators, closures, and compiler-generated types.
  8. Search for all platform-specific APIs.
  9. Search for Steamworks initialization, achievements, cloud saves, and Overlay calls.
  10. Locate SonyNP and SonyPS4SaveData call sites.
  11. Find save loading and writing logic.
  12. Find input logic.
  13. Find Shader, resource-path, and Addressables calls.
  14. Find logic that discovers types dynamically through reflection.

Generate:

decompiled/Assembly-CSharp/ reports/03-code-analysis.md reports/pinvoke-list.txt reports/platform-code-list.txt reports/steamworks-usage.txt reports/save-system.md reports/input-system.md

Do not proactively modify code during this phase.

==================== Phase 4: Resource recovery

Use a version of AssetRipper, or an equivalent tool, suitable for Unity 2021.3 to recover resources from:

/Users/xxx/Library/Application Support/Steam/steamapps/common/A Short Hike/AShortHike.app/Contents/Resources/Data

Export to:

extracted/assetripper-export

Pay particular attention to:

  • Scenes
  • Prefabs
  • MonoBehaviours
  • ScriptableObjects
  • Animator Controllers
  • AnimationClips
  • Textures
  • Sprites
  • Meshes
  • Materials
  • Shaders
  • AudioClips
  • Fonts
  • TextMeshPro assets
  • Timelines
  • Cinemachine
  • Resources
  • StreamingAssets
  • AssetBundles
  • Addressables

Record:

  • Missing Script count
  • resources that could not be exported
  • Shader recovery quality
  • scene recovery quality
  • Prefab-reference quality
  • MonoBehaviour type mappings
  • whether GUID and FileID values were preserved
  • whether an importable Unity project was produced

Generate:

reports/04-resource-recovery.md

Do not treat the export as the final project. Preserve the original export unchanged.

==================== Phase 5: Reconstruct the project

Create the Unity project at:

unity-project/AShortHike

Use Unity 2021.3.27f1 exactly.

The first objective is a project that runs in the macOS Unity Editor. Do not switch immediately to iOS.

Complete:

  1. Integrate the AssetRipper resource export.
  2. Integrate the decompiled C# code.
  3. Restore the Assembly-CSharp assembly structure.
  4. Restore required asmdef files.
  5. Re-add official Unity Packages.
  6. Prefer lawful public packages or source corresponding to the required versions for:
    • Cinemachine
    • Input System
    • 2D Pixel Perfect
    • Addressables
    • TextMeshPro
    • ProBuilder
  7. Exclude Editor assemblies that are unnecessary at runtime.
  8. Do not include Sony platform libraries in the normal Editor or iOS build.
  9. Preserve Steamworks support on desktop initially, but create a clear platform boundary.
  10. Record each category of compile error separately. Do not broadly delete code merely to make compilation pass.

For problems in decompiled code:

  • Prefer minimal repairs.
  • Do not change serialized field names.
  • Do not change fully qualified type names.
  • Do not arbitrarily rename private fields.
  • Do not arbitrarily change inheritance.
  • Do not break MonoBehaviour type mappings stored in Unity scenes.
  • Manually clean up compiler-generated code only when necessary.

Generate:

reports/05-project-reconstruction.md reports/compile-errors.md reports/missing-scripts.md

Success criteria:

  • The Unity project opens.
  • No infinite import loop occurs.
  • C# compilation passes, or every remaining error is clearly classified.
  • At least one primary scene opens.
  • Play Mode produces meaningful runtime logs.

==================== Phase 6: Desktop validation

Before iOS work, validate the reconstructed project in the macOS Editor or a macOS Development Build.

Validate in order:

  1. Launch.
  2. Main menu.
  3. New game.
  4. Player movement.
  5. Jumping.
  6. Gliding.
  7. Climbing.
  8. Dialogue.
  9. Scene loading.
  10. Pause menu.
  11. Save and load.
  12. Audio.
  13. Shaders and rendering.
  14. Controller input.
  15. Behavior without the Steam client.

Enable Development Build and detailed logging.

For every crash, collect:

  • Editor.log
  • Player.log
  • crash report
  • stack trace
  • reproduction steps

Generate:

reports/06-desktop-validation.md

Proceed to iOS only after the basic desktop flow works.

==================== Phase 7: Establish platform abstractions

Create small, clear interfaces for platform-specific features. Do not scatter large numbers of #if blocks across the project.

Suggested abstractions:

  • IPlatformServices
  • IAchievementService
  • ICloudSaveService
  • IInputBackend
  • IPlatformUserService

Implement:

  • SteamPlatformServices
  • IOSPlatformServices
  • NullPlatformServices

Temporarily disable or replace on iOS:

  • Steam initialization
  • Steam Overlay
  • Steam achievements
  • Steam cloud saves
  • Steam Input
  • Sony NP
  • PS4 saves
  • macOS-specific paths
  • desktop-window features
  • incompatible native plugins

The initial iOS target does not require Game Center. A null implementation is acceptable while establishing a working game flow.

==================== Phase 8: iOS input adaptation

Use an external controller as the minimum viable input method first.

Prioritize:

  • Apple Game Controller framework through Unity Input System
  • Xbox controllers
  • PlayStation controllers
  • MFi controllers

Examine the relationship between InControl and Unity Input System.

Preserve the original input semantics wherever possible:

  • movement
  • jump
  • interact
  • run
  • climb
  • glide
  • menu
  • pause

After controllers work, design basic touch controls:

  • a left-side virtual joystick
  • right-side jump/interact and related buttons
  • UI Safe Area support
  • landscape orientation
  • multi-touch
  • no obstruction of subtitles or menus

The touch UI must remain an independent layer and must not break controller input.

==================== Phase 9: iOS and IL2CPP compatibility

Switch to iOS and use IL2CPP.

Check:

  1. AOT-incompatible code.
  2. Reflection dependencies.
  3. Generic instantiations.
  4. Reflection-based JSON serialization.
  5. Unity Linker stripping.
  6. Dynamic assembly loading.
  7. Expression.Compile.
  8. System.Reflection.Emit.
  9. P/Invoke.
  10. Native-plugin architectures.
  11. File-path case sensitivity.
  12. Threads and background behavior.
  13. Metal Shaders.
  14. Audio formats.
  15. iOS lifecycle.
  16. Pause and resume.
  17. Memory warnings.
  18. Safe Area.
  19. Device rotation.
  20. Conflicts between iCloud and Steam save logic.

Create when necessary:

  • link.xml
  • PreserveAttribute usage
  • AOT generic references
  • iOS stubs
  • platform conditional compilation
  • native-plugin import settings

Do not hide problems by disabling all managed-code stripping. Identify the exact types that need preservation first.

==================== Phase 10: Xcode build

Configure:

  • iOS
  • ARM64
  • IL2CPP
  • Metal
  • landscape
  • Development Build
  • Script Debugging initially
  • a unique Bundle Identifier, for example: com.example.AShortHikeResearch
  • automatic signing
  • my own Apple Developer Team

Export the Xcode project to:

build/ios-xcode

Target a Development Build first.

Record:

  • Unity build log
  • IL2CPP output
  • Xcode compile errors
  • linker errors
  • missing symbols
  • signing issues
  • native-plugin issues
  • Shader compilation issues

Generate:

reports/07-ios-build.md

==================== Phase 11: On-device validation

After installation on a physical device, validate:

  • launch
  • first screen
  • main menu
  • controller recognition
  • touch input
  • new game
  • save
  • resume
  • foreground/background transitions
  • lock-screen recovery
  • audio interruption
  • memory use
  • heat
  • frame rate
  • Shader stutter
  • scene transitions
  • crash logs

Use Xcode Devices and Simulators, Console, and device logs to locate problems.

Do not consider reaching the main menu sufficient for completion.

==================== Automation requirements

Write safe scripts:

scripts/ ├── audit-game.sh ├── copy-managed.sh ├── decompile-assemblies.sh ├── extract-assets.sh ├── scan-platform-apis.sh ├── scan-pinvoke.sh ├── check-unity-version.sh ├── backup-workspace.sh └── collect-logs.sh

Every script must:

  • use set -euo pipefail
  • correctly handle paths containing spaces
  • validate input paths
  • prohibit writes to the original Steam directory
  • produce clear logs
  • support repeated execution
  • never silently overwrite important files
  • require confirmation for potentially destructive operations

==================== Working method

For now, execute only Phase 1, Read-only audit, and Phase 2, Tool and environment check.

Do not run AssetRipper, decompile assemblies, create the Unity project, or install large applications yet.

First:

  1. Inspect the original directory.
  2. Create the workspace.
  3. Generate the file manifest and checksums.
  4. Analyze the Unity build structure.
  5. Scan assemblies and native dependencies.
  6. Check the local tool environment.
  7. Produce the audit reports.
  8. Propose the next action plan.

Then stop and report:

  • the confirmed Unity technology stack;
  • whether the build is definitely Mono;
  • whether native plugins are present;
  • which dependencies block an iOS build;
  • the estimated reconstruction difficulties;
  • the three most important risks to validate first;
  • the commands proposed for the next phase;
  • whether I need to install Unity 2021.3.27f1 or any other tools.

Do not begin resource extraction or code decompilation until I confirm.