Computer Science Canada

Games and Programming Languages

Author:  jonos [ Sun Mar 14, 2004 5:01 pm ]
Post subject:  Games and Programming Languages

I thought that this was the best place to put this, because it had to do with programming, but if it is the wrong place, then move it.

I want to know what programming languages are used for different games and on consoles:

For really knew 3D games like Call of Duty and Doom 3:

Playstation 1/2, N64/GameCube, XBOX:

Sega Saturn (I heard it was C but that C didn't utilize the full power of the Sega Saturn)

Genesis/SNES/NES/Turbo Graphics:

Im thinking that C or C++ was used for the older systems, but I'm curious to the newer ones.

Author:  wtd [ Sun Mar 14, 2004 5:20 pm ]
Post subject: 

Often a back-end written in C or C++, with Python, Lua or some other comparatively lightweight "glue" language for the logic of the game.

Author:  jonos [ Sun Mar 14, 2004 10:21 pm ]
Post subject: 

by backend do you mean the main part of the engine, like rendering models and stuff or whatever it does?

thats pretty cool, because i thought they used custom languages or didn't even use a language for newer games!

Author:  rizzix [ Sun Mar 14, 2004 10:30 pm ]
Post subject: 

well they use Lisp variants for developing AI of the game.

There are so many of them heh.

Author:  wtd [ Sun Mar 14, 2004 10:47 pm ]
Post subject: 

jonos wrote:
by backend do you mean the main part of the engine, like rendering models and stuff or whatever it does?


Yeah... like the "how to render a character on the screen doing some particular action" stuff.

Then you use Python, Lua, Tcl, or something else to do the "if character X is in Position Y, have character Z do something" stuff.

Quote:
thats pretty cool, because i thought they used custom languages or didn't even use a language for newer games!


They sometimes do use custom languages, but there's ever more drive to use popular general purpose programming languages of the lightweight variety, since it means having the ability to draw on an existing talent pool, and lowered training costs.

The fact that many are open source languages means that game companies also benefit from the work of huge communities to improve performance and libraries.

Author:  jonos [ Sun Mar 14, 2004 11:30 pm ]
Post subject: 

and its easy to mod also?

so if i say that call of duty, halflife, mohaa, battelfield are all made with a combonation of open-source languages, then i would be right?

Author:  rizzix [ Mon Mar 15, 2004 12:41 am ]
Post subject: 

makes modding easy, no doubt.

i think its a good idea to integrate an intepreted language (scripting language) into most of your complex programs, thus reducing the complexity drastically.

the problem is that it is not easy.

In Java it's a piece of cake. but c/c++... hmm no. I guess i should write some tutorials on howto do this in java. Thinking

Author:  wtd [ Mon Mar 15, 2004 12:42 am ]
Post subject: 

jonos wrote:
and its easy to mod also?


The potential is there for them to be, but it would require more detailed knowledge of the systems themselves to answer that. Keep in mind that a simple language does not necessarily mean a simple library of code. Smile

Objective-C is dead simple to learn, but learning to use the Cocoa framework is a daunting task. Much like C and the Windows API.

Quote:
so if i say that call of duty, halflife, mohaa, battelfield are all made with a combonation of open-source languages, then i would be right?


Again, I'm really not familiar enough to answer either way.

One place I do know they use Python extensivey is Industrial Lights and Magic.

Author:  jonos [ Mon Mar 15, 2004 12:50 am ]
Post subject: 

well thats george lucas' company (i think). i know that blitz basic was used for unreal tourny, and the next one was then ported to a different language (im pretty sure). this stuff is interesting, cause we have the tools to make some awesome stuff, we just have to learn it.

Author:  rizzix [ Mon Mar 15, 2004 12:53 am ]
Post subject: 

r u sure.. cuz unreal tournament is available for mac.. i dun think blitzbasic is available for mac.

Author:  jonos [ Mon Mar 15, 2004 12:55 am ]
Post subject: 

ive heard that a lot, it may have been ported or something, but i think that .exe can still work, but im not sure because ive only used a mac for 10 mins at school.

Author:  rizzix [ Mon Mar 15, 2004 12:57 am ]
Post subject: 

believe me NO. exe's don't work. i have a mac.. use it 24/7.

it could be that they invented a new language.

Author:  wtd [ Mon Mar 15, 2004 3:32 am ]
Post subject: 

It's also possible they prototyped UT in Blitz BASIC, then implemented it in something else for the final version.

Author:  shorthair [ Mon Mar 15, 2004 9:11 am ]
Post subject: 

we had this convo before , it was originally developedin litz but , epic games took over i think it was them , and they rewrote most of it off that basis ,the original was jsut a couple of guys trying to make a game , they sold out for a chunk of change

BUT BACK TO THE TOPIC

You will find tat lots of games use their own uniqu languages , the basis and AI may e in a common language , but most have hteir own engines , thre is a doom engine , quake engine , unreal engine , and some companys pay to use andother companys engine ( perfectly legal )

Author:  jonos [ Mon Mar 15, 2004 8:21 pm ]
Post subject: 

isn't the doom engine and the quake engine in c though?

Author:  Mazer [ Mon Mar 15, 2004 8:24 pm ]
Post subject: 

shorthair wrote:
You will find tat lots of games use their own uniqu languages , the basis and AI may e in a common language , but most have hteir own engines , thre is a doom engine , quake engine , unreal engine , and some companys pay to use andother companys engine ( perfectly legal )

You can have different engines written in the same language. Catalyst made his 3D engine, Homer made his 3D engine, Zylum made his 3D engine, and they were all different. But they were still made in Turing.
As for lots of games using their own unique language, care to give some examples?

Author:  wtd [ Tue Mar 16, 2004 12:55 am ]
Post subject: 

Something that's really important to understand is that virtually all lightweight languages like Perl, Python, Ruby, Lua, Tcl, etc. are implemented in C. That is the interpreter for the language is written in C and sometimes C++.

This means that internally things like Ruby objects, for instance are C structs. So you can write Ruby code in C, compile it, then load that code into the Ruby interpreter when the Ruby program is run.

It's like writing a C++ program, but writing parts of the program where performance is absolutely critical in assembly. You can do very clever things that the compiler won't necessarily do.

An example:

code:
class Test
  def initialize
    @arr = Array.new
  end
  def add(anObject)
    @arr.push(anObject)
  end
end


Becomes:

code:
#include "ruby.h"


static VALUE t_init(VALUE self)
{
  VALUE arr;


  arr = rb_ary_new();
  rb_iv_set(self, "@arr", arr);
  return self;
}


static VALUE t_add(VALUE self, VALUE anObject)
{
  VALUE arr;


  arr = rb_iv_get(self, "@arr");
  rb_ary_push(arr, anObject);
  return arr;
}


VALUE cTest;


void Init_Test() {
  cTest = rb_define_class("Test", rb_cObject);
  rb_define_method(cTest, "initialize", t_init, 0);
  rb_define_method(cTest, "add", t_add, 1);
}

Author:  shorthair [ Tue Mar 16, 2004 11:27 am ]
Post subject: 

no what im trying to get acooss is that tose engines are the language , i mean look at hte ones done in tuing , they creates like 20 new classes , and new commands , the quake engine adds somthing like 3000 commands , its almost like a language n its own , yes it was writin in c but the engine itself is an entire language , you can write a complete gae with it , i mean look at turing , that was writen in a different language but it created a new one

Author:  rizzix [ Tue Mar 16, 2004 2:34 pm ]
Post subject: 

huh?

u know shorthair. there is this really thick line between the defination of a language and that what is not a language. and you have crossed it.

Author:  Catalyst [ Tue Mar 16, 2004 5:26 pm ]
Post subject: 

while the quake engine can completely cover the graphics api or handle physics, it can in no way replace the underlying language.

Author:  wtd [ Tue Mar 16, 2004 6:11 pm ]
Post subject: 

I'd have to agree. You're confusing the underlying language and the vocabulary used with that language.

Author:  shorthair [ Tue Mar 16, 2004 6:18 pm ]
Post subject: 

im not confusing it , i know the difference , but i m saying that you have a huge influence from the engine , it makes up over half the code , becuase its mostly graphics and physics , im my target game , 90% was writtin in hte graphics engine and about 80 lines were fro mthe acual BLITZ language

Author:  Mazer [ Tue Mar 16, 2004 8:13 pm ]
Post subject: 

shorthair wrote:
im not confusing it , i know the difference , but i m saying that you have a huge influence from the engine , it makes up over half the code , becuase its mostly graphics and physics , im my target game , 90% was writtin in hte graphics engine and about 80 lines were fro mthe acual BLITZ language

I'd say about all of it was written in the Blitz language. If you write a graphics engine in BlitzBasic and write a game that uses that engine, it's still using the Blitz language.

Author:  shorthair [ Tue Mar 16, 2004 11:25 pm ]
Post subject: 

if you write a program in C and by chance its tuing , are we all actally coding in C , or are we coding in turing

Author:  Catalyst [ Tue Mar 16, 2004 11:53 pm ]
Post subject: 

by the blitz language do u mean like if, for, loop, variables and such?
and the graphics whatever function u call for their engine?

Author:  Mazer [ Wed Mar 17, 2004 8:10 am ]
Post subject: 

shorthair wrote:
if you write a program in C and by chance its tuing , are we all actally coding in C , or are we coding in turing

How about this. If you can think of somebody who has a compiler for the Quake III: Arena language, and then wrote Quake III: Arena in said language, then okay.

Author:  SilverSprite [ Wed May 19, 2004 8:50 pm ]
Post subject: 

if you write turing in c, then the language you used to write the program is c. however if you use that program to write a code in turing. then the program is in turing.

its like creating a new language. lets say everyone in the world only speaks arabic... and some people think its too hard and want to create englihs. they create english from arabic. but english is its own special language thereafter.

Author:  wtd [ Thu May 20, 2004 12:26 am ]
Post subject: 

The comparison to human languages is actually not too bad here.

Programming languages and their libraries are different in sort of the same way a single script can be used to spell numerous languages.

The Arabic script, for instance, is widely used, yet no one would claim the Arabic and Farsi languages are the same.


: