Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Write a (better) computer opponent for kdegames-ktron

1 view
Skip to first unread message

ab

unread,
Apr 8, 2004, 7:02:45 PM4/8/04
to
If you have time...
(Try to) write a (better) computer opponent for ktron (tron clone)!

(I'm not the author of this program)

Already included in the program is a computer opponent (called "Expert-Mode"
:) that is not very bad,
but also not really good, i think.

it plays a bit too defensive, usually run's itself into problems very fast,
and unflexible in direct confrontation (a bit random is included, though).
but it divides the space on the board already good.
it moves aggressivly only only when you are running immediately behind him
(good behaviour!!)


ideas for the strategy:

avoid silly mistakes when only few space is left (=lookahead; don't run into
a dead end)
don't run behind the opponent, especially not in a small corridor at the
side
keep an escaperoute for yourself open
play more aggressive --> try to get into the part of the board where the
opponent is in
win by creating 2 areas, where the opponent in the smaller one
if you are already shut in --> use the remaining space optimally

must (should) be fast enough to run in real time

****
Goto www.kde.org
Download kde-games.tar.gz (8-10 MB)
You need for example qt-devel.rpm (suse 8.2) (the qt-includefiles) and some
other things....

./configure
make (you can interrupt when the libkdegames directory is made)

cd ktron
make
./ktron (try out)

*** OK, now write your computer opponent
the files to edit are tron.cpp/tron.h
rename think() to think1()
OR edit think() directly

think() has to call SwitchDir()


**
0 <= i,j < playfieldWidth/Height
playfield[x][y]==BACKGROUND etc

Try it!

Send me a mail if you have written something good or with an interesting
style to play against and/or send it to the official maintainer (I don't
know whether/who this is) to include it in a future release.


0 new messages