Adventure Game Studio

Community => Adventure Related Talk & Chat => Topic started by: on Thu 05/11/2015 12:39:40

Title: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: on Thu 05/11/2015 12:39:40
Hello to everyone. I have a question that was stuck in my mind for years.

Why was it more easy for Sierra On-Line to create a game engine (A.G.I) for the King's Quest I (since the engine itself would be written in assembly language) rather than just code the game in assembly?


The only reasons I can think of is the ease of portability and making easier the process of creating another (and another) game. Sierra was creating a game for a technically "advanced" machine of the era, so, Sierra was not thinking about portability in my humble opinion. And how would they know if they were to create another game for the PCjr? So, I believe, these 2 reasons were NOT the real reasons.

So, why? Was it really more easy to create a game through a game engine? Why was that? Can someone explain it in simple english?

It is very strange for me.

Btw, I am a total noob in programming and game engines...   
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: Mandle on Thu 05/11/2015 13:59:40
I'd say they were just looking at the future of computer games and realised that a game engine allowed them to do so much more the next time around without having to reinvent the wheel...Whether they got another licence on the same label or not did not matter...They knew that whatever they created would give them the experience to further develop their games...
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: on Thu 05/11/2015 14:23:38

In Wikipedia, it says: "The project (King's Quest I) was too complicated to write easily in assembly language, so Sierra began developing a scripting engine that would greatly simplify programming of the game." 

This sentence does NOT "contain" nothing about future games to be made. It talks about the one and only game, King's Quest.

:)
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: Snarky on Thu 05/11/2015 15:09:55
Yeah, there are definite advantages to an adventure game engine, even for just one game. (This is what Ron Gilbert found when he started working on Maniac Mansion, as well. If I remember correctly, he got bogged down for some weeks or months trying to code the game directly, before he gave up and built SCUMM instead.)

It's a bit hard to explain if you don't know anything about coding, but I would emphasize these points:
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: MiteWiseacreLives! on Thu 05/11/2015 15:10:50
You only have to build the engine once. It handles all the tough scripting and now you can use a set of commands to easily perform tasks (walkto x,y). Now the designer can focus on the creative part and have flexibility because the hefty engine design is behind them.
So if even only for one game it saves time (probably) in the end.

Snarky beat me. Read his ;)
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: Radiant on Thu 05/11/2015 16:01:11
The answer is that if you had coded the game in assembly, then it would already be the engine.

For example, KQ1 has about 60 rooms. You could write 60 different pieces of code to draw rooms and have a character move around in them, but that would be horribly inefficient. Instead, you write a generic piece of code that handles a room, and re-use it 60 times with different data. You apply the same for characters, objects, and input: a simple generic class that can be reused as often as you need in the same game.

...but that's precisely what an engine is. As soon as that's functional, you can also replace the rooms by other rooms without affecting anything else, and ta dah! You have King's Quest II. It's nothing but smart programming.

Note that LucasArts did exactly the same: when designing their first adventure game, they first wrote the SCUMM engine. Every well-written game with multiple locations will be written as an engine first.
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: Snarky on Thu 05/11/2015 16:23:29
Yes, but you're applying principles of abstraction that were very far from universal at the time. In the early 80s, the very notion of structured programming (e.g. Pascal and C), with well-defined, reusable functions, was still pretty cutting-edge. Object-oriented programming was a relatively obscure notion mostly confined to academia. It wouldn't have been that surprising if Ken and Roberta had e.g. hard-coded the list of words their parser could understand as part of the KQ game code. (I'm not sure how they developed Mystery House and their other text adventures. Perhaps they already had a text-parser codebase they reused.)

I think the big distinction here is whether the code that defines the gameplay is written as part of the same codebase and in the same language as the code that handles the basic generic operations, particularly if the two are intertwined in some intimate way. In some games that's the case (Flight of the Amazon Queen was written that way, I seem to remember reading), but most games tend to impose a pretty clear-cut division between engine code and game code.

Of course, an engine written with one specific game in mind will be (overall) less flexible and more customized than a more generic engine like AGS.
Title: Re: Game engine and coding from scratch. Why the first and not the latter?
Post by: on Thu 05/11/2015 18:02:06
Thank you ALL for your well written and very explenational answers. My apologies for my bad english. I think I got the point although I am a total noob in coding. See ya. :)
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: Radiant on Thu 05/11/2015 22:59:25
Quote from: Snarky on Thu 05/11/2015 16:23:29
Yes, but you're applying principles of abstraction that were very far from universal at the time. In the early 80s, the very notion of structured programming (e.g. Pascal and C), with well-defined, reusable functions, was still pretty cutting-edge. Object-oriented programming was a relatively obscure notion mostly confined to academia.
Well, Infocom did it four years before King's Quest, and with a better parser to boot :)
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: ThreeOhFour on Fri 06/11/2015 04:21:00
Here's an interesting writeup of the genesis of King's Quest: http://www.filfre.net/2013/07/the-unmaking-and-remaking-of-sierra-on-line/ (http://www.filfre.net/2013/07/the-unmaking-and-remaking-of-sierra-on-line/)

If you dig further into the backlog you can find the very roots of Ken & Roberta, back to before Mystery House here: http://www.filfre.net/2011/10/ken-and-roberta/ (http://www.filfre.net/2011/10/ken-and-roberta/)

This discusses many of the technical aspects of the game's development, including the suggestion that the engine was fully intended to be re-usable for future games.
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: Radiant on Fri 06/11/2015 10:43:21
Quote from: ThreeOhFour on Fri 06/11/2015 04:21:00
Here's an interesting writeup of the genesis of King's Quest: http://www.filfre.net/2013/07/the-unmaking-and-remaking-of-sierra-on-line/ (http://www.filfre.net/2013/07/the-unmaking-and-remaking-of-sierra-on-line/)

Very interesting. I didn't actually know that Sierra was already an accomplished publisher with strong ties to IBM before they started KQ. That goes a long way in explaining their architecturally sound engine-first approach to writing KQ.
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: Superkumi on Fri 06/11/2015 11:49:41
http://www.ign.com/articles/2014/12/01/igns-year-of-adventure-all-our-point-and-click-adventures
They might have wrote about it in one of IGN's year of adventure articles... even if they didn't, its a fun read :)
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: ollj on Wed 25/11/2015 17:47:43
Game engines can make things easier to use for creative people, causing them to waste less time with source code and more time with artwork.

Game engines can make large projects easier to share tasks among larger teams.

It can make sense to write a game engine for only one game. this easily happens if you looked at all existing engines and none was sufficient for your project.
Title: Re: SOLVED: Game engine and coding from scratch. Why the first and not the latter?
Post by: RickJ on Sat 28/11/2015 21:32:50
Just a couple of things to add to what ever one else said.  Back in the day compiling C or ASM could take an hour or longer whereas a script could be immediately executed.

Also the games industry is not the only or the first to utilize a domain specific language and IDE.  PLC and DCS come to mind in the area of industrial control.