First release of JCAI - global AI - Page 2

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
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'd do

Code: Select all

"C:\Program Files\TASpring\spring.exe" aiscript.txt
Or better yet, create the shortcut as

Code: Select all

"C:\Program Files\TASpring\spring.exe"
And just drag drop the script onto it
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Post by cain »

could the script be played with ai and a "mission script"?

examlpe: three ai building defenses AND the random enemyes popping out to crush your skull... it's not fair not balanced, but I think kinda fun for hardcore gamer.

Also, could a game log be dumped to a log? it would be nice to record a game between two experienced player and extract from that a "fair" random enemy script.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

rabbit: just remove the / and it will work

IMSabbel: just save it in the taspring base directory, name doesn't matter but as SJ said, you have to give the name of the script to spring.exe as a command line option. Just make a .bat file and enter "spring aiscript.txt"
I tried it on mars too, now I got the same error (weird that I didn't spot it earlier though)
Those errors are caused by incorrect building positions that are given by the interface... still have to fix that. The messages are from a sort of error correction system I build into it, only this time it couldn't be solved.

Slamoid: nice :), there might be a problem you will run into with progressing to next levels (level 1 build stuff to level 2 build stuff), I'll fix that asap.
rabbit
Posts: 2
Joined: 17 Aug 2005, 11:23

Post by rabbit »

Alantai Firestar wrote:I'd do

Code: Select all

"C:\Program Files\TASpring\spring.exe" aiscript.txt
Or better yet, create the shortcut as

Code: Select all

"C:\Program Files\TASpring\spring.exe"
And just drag drop the script onto it
Aha, thanks very much. Thought you needed a / or a +, or something.
Well done to Zaphod for making the AI too!
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

cain: I was actually thinking about adding some sort of mission script, in a sense that a set of buildings are just cheated in at start to make things harder.
recording from real games won't be possible - even if you store all the buildings the AI still wouldn't know very well what their relations are and how they should be used in a good way - it's better to make some kind of script for it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The next version of TAI committed to CVS will have a LUA interpreter which should do all of that.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Post by cain »

alantai: so... let the ai wars begin! =)

zaphod: I was wondering only about the unit.
the ai should have it's everchanging path of
production, also can't use the same strategy
as the recorded player. was only an idea for a
better "random" enemy. Just Wondering (TM)
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

My AI doesn't do anything, but I get the following message repeated constantly:
GlobalAI1: Friendly 1 Enemy 0
I vaguely remember getting this message before, so perhaps it is not related to the AI, but either way it isn't working.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

That's because it isnt JCAI your playing against it's SJ's test AI which does absolutely nothing but count how many units it can see.
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Post by Michilus_nimbus »

I just got a nasty BSOD when i tried to take control of the AI using .team 1.
Also, it seems he's unable to build solars.
But otherwise, it works like a charm! Good job!
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I just got a nasty BSOD when i tried to take control of the AI using .team 1.
Taking control of AI (And the builders in particular) will crash it. It will hit an assertion and in a release mode that's just a crash. The BSOD is weird though.
Taking control of forces isn't really possible because it will just give another order.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

hm. With that script i constantly get "map not found" errors, even though it IS present....

Hm. It seems it works only when i unpack the sd7 files of the maps...

BUT, i got 1 ai ally and 2 enemies, and they all expanded without crashes...
Last edited by IMSabbel on 17 Aug 2005, 22:40, edited 1 time in total.
Kixxe
Posts: 1547
Joined: 14 May 2005, 10:02

Post by Kixxe »

When i start the group ai script, if frezzes as soon as i push enter...

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

Post by jcnossen »

hm. With that script i constantly get "map not found" errors, even though it IS present....
Maybe you didn't set the working directory correctly, it usually causes such "file not found" problems with me.
When i start the group ai script, if frezzes as soon as i push enter...
You ment global ai script right?
The 2AI vs player script or the AIvsAI script from SJ ?
Anyway 2 AIs take 2x the startup time of one, so if you have a slow PC is can take a while. Other than that, sorry I can't help you...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You might want to create a cache routine for your AI zaphod. Might enable you to do preload files for maps to get rid of the startup freeze and at the same time allow savegames to function correctly with the AI.

Also exception handling. I wont have that problem though as Lua scripts throw exceptions which get caught by luabind and presented on a silver platter.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

You might want to create a cache routine for your AI zaphod. Might enable you to do preload files for maps to get rid of the startup freeze and at the same time allow savegames to function correctly with the AI.
I was already planning on storing map info on disk, but the info structures have to be somewhat more mature otherwise I can keep rewriting it.
Savegames aren't even supported by the engine yet so it's a little premature to think about that.
Also exception handling. I wont have that problem though as Lua scripts throw exceptions which get caught by luabind and presented on a silver platter.
Sure..., first code it before you can claim it ok. But where did I bring up exception handling actually?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I dont have to code it, it's already coded for me in luabind, I just tell it what my exception function is and write a function that takes the error message and outputs to logfile and console.

And savefiles are pretty much demo files, exept there's a function button tied to save, f8 I think, you can load it aswell through the main menu in singleplayer, though it isnt 100% perfect stable.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

So why did you actually start talking about exception handling? Still trying to convince me to use lua?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Using LUA gives AI configs the chance to use a universal format that both skirmish AI can use, and I dont want JCAI to fall flat when I'm done with TAI. To heck with what I've said before, I can see construction being solved in TAI soon which leads to Attack systems, that combined with a resource agent that's already highly aggressive and an initial build order, should kick your AI's ass. Of course that wouldnt be very good for competition so I'm inclined to help you somewhat. Firstly someone make him new AI configs, he hasnt the tiem to write them to be as effective as they could be.

Besides, LUA shall open AI coding to a wider audience of people who cant or wont get VS .Net 2003.

And exception handling, because your AI crashes spring sometimes without warning, and nobody wants to lumber a debug build all the time.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

I was trying to make a script for TA:WD and I got the following error...:(
Log started.
AIConfig: Ordertimeout=80, Debug=off, ForceEnergyRatio=0.800000, ForceMetalRatio=1.300000, DefaultMinDist=6
Running mod xta_se_v061.sdz on map smalldivide.smf
Infomap of 8x8 created - high metal val=169
Build table constructed: 96 unit definitions
No profile for side of IHCCOM

Closing logfile...
IHCCOM is the Mospact Commander (Core) and I made a SpringWD.cfg file which looks like this:

Code: Select all

//------------------------------------------------------------------------------------------
// General
//------------------------------------------------------------------------------------------

info
{
	CellSize=64
	DefaultMinDist=6
	BuildOrderTimeout=80
	Debug=0
	SafeSectorRadius=15
	MexSectorRadius=15
	Handicap=0 // handicap percentage

	ForceEnergyRatio=0.8
	ForceMetalRatio=1.3
	
	ihccom="wd_mospact.cfg"
	armcom="xta_arm.cfg"
}
So...naturally I made a wd_mospact.cfg file, I put a springWD.SDZ file in the mods folder...

so i'm rather confuzzled, what am I doing wrong here?
Post Reply

Return to “Engine”