Page 1 of 1

Skirmish AI Template

Posted: 08 Oct 2005, 17:49
by AF
V0.2 released:

https://sourceforge.net/project/shownot ... _id=362051

This is a template GlobalAI project, with numerous stuff added, for example a working Agent system and example agent (Assigner, adds mm's to metal maker AI).

Other additions:

- Multiple Sectorgrids/gridsets, with variable sector sizes.
- Matrix helper functions to add any nubmer of matrixes to whichever gridset you want.
- Unit and Unitgroup classes, instead of using 6 lines of code to send a unit somewhere it's now as easy as unit->move().
- Sector container class, allows you to group sector offsets together and then treat them as a single sector
- Sectors can be marked temporarily
- Integration of cains mex handler class
- Cross compatible with mine and triaxx AI's(itnerchangeable agents) and soon cains' (JCAI can be ran as a single agent albeit it would be balancing on a tightrope being such a large project).

Planned for V0.3:

- Debug console and basic GUI interface
- SlowUpdate() added to agent system
- Build() function for TUnit and UGroup classes, with CRequest structure.
- AI tags, to separate multiple AI within a single DLL and allow switching support.
- html file logging

Any more suggestions for the next verion? or changes? etc...

Posted: 08 Oct 2005, 18:39
by jcnossen
It's certainly nice to see how fast you've managed to learn C++, but you might want to give the memory manager a break. Things like this:

Code: Select all

map<int,TUnit*> GetUnitMap(){return Unitmap;}
require copying an entire map<int,TUnit*>.
You use STL containers (vector) in small elements like TOffset. I don't know how dynamically you want to use these kind of things, but it will be slow if you do anything besides just reading them.
If you want to create a general matrix class, you can better use a template.
Also be aware of the advantage of a const reference:
This

Code: Select all

TOffset(vector<Offset*> tOffsets){offsets = tOffsets;}
requires when calling two copy constructor calls and a destructor call, while

Code: Select all

TOffset(const vector<Offset*>& tOffsets){offsets = tOffsets;}
requires only a copy constructor call.
You can see how all these little things can quickly end up being a big load on the cpu.

Posted: 08 Oct 2005, 18:48
by AF
Thx, I'll change that for V0.3