Welcome to generals.ar, a two-player, iOS, AR-based implementation of the popular online game generals.io. Created during the Uncommon Hacks 2024 hackathon.
Note that the device running the server must be on the same network as the device(s) running the app.
- Clone the generals-ar-server repo.
- If needed, install uvicorn (for example, by running
pip install uvicorn
) - From the top level of the server repo, run
uvicorn app:app --host 0.0.0.0 --port 8000
- Clone this repo.
- Open the top-level
generals.ar.xcodeproj
file in XCode - On line 219 of Game.swift, modify the IP address to use the local address of your device running the server (keeping port 8000). Please don't commit this change!
- To find this IP address, you can go System Settings -> Network -> Details (next to your wifi network).
- For example, if your IP address is 192.168.1.10, then line 219 should now be
let serverURL = "http://192.168.1.10:8000"
- Connect your device (iPhone or iPad) with a physical cable and wait for it to appear in XCode
- Click the Build button (looks like a "play" button)
- If needed, follow any prompts to (a) enable Developer Mode, and (b) trust the Developer App certificate; afterwards, build again
- Follow instructions 4-6 to install the app on a second device. (You can unplug the first device once the game is installed.)
Notes:
- The device(s) running the app must be running iOS/iPadOS 17.4 or higher.
- The server cannot handle more than 2 devices at the same time.
To reset the game:
- Close the server (CTRL+C, then CTRL+Z)
- Close the app on the device(s)
- Restart the server
- Re-open the apps
Enjoy!