1 Development Guide 2 Contents Development Guide ..............................

1 Development Guide 2 Contents Development Guide ................................................................................................................................ 1 Contents ....................................................................................................................................................... 2 Overview ...................................................................................................................................................... 3 Compiling framework ............................................................................................................................. 5 Assets and authoring ........................................................................................................................... 12 Game ........................................................................................................................................................... 15 Input and sensors .................................................................................................................................. 18 Sprites and fonts .................................................................................................................................... 20 Scene and nodes.................................................................................................................................... 22 Model and mesh .................................................................................................................................... 28 Lights ........................................................................................................................................................... 30 Materials and shaders .......................................................................................................................... 33 Particle emitters ...................................................................................................................................... 37 Physics ........................................................................................................................................................ 39 Animation .................................................................................................................................................. 48 Audio ........................................................................................................................................................... 53 User Interface .......................................................................................................................................... 55 Scripting ..................................................................................................................................................... 65 License ........................................................................................................................................................ 71 3 Overview The gameplay framework is an open-source, cross-platform gaming framework that is designed to make it easy to learn to write 3-D mobile and desktop games using native C++. In this guide, we cover a top-down approach to teaching you the gameplay library, tools, and all the major parts of the APIs that are included in the framework. This guide covers a set of the C++ classes that you can use to write your games. Design goals and considerations In creating the gameplay framework, the goal was not only to focus on creating a high performance native C++ game framework, but also on a clean, simple, and elegant architecture. The framework uses a minimal set of cross-platform external dependencies and tries to take a minimalist approach to designing the classes. This approach allows you to learn from the classes in the library and extend the framework to build your own game engine or tools. The framework is a good starting block for learning how to write 3-D cross-platform mobile and desktop games, allowing you to spend more time designing your game. Why write another game engine? We actually hope it will be considered more of a gaming framework; however, in essence, it is really still just the core components of a game engine. There are several reasons why the gameplay framework was developed. First, most modern 3-D game engines, while sometimes free or cheap, are closed source. Additionally, they usually have licensing fees. The gameplay framework is free, open-source software under the Apache 2.0 license. We want more people to 4 learn about the fact that cross-platform is a reality and building a good base lets you move forward to writing game titles. Secondly, a game engine is not only about rendering. Yes, it’s a huge part, but equally important are other aspects of game engines, such as audio, physics, animation, UI forms, particle emitters, scripting, and math. Searching on the web and trying to find information on how to fit these things into your game engine, or games, will likely scatter you across many different places, with the chance of gaps in your learning. This framework will hopefully bring it all together for you. Lastly, mobile is hot! The gameplay framework will have a lot of emphasis on gaming on mobile devices. Today, mobile gaming is the largest growing sector of the game industry. Additionally, we still provide support for desktop platforms for both tooling and gaming. However, we think more focus should be on mobile gaming and learning how to write games that can easily target the cross-platform mobile sector. 5 Compiling framework To build the gameplay library, tools, and samples as well as write your own games, you will have to install and use the platform specific tools listed below. These are the supported development environments for each specific operating system as a target platform. Desktop OS Tool Development environment Microsoft Windows 7 Visual Studio 2010 Windows 7 Apple Mac OS X Xcode 4.3.2 Mac OS X Mobile OS Tool Development environment BlackBerry PlayBook OS 2.0 BlackBerry Native SDK 2.0 Windows 7, Mac OS X Android 2.3 Android NDK 7 Windows 7, Mac OS X iOS 5.1 Xcode 4.3.2 Mac OS X Project repository Included in the project repository are the following notable folder and files: Folder/Files Description /bin Precompiled binary tools /external-deps External dependency libraries /gameplay The gameplay library /gameplay-api Doxygen API Reference /gameplay-docs Documentation guides and tutorials /gameplay-encoder Game asset/content encoding tool /gameplay-luagen Lua script bindings generator tool /gameplay-template Game samples template project files /gameplay-samples Game samples 6 gameplay.xcworkspace Xcode workspace gameplay.sln Microsoft Visual Studio solution gameplay-newproject.bat/.sh New cross-platform project script Getting started on desktop The quickest way to get started using the gameplay framework and tools is to simply start working in one of the desktop environments. You could use Microsoft Visual Studio 2010 Express, Professional on a Windows 7 operating system, or Xcode 4.3.2 on an Apple Mac OS X operating system. Then just open either the Microsoft Visual Studio solution or Xcode workspace, and build and run the projects. These solutions/workspaces are set up by default to build all the projects needed and to run the samples you have selected as active. Voila! You now have one of several simple, interactive samples running on your desktop environment, which you can explore and become more familiar with. Game samples The gameplay-docs folder contains additional tutorial documentation for our gameplay-samples. These are intended to go into more detail for designing and coding games written using the framework. They all have a good starting point but have intentionally been left incomplete. This gives you the opportunity to change the samples, and complete them to make them more fun to interact and play with. They provide good building blocks and are a basis for you to explore various features in the framework. You can utilize code snippets from the samples to help speed up the development cycle in your own games. API reference We firmly believe in making a very intuitive set of APIs that are as straight-forward 7 and as consistent as possible. However, all of the classes in the framework have been well documented with Doxygen formatting. The classes will be updated and improved iteratively throughout each release. This is to help you learn about what classes or sets of functions can be used and the recommended practices in using them. You should consider reading the latest versions of the API reference from the pre- generated HTML Doxygen API documentation in the gameplay-api folder. This will give you a deeper understanding of the C++ gameplay framework. Getting started on mobile Now that you are up and running on one of the desktop environments, we recommend you take this seriously and go mobile! In today’s mobile game market, cross-platform development is a reality. It is quite simple and easy to use the gameplay framework to target a wider device audience. Start by downloading the native development kit for one of the various supported mobile operating system targets or set them all up. Mobile setup instructions Listed below are the basic setup instructions for downloading and installing the supported mobile platform and development environments for gameplay. BlackBerry Native SDK 2.0/10 Beta (PlayBook tablets and BlackBerry 10 devices) 1. Download and install the BlackBerry Native SDK 2.0 or BlackBerry 10 Beta 2. Run the QNX Momentics IDE (Eclipse CDT based) and click File > Import > Import Existing Projects. 3. Import all the gameplay projects by selecting the repository project folder. 4. Set the active configuration to one of the Device-XXX or Simulator-XXX profiles. 5. Build and run any of the game samples. 8 Apple Xcode 4.3.2 (iPad tablets and iPhone devices) 1. Download and install Apple Xcode 4. 2. Open the gameplay.xc workspace. 3. Change the active configuration to iOS Device, iPhone Simulator, or iPad Simulator. 4. Build and run any of the game samples. Android NDK 7 (Android tablets and devices) 1. Download and install Android NDK 7, Android SDK, Apache Ant, and GNU Make for Cygwin. a. Setup the Android SDK. b. Make sure <android-sdk-path>/tools and <android-sdk-path>/platform-tools are added to PATH. c. Setup the Android NDK and follow these instructions. d. Make sure <android-ndk-path> is added to PATH. e. Install Apache Ant. f. Make sure <ant-path>/bin is added the PATH. g. Install Cygwin and select and add the package make: The GNU version of the 'make' utility during installation. h. Rename awk.exe to something else (awk_.exe for example) in <android-ndk- path>/prebuilt/windows/bin. This is to prevent the Android build system from being confused by the cygwin's awk. 2. Build the gameplay library using following steps: a. Open the Cygwin terminal. b. Change to the <gameplay-root>/gameplay/android folder. c. Run the following command to generate the needed files to build the project: > android.bat update project -t 1 -p . -s d. Run the following command to build the gameplay library: > ndk-build 3. Build a sample game(s) with following steps: a. Open the Cygwin terminal. 9 b. Change to the: <gameplay-root/gameplay-samples/sampleXX-XXXXX>/android folder. c. Run the following command to generate the needed files to build the project: > android.bat update project -t 1 -p . -s d. Run the following command to build the gameplay sample: > ndk-build Android NDK permissions errors: If you see an error like "./obj/local/armeabi/libpng.a: No such file: Permission denied", make sure that the "*.a" files have read permission by running: > chmod +r obj/local/armeabi/*.a 4. Connect the device and run the following command in the Cygwin terminal to deploy the game: > ant debug uploads/S4/ development-guide.pdf

  • 47
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager
  • Détails
  • Publié le Jui 11, 2021
  • Catégorie Law / Droit
  • Langue French
  • Taille du fichier 0.8700MB