[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: Developer Questions
On 08.03.2004 17:45, Gil Pinheiro wrote:
> I guess I'll introduce myself first, and mention why I'm working on crimson fields:
Welcome to the list.
> My name is Gil Pinheiro, I'm an 4th year undergrad at WLU (Ontario, Canada)
> - I'm currently enrolled in a course on Artificial intelligence. The crux of
> the course is a project, chosen by the student. Therein lies the reason for
> this email - I'm going to add additional AI support to CF.
I seem to remeber having talked about this lately.
AI improvement is certainly something we'd like to see. And someone actually
working on it is a refreshing change. ;-)
> I've been hacking on the source for a week or so now, and though I don't have
> much experience working on open projects, I've managed to abstract out a multiple
> AI interface, and have added a game type that allows 2 AI to compete against
> each other.
>
> Principally, I'd like to merge this back into the main tree, but I am not sure
> how to accomplish this, or even if its a good idea. Right now I'm using my own
> SVN server to track my own local changes, and can generate DIFF files from it
> to the main branch.
>
> Second, although my code works, I'm not sure that I understand the event handling
> mechanism. Specifically what should I call to handle events during long processes
> (such as when the AI is thinking) to ensure the UI does not 'hang'.
Uh... <blush>... hm. Let me put it this way: The event handling sucks. I wrote it
waaay back and didn't invest as much care as I should have. If that stuff wasn't
so intrusive I would have rewritten it long ago. In most cases it doesn't mean
that something's not possible, but it can get awkward at times. An example of
what you are asking for is ProgressWindow::Abort(). You need to call something
like that at arbitrary intervals to check for pending events.
> Right now my code has diverged quite significantly from the tree, I've done
> some refactoring in some cases, with much more work to be done. At the moment
> the build is stable with only a single serviceable AI (the stockAI, and a test
> AI that does nothing). I would not recommend distribution, but would like feedback,
> and a chance to share my work.
>
> Certainly I can tar.gz up my sources, or distribute a binary to see if the changes
> are worthwhile. I would note however that the file format has changed, and any
> compiled .sav, .lev would be incompatible.
That's not a problem. With the music additions we'll have in 0.4.2, we'll be
incompatible, anyway. I'll be suprised if this is the last time we need to change
the format. Or, to quote Dave: "Hell, we're still way off from 1.0, so people expect
changes, right?"
That said, I'd like to have a look at the diffs to get an idea of where you
are going. If we manage to find some common ground (and right now I don't see a
reason why we shouldn't) we can also get you CVS access if you like.
> It is actually pretty interesting to watch the two AIs battle it out.
I had something like that in the predecessor to Crimson Fields. Well, actually,
it was more like the first incarnation of it (which was never released, and
still had a slightly different name). I didn't exactly miss that feature,
but if your code makes something like that possible (even if it was never used)
that's a good thing.
Jens