
Halo was written with a Lisp dialect called blamscript (2014) - kuwze
https://opencarnage.net/index.php?/topic/4156-scripting-guide/
======
Sharlin
Nb. "Written" as in screenwriting, not "written" as in implementing the game
engine itself.

~~~
msbarnett
The game engine, no. But the game logic, the code that makes the game engine
do the things that make what it's doing Halo as opposed to some-other-game-on-
that-engine, _is_ written in blamscript.

"Screenwriting" to me would sort-of imply that this was all just for human
consumption during planning, and later implemented in something else.

~~~
Sharlin
I first meant to use its synonym, "scriptwriting", but that one of course has
a somewhat diverged meaning in the computer world. But actually in interactive
fiction the meanings beautifully converge again.

------
blattimwind
Meanwhile, Half-Life/GoldSrc/Source scripting means placing "entities" in the
world space and connecting them. Like a very messy form of visual/block-based
programming. On many maps with a lot of scripts there are separate,
inaccessible rooms where the mapper stashed all the entities, because placing
them where their triggers / effects happen would make editing the level
geometry quite difficult.

------
grogenaut
We had this at another Sony studio I worked at. I asked why. The person who
write it said writing the interpeter/compiler for lisp is quite easy. As is
understanding the byte code. They did it as an intern project in about 3
months.

It wasn't the most friendly language and ended up with many c like additions.
At the end of the day it was all about cost to work on and efficiency of
using.

Many would have been super happy to slap a "real" language in there but they
would have spent years putting the real time esque controls they needed on it.
Not the normal real time but bound to game engine execution phases which is
different. It also needed to very easily work with cpp and the art tree.

I doubt any of the fp folks here would have loved the language and would have
spent much of their kvetching time on why it wasn't more lispy and therefore
more productive.

Thing is most of what it needed to do was atomic thread and mutex/semaphore
joins, branching parallel green threads and parallel wait conditions and goto.
The scripts were all written by non programmers and when slow converted to c++
which was about 20kx faster.

------
t3hz0r
The title is misleading. Blamscript is only really used in the interactive
consoles of the game and its editing kit, and the scripting of encounters,
cinematics, and triggers in the campaign[1].

Modders also use it in custom multiplayer maps for things like doors. Since
Halo PC's netcode doesn't synchronize the state of such scenery to players,
some map makers came up with the clever idea of hidden "biped crusher" rooms
which repeatedly dropped vehicles on NPCs depending on the state of doors.
Their respawns _were_ synchronized across the network, so this system could be
used to trigger doors opening/closing on clients.

[1]:
[https://github.com/Dwood15/HaloScripts](https://github.com/Dwood15/HaloScripts)

------
jayd16
>Any sufficiently complicated program contains an ad-hoc, informally-
specified, bug-ridden, slow implementation of half of Common Lisp

I find this quote especially true in games.

~~~
mbrodersen
>Any sufficiently complicated program contains an ad-hoc, informally-
specified, bug-ridden, slow implementation of half of Common Lisp

I call BS on that one. I have worked on very large scale C++ software (games
etc.) and have never seen or needed anything like Common Lisp to get the job
done. And I actually know how to program in Common Lisp (and Scheme) and have
implemented my own Lisp variations for fun.

~~~
lispm
> seen or needed anything like Common Lisp

That's not the point. It's not half a Common Lisp, but half of (the features)
of Common Lisp: code generation/macros, runtime scripting language, loading of
code, interactive error handling, a console to interact with the program,
dynamic objects, exchanging data in a textual format, a configuration
language, etc. etc

------
ryanmercer
Meanwhile, Halo 2600 was written in Atari BASIC (probably)
[https://atariage.com/store/index.php?l=product_detail&p=998](https://atariage.com/store/index.php?l=product_detail&p=998)

~~~
reidrac
The 2600 didn't have BASIC. Not viable with only 128 bytes of RAM.

It was written in assembler:
[http://atariage.com/forums/topic/185693-halo-2600-source/](http://atariage.com/forums/topic/185693-halo-2600-source/)

~~~
opencl
The 2600 actually did have a BASIC interpreter cartridge available. It was
both an incredible engineering feat (interpreter and IDE in 4K ROM and 64
bytes of RAM) and completely useless (because your program only had the other
64 bytes of RAM).

~~~
reidrac
Fair enough, looks like viability (or being "totally useless") didn't stop
people back then!

~~~
mcculley
I had the cartridge. It was indeed useless.

------
vernie
I believe that Naughty Dog also scripts game logic in their own Lisp dialect.

~~~
steinuil
Other than the games they wrote entirely in GOAL, all of their PS3+ games use
a series of lispy DSLs implemented in Racket that get compiled to C and C++
for defining data to be loaded in the game and dependencies between these
data, light scripting, dialogues, stuff like that.

There's a talk by one of the engine devs at RacketCon from a few years ago on
youtube about how they use these DSLs and how they came to be:
[https://youtube.com/watch?v=oSmqbnhHp1c](https://youtube.com/watch?v=oSmqbnhHp1c)

------
rongenre
This seems like a pretty typical pattern: Back when I did games (mid 90's), it
was pretty essential to come up with a tight game engine with components that
could be driver from a script: That way someone in design/production could
focus on making things interesting and fun without needing to mess with a
compiler.

In our case, we used tcl, but embeddable lisp would have worked too.

------
bitwize
Recently I learned that the AI for Age of Empires was also written in a Lisp-
like dialect. Interesting.

------
Haga
I cant help but think that a lualisp merge would be the ideal script addition
for all most any engine.

~~~
adrianm
Have you seen Fennel? [https://fennel-lang.org/](https://fennel-lang.org/)

------
jorvi
Don’t most engines offer this by default?

I know Unreal Tournament 99 and especially 2004 was very extensible because
they offered uScript (very C++ like) which made it easy to make all sorts of
mutators and mods. They even had a specific feature for making in-game
cutscenes (I thought it was named Kino but apparently not).

I don’t have much knowledge of Source but afaik they also offered something
similar.

