Show whole topic Dec 15, 2012 6:41 pm
Razvan Offline
Approved Member
Registered since: Dec 13, 2012
Location: Rochester Hills, MI


Subject: Ai implementation
Hi Everybody,

Since MAXr has no AI, and I enjoy playing offline, I started hacking around this topic. The current status is:
- AI connects to the new game, and acts as a regular remote player.
- AI cannot handle right reconnects, game saves, etc (tried to implement it, but doesn't work right: need to store the "socket number" between crashes/disconnects)
- AI has a landing party (generously composed of constructors, tanks, pioneers, scanners and surveyors). However, no limitations of start-up capital is being taken into consideration. It seems the server allows me to get along with my choices without checking.
- AI doesn't move, but reacts to aggression.
- AI has an obsession to end turn.

So far so good, future plans, with regard of features are:
- ability to randomly move units
- resource exploration
- map exploration
- economy intelligence (investment Simplex)
- land randomly, on the buildable ground
- adjust the landing party & upgrades to the game limits

The current code is a golem of existing source taken from client GUI code. When I will have time, I will refactor it into classes. However, since I am a manager and a PhD student, I never have time Smiling

The sources are attached. There is a new Visual Studio project (yes, I have license for 2012 Ultimate) that shares the sources of the original MAXR game. There is a new file, containing main function (since VS console project has _tmain, no conflict with the original main occurs). However this conflict needs to be addressed on compiling another platforms. Also, I changed a few original sources: there were some minor errors with MSVC2012 (possible uninitialized variable is escalated to error), and I changed a few class members from private to protected.

The AI runs as a different process. For the moment, the IP address is hard-coded, as well as my name as player.

Maybe there is interest in this direction, I would like to hear other people's idea regarding AI. Feel free to write me in English or German, but I will reply in English, I really lost my skill of writing German.

I like to work on this project to improve my C++11 skill (until now, no C++11 in my code) and to understand VS2012 before using it in production.

Enjoy the winter holidays!
Razvan

Attachments:
src.zip
Downloads: 446
Filesize: 518.69 KB