It is currently Tue Dec 12, 2017 5:28 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Fri Jan 30, 2015 3:04 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
I know this has probably been discussed before, but I'd like to know about what programming languages were used to make the commercially available computer games (not only NES, but all generations).

It is a well known fact that different programming languages were designed for different tasks, and are unsuited or unpractical for other tasks.

I know that the "mainstream" languages were first assembly, then C and slowly moved to C++. However all three of those languages has plenty of inconvenients. 'C' was designed for operating system programming, and is in fact not very well suited for other things (such as games), despite the fact it is used in everything because of a snowball effect that could have happened to any other of it's competitors. 'C++' was designed to remedy for C's shortcomings, but comes as a bloated huge pile of backwards compatibility s***t that is barely manageable.

So my question is : Is there any accurate sources stating in which language some popular games were developed ? That'd be especially interesting if they were not developed in a language of the 'C' family, however any accurate source in regard to the 'C' family would still be interesting too.

Were some games programmed in FORTH, ADA, Pascal, .... ?


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 6:28 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
I thought this was interesting: http://en.wikipedia.org/wiki/Game_Orien ... embly_Lisp (LISP used for games like Jak and Daxter.)

I don't really 'get' LISP, or what advantages there could be here, but still interesting anyway.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 8:27 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Bregalad wrote:
'C++' was designed to remedy for C's shortcomings, but comes as a bloated huge pile of backwards compatibility s***t that is barely manageable.

C++ was originally just a quick attempt to add OOP to C (in fact, it was literally just C with the addition of classes). It escalated from there until it turned into the current mess.

That said: Pascal was extremely common for making games on PC.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 9:15 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19334
Location: NE Indiana, USA (NTSC)
Xbox Live Indie Games for Xbox 360 are written in C# with the XNA framework. Every single one of them. The use of verifiably type-safe CIL compatible with the .NET Compact Framework is a platform requirement, and that rules out effectively every language that isn't C#. Standard C++ compiled with C++/CLI isn't verifiably type-safe, and IronPython and other DLR languages use Emit that isn't in the Compact Framework.

Tetris was written in Pascal.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 9:48 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
The games I've worked on professionally have all been C++. Usually several features of C++ are forbidden or disabled, like exceptions or multiple inheritance; often the code is mostly c-like. Very occasionally small routines will be written in assembly for optimization, though the rise of "compiler intrinsics" have made it easier to do assembly-like optimizations that weave seamlessly into C++ code, reducing the need for pure assembly optimization quite a lot.

For the most part, game development using other languages is rare and requires development of a unique programming culture at that specific company. Most of the places that do it have a very "do it yourself" approach, and don't use ready-made middleware solutions for much of anything. The vast majority of game development middleware is C++ based, for obvious reasons. (Off the top of my head, I've used: Unreal, Gamebryo, Havok, Scaleform, Miles Audio, Wwise, Beast, FaceFX, SpeedTree...)

In addition to this, a lot of games have some sort of scripting language used to customize behaviours of various things where quick turnaround and iteration is needed (especially for use by designers, rather than programmers). I've worked on games that used Lua, Python, and Pawn, and heard of a few others. It's not uncommon for custom scripting languages to be created, as well. Often "functional" style languages are used for scripting (e.g. Haskell), partly because you can represent funcional programming with flowchart-style visual boxes connected to each other; I've seen many game scripting tools designed this way around "visual coding".

Proprietary game tools are a whole other story. Here it's whatever gets the job done. Shell scripts, C#, Visual Basic, Python, etc...

Shader programming for graphics cards is generally done in some high level shader language (HLSL, GLSL, CG, etc.) and very occasionally assembly language (GPU-specific).

Examples I know of unusual game programming languages
  • Eve Online is primarily written in a proprietary form of Stackless Python, with a few core components written in C++ (and of course Stackless itself is written in C).
  • Spore used a modified form of Pure Data to write its procedural music generators.
  • From what I recall, Insomniac Games uses a proprietary high-level assembly language, and large portions of their games are written in assembly, though they use C++ as well. This may have changed a bit in the 5 years since I heard about it, though. (Edit: found a recent Mike Acton talk where he says they're now "70% C++" and 30% other stuff, including assembly. Years earlier he had suggested in a different talk that they used much more assembly.)
  • Minecraft was written in Java, though some of its ports were C++ based.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 10:53 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Also, as the commercial scale of games gets smaller (or nonexistent) there appears to be a lot more diversity to the language used. I could probably spend all day digging up examples here:
  • The Python-based RenPy used for Hate Plus and lots of other visual novels.
  • Actionscript for browser games made in Flash.
  • Haxe which targets multiple platforms, including Flash, used in Papers, Please and many broswer games.
  • GameMaker is widely used, and the bulk of the work is done in its proprietary scripting language.
  • The Microsoft XNA platform runs C#.
  • Java4k challenges people to write Java games that compile to 4 kilobytes or less.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 10:57 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Roller Coaster Tycoon was known for being a late holdout, written entirely in assembly language and released in 1999.


Top
 Profile  
 
PostPosted: Fri Jan 30, 2015 12:17 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Talking about the Apple IIGS specifically, and from my perspective/experience:

  • Games on the Apple IIGS were done in either assembly or a combination of something else and assembly. The most common tools used were ORCA/M (assembly) and ORCA/C (C), both by The Byte Works; others preferred assemblers like Merlin 16. Others were done in HyperCard. I'm sure some were done in Pascal but I don't know of any off the top of my head. And yes, there were some which were even done in Applesoft BASIC (either using classic LORES or HIRES graphics, which were more along the lines of what the non-IIGS Apple II models were used to, ex. Akalabeth).
  • Graphics were done in a multitude of ways, but a lot of people preferred the graphics editor called DreamGrafx (PDF).
  • Music was done in a multitude of ways, but a lot of people preferred the sequencer/"tracker" called SoundSmith; alternates included SynthLab (PDF), NoiseTracker GS, or Music Construction Set.
  • Sample editing/recording (also ties into the music part, since the IIGS used an Ensoniq chip that played digital samples) had lots of programs (too many to list); recording required a dedicated sound card (Sonic Blaster, Audio Animator, and SoundMeister were usual; Sonic Blaster was the most common), where subtle bus noise during recordings was quite common. Software filters for post-recording clean-up were very few (barring obvious ones like "echo", "reverb", etc.), and so owning a sound card which did all its recording/mixing in an external box (outside of the IIGS case) was highly preferred.
  • I should note: many of these programs were commercial, or shareware with hard expiries (meaning you could not use the product after N days), and piracy of commercial or shareware software on the IIGS was highly shunned (quite often if you were found doing this, you'd be ousted by peers and/or socially boycotted. I remember this being the same way in the Macintosh days, and to some degree even today in the OS X world).


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 2:52 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Quote:
Tetris was written in Pascal.

Thanks, that's exactly the kind of info I was looking for !

Sounds like I should deep into some Pascal tutorial someday. Looks like the typing is much less painful than C-family, with all those {} [] which are annoying to reach on a swiss keyboard. (C-like syntax was obviously meant to be typed with american keyboards)

Quote:
The games I've worked on professionally have all been C++. Usually several features of C++ are forbidden or disabled, like exceptions or multiple inheritance; often the code is mostly c-like.

Exceptions in C++ is still one of the few things I have *no* ideas how they could possibly translate into machine language. The problem is that if you want to avoid them, a huge part of the standard library becomes "forbidden" as well. You cannot use "new" and "delete". Well that don't matter you'd tell me you still have malloc() and free(), but those won't work for objects, as they would leave them in a dangerous un-initialized state. Even if you initialize the object later with an '=' assignement, it's destructor might be called on an uninitialised object, and that's hell. The only viable option would be to re-define "new" and "delete" for everything, but I never used this functionality of C++ personally, because I'd rather live with the exceptions.

Quote:
I don't really 'get' LISP, or what advantages there could be here

The advantage is simple parsing. Using forward or reverse polish notation is much simpler to code than the "normal" inline notation. Reverse polish is the only one which can allow to get completely rid of (), but forwards polish is probably even much simpler to parse.


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 3:32 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Bregalad wrote:
Exceptions in C++ is still one of the few things I have *no* ideas how they could possibly translate into machine language.

If you're ever curious, most C++ compilers have options to dump an assembly listing during the compile process. It's a great way to learn what's really going on. (Exceptions can do some really, really ugly things though. Might be easier to understand the assembly if you looked up an explanation of the implementation details for your compiler.)

Bregalad wrote:
The problem is that if you want to avoid them, a huge part of the standard library becomes "forbidden" as well. You cannot use "new" and "delete". Well that don't matter you'd tell me you still have malloc() and free(), but those won't work for objects, as they would leave them in a dangerous un-initialized state. Even if you initialize the object later with an '=' assignement, it's destructor might be called on an uninitialised object, and that's hell. The only viable option would be to re-define "new" and "delete" for everything, but I never used this functionality of C++ personally, because I'd rather live with the exceptions.

Well, new and delete were both part of the C++ language before it had exceptions. For instance, new is specified to return a null pointer if exceptions are disabled. There are a lot of important caveats to having no exceptions, like how bad an idea it is to use new inside a constructor without them. There's many common C++ programming patterns that you just wouldn't use without exceptions. I think almost everything in the standard library has an exception-free version, though. STL is frequently forbidden at game companies, but the reasons for that go far beyond exceptions.

I think every C++ professional game project I've worked on has defined custom allocators to use with new and delete, though there are other alternatives. You mentioned malloc/free, which are very much usable for C++ allocations in conjunction with placement new. I don't think there's much reason to use placement new + malloc instead of just nothrow new, though. I'm just pointing out that you can do it. A more useful thing to do with placement new might be to construct object in a statically allocated block of memory, for example.


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 4:16 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
rainwarrior wrote:
If you're ever curious, most C++ compilers have options to dump an assembly listing during the compile process. It's a great way to learn what's really going on. (Exceptions can do some really, really ugly things though. Might be easier to understand the assembly if you looked up an explanation of the implementation details for your compiler.)

Exept I don't "speak" x86 at all. I could check the output of arm-gcc, it's true, but it'd be somewhat different.


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 5:55 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Bregalad wrote:
Exceptions in C++ is still one of the few things I have *no* ideas how they could possibly translate into machine language.

I know it's not uncommon to implement them as setjmp/longjmp internally (oh, the irony).

Bregalad wrote:
The problem is that if you want to avoid them, a huge part of the standard library becomes "forbidden" as well. You cannot use "new" and "delete".

They're operands that can be overriden, so just change their behavior to not use exceptions.

Mind you, in practice these days if you can't use exceptions then you already wouldn't want to use (if you even can) the native new/delete and would be overriding them in the first place (usually making them use your own memory manager). This is what the EASTL does. (EASTL = EA's version of the C++ standard library, because the default was too slow for use on consoles)


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 10:12 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 941
I know many games were written in Pascal, and many games were written in QBASIC. There are also several in assembly language for whatever computer it is designed for. C is probably also used, although BASIC does seem to be more well suited for writing computer games than C is.

I think I may have seen one once written in Forth, but I don't know if that is common and I don't know if any are written in Ada. Writing computer games in SQL is probably even more rare if they exist at all.

Some computer games use virtual machines and the interpreter is then included with the game.

Several games that run on Synchronet are written in Javascript, although the client doesn't need to interpret Javascript since it is all server-side scripting.

_________________
.


Top
 Profile  
 
PostPosted: Sun Feb 01, 2015 1:30 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 950
rainwarrior wrote:
T Most of the places that do it have a very "do it yourself" approach, and don't use ready-made middleware solutions for much of anything. The vast majority of game development middleware is C++ based, for obvious reasons. (Off the top of my head, I've used: Unreal,

Huh. I thought the code exposed to the user via the editor looked vaguely Java-ish more than C++ (in particular: object inheritance syntax), but it's been ages, so take with salt.

Anyone else remember QuakeC?

Ski for VAX/VMS [...] was written in Fortran,
[...]
I wrote SkiFree in C on my home computer,


Also to think on: Maniac Mansion and subsequent games that used the SCUMM engine. (Script Creation Utility for Maniac Mansion). Though, was that an interpreted language...?


Top
 Profile  
 
PostPosted: Sun Feb 01, 2015 3:50 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Myask wrote:
(re: Unreal is C++) Huh. I thought the code exposed to the user via the editor looked vaguely Java-ish more than C++ (in particular: object inheritance syntax), but it's been ages, so take with salt.

UnrealScript is one of Unreal's scripting languages, and yes it does have some elements reminiscent of Java. Unreal itself is written in C++. If your user is a modder, probably they will only see UnrealScript. If your user is a game developer with a full license for the engine, they have the C++ code to work with, too.

My experience with Unreal development has been to prototype as much as you can with UnrealScript, but ultimately you run into limitations of functionality or speed that can be solved by writing natively compiled code. Aside from migrating UnrealScript prototypes to more efficient C++ implementations, there are lots of custom changes and additions that a developer will usually want to make to the engine. A huge part of making the game has nothing to do with the kinds of stuff you do in UnrealScript.

Though, for the programers on my team, a huge part of the motivation to prototype things in UnrealScript was simply to avoid the truly horrendous compile times Unreal had. A lot of tasks would have just been started and finished in C++ directly if we could have done faster testing/iteration that way.

(I only have experience with UE3, by the way. I can't comment on UE4.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group