Advertisement

Game Programming (before DOOM...game engines)

Started by January 23, 2017 11:59 PM
50 comments, last by blueshogun96 7 years, 8 months ago

Is it possible to implement ECS in C? I only know that it's really a stripped down language. When did C++ become popular in gmaes?
ECS predates C. We used to call it RDBMS

It's also not commonly used in games :P

some kind of wizardry should be used to get the same reusability from C++ (templates, polymorphism, etc).
C++ Interfaces/PIMPL were called ADT's back in C.

Templates were achieved with macros and #includes.

The original version of C++ was actually a code generator for C, and then you fed that C code into a compiler :lol:

That's an interesting fact. I also searched a bit, C++ adoption wasn't massive until mid 2000s? That's crazy, I though It was like in the early 90s.

Some areas took up C++ much more readily than games.

If you look at language adoption today, it's much the same story. Compilers for Foo language aren't mature enough to be trusted, don't produce fast enough code, don't provide the right abstractions, don't offer sufficient control over certain aspects of software design (usually memory management is the pet buggabear here), and on and on.

Mostly this stuff is bullshit FUD from programmers stuck in their ways and scared of change, but there is a kernel of truth to all of it.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement

That's an interesting fact. I also searched a bit, C++ adoption wasn't massive until mid 2000s? That's crazy, I though I was like in the early 90s.

C++ wasn't standardized until 1998, and then revised in 2003 (and 2011).
I learned C++ game programming in the Half-Life 1, which was C++... but as HL1 came out back in 1998, it was written in "Microsoft Visual C++ 6", which wasn't quite standards compliant... So C++ code written for that compiler didn't work on any other compiler most of the time... It wasn't until the early 2000's that C++ compilers got universally decent.

So yeah, so C++ was being used a lot in the 90's, but most of that C++ code is garbage :D Everyone in the 90's also sucked at OOP, and hence Java was born :wink:
Working in games, we had shitty compilers up until very recently. On one PS2-era game that I worked on, constructors/destructors were banned as part of the coding guidelines, and on a Wii game templates were banned. Even as recently as the Xbox360, we were unable to use the nice new C++11 features...

If you read the postmortem and principles ID used and still advices, one of then is too make the code towards the game itself and not towards reusing it for other/ future games.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Hi everybody,

I would really appreciate if someone would help to unscramble my thoughts... :)

I'm trying to write a short summary about how "game programming" was when there were no reusable game engines. Let's assume (and I know it's controversial) that the DOOM engine was the first reusable game engine - so how where games programmed / build before 1993? When you ask google you'll get "games were written as singular entities from scratch in assembly" about 5.000 times but I don't know what to think about this phrase. Another thing I found was "games were monolithic software systems"...I like this a little more as it fits nicely with the reusable game engine as part of a "modular / component-based game architecture".

What do you guys think about that? If you could name some books (i've already read a few) that cover this topic - please let me know.

Best regards

koS

Well first you have the assumption that DOOM was the first reusable engine. However there were many reusable engines around long before DOOM even in the old 8 bit era.

Freescape for example was a multi platform 3D engine with a Graphical IDE and scripting language that was first released in 1987 and was used to create games such as Driller, Castle Master and Dark Side. It was later released as 3D construction kit.

All the old Sierra games such as Kings Quest were written using Sierras Adventure Games Interpreter followed up a few years later with the Sierra Creative Interpreter. LucasArts used SCUMM. Even Zork was written using its own engine with a scripting language and virtual machine that was reused for dozens of other Infocom games.

There were several game creation systems available for 8 bit home computers such as War Game Construction Kit and Shoot ' Em Up Construction Kit. There were actually commercial games produced using these.

As for games being written in 100% Assembler even this isn't true. All of Cinemawares games such as Wings and "It Came from the Desert" were written in C with some Assembly routines. Dungeon Master 2 and FA18 Interceptor were also written in C. Several Megadrive / Genesis games were written in C such as Ecco the Dolphin. Most were written in Assembly but, not all.

I'm trying to write a short summary about how "game programming" was when there were no reusable game engines. Let's assume (and I know it's controversial) that the DOOM engine was the first reusable game engine - so how where games programmed / build before 1993? When you ask google you'll get "games were written as singular entities from scratch in assembly" about 5.000 times but I don't know what to think about this phrase. Another thing I found was "games were monolithic software systems"...I like this a little more as it fits nicely with the reusable game engine as part of a "modular / component-based game architecture".

You're overthinking it. Games are just software. It's always been possible, if you have the source code, to take a piece of software and change it to do something slightly different. As such, games made before Doom were made much the same way as most games after Doom were made; either:

  1. Written from nothing, or
  2. Based on an old game, with relevant bits changed.

And just in case you thought this, it's not true to think that all modern games are built from 'component-based' architectures. Components are a bit of a fad and not every game uses them. Even UE4 only half-heartedly embraces them, because you get components AND an inheritance hierarchy. The best worst of both worlds!

Advertisement

That's an interesting fact. I also searched a bit, C++ adoption wasn't massive until mid 2000s? That's crazy, I though It was like in the early 90s.

A couple of years ago, maybe 2011-12, my college had a visit from the lead programmer (I think) of a large Swedish game developer, who worked on a fairly successful AAA title which was released on at least PS3 and PC. They had more or less banned large parts of C++, including things like templates since they increased code size and compilation times too much. Code size was a big thing for them due to the PS3's CELL architecture. They also said something along the lines of "Ignore those advices about trusting the compiler to generate fast/good code, that only works in trivial scenarios and unit tests, in the real world you'll need to drop down to assembly and optimize by hand to get good performance". He did repeatedly talk about how you should always profile and base your efforts on that though.

That's an interesting fact. I also searched a bit, C++ adoption wasn't massive until mid 2000s? That's crazy, I though It was like in the early 90s.

A couple of years ago, maybe 2011-12, my college had a visit from the lead programmer (I think) of a large Swedish game developer, who worked on a fairly successful AAA title which was released on at least PS3 and PC. They had more or less banned large parts of C++, including things like templates since they increased code size and compilation times too much. Code size was a big thing for them due to the PS3's CELL architecture. They also said something along the lines of "Ignore those advices about trusting the compiler to generate fast/good code, that only works in trivial scenarios and unit tests, in the real world you'll need to drop down to assembly and optimize by hand to get good performance". He did repeatedly talk about how you should always profile and base your efforts on that though.

That's not very representative of the industry as a whole. Because the Cell SPU's were a brand new processor design, not in widespread use, and quite dramatically different to typical processor designs, there weren't that many people working on good compilers for it. It was a very complex CPU that, yep, did greatly benefit from hand-massaging instruction schedules... The Cell's/Xb360's PPU was an existing design so it fared a little bit better in the compiler department, and now the PS4/Xbone are using x86-64, which is extremely widespread and has had a lot of of people working on compilers for it for a long time. Likewise for ARM based systems -- it's got a legacy and existing market share, so you won't be using a brand new compiler.

When you're not dealing with a specialized bit of hardware like a SPU, you almost never touch assembly. The lowest that you'll typically go is C/C++ with intrinsic functions that map to particular asm instructions (e.g. the _mm_*** functions for SSE instructions)...

However, on this topic, yep, back in the early 90's when even x86 compilers were a lot shittier, C++ definitely would've produced quite bloated asm in a lot of cases, and many people would've resorted to hand-writing asm a lot of the time... Going back to the 80's it would've been pretty normal to write entire games in asm by hand.

Agree, there has presumably been much reuse of code since the dawn of time. Many of the games of the early eighties (when I started) did use their own 'engines' much as they are used today for a series of games, e.g. knight lore, alien 8, etc etc. The use of a 'game engine' (and the reuse of tools) is not a new thing.

C++ was widely used in games in 98 / 99 afaik, C was gradually losing favour for games then, when I went for an interview in 2000, a company posed a trick question that they wanted me to use C. I said I wouldn't be interested in a job using C, and they replied, that that was the right answer, they were trying to filter out those who hadn't seen the light ... :) The compilers in 98 / 99 were very usable, just not great support for some more complex templates and some 'non standardness'.

And yeah assembly was the way back in the 80s, it was not that difficult on the 8 bit CPUs, with direct access to screen memory, and a lot of people did it on the amiga and ST which were 16 bit. Even the tools were in assembly, like sprite editors, map editors, memory editors, disk editors.

C++ was widely used in games in 98 / 99 afaik, C was gradually losing favour for games then, when I went for an interview in 2000, a company posed a trick question that they wanted me to use C. I said I wouldn't be interested in a job using C, and they replied, that that was the right answer, they were trying to filter out those who hadn't seen the light ... The compilers in 98 / 99 were very usable, just not great support for some more complex templates and some 'non standardness'.

You reminded me. I interviewed at a large well known company back in 2007 / 2008 and their programming test that you were supposed to take away and complete at home was in straight C with no C++. with the specific instruction that you were to complete it using only C code.

This topic is closed to new replies.

Advertisement