Hacker News new | comments | ask | show | jobs | submit login
Halo was written with a Lisp dialect called blamscript (2014) (opencarnage.net)
119 points by kuwze 33 days ago | hide | past | web | favorite | 36 comments



Nb. "Written" as in screenwriting, not "written" as in implementing the game engine itself.


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.


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.


Screenwriting is not a term people use for programming languages, I think you're looking for "scripting".


Indeed, I was mislead by the title at first!


Did you find an example of this in that link somewhere?


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.


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.


>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.


>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.


> 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


This is also especially true, per Morris' corollary, of Common Lisp.


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


Have you seen Fennel? https://fennel-lang.org/


I started writing my own embedded scripting language [0], based on Forth and Lisp rather than Lua. Besides being easy to embed, there's not much in Lua worth keeping if you ask me.

[0] https://gitlab.com/sifoo/snigl


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


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


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/


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).


64 bytes is quite a lot if you use it cleverly enough. Sure, it's not enough for media but it's plenty to implement control loops and algorithms... Unless your code had to share that 64 bytes too, I guess.


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


I had the cartridge. It was indeed useless.


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

BASIC Programming, Model# CX2620. I have 5 or 6 of the carts (not sure off the top of my head, I never touch my 2600 stuff, only my 8-bit computer stuff. My daily driver is one of my 800xl's with s-video out and a Rambo 256k).

>It was written in assembler

I stand corrected.


I'm not familiar with the console anyway, but I remember it had a ridiculous amount or RAM, so I assumed BASIC was out of question.

Thanks, that sparkled my curiosity and turns out the source code is available!


Atari Age is a great forum, not just for Atari machines either. There's still a lot of hardware and software development for Ataris. Also you might want to check out:

- ANTIC the Atari 8-bit podcast https://ataripodcast.libsyn.com/ (part of the fun here is when those interviewed find out people still use the machines today!)

- Floppy Days podcast https://floppydays.libsyn.com/

Both have a lot of interviews with people that worked on Atari hardware and software for ANTIC and all sorts of vintage machines on Floppy days. Randy Kindig, one of the hosts, leads the Indy Vintage Computer Club here in Indianapolis, hopefully are meeting this weekend doesn't get snowed out!

There's also gobs and gobs of stuff, contributed by one of the hosts for the podcasts above, to Archive.org


I wonder what an AtariLisp would look like ;p



The Atari 8-bit machines supported a lot of language, even some I've never seen since like Action! https://en.wikipedia.org/wiki/Action!_(programming_language)


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


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


IIRC, GOOL was a lisp dialect used for scripting Crash Bandicoot; later ND games were written in GOAL (i.e. not just scripting, but the majority of the game was written in lisp).


Article on GOAL/creating Crash Bandicoot by creator, Andy Gavin: https://all-things-andy-gavin.com/2011/02/02/making-crash-ba...

Certainly my favorite Lisp game.



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.


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


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.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: