From: ········@gmail.com
Subject: Which LISP for a game bot?
Date: 
Message-ID: <74081505-ed22-40d1-895d-b5c48047a910@e5g2000vbe.googlegroups.com>
I'm a High School studnet, a beginner in computer programming and
currently learning LISP as my first language. Really liking all the
features so far, but a lot on confusion is ahead of me.

My main concern is that I am just starting out with LISP and it seems
that there are so many different versions of it and each with its own
rules. I've been through a Scheme book and I really liked it, but I
don't think it will be very practical for my first hobby project. I'd
like to make a simple/complex bot that will play a video game in place
of a human. I like the idea of the project as I will just keep on
adding functionality to the bot and see how far I can get it to
impersonate a real player. I also have an interest in developing
sophisticated AI functionality for games in the future and I think
this would be a great start.

I haven't decided on the game or even how it will function for the
most part, but everything I can think of would be like pulling teeth
in scheme. The bot could end up interpreting any kind of information
in the game including 3d models. I'd like to have a GUI if possible,
but a command line app is fine too (still haven't done any GUI
programming in LISP). I don't intend to distribute this app so nothing
has to be super accurate or perfect. I'm just trying to find the
quickest way to do it. It seems like LISP would lend itself quite well
to a project like this.

So, any suggestions on what LISP dialect would suit a project like
this?

From: Curt  Micol
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <07af341a-46ac-4dc7-b2e4-9e1cc0498c54@41g2000yqf.googlegroups.com>
On Mar 11, 4:25 am, ········@gmail.com wrote:
> So, any suggestions on what LISP dialect would suit a project like
> this?

First of all I would make sure the game you pick allows such a thing
(read the Terms of Service).

Second of all, having just started getting into Lisp, I've found SBCL
to be nice (if you need threads) and off of a recommendation on this
list have been using CLisp (no threads) as it is fast, scriptable and
very easy to work with.

HTH,

Curt Micol
From: main
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <65a3c883-0b92-47bf-b2e3-b492d8216627@f1g2000prb.googlegroups.com>
On Mar 11, 9:25 pm, ········@gmail.com wrote:
>
> I haven't decided on the game or even how it will function for the
> most part, but everything I can think of would be like pulling teeth
> in scheme. The bot could end up interpreting any kind of information
> in the game including 3d models. I'd like to have a GUI if possible,
> but a command line app is fine too (still haven't done any GUI
> programming in LISP). I don't intend to distribute this app so nothing
> has to be super accurate or perfect. I'm just trying to find the
> quickest way to do it. It seems like LISP would lend itself quite well
> to a project like this.

Warning: this is going to be difficult in any language. Also, pick you
game carefully. If there are already bot AI replacement mods for it,
then that's a very good sign.

Think carefully about how this bot will interact with the game. Does
the game allow bot control via communication with an external process?
Does it have a scripting language in which game objects are directly
represented? (If so, you could write a compiler targeting it, or write
a lisp interpreter in it.) Will your bot try to identify objects on
the screen (ie. outside of the game environment) and then provide
keyboard and mouse input?
From: Pascal J. Bourguignon
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <87iqmgv3xo.fsf@galatea.local>
········@gmail.com writes:

> I'm a High School studnet, a beginner in computer programming and
> currently learning LISP as my first language. Really liking all the
> features so far, but a lot on confusion is ahead of me.
>
> My main concern is that I am just starting out with LISP and it seems
> that there are so many different versions of it and each with its own
> rules. I've been through a Scheme book and I really liked it, but I
> don't think it will be very practical for my first hobby project. I'd
> like to make a simple/complex bot that will play a video game in place
> of a human. I like the idea of the project as I will just keep on
> adding functionality to the bot and see how far I can get it to
> impersonate a real player. I also have an interest in developing
> sophisticated AI functionality for games in the future and I think
> this would be a great start.
>
> I haven't decided on the game or even how it will function for the
> most part, but everything I can think of would be like pulling teeth
> in scheme. The bot could end up interpreting any kind of information
> in the game including 3d models. I'd like to have a GUI if possible,
> but a command line app is fine too (still haven't done any GUI
> programming in LISP). I don't intend to distribute this app so nothing
> has to be super accurate or perfect. I'm just trying to find the
> quickest way to do it. It seems like LISP would lend itself quite well
> to a project like this.
>
> So, any suggestions on what LISP dialect would suit a project like
> this?

The right lisp dialect would be Common Lisp.

Then you may choose to write your bot either in conforming Common Lisp
code, or in implementation specific Common Lisp code.

The advantage of using conforming Common Lisp code, is that you will
be able to run your program on the various Common Lisp implementation,
so you may choose the implementation to run it later, and you can use
different implementations to debug and to run (some implementations
are better for debugging, others are better to compile fast code).

The inconvenient is that it may be harder to do things that have not
been specified in the language, like 3D or network I/O.  For this you
have to use implementation specific features.  Happily there are
portability libraries that allow you to do so without being concerned
by the details of each implementation so you can still port your code
from one to the other.  

In general, that would be the advise I'd give even for your code: most
of it you will be able to implement using only conforming Common Lisp,
and only some low-level packages you will implement using portability
libraries or implementation specific features.  This way, if you need
to change the implementation, most of the code will be unaffected, and
your implementation specific code will be small and well
circumscribed.

-- 
__Pascal Bourguignon__
From: Thomas M. Hermann
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <C5mdnaJPLIMoTirUnZ2dnUVZ_jSWnZ2d@centurytel.net>
········@gmail.com wrote:
> So, any suggestions on what LISP dialect would suit a project like
> this?

If you are just learning programming, then I suggest you start with PLT 
Scheme and How To Design Programs.

PLT Scheme : http://www.plt-scheme.org/
HTDP : http://www.htdp.org/

You are getting a little bit ahead of yourself at the moment. When 
you've worked through the fundamentals, then you'll be in a better 
position to understand your requirements. In the end, you are the only 
one that truly understands them.

I've recommended PLT Scheme despite the fact that ALL of my programming 
is done in Common Lisp. My recommendation is based on the idea that 
first you should learn the fundamentals using an environment that 
doesn't get in your way with irrelevant details. PLT Scheme is expressly 
designed for this. Then, when you have the fundamentals down, you'll be 
able to identify details that are relevant to your specific application 
that were irrelevant to learning fundamental programming. At that point 
in time, you may determine that you need to switch to Common Lisp. For 
game programming, there is strong possibility that you will require the 
features of Common Lisp. With the fundamentals under your belt, you'll 
be in a much better position to appreciate the subtleties of Common Lisp 
and succeed in using it.

Good luck,

Tom


-- 
=== Thomas M. Hermann ===
From: Dimiter "malkia" Stanev
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <gp8tbe$7kp$1@malkia.motzarella.org>
Hi,

········@gmail.com wrote:
> I'm a High School studnet, a beginner in computer programming and
> currently learning LISP as my first language. Really liking all the
> features so far, but a lot on confusion is ahead of me.
> 
> My main concern is that I am just starting out with LISP and it seems
> that there are so many different versions of it and each with its own
> rules. I've been through a Scheme book and I really liked it, but I
> don't think it will be very practical for my first hobby project. I'd
> like to make a simple/complex bot that will play a video game in place
> of a human. I like the idea of the project as I will just keep on
> adding functionality to the bot and see how far I can get it to
> impersonate a real player. I also have an interest in developing
> sophisticated AI functionality for games in the future and I think
> this would be a great start.
> 
> I haven't decided on the game or even how it will function for the
> most part, but everything I can think of would be like pulling teeth
> in scheme. The bot could end up interpreting any kind of information
> in the game including 3d models. I'd like to have a GUI if possible,
> but a command line app is fine too (still haven't done any GUI
> programming in LISP). I don't intend to distribute this app so nothing
> has to be super accurate or perfect. I'm just trying to find the
> quickest way to do it. It seems like LISP would lend itself quite well
> to a project like this.
> 
> So, any suggestions on what LISP dialect would suit a project like
> this?

Consider looking into lispbuilder - it's a set of libraries for Common 
Lisp that expose various game-related libraries - OpenGL, SDL, 
Animation, etc.

There have been couple of other game projects written in Common Lisp, 
but unfortunately lost their links - one was a mud 2D based game, and 
the other a 3D one.

As for implementation - consider something free for now, unless you 
saved money from not buying game consoles.

Such free implementations are:
    SBCL (Linux, Windows, Mac OS X)
    ClozureCL (Linux, Windows, Mac OS X)
    CMUCL (Linux, Mac OS X)

The latter are also lisp compilers - e.g. they can optimize much of the 
lisp code and produce native code that is close to what a "C" compiler 
would do (but this should not be your goal, your goal as always should 
be better algorithms first, maybe better data structure later, and at 
last optimization to the metal).

Consider also trying these fine lisp systems:
    ABCL - A Lisp running on the JVM (Java Virtual Machine)
    CLISP - fine "C" interpretter
    ECL - embedded lisp that generates "C" code.

Please try to use the CLOS, you should be able to build better 
interactions between special cases - such as:

(defmethod attack ((ATTACKER MECH-ROBOT) (DEFENDER CRYO-ZAURUS))
    (format t "Mech robot ~A attacks cryo-zaurus ~A" ATTACKER DEFENDER))

E.g. unlike other OO systems, here you can specialize specific method, 
function, operation, whatever you call it _between_ objects! That's 
important... it's the interaction between objects that usually matters 
in games, not operation on an object alone.

Thanks,
Dimiter "malkia" Stanev.
From: ··············@yahoo.it
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <ccdfe02f-7774-41cb-a7f7-3c91767b824a@o11g2000yql.googlegroups.com>
beside the fact that lisp is a good choice for the core program, the
interacting with your game might be difficult in common lisp. if you
work on windows, I would recommend you autoit3, which lets you
interact with your pc in any imaginary way: sending keystrokes, moving
and clicking the mouse, take screen shots, controlling processes ... .
I do a similar project and use: eclipse with cusp and sbcl for the
lisp development, connecting to autit as an external process via file-
streams or socket-streams. it works fine for atomisation of
applications.
good luck c.
From: Pascal J. Bourguignon
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <87eix3venn.fsf@galatea.local>
··············@yahoo.it writes:

> [...] if you work on windows, I would recommend you autoit3, [...] 
> it works fine for atomisation of applications.

I guess that's all they deserve, as MS-Windows applications...

-- 
__Pascal Bourguignon__
From: Tamas K Papp
Subject: Re: Which LISP for a game bot?
Date: 
Message-ID: <71q2plFlvl27U1@mid.individual.net>
On Wed, 11 Mar 2009 01:25:32 -0700, rice1620 wrote:

> My main concern is that I am just starting out with LISP and it seems
> that there are so many different versions of it and each with its own
> rules. I've been through a Scheme book and I really liked it, but I

AFAIK there are only two mainstream dialects used for general-purpose
programming, CL and Scheme.  I faced a similar dilemma when I started
using Lisp, and initially chose Scheme but then switched to CL.  I
find that the latter is better for practical projects, the standard is
much more mature and the implementation is quite good.

> don't think it will be very practical for my first hobby project. I'd
> like to make a simple/complex bot that will play a video game in place
> of a human. I like the idea of the project as I will just keep on adding
> functionality to the bot and see how far I can get it to impersonate a
> real player. I also have an interest in developing sophisticated AI
> functionality for games in the future and I think this would be a great
> start.
> 
> I haven't decided on the game or even how it will function for the most
> part, but everything I can think of would be like pulling teeth in
> scheme. The bot could end up interpreting any kind of information in the
> game including 3d models. I'd like to have a GUI if possible, but a
> command line app is fine too (still haven't done any GUI programming in
> LISP). I don't intend to distribute this app so nothing has to be super
> accurate or perfect. I'm just trying to find the quickest way to do it.
> It seems like LISP would lend itself quite well to a project like this.
> 
> So, any suggestions on what LISP dialect would suit a project like this?

I would go for CL.  The project you outline above is quite complex,
and involves stuff that I would not necessarily burden myself with as
a beginner (like GUIs and interfacing with a video game), so I would
recommend that you start with something simpler.

Tamas