The use of Lisp in games

Started by
5 comments, last by Erik S. Andersson 19 years, 6 months ago
I've recently been interested in using Common Lisp to create a game of some sort, but there are a few things that I am unclear on. I've looked at previous threads on this topic but could not find what I was looking for. I've done some minimal C/C++ games programming in the past but I now seem to prefer programming in Common Lisp. What I essentially want to do is either : a) Create a C++ 3D engine which interfaces with Common Lisp for game logic and everything else, meaning Common Lisp would be the highest layer of abstraction. or, b) Create a Lisp 3D engine which interfaces with C++ for any extra needed libraries. I like the idea of extending Lisp in the same way that Python can be extended, but I have no idea how to do this, does anyone have any pointers as to where I should start? Also another thing is, would the garbage collector in CMUCL cause problems for real time graphics? Would it even be conceivable to create a full 3D engine in Lisp? Thanks.
Advertisement
Hi

The Golgotha Project and Abuse (both open sourced) use Lisp as
the scripting Language.

Regards
paines
i believe there's a OpenGL binding to Lisp out there.
in other words you can make a 3D game strictly with Lisp and OGL

Beginner in Game Development?  Read here. And read here.

 

Naughty Dog (Jax & Daxter) used scheme in some of their games, a quick search on google brought up this:

http://www.spies.com/~palevich/CLRScheme/WhyLispSucksForGames.htm

might give you some insight

-- best, Chris
It's not common lisp, but I've been able to write C++-libraries for mzscheme ( http://www.plt-scheme.org/ ) very easily. I suppose common lisp implementations would make that easy too. Just read some docs and jump into it.
Every common lisp compiler will have SOME way of interfacing between the lisp and extrnal c-based apis (or, technically, 'cdecl{as MS calls it} calling convention'-based apis). The problem is that common lisp is so old that the standard doesn't specify such interfaces, so they'll be completely compiler-dependant.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Quote:Original post by Extrarius
Every common lisp compiler will have SOME way of interfacing between the lisp and extrnal c-based apis (or, technically, 'cdecl{as MS calls it} calling convention'-based apis). The problem is that common lisp is so old that the standard doesn't specify such interfaces, so they'll be completely compiler-dependant.


I don't think age is the main problem, Lisp might be older than C, but Common Lisp is not. The problem is probably more related to the fact that this kind of extension interacts more directly with the underlying architecture and that it was too hard to get everyone to agree about it...

I've seen some libraries that attempted to create foreign function interfaces for several Lisps, but none of them covered all the Lisps I was interested in at the time (CMUCL, SBCL, GCL, clisp, Corman Lisp). A lot of this has probably to do with the licenses as well, GCL and clisp are GPL, and Corman is a commercial Lisp.

If you want to do a multi-platform game with Lisp I would probably recommend that you write an I/O-client with as little game code as possible in C++ and use some IPC mechanism to communicate with the Lisp server. I think all major Lisps have support for sockets (although I did have some problems with GCL's), so that's perhaps easiest.

I'm not sure if Lisp is really worth the trouble when it comes to games programming, and that's too bad because it's a cool language. I might make an attempt some day, using Corman in Windows and CMUCL in Unix + SDL or something similar for the client.

This topic is closed to new replies.

Advertisement