Appearance
SAGE C4 Developer Docs
SAGE C4 is a major expansion and update of the Star Atlas strategy game, available in the browser at https://sage.staratlas.com and currently running on the z.ink testnet.
This section focuses on developer integration: what to import, which cluster to use, how to decode on-chain game state safely, and how to structure calls so examples remain easy to verify.
If you are new to Solana or SAGE, start with the Beginner Map. It explains the basic nouns before the code samples start using them.
Reader promise
These docs are organized for developers who want to build against the on-chain Star Atlas and SAGE C4 programs without already knowing the generated clients.
Each program and domain page should answer, in order:
- what the concept means in Star Atlas
- what the program or account model owns on-chain
- how to read useful state with
@solana/kit - how state-changing instructions are structured
- which accounts, signers, writable state, and simulations matter before sending
Reference inventory still matters, but it should support the workflow instead of leading it.
Star Atlas context
The game context comes from Star Atlas SAGE and KB material: SAGE is a browser-based 4X strategy game where actions such as movement, mining, crafting, and transport settle on Solana, and resources power fleet operations, crafting, trading, and starbase upkeep.
Useful official starting points:
Goals
- Document real integration paths for SAGE C4 PTR on the z.ink testnet.
- Keep code samples short enough to copy into tools.
- Explain the game and Solana concepts before relying on them.
- Avoid hiding cluster assumptions in helper magic.
- Keep generated client usage separate from Aephia-specific application code.
Current PTR endpoints
| Purpose | Endpoint |
|---|---|
| HTTP RPC | https://testnet-rpc.z.ink |
| WebSocket RPC | wss://testnet-rpc.z.ink |
| Explorer | https://explorer.z.ink |
Suggested layout
txt
src/
clients/
sage-c4.ts
clusters/
sage-ptr.ts
scripts/
inspect-sector.ts
types/
sage.tsBaseline client shape
ts
import { createSolanaRpc, createSolanaRpcSubscriptions } from '@solana/kit';
export const sagePtr = {
rpc: createSolanaRpc('https://testnet-rpc.z.ink'),
subscriptions: createSolanaRpcSubscriptions('wss://testnet-rpc.z.ink')
};TIP
Keep the endpoint visible in examples while the PTR is moving. Hidden global cluster config is convenient later, but noisy while debugging early integrations.
Reading paths
If you are new to the game and the programs:
If you are building a tool:
- Connection setup
@solana/kitclient- Transaction Review and Account Diffs
- The relevant domain page: Fleets, Cargo and Currency, Crafting, Claim Stakes, Mining, Scanning, and Loot, Starbases, World Data, or Local Markets.
- The matching workflow page when the action creates or mutates state.
If you need exact generated-client details:
- Account decoding
- Program Architecture
- Current Package Surface
- Generated Types Glossary
- The relevant domain and workflow pages for live PTR behavior.
