Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Video game programming
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Subset of game development}} {{About|programming video games|a broader overview of the subject|video game development}} {{Video game industry}} '''Game programming''', a subset of [[game development]], is the [[software development]] of [[video games]]. Game programming requires substantial skill in [[software engineering]] and [[computer programming]] in a given [[Programming language|language]], as well as specialization in one or more of the following areas: [[simulation]], [[computer graphics]], [[artificial intelligence (video games)|artificial intelligence]], [[physics]], [[audio programming]], and [[Input/output|input]]. For [[multiplayer]] games, knowledge of [[Computer network programming|network programming]] is required (the resultant code, in addition to its performance characteristics, is commonly referred to as the game's [[netcode]] by players and programmers alike). In some genres, e.g. [[fighting games]], advanced network programming is often demanded, as the netcode and its properties (e.g. [[network latency|latency]]) are considered by players and critics to be some of the most important metrics of the game's quality. For [[massively multiplayer online game]]s (MMOGs), even further knowledge of [[database programming]] and advanced networking programming are required. Though often engaged in by professional [[video game programmer|game programmer]]s, there is a thriving scene of [[indie game|independent]] developers who lack a relationship with a publishing company. ==Development process== Professional game development usually begins with a [[game design]], which itself has several possible origins. Occasionally the game development process starts with no clear design in mind, but as a series of experiments. For example, [[game designer]] [[Will Wright (game designer)|Will Wright]] began development of ''[[The Sims]]'' by getting programmers to experiment with several ideas. ===Prototyping=== Programmers are often required to produce [[Prototype#Software release cycle|prototypes]] of gameplay ideas and features. A great deal of prototyping may take place during pre-production, before the design document is complete, and may help determine what features the design specifies. [[Prototype]]s are developed quickly with very little time for up-front design and mostly act as a [[proof of concept]] or to test ideas. They are not expected to work flawlessly, but are developed to try out new, sometimes exotic, ideas. ===Game design=== {{Main|Game design}} Though the programmer's main job is not to develop the game design, the programmers often contribute to the design, as do [[video game artist|game artists]]. The game designer will solicit input from both the [[game producer|producer]] and the art and [[lead programmer|programming lead]] for ideas and strategies for the game design. Often individuals in non-lead positions also contribute, such as [[copywriter]]s and other programmers and artists. Programmers often closely follow the [[game design document]]. As the game development progresses, the design document changes as programming limitations and new capabilities are discovered and exploited. ===Production=== During production, programmers may create a great deal of [[source code]] to create the game described in the game's design document. Along the way, the design document is modified to meet limitations or expanded to exploit new features. The design document is very much a "living document", much of whose life is dictated by programmer's schedules, talent and resourcefulness. While many programmers have some say in a game's content, most [[game producer]]s solicit input from the [[lead programmer]] as to the status of a game programming development. The lead is responsible for knowing the status of all facets of the game's programming and for pointing out limitations. The lead programmer may also pass on suggestions from the programmers as to possible features they'd like to implement. With today's visually rich content, the programmer must often interact with the [[video game artist|art staff]]. This very much depends on the programmer's role, of course. For example, a [[Game programmer#Graphics programmer|3D graphics programmer]] may need to work side by side with the game's 3D modelers discussing strategies and design considerations, while an [[Game programmer#Artificial intelligence programmer|AI programmer]] may need to interact very little, if at all, with the art staff. To help artists and level designers with their tasks, programmers may volunteer or be called upon to develop [[game development tool|tools and utilities]].<ref>{{Cite journal |last=Bouknight |first=W. Jack |date=September 1970 |title=A procedure for generation of three-dimensional half-toned computer graphics presentations |journal=Communications of the ACM |volume=13 |issue=9 |pages=527–536 |doi=10.1145/362736.362739 |s2cid=15941472 |issn=0001-0782|doi-access=free }}</ref><ref>{{Cite book |last=Millington |first=Ian |date=2019-03-18 |title=AI for Games |url=http://dx.doi.org/10.1201/9781351053303 |doi=10.1201/9781351053303|isbn=9781351053303 |s2cid=186504701 }}</ref> Many of these may be for a specific purpose and can be [[computer bug|buggy]] due to time constraints (time for development of such tools is often not included in a game's schedule) as well as because they are only for in-house use anyway. Many game tools are developed in [[Rapid application development|RAD]] languages for quicker development and may be discarded after the completion of the game. ===Testing=== {{Main|Game testing}} The formal [[quality assurance]] testing process, performed by professional [[game tester]]s, begins well into game development. High-budget titles may begin testing with the first playable [[Alpha test|alpha]], while low-budget and casual games might not enter testing until a [[release candidate]] is ready. The programmers' task is to fix errors and bugs as such are discovered by the QA teams.<ref>{{Cite web |last=Schubotz |first=Moritz |date=2016-12-12 |title=Cogex: A logic prover for question answering |url=https://www.datasakura.com/works-games |website=Datasakura}}</ref> ===Nearing completion=== Final tasks include "polishing" the game, such as programmers fixing occasional bugs—from minor to catastrophic—that may arise during the last phases of [[game tester|testing]]. Game developers may have a [[beta test]]ing period, but the definition of such varies from developer to developer. Often a beta contains all of the game's features, but may have a few bugs or incomplete content. Few games are given a public beta period, for example, to measure stress tolerance for game [[Server (computing)|server]]s. When the game is deemed complete, it is said to have "[[Release to manufacture|gone gold]]" and is shipped off to the publisher. Depending on circumstances, the publisher may then subject it to its own quality assurance or may begin pressing the game from the [[Golden master|gold master]]. ===Maintenance=== Once a game ships, the maintenance phase for the video game begins. Programmers wait for a period to get as many bug reports as possible. Once the developer thinks they've obtained enough feedback, the programmers start working on a [[patch (computing)|patch]]. The patch may take weeks or months to develop, but it's intended to fix most bugs and problems with the game. Occasionally a patch may include extra features or content or may even alter gameplay. ===Duration=== Most modern games take from one to three years to complete. The length of development depends on a number of factors, but programming is required throughout all phases of development except the very early stages of game design. ==Tools== Like other software, game development programs are generated from [[source code]] to the actual program (called the ''executable'') by a [[compiler]]. Source code can be developed with almost any [[text editor]], but many professional game programmers use a full [[integrated development environment]]. Once again, which IDE one uses depends on the target platform. In addition to IDEs, many game development companies create [[Game development tool|custom tools]] developed to be used in-house. Some of these include prototypes and asset conversion tools (programs that change artwork, for example, into the game's custom format). Some custom tools may even be delivered with the game, such as a [[level editor]]. Game development companies are often very willing to spend thousands of dollars to make sure their programmers are well equipped with the best [[Game programmer#Languages and tools|tools]]. A well outfitted programmer may have two to three development systems and multiple monitors dominating their office or cubicle. ===Programming languages=== {| class="wikitable" style="margin-left:1em; float: right; width: 450px" |- ! Language ! Features |- | [[Assembly language|Assembly]] | Potentially minimal CPU [[Overhead (computing)|overhead]] |- | [[C (programming language)|C]] | Widely known, widely portable, numerous APIs, compiles to [[machine code]] |- | [[C++]] | [[Object-oriented programming|Object-oriented]], widely known, numerous APIs, compiles to machine code |- | [[Java (programming language)|Java]] | Object-oriented, [[garbage collection (computer science)|garbage-collected]], widely portable (via a [[virtual machine]]) |- | [[C Sharp (programming language)|C#]], [[Visual Basic .NET]], etc. | Object-oriented, garbage-collected, interfaces with [[Microsoft]] products |- | [[Objective-C]], [[Swift (programming language)|Swift]] | Object-oriented, interfaces with [[Apple Inc.|Apple]] products |- | [[Lua (programming language)|Lua]], [[Python (programming language)|Python]], [[JavaScript]], [[Tcl]], etc. | Familiar syntax, easily embedded in the above languages, often used for [[scripting language|scripting]] |- | [[Lisp (programming language)|Lisp]], [[Pascal (programming language)|Pascal]], [[Perl]], [[Smalltalk]], etc. | Fringe game languages, although bindings to popular libraries are common |} Once the game's initial design has been agreed upon, the development language must be decided upon. The choice depends upon many factors, such as language familiarity of the programming staff, target platforms, the execution speed requirements and the language of any [[game engine]]s, [[Application programming interface|APIs]] or [[library (computing)|libraries]] being used. For [[personal computer]]s, the language selected may be little more than a matter of preference. [[Language binding]]s for popular libraries such as [[Simple DirectMedia Layer|SDL]] and [[Allegro (software library)|Allegro]] are widespread,<ref>{{cite web |url=https://www.libsdl.org/languages.php |title=SDL Language Bindings |access-date=2015-11-08 }}</ref><ref>{{cite web |url=http://liballeg.org/bindings.html |title=Allegro - Language bindings |access-date=2015-11-08 }}</ref> and the performance gap between idiomatic code written in modern [[Compiled language|compiled]] languages is negligible.<ref>{{cite web |url=http://dan.corlan.net/bench.html |title=Programming language benchmarks |last=Corlan |first=Alexandru-Dan |date=2003 |access-date=2015-11-08 }}</ref><ref>{{cite web |url=https://attractivechaos.github.io/plb/ |title=Programming Languages Benchmarks |last=Corlan |first=Alexandru-Dan |date=2011-06-11 |access-date=2015-11-08 }}</ref> The most popular languages are usually [[Procedural programming|procedural]] or [[Object-oriented programming|object-oriented]] and implemented via [[compiler]]s; for example, [[C (programming language)|C]],<ref name="cprogramming" /> [[C++]],<ref name="cprogramming">{{cite web |url=http://www.cprogramming.com/game-programming.html |title=Game Programming in C and C++ |last=Corlan |first=Alexandru-Dan |date=2011 |access-date=2015-11-08 }}</ref><ref name="satori">{{cite web |url=http://www.satori.org/2009/03/the-engine-survey-general-results/ |title=The Engine Survey: General results |last=DeLoura |first=Mark |date=2009-03-05 |access-date=2015-11-08 }}</ref> and [[Java (programming language)|Java]].<ref>{{cite web |url=http://legacy.lwjgl.org/projects.php |title=LWJGL - Projects |last=Corlan |first=Alexandru-Dan |access-date=2015-11-08 |url-status=dead |archive-url=https://web.archive.org/web/20151110034437/http://legacy.lwjgl.org/projects.php |archive-date=2015-11-10 }}</ref> However, developers may take into account [[Domain (software engineering)|domain]]-specific features, such as interfacing with the operating system, and resilience to [[reverse engineering]] for online video games.<ref>{{cite web |url=http://ithare.com/chapter-vb-modular-architecture-client-side-programming-languages-for-games-including-resilience-to-reverse-engineering-and-portability/ |title=Chapter V(b) from "Development&Deployment of MMOG"|author='No Bugs' Hare|date=30 November 2015}}</ref> Many games are not written in one language exclusively, and may combine two or more languages; For example, [[Unity (game engine)|Unity]], a popular game engine, has different pieces written in C, C++, and [[C Sharp (programming language)|C#]].<ref>{{Cite web |last=Corlan |first=Alexandru |date=2011 |title=Game Programming in C and C++ |url=https://www.datasakura.com/ |website=Datasakura}}</ref> For [[video game console|consoles]], the support of the target platform is usually the most considered factor. In the past, video games for consoles were written almost exclusively in [[Assembly language|assembly]] due to limited resources in terms of both storage and processing speed.<ref>{{cite book |last1=Hyde |first1=Randy |title=Using 6502 Assembly Language |year=1985 }}</ref> However, as technology has advanced, so have the options for game development on consoles. [[Nintendo]],<ref name="VB Unity interview">{{Cite interview | title=Game developers, start your Unity 3D engines | first=David | last=Helgason | date=November 2, 2012 | interviewer=Dean Takahashi | publisher=[[VentureBeat]] | work=GamesBeat | url=https://venturebeat.com/2012/11/02/game-developers-start-your-unity-3d-engines-interview/ | access-date=July 13, 2014 }}</ref> [[Microsoft]], and [[Sony Entertainment|Sony]]<ref>{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=MTU1MTY|title=[Phoronix] Why Sony Is Using LLVM/Clang On The PlayStation 4|publisher=Phoronix.com|access-date=17 November 2014}}</ref> all have differing [[Software development kit|SDK]]s for their [[Wii U]], [[Nintendo Switch]], [[Xbox One]], and [[PlayStation 4]] consoles, respectively. [[High-level programming language|High-level]] [[scripting language]]s are increasingly being used as embedded extensions to the underlying game written in a compiled programming language, for the convenience of both the original developer and anyone who would wish to [[Mod (video gaming)|mod]] the game. [[Lua programming language|Lua]] is a very popular choice, as its API is written in [[ANSI C]] and the language is designed to be embedded into other applications.<ref name="satori" /><ref>{{cite web |url=http://www.lua.org/uses.html |title=Lua: Uses |last=Corlan |first=Alexandru-Dan |date=2015-03-24 |access-date=2015-11-08 |archive-url=https://web.archive.org/web/20190724041205/http://www.lua.org/uses.html |archive-date=2019-07-24 |url-status=dead }}</ref> Many developers have created custom languages altogether for their games, such as [[id Software]]'s [[QuakeC]] and [[Epic Games]]' [[UnrealScript]]. ===APIs and libraries=== A key decision in game programming is which, if any, [[application programming interface|API]]s and [[library (computer science)|libraries]] to use. Today, there are numerous libraries available which take care of key tasks of game programming. Some libraries can handle sound processing, input, and [[Rendering (computer graphics)|graphics rendering]]. Some can even handle some [[artificial intelligence|AI]] tasks such as [[pathfinding]]. There are even entire [[game engine]]s that handle most of the tasks of game programming and only require coding game logic. Which APIs and libraries one chooses depends largely on the target platform. For example, libraries for [[PlayStation 2]] development may not be available for [[Microsoft Windows]] and vice versa. However, there are game frameworks available that allow or ease cross-platform development, so programmers can program a game in a single language and have the game run on several platforms, such as the [[Wii]], PlayStation 3, [[Xbox 360]], [[PlayStation Portable|PSP]] and Microsoft Windows. ====Graphic APIs==== {| class="wikitable" style="margin-left:1em; float: right; width: 450px" |+Graphics API usage across Operating Systems: !OS ![[Vulkan (API)|Vulkan]] ![[DirectX|Direct X]] !GNMX ![[Metal (API)|Metal]] |- !Windows 10 |yes |yes |no |no |- !Mac |[[MoltenVK]] |no |no |yes |- !Linux |yes |no |no |no |- !Android |yes |yes |yes |no |- !iOS |[[MoltenVK]] |yes |yes |yes |- !Tizen |in Dev |no |no |no |- !Sailfish |in Dev |no |no |no |- !Xbox One |no |yes |no |no |- ![[PlayStation 4 system software|Orbis OS]] (PS4) |no |no |yes |no |- !Nintendo Switch |yes |no |no |no |} Today, graphics are a key defining feature of most games. While [[2D computer graphics|2D graphics]] used to be the norm for games released through the mid-1990s, most [[AAA (video game industry)|AAA games]] now boast full [[3D computer graphics|3D graphics]], even for games which are largely 2D in nature, such as ''[[Civilization III]]''. However, purely 2D graphics have experienced a Renaissance with [[indie game]]s.<ref>{{cite web |url=http://rampantgames.com/blog/?p=5934 |title=Why Are Most Indie Games 2D Instead of 3D? |publisher=Rampant Games |date=2013-05-16 |access-date=2017-01-01 }}</ref> A well established [[personal computer]] platform is Microsoft Windows. Since it came pre-installed on almost ninety percent of [[IBM PC compatible|PCs]] sold, it now has the largest user base.{{Citation needed|date=May 2015}} The two most popular 3D graphics APIs for Microsoft Windows are [[Direct3D]] and [[OpenGL]]. The benefits and weaknesses of each API are hotly debated among Windows [[game programmer]]s. Currently, the most popular [[Computing platform]] is Google Android. Since it comes pre-installed on almost eighty percent of [[Smartphones]] sold, Android has the second largest user base, and increasing. Android uses [[OpenGL ES]] & [[Vulkan (API)]]. DirectX is a collection of game APIs. [[Direct3D]] is DirectX's 3D API. Direct3D is freely available from [[Microsoft]], as are the rest of the [[DirectX|DirectX APIs]]. Microsoft developed [[DirectX]] for game programmers and continues to add features to the API. The DirectX specification is not controlled by an open arbitration committee and Microsoft is free to add, remove or change features. Direct3D is not portable; it is designed specifically for [[Microsoft Windows]] and no other platform (though a form of Direct3D is used on Microsoft's [[Xbox (console)|Xbox]], Windows Phone 7.5 smartphones and mobile devices which run the [[Pocket PC]] operating system). OpenGL is a portable API specification. Code written with OpenGL is easily ported between platforms with a compatible implementation. For example, ''[[Quake II]]'', which uses OpenGL, was ported from Windows to Linux by a fan of the game. OpenGL is a standard maintained by the OpenGL Architecture Review Board (ARB). The ARB meets periodically to update the standard by adding emerging support for features of the latest 3D hardware. In addition, the development tools provided by the manufacturers of some video game consoles (such as the Nintendo GameCube, the Nintendo DS, and the PSP) use graphic APIs that resemble OpenGL. OpenGL often lags behind on feature updates due to the lack of a permanent development team and the requirement that implementations begin development after the standard has been published. Programmers who choose to use it can access some hardware's latest 3D features, but only through non-standardized extensions. The situation may change in the future as the OpenGL architecture review board (ARB) has passed control of the specification to the [[Khronos Group]] in an attempt to counter the problem.<ref>{{cite web|url=http://www.khronos.org/news/press/releases/opengl_arb_to_pass_control_of_opengl_specification_to_khronos_group/|title=Khronos Places OpenGL and OpenGL ES Conformance Tests into Open Source|publisher=Khronos Group Press Release |archive-url=https://web.archive.org/web/20080503182855/http://www.khronos.org/news/press/releases/opengl_arb_to_pass_control_of_opengl_specification_to_khronos_group/|archive-date=2008-05-03}}</ref> ====Other APIs==== For development on Microsoft Windows, the various APIs of DirectX may be used for input, [[sound effects]], music, [[computer network|networking]] and the playback of videos. Many commercial libraries are available to accomplish these tasks, but since DirectX is available for free, it is the most widely used. For console programming, the [[console manufacturer]]s provide facilities for rendering graphics and the other tasks of game development. The console manufacturers also provide complete development systems, without which one cannot legally market nor develop games for their system. Third-party developers also sell toolkits or libraries that ease the development on one or more of these tasks or provide special benefits, such as cross-platform development capabilities. ==Game structure== The central component of any game, from a programming standpoint, is the ''game loop''. The game loop allows the game to run smoothly regardless of a user's input or lack thereof. Most traditional software programs respond to user input and do nothing without it. For example, a [[word processor]] formats words and text as a user types. If the user doesn't type anything, the word processor does nothing. Some functions may take a long time to complete, but all are initiated by a user telling the program to do something. Games, on the other hand, must continue to operate ''regardless'' of a user's input. The game loop allows this. A highly simplified game loop, in [[pseudocode]], might look something like this : '''while''' (user does not exit) check for user input run AI move enemies resolve collisions draw graphics play sounds '''end while''' The loop may be refined and modified as game development progresses, but most games are based on this basic idea.<ref>{{cite book |url=https://archive.org/details/programminglinux0000loki |title=Programming Linux Games, Chapter 1 |year=2001 |isbn=1-886411-48-4 |url-access=registration |last1=Stutz |first1=Michael |publisher=Linux Journal Press }}</ref> Game loops differ depending on the platform they are developed for. For example, games written for [[MS-DOS|DOS]] and many consoles can dominate and exploit available processing resources without restraint. However, games for a modern PC operating system such as Microsoft Windows must operate within the constraints of the process scheduler. Some modern games run multiple [[thread (computing)|thread]]s so that, for example, the computation of character AI can be [[Coupling (computer programming)|decoupled]] from the generation of smooth motion within the game. This has the disadvantage of (slightly) increased overhead, but the game may run more smoothly and efficiently on [[hyper-threading]] or [[Multi-core (computing)|multicore]] processors and on multiprocessor platforms. With the computer industry's focus on [[CPU]]s with more cores that can execute more threads, this is becoming increasingly important. Consoles like the [[Xbox 360]] and [[PlayStation 3]] already have more than one core per processor, and execute more than one thread per core. ==Hobbyists== The only platforms widely available for hobbyists to program are consumer [[operating system]]s, such as Android, iOS, Windows, Mac, Linux, etc. This is because development on game consoles requires special development systems that cost thousands of dollars. Often these must be obtained from the console manufacturer and are only sold or leased to professional game development studios. However, Microsoft used to distribute a game development framework, [[Microsoft XNA|XNA]], which runs on both Microsoft Windows and Xbox 360. XNA was discontinued, but other projects like [[MonoGame]] and [[SharpDX]] are trying to allow the same access for game coding. Lately, Android is the most popular hobbyist platform of choice for mobile developers.<ref>{{cite web|url=https://arc.applause.com/2016/08/29/mobile-developers-android-vs-ios/|title=Report: 79% Of Mobile Developers Prefer To Build For Android|date=29 August 2016}}</ref> Some hobbyists also develop [[Homebrew (video games)|homebrew games]], especially for handheld systems or [[Modchip|modded]] consoles. Some [[software engineer]]ing students program games as exercises for learning a [[programming language]] or [[operating system]]. Some hobbyists may use software packages that help with game development, such as [[Adobe Animate]], [[Unity (game engine)|Unity]], [[Android Studio]], [[pygame]], [[Adventure Game Studio]], [[Roblox|Roblox Studio]], [[GameMaker Studio]], [[Godot (game engine)|Godot]], [[Unreal Engine]], [[Pixel Game Maker MV]], or [[Construct (game engine)|Construct]]. ==See also== {{Portal|Video games}} *[[List of gaming topics]] ==References== {{Reflist}} ==External links== *[http://www.gamedev.net/ GameDev.net], a leading resource for game development *[http://www.igda.org/ International Game Developers Association (IGDA)] * [http://web.mit.edu/professional/short-programs/courses/game_development_for_software_engineers.html Game Development for Software Engineers], a short 5 day short course offered by MIT with guidance from the mentors of the award-winning MIT Game Lab. *[https://web.archive.org/web/20090303040643/http://www.konaearth.com/Life/2006/060430/ One ex-game programmer's experience in the game development industry] *[http://www.sloperama.com/advice/lesson15.htm Game industry veteran Tom Sloper's advice on game programming] ===Wikis=== * [http://gamedesign.wikidot.com/ 2D Game Development wiki] * [https://web.archive.org/web/20100107180938/http://wiki.gamedev.net/index.php/Main_Page Game Development Wiki -GDwiki] {{Authority control}} [[Category:Video game development]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Authority control
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite interview
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Main
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Video game industry
(
edit
)