Planning your game

If you’re new to developing games for Apple platforms, take a moment to familiarize yourself with the tools and technologies you need to get started. Apple provides the hardware, graphics, audio, social-gaming, and development and distribution tools you need to create the next generation of games on Apple platforms.

A storyboard of a new game idea.

    What you can do

    Apple SDKs provide everything you need to create amazing games for all Apple platforms. The SDKs include APIs for everything from powerful GPU-accelerated graphics to game controller integration, and even immersive spatial audio.

    Create high-performance adventure, racing, and action games

    Build action-packed games that immerse players using hardware-accelerated 3D graphics, haptic and sound feedback, and spatial audio. Support popular game controllers, racing wheels, and device-specific touch and motion.

    Create puzzle and strategy games

    Assemble your interface from standard controls, draw your own 2D views, and perform hardware-accelerated animations. Offload large data sets and computation to the GPU.

    Create multiplayer games

    Add matchmaking, finding friends, voice chat, and other social-gaming features with Game Center. Encourage competition using leaderboards, achievements, and challenges. Let players start your game with family and friends over FaceTime using SharePlay.

    Blend the virtual with the real world

    In visionOS, combine your game’s graphics and Spatial Audio with the player’s real world in a 3D space and adapt it to the level of immersion the player chooses. Fly spaceships through a hole in the wall or project your 2D board game on the player’s desk.

    Run well on all devices

    Save your game data in iCloud so players can continue playing on any Apple device. Adapt your iOS game to run in iPadOS and macOS too. Easily share code between different Apple platform versions of your game.

    Where to start

    Game development with Apple technologies starts with Xcode, Apple’s integrated development environment, which includes code editors, debugging tools, device simulators, graphics performance and analysis tools, and platform SDKs.

    Download Xcode from the Mac App Store

    Xcode includes the SDKs for iOS, iPadOS, macOS, tvOS, visionOS, and watchOS.

    Start by creating an Xcode project, then select a platform, the Game template, and the game technology you want to use, such as Metal. If you prefer to use C++ for Metal, or have a Unity™ project, see Bring existing games to Apple platforms below.

    Design for Apple platforms

    Great games incorporate the unique characteristics and capabilities of the devices that they run on. Consider that the player may be traveling, sitting at their desk, relaxing on the couch, or standing in their living room while playing your game. Let players interact with your game using Multi-Touch gestures and voice control when possible. Take advantage of high-resolution displays, Apple silicon, external game controllers, headphones, and speakers. In visionOS, allow for passthrough, adapt audio to the player’s surroundings, handle touch events, and add custom gestures. For platform-specific design guidance, see Human Interface Guidelines > Platforms.

    Create gorgeous graphics

    Use Metal to get the best graphics performance out of the player’s powerful Apple hardware. Metal provides a low-level API for hardware-accelerated 2D and 3D graphics on all Apple platforms, as well as powerful features designed especially for Apple silicon.

    Submit work to the GPU. To execute commands on the device’s graphics processing unit (GPU), create a command buffer, write commands into it, and commit the buffer to a command queue. To learn more, see GPU Devices and Work Submissions.

    Stream assets to the GPU. Load graphics resources faster by streaming asset data to textures and buffers asynchronously. To learn more, see Resource Loading.

    A screenshot on a Macbook Pro from the video game Stray.

    Accelerate performance with upscaling. Improve performance of your 3D scenes using high-performance temporal antialiasing or spatial upscaling. Use the MetalFX framework to upscale low-resolution images to higher-resolution images in less time than directly rendering an image.

    Use shaders tuned for each GPU family. Use the Metal Performance Shaders framework to apply high-performance filters to images, multiply matrices, and vectors.

    Run computations on the GPU. Encode compute passes, which run in parallel with render passes on the multiple cores of the GPU, so that computations don’t impact graphics rendering. To implement ray tracing on the GPU, see Accelerating ray tracing using Metal.

    To find working code for features you want to implement, see Metal Sample Code Library.

    Improve graphics quality and performance

    Use the powerful suite of Metal development tools to help make your game fast and efficient.

    Locate and fix Metal API issues. Run your game in Xcode to validate your Metal code and catch shader execution errors. To learn more, see Validating your app’s Metal API usage and Validating your app’s Metal shader usage.

    Debug and profile your game. Use Metal debugger to investigate visual artifacts and optimize GPU performance. Capture your Metal workload and use the Performance timeline to explore GPU execution performance. Use shader debugger to investigate visual artifacts on a capture of your Metal workload.

    An Xcode screenshot showing Metal debugger's Performance timeline for a GPU trace. An Xcode screenshot showing Metal debugger's Performance timeline for a GPU trace.

    Fix graphics interruptions or stutters. To analyze slowness in your game’s frame rate, use the Game Performance template in Instruments, which combines threading and system call information with the Metal System Trace instrument. To learn more, see Analyzing the performance of your Metal app.

    Optimize memory usage. Use Instruments profiling tools to maintain a small memory footprint and improve your game’s frame rates. To learn more, see Profile and optimize your game’s memory.

    Analyze performance in real time. Overlay the Metal Performance HUD on your game to view CPU and GPU metrics in real time. To learn more, see Monitoring your Metal app’s graphics performance.

    Create exceptional soundtracks

    Increase engagement and realism by adding sound effects and music that complement the action within your game.

    Add audio, sounds, and music. To play audio, control cameras, and process audio, use AVFoundation. To configure voice chat or mix audio with other sources, use AVAudioSession. To control playback, use AVAudioPlayer or AVAudioEngine. To play music from the library, use Media Player. To interact directly with audio hardware, use Core Audio.

    Integrate spatial audio into scenes. Use the PHASE (Physical Audio Spatialization Engine) framework to create a more realistic and immersive audio experience that reacts in real time to events and scenes in your game. PHASE provides a consistent spatial audio experience across platforms and output devices, such as headphones and speakers.

    Add haptic feedback

    On iPhone and Apple TV, engage players physically by combining tactile and audio feedback using Core Haptics. To get the player’s attention and reinforce actions, build custom haptic patterns from events that can be transient, like toggling a switch, or continuous, like the vibration and sound of a ringtone. To provide haptic feedback through game controllers, see Support input devices below.

    Support input devices

    Let players interact with your game in more natural ways using the Game Controller framework.

    • Support third-party gamepads, arcade sticks, and racing wheels, as well as the mouse and keyboard.
    • Overlay a virtual controller on mobile devices to emulate a physical controller.
    • Play rumble and haptic feedback through a physical controller. To learn more, see GCDeviceHaptics and Advancements in Game Controllers.

    The App Store adds a game controller badge to your game if it supports controllers.

    Tune graphics-intensive games for Apple silicon

    Take advantage of powerful Apple silicon GPUs.

    Build your code for Apple silicon. Use virtual memory-page sizes, cache line sizes, variadic functions, memory that’s simultaneously writable and executable, and more. To learn more, see Addressing Architectural Differences in Your macOS Code.

    Update your CPU thread priorities. In addition to using POSIX thread priorities and scheduling policies, use Grand Central Dispatch (GCD) to manage thread scheduling and keep the system responsive, and Quality of Service (QoS) to attach semantics to threads. To learn more, see Tuning Your Code’s Performance for Apple silicon.

    Accelerate performance with Neon. The Neon instruction set provides single instruction multiple data (SIMD) operations to accelerate performance on ARM processors. To use open source Neon libraries on Apple platforms, see SSE2Neon and AVX2Neon.

    Optimize GPU performance and efficiency. Write Metal code that uses GPU features like imageblocks, tile shading, and raster order groups. To learn more, see Tailor Your Apps for Apple GPUs and Tile-Based Deferred Rendering.

    Build spatial computing games for visionOS

    Consider how to modify your code to create a great, immersive, experience on visionOS.

    Integrate virtual objects into the real world

    Use RealityKit to create virtual objects that blend realistically with the surrounding real-world objects.

    In the Shared Space, RealityKit applies the real world lighting of the player’s room to your objects. RealityKit applies other effects to make virtual objects more realistic, such as depth mitigation, near-field vignetting fades, passthrough, and grounding shadows when virtual objects are near real objects.

    You can use the built-in physical-based-rendering (PBR) shaders or create custom ones that you edit in Reality Composer Pro. You can also apply your own custom lighting effects. To learn more, watch Meet Reality Composer Pro.

    Render scenes in an infinite 3D space

    You provide the models, textures, and shaders to the device that renders it for each eye. For fully immersive games that take the player to a different place, use RealityKit, SwiftUI, and ARKit.

    For high-performance graphics that need direct control of the GPU, use Compositor Services to access Metal and render the scene for each eye yourself. Then use ARKit for world tracking and hand tracking. To learn more, watch Discover Metal for immersive apps.

    To adapt 2D games to the 3D space, consider adding a parallax effect by rendering objects in separate layers, and have elements come out of the plane, such as smoke or sparks. To learn more, watch Design for spatial user interfaces.

    To anchor your content to the real world including the player’s hands, use RealityView.

    Enhance the experience with immersive audio

    To bring your objects to life in the 3D space, play audio through RealityKit on specific entities in your scene. RealityKit automatically matches the reverb and real-world acoustics. For audio using other APIs that Create exceptional soundtracks mentions, you can get the player’s head position using the ARKit queryPose(atTimestamp:) method to implement head tracking. To learn more, watch Explore immersive sound design.

    Design interactions for eyes and hands

    Engage the player by using their eyes, hands, and head pose as an input device.

    In SwiftUI, let the player reach out and select or drag objects. Use CollisionComponent to define the shape of objects and InputTargetComponent to make them interactable.

    To create custom gestures using the player’s hands, use ARKit to track the hands and get a virtual mesh of the room. Use ARKit to find horizontal and vertical surfaces, and even get their materials, such as carpet or wood. To learn more, watch Design for spatial input and Meet ARKit for spatial computing.

    For traditional games, the player can use a game controller or keyboard when running in a Full Space, because passthrough allows the player to see the device they’re holding.

    Bring your games to visionOS

    Existing iPad and iPhone games automatically run on the device in a window using indirect and direct gestures. To add stereoscopic and take full advantage of the device features, such as gesture input and effects to enhance 2D games in a 3D space, design your game for spatial computing using RealityKit.

    For existing Unity VR games, watch Bring your Unity VR app to a fully immersive space and Create immersive Unity apps.

    To get started, create a visionOS game from the RealityKit template and then run your game in the Apple Vision Pro simulator. To learn more, watch Get started with building apps for spatial computing and Build great games for spatial computing.

    Bring existing games to Apple platforms

    Apple provides support and tools to assist you in bringing your existing games to Apple platforms.

    Evaluate your Windows executable on Apple silicon. If you’re bringing a Windows™ game to Mac, test your game’s graphics and performance on Macs with Apple silicon without modifying your game. To learn more, watch Bring your game to Mac: Make a game plan and download the game porting toolkit.

    Use Apple technologies in your Unity-based game. Use Apple Unity Plug-ins with your Unity project to access the GameKit, Core Haptics, PHASE, Accessibility, and Game Controller frameworks.

    Use C++ for Metal. If you have existing C++ code, you can continue using it with Metal. Metal-cpp allows you to access the Metal API from C++ without having to use separate Objective-C or Swift files. To learn more, see Getting started with Metal-cpp.

    Convert shader code to Metal. Save time by using the Metal shader converter to convert DirectX Intermediate Language (DXIL) into a Metal library that you add to your Xcode project. To learn more, watch Bring your game to Mac: Compile your shaders and download the Metal shader converter.

    Convert game assets. If you have Windows asset creation pipelines, use the Metal Developer Tools for Windows to move your assets to Apple platforms. Use the Metal compiler to compile graphics and compute shaders, and the texture converter to convert textures to formats that Metal supports.

    Build a social network

    Take advantage of the services Apple provides for social gaming and storing game data using Game Center. Let Apple help promote your game organically through players sharing and interacting with each other.

    Grow discovery and engagement. Enable Game Center, Apple’s social-gaming network, to help new players discover your game on the App Store and through friends — and keep the enjoyment going for existing players.

    A composite of iPhone and iPad screenshots showing Game Center on the App Store and in a game.

    Motivate players and encourage competition. To increase enjoyment and promote your game through friend activities, add Game Center social-gaming features using the GameKit framework.

    • Keep players engaged using achievements, leaderboards, and challenges.
    • Let players view their Game Center activity and invite friends to play within your game.
    • Access the player’s friends list to create new ways for friends to interact in your game.

    Save game and player data. Allow players to continue playing your game from multiple devices by saving the game data to their iCloud account using GameKit or CloudKit. In addition, save game data in your game’s private or public iCloud containers that all players can access.

    Provide a familiar multiplayer experience. It’s easy to add multiplayer features using GameKit's matchmaking and communication APIs.

    • Present interfaces to match players with other players and start your game quickly.
    • Create better matches using game-specific matchmaking rules.
    • Send match data between players when they perform actions and take turns.
    • Add communication during real-time games and exchanges in turn-based games.
    • Enable friends to participate in group activities over FaceTime using SharePlay.

    To learn more, see Finding multiple players for a game.

    Capture and replay game content. Add a screen-sharing or game-streaming feature to your macOS game using the ScreenCaptureKit framework. ScreenCaptureKit records video and audio of the windows, apps, and displays that you specify with minimal CPU and GPU overhead.

    Distribute your game

    The App Store lets you easily distribute your game to hundreds of millions of people around the world on all Apple platforms. The App Store processes customer payments, provides secure and reliable downloads, manages releases, and helps promote your game.

    Distribute your game through the App Store. Join the Apple Developer Program and then upload builds using Xcode. Use App Store Connect to configure game-oriented features, distribute your game for beta testing, and submit builds to App Review.

    Reduce the size of downloads. The App Store optimizes the build for each platform and hosts on-demand resources for you that reduce your game size and enable faster downloads. To learn more, see Preparing your app for distribution. Alternatively, use Background Assets to host your own resources.

    Help customers discover your game. Create your product page on the App Store with app previews, screenshots, and a description that gets players excited about your game.

    Make your macOS game available on Apple silicon only. To target your game exclusively to Macs with an M1 chip or later, see the “Apple silicon-only apps” section of Submit your apps to the Mac App Store.

    Notarize your macOS game. To give players confidence that your macOS game distributed outside the Mac App Store is from you and has been checked for known malicious components, notarize your macOS game before distribution using Xcode or the notarytool command-line tool.

    Protect the integrity of your game. Enable the Hardened Runtime capability and select options to prevent against malicious code injection, dynamic library hijacking, and process memory space tampering.

    If you’re working on a groundbreaking, unreleased game and would like Apple to consider it for the Apple Arcade game subscription service, we'd love to hear from you.