• Advertisement

Archived

This topic is now archived and is closed to further replies.

Game programming in Lisp

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve recently acquired a fascination for Lisp, and I''m reading "ANSI Common Lisp" by Paul Graham. Luckily I also get Allegro Common Lisp for free at my university. What I''m wondering is how practical is Lisp for game programming? I''m thinking in particular of the graphical/engine element(nothing more than 2d for now though). Does anyone have experience with it? Is it fast enough? Or is engine programming more in the C++ domain? In that case how is Lisp as an extension language for a C++ engine?

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by robinei
I''ve recently acquired a fascination for Lisp, and I''m reading "ANSI Common Lisp" by Paul Graham.

Great book.


quote:
Original post by robinei
Luckily I also get Allegro Common Lisp for free at my university.

What I''m wondering is how practical is Lisp for game programming? I''m thinking in particular of the graphical/engine element(nothing more than 2d for now though).
Does anyone have experience with it? Is it fast enough?

Why not give it a try? It''s certainly quick enough to get started. I''m not sure about Allegro but check out the Corman CL libraries for SDL/OpenGL.

SDL Bindings
Corman Lisp

You should also search these forums. I have a ton of links, but Lisp is King and What''s So Great About Lisp cross my mind.
Cheers.


If a plant cannot live according to its nature, it dies; so a man.

(princ(substitute #\Space #\0(format()"~36R"5688852237040631986030796883)))

Share this post


Link to post
Share on other sites
quote:
What I''m wondering is how practical is Lisp for game programming? I''m thinking in particular of the graphical/engine element(nothing more than 2d for now though).

Abuse is a 2d platform game written in Common Lisp.

If you use Debian Linux you can install it with "sudo apt-get install abuse-sdl".

Share this post


Link to post
Share on other sites
I downloaded the abuse source, and it''s engine is C++ code. It apparently just uses Lisp for game logic.
I guess it was perhaps a cutting edge game when it came out, so it probably needed the extra bit of speed. But are there any examples of games written exclusively in Lisp?

SDL for Lisp sounds great, since that''s what I''ve been using in C++.

Share this post


Link to post
Share on other sites
quote:
I downloaded the abuse source, and it''s engine is C++ code. It apparently just uses Lisp for game logic.
Why does that matter? If that matters, why doesn''t it seem to matter that SDL is written in C?

Share this post


Link to post
Share on other sites
Naughty dog have used lisp in at least some of their titles:

http://www.franz.com/success/customer_apps/animation_graphics/naughtydog.lhtml

Jak, Crash, etc..

Share this post


Link to post
Share on other sites
> In that case how is Lisp as an extension language for a C++ engine?

I think there are a lot of people using C/C++ to do the rendering, and lisp-like languages to do the scripting and logic.

I love common lisp, it''s a fascinating language.

Share this post


Link to post
Share on other sites
Are there any library versions of Lisp which integrates like Lua, into C/C++ programs?

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
Do you count dialects of Lisp? There''s TinyScheme


Thanks, I''ll check it out. I guess the idea behind all of them are the same? Hvor much beyond function/macro names differ between them?

Share this post


Link to post
Share on other sites
Hvor?

Scheme is very similar to Lisp, but lacks some of Lisp''s functionality. You can think of it as a subset of Lisp. (Boy am I going to get crucified for saying that.) For example, Scheme lacks packages, arrays, and hash tables.

They also spell somethings differently. (Like setq vs. set!)

Share this post


Link to post
Share on other sites
Ok, thanks.

quote:
Original post by SiCrane
Hvor?


I mean "how"! I actually managed to write the norwegian word...

Share this post


Link to post
Share on other sites
If you want to see some games implemented in Lisp, you can look at John''s book of Lisp games . It seems they''re all text-based, but it should help somewhat to see how the logic is implemented in lisp (I haven''t looked over them, but I''m betting its different from the style in whatever language you''re used to)

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
Hvor?

Scheme is very similar to Lisp, but lacks some of Lisp's functionality. You can think of it as a subset of Lisp. (Boy am I going to get crucified for saying that.) For example, Scheme lacks packages, arrays, and hash tables.

They also spell somethings differently. (Like setq vs. set!)
Heh, you could've at least mentioned the shared namespace for functions and non-functions in Scheme, higher dynamicity, Scheme's continuations or some other bigger difference instead of the obvious name differences. Scheme is not simply a subset, because it does some things quite differently. Here's a good list on Common Lisp vs Scheme.

[edited by - civguy on April 30, 2004 3:34:11 AM]

Share this post


Link to post
Share on other sites
I just wanted to point out - there are lots of embeddable intepreters out there, many of them Lisp-like. You should look into several before you choose one - there are a lot of options.

Also, Scheme may lack hash tables, but I think most implementations of scheme "throw in" a hash table implementation along with a bunch of other handy data structures. Admittedly, it''s not portable to other scheme dialects, but that usually doesn''t matter so much if you''re using this as an embedded scripting language in a game. I''ve never tried "libguile", but it looked good last time I read up on it.

Type "scripting languages" (with the quotes) into google.

- Josh

Share this post


Link to post
Share on other sites
There is a lot of research at my school NC State University, about using lisp for video games, especially plot scripting.

If there was a good wrapper package that was designed to make C++ libraries accessable to the lisp runtime, then lisp would make a great language. I''m currently looking into the issues of writing one myself...

Share this post


Link to post
Share on other sites

> If there was a good wrapper package that was designed to make C++ libraries accessable to the lisp runtime, then lisp would make a great language.

Look up "SWIG" on google.

- Josh

Share this post


Link to post
Share on other sites

  • Advertisement