First release of JCAI - global AI - Page 4

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

Post by jcnossen »

Good for you, now you have time to isolate my bug :P
Problem is now that I have to run for about 10 mins before it crashes, so debugging doesn't go exactly fast.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Is it only me, or dont the scripts work if you change the default map to a new one that is packed in the new formats?

edit: did try out the standart aivsai.bat two times, and it crashed both times after about 3-4 minutes.
log:

Code: Select all

UnitGroup: Added CORFAV - batch has 3 units.
UnitGroup: Added CORFAV - batch has 4 units.
New cell klab
RequestSafeBuildingZone(): heightdif=7.137262
New cell vplant
RequestSafeBuildingZone(): heightdif=10.461583
UnitGroup: Added CORFAV - batch has 4 units.
The first crash also ended in excatly the same line (...added CAORFAV...)
The first crash was before any unit had been killed,the second one after one kill.
Maybe there was a pointer error or something, because batchsize didnt increase after the unit-add?

Edit2:
I did a few runs with debug=1

Code: Select all

1st one:
.
.

New cell mine
RequestMiningZone(): (0,4)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (224,2480)
New cell mine
RequestMiningZone(): (3,3)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (1776,1792)
New cell mine
RequestMiningZone(): (4,2)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (2272,1248)
New cell mine
RequestMiningZone(): (1,5)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (768,3056)
New cell mine
RequestMiningZone(): (3,4)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (1872,2416)
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
airbuilder: Trying to build a support CORSOLAR...
AddBuildOrder: CORSOLAR @ (6400,7040)
SetBatchBuildingTask: BasicForce1
UnitGroup: Added CORFAV - batch has 4 units.
ForceHandler: Batch build completed: (BasicForce1)

--------------------------------------------------
2nd one:
.
.
Add factory order: CORFAV
New cell klab
RequestSafeBuildingZone(): heightdif=7.137262
AddBuildOrder: CORLAB @ (1792,768)
New cell vplant
RequestSafeBuildingZone(): heightdif=10.461583
Add factory order: CORCV
SetBatchBuildingTask: BasicForce1
Add factory order: CORVENG
UnitGroup: Added CORFAV - batch has 4 units.
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
SetBatchBuildingTask: BasicForce1
airbuilder: Trying to build a support CORSOLAR...
AddBuildOrder: CORSOLAR @ (6400,7040)
UnitGroup: Added CORFAV - batch has 4 units.
ForceHandler: Batch build completed: (BasicForce1)
--------------------------------------------------
3rd one:
.
.
New cell mine
RequestMiningZone(): (4,2)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (2272,1248)
New cell mine
RequestMiningZone(): (1,5)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (768,3056)
New cell mine
RequestMiningZone(): (3,4)
mine: Trying to build a mex...
AddBuildOrder: CORMEX @ (1872,2416)
SetBatchBuildingTask: BasicForce1
airbuilder: Trying to build a support CORSOLAR...
AddBuildOrder: CORSOLAR @ (1280,896)
UnitGroup: Added CORFAV - batch has 4 units.
ForceHandler: Batch build completed: (BasicForce1)
It seems the crash happens _everytime_ the first batch of CVs and Jeffys has been build.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Strangly, when selecting playervs2cpu, it didnt crash that quickly.
And your ai is already better than the cavedog one (if it doesnt crash).

After building a rader tower i found a group of enemy units. I send some flashes , and the jeffies retreated, only to come back a minute later when a second group had arrived and attacked my base, while at the same time they send in planes from the other direction. (maybe the "other direction" part was coincidence, but that behaviour did _feel_ like a real opponent.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

It's probably a lot of coincidence too, mainly it's just attacking in groups.That's what makes it better than cavedog AI already I think. Probably the other direction is just caused by the fact that there were 2 AIs in the game.
Is it only me, or dont the scripts work if you change the default map to a new one that is packed in the new formats?
It doesn't use any map specific information. (at least none that isn't given by the spring interface) However, because there is no balancing in place could make it very weak or even non-working at some maps.

Anyway, back to debugging :( - this part of coding sucks...
thx for testing...
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

wll, yes, i guess the attack was just a lucky encounter, but the crash with the aivsai was VERY reproducable.
(10 runs==10crashes at about the same time (+-10s). Somethings definitively not right, there.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I will be adding a more automated form of dependency handling now, just like spring itself has. This should get rid of errors like this, because it all involves access violations, but it could take a while before it's running properly again....
I also discovered that the debug version is a lot more stable than the release, that's why it was very hard to reproduce all the reported bugs...
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

I got another question:

How do i run a map thats packaged as an sd7 file?

You just write "... can easily be changed in the ... . txt file...." in the readme, but try running one of your batchfiles to run mars, for example (or any other map that is packaged compressed).
It just doesnt work.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I think the Mapname is case sensitive or something. When I use Mapname=mars.smf, it complains about not finding mars.smd, though when I use Mapname=Mars.smf, it works fine.
Maybe that fixes it.
alik83
Posts: 82
Joined: 08 Sep 2004, 15:32

Metal extractor finding and mex radius

Post by alik83 »

Zaphod, can you modify your MEX spot finding routine so it will get the spots correctly on map like Core Prime industrial(metal uniformely distributed) and some others by using new callback->getExtractorRadius function to calculate metal spots so the mex's radiuses cover all metal. In CPIndustrial map mex radius is just the size of mex, so mex spots should be all over, while now your AI finds them like this(tested) : (0;0) (0;512); (0;1024)... (512;0) (512;512) and so on I don't know why.
If you'll fix this could I get a link to the new code? :)
I've read enough C++ and started writing my AI and just lazy to wright my own metal spot finder routine;)
Thanks,
Oleg.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

I notices it crashes after the commander can't move to a desired position.

Doesn't explain the random crashes, but the AI fights very well though.

in TA:WD it more often crashes, probably due to the commander finding spots to build...

BTW, when the new TA:WD beta is ready, i'll release it as a mod file along with a script for it...i'll probably release the .ccx version seperately.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Zaphod, can you modify your MEX spot finding routine so it will get the spots correctly on map like Core Prime industrial(metal uniformely distributed) and some others by using new callback->getExtractorRadius function to calculate metal spots so the mex's radiuses cover all metal. In CPIndustrial map mex radius is just the size of mex, so mex spots should be all over, while now your AI finds them like this(tested) : (0;0) (0;512); (0;1024)... (512;0) (512;512) and so on I don't know why.
If you'll fix this could I get a link to the new code? :)
I've read enough C++ and started writing my AI and just lazy to wright my own metal spot finder routine;)
Thanks,
Oleg.
Sorry, eventually I will be focusing on that too, but currently other things are way higher on my todo list...
It's basically because the cell system only allows one mex per cell, plus it's easier to find the spots with such a system.

I'm doing some restructuring now, though the scripts (your TA:WD script as well) should be fine. It'll take at least 4 days, as I'm kinda demotivated because of the debugging and I also have exams coming up.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

Hey, I feel ya man, I am not quite motivated my self to work on TA:WD, even though I know I need to make new textures, new models etc.

Focus on your exams for now, you might get more motivation soon as you see more posts with praise to your AI :) because you did a hell of a job so far! it works great even though it's only version 0.11!
Iahmel
Posts: 1
Joined: 23 Aug 2005, 14:32

Post by Iahmel »

I decided to register here so that I could thank you Zaphod publicly for two reasons.

1) The AI, yes it's not finished and it crashes. All great works start somewhere. You have so far provided the leading AI in the spring community take a bow :)

2) Burning Alantai Firestar. I have been following the threads on AI construction here pretty close for some time now. I had started to grow a dislike to the windbag. I got a good laugh at you making him take a quiet exit.

Once more, many thanks on doing both of those!
Keep up the great work!
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

1) Well thanks :P

2) I can't really disagree with you :wink:
User avatar
hrmph
Posts: 1054
Joined: 12 May 2005, 20:08

Post by hrmph »

Iahmel, LOL! You rawk :)
Kixxe
Posts: 1547
Joined: 14 May 2005, 10:02

Post by Kixxe »

Okay, i reinstalled the lastest version with only maps and downloaded your updated version of JCAI. Now, when i start it says ''Incoret version of globall AI test.dll'' and the path to it. Then there is either 1 commander (if i started spring.exe and global AI) or nothing (if i played a me vs bot game in spring lobby).

Help?

Oh, and i can only select the test.dll in spring lobby...
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

I think Zaphod has to recompile his IA for this version.
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

Kixxe wrote:Okay, i reinstalled the lastest version with only maps and downloaded your updated version of JCAI. Now, when i start it says ''Incoret version of globall AI test.dll'' and the path to it. Then there is either 1 commander (if i started spring.exe and global AI) or nothing (if i played a me vs bot game in spring lobby).

Help?

Oh, and i can only select the test.dll in spring lobby...
ditto.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Since it basically crashes somewhere in the game anyway, I didn't bother to recompile.
I'm kinda redesigning and rewriting it, while continously testing it on release mode so I bump on (hopefully) every bug in it. This will make parts of the AI script outdated, and will take some time since I also have exams coming up next week.
I'm not really willing to invest my time on debugging the not-quite-optimal solution that JCAI 0.11 had, I going for long-term improvements :), so you guys have to wait for at least a week longer...
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

You could add in your AI to the standard cvs tree and so anyone can recompile it that want to try it out Zaphod.
Post Reply

Return to “Engine”