First release of JCAI - global AI

First release of JCAI - global AI

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

First release of JCAI - global AI

Post by jcnossen »

I've released the first version of my AI:

http://www.fileuniverse.com/?p=showitem&ID=1322

It's currently very weak to play against, a bug is limiting it from progressing to level 2 units, but I decided to release it anyway - you can go on forever improving and debugging...

So this is mainly a test version, if you want some real competition you should still play online (It will take a long time before that changes).
Please report any hangs or crashes on this forum thread, but you don't have to tell me building and attacking is inefficient or anything - I know that :P

I added a really basic explanation of the scripts, so other people could support other mods as well. I will add more in later versions.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

At long last, however no source code
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Ok I added a source download:

http://www.fileuniverse.com/?p=showitem&ID=1323

Weird though, I had to select Total Annihilation instead of TA:Spring, otherwise fileuniverse just kept giving errors.

Btw, the source has to be put in a map in the taspring dir next to rts, so it can do ..\rts\IGlobalAICallback.h to get to the callback interface.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You could always do what i did and just include the files in the archive. If not TAI is setup to use the RTS fodler as an include folder, I just copied SJ's TestAI and started working from there with everythign preconfigured.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Copying sources is never a good idea imo, you still have to keep it in sync with the cvs anyway.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You dont have a CVS for JCAI Zaphod. You can always use whatever sourceforge project if you want
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I ment the springrts cvs, you'll have to keep copying the interface headers. But anyway, do what you want...

Another thing, the current spring release starts with 5000 metal/energy for the AI to make it harder.
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Nice work, although as you say its still a bit weak :)

If you want to try it ai vs ai while waiting for a new lobby you can use this script file to start spring with. Just start spring with aiscript.txt as command line option.
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

it's not working on meh :(

when i goto the game and press enter to get into the battlefield then sring just STOPS "freezes" nothing happens... and i did everything just the way they are supposed to be done :-)

*works now just reinstalled Spring... actually musta used the 61b1... thats why it didn't work...*
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

The initialization usually takes a while, but it shouldn't hang obviously :S
What kind of PC do you have, and could you show testai.log from the taspring base directory?

And thanks for the script SJ
Last edited by jcnossen on 17 Aug 2005, 00:51, edited 1 time in total.
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

it didn't write anything on the log... the Spring version 61b1 was the problem i think ?... but now my spring just crashed after while of playing (spring 61b2) agaist AI. but i think the crash had nothing to do with AI... spring does it all the time on me :(
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

What can I say? Woot, it really deserve what it mean to be :)

When I try the script from SJ, it always crash at the same time : The AI from the bottom make 4 scout, it attak, destroy ennemi's scout and focus the airplant. Then it crash and my pc reboot.

Oh, and I understand what mean *5 in the config file, but *2s2 what the "s" mean?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

*2s2 means it will build 2 childs of those, but only if at least 2 support buildings have been made (or skipped if they couldn't be made)

Here's a player vs 2 AI's script as well:

Code: Select all

[GAME]
{
	Mapname=XantheTerra_v3.smf;
	StartMetal=5000;
	StartEnergy=5000;
	MaxUnits=500;
	StartPosType=0;
	GameMode=0;
	GameType=xta_se_v061.sdz;

	hostip=localhost;
	hostport=8452;

	MyPlayerNum=0;

	NumPlayers=3;
	NumTeams=3;
	NumAllyTeams=2;

	[PLAYER0]
	{
		name=Zaphod;
		Spectator=0;
		team=0;
	}
	[PLAYER1]
	{
		name=JCAI1;
		Spectator=0;
		team=1;
	}
	[PLAYER2]
	{
		name=JCAI2;
		Spectator=0;
		team=2;
	}

	[TEAM0]
	{
		TeamLeader=0;
		AllyTeam=0;
		Color=9;
		Side=Arm;
		Handicap=0;
	}
	[TEAM1]
	{
		TeamLeader=0;
		AllyTeam=1;
		Color=0;
		Side=Core;
		Handicap=0;
		AIDLL=aidll\globalai\test.dll;
	}
	[TEAM2]
	{
		TeamLeader=0;
		AllyTeam=1;
		Color=0;
		Side=Core;
		Handicap=0;
		AIDLL=aidll\globalai\test.dll;
	}
	[ALLYTEAM0]
	{
		NumAllies=0;
	}
	[ALLYTEAM1]
	{
		NumAllies=0;
	}
	NumRestrictions=0;
	[RESTRICT]
	{
	}
}
I'm trying to reproduce that bug now...
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Hm. Where and under which name has this script to be saved?

edit:

I tried the ai twice on mars, and both times i got following after 5 minutes or so:
RequestMiningZone(): (15,4)
New cell mine
RequestMiningZone(): (9,8)
HandleFinishedUnit: CORMEX by CORCV
mine: Trying to build a support CORRL...
AddBuildOrder: CORRL @ (4352,7424)
HandleCreatedUnit: CORRL by CORCV
HandleFinishedUnit: CORRL by CORCV
Order CORMEX by CORCV not found in command list - reordered 1 time.
Order CORMEX by CORCV not found in command list - reordered 2 time.
Order CORMEX by CORCV not found in command list - reordered 3 time.
Order CORMEX by CORCV not found in command list - reordered 4 time.
Order CORMEX by CORCV not found in command list - reordered 5 time.
Order CORMEX by CORCV not found in command list - reordered 6 time.
Order CORMEX by CORCV not found in command list - reordered 7 time.
Order CORMEX by CORCV not found in command list - reordered 8 time.
Order CORMEX by CORCV not found in command list - reordered 9 time.
Order: CORMEX by CORCV never posted!!!
... (the last one repeated 100s of times), with nothing else following.


But great work, it seems _really_ promising for an alpha1
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

Yeah, definitly promising!!

I had a crash happen when I was happilly building units, Weasels were attacking me YAY!

Good job!
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Hey, AF, has it helped you understand why yours won't build stuff?
User avatar
genblood
Posts: 862
Joined: 19 Jan 2005, 03:37

Post by genblood »

GREAT JOB on th AI ... :-) :-)


Its only going to get better as time moves on ...


Cool Beans .... :wink: :wink: :wink:
User avatar
Slamoid
Posts: 237
Joined: 25 Jan 2005, 19:23

Post by Slamoid »

Anyone got any good AIs done yet? I'm in the midst of revamping the Core for an easy OTA skirmish.... :-)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Triaxx, I know what I need todo to fix mine, it's just that I aint too good with using STL yet so my fix isnt fixing it at all...... I have a solution in line....
rabbit
Posts: 2
Joined: 17 Aug 2005, 11:23

Post by rabbit »

SJ wrote:Nice work, although as you say its still a bit weak :)

If you want to try it ai vs ai while waiting for a new lobby you can use this script file to start spring with. Just start spring with aiscript.txt as command line option.
sorry but could you explain how to get it working a bit more?
I've got

Code: Select all

"C:\Program Files\TASpring\spring.exe" /aiscript.txt
in the target field of a shortcut. Doesn't do anything. noob :oops:

thanks
Post Reply

Return to “Engine”