Interface Redesign - Page 12

Interface Redesign

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

zenzike
Posts: 77
Joined: 12 Apr 2008, 13:19

Re: Interface Redesign

Post by zenzike »

Great work hoijui!

I think that the first option:

Code: Select all

struct SMoveUnitCommand { int unitId, ...};
struct SBuildUnitCommand { int unitId, ...};
struct SAttackUnitCommand { int unitId, ...};
is more sensible; each one of these is bound to a particular commandID; exactly like the Events I implemented. That way there's no guessing how things work, since it is self explanatory in the code. I don't advise a CustomUnitCommand though, since that would lead us away from having a Command for each action.

I can't wait to see what you've been up to :)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

ok. then ill go on that way :-)

i agree that an SCustomCommand would be ugly. if we will not have one, it will be impossible for AIs to use custom mod commands. the question there is how bad would that really be.
i will not have one for now, as it would be easy to add one later anyway, if requested by a modder or AI dev.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

the commands are done and working too now. everything in IAICallback is done now, now i will do IAICheats. As it is nearly exclusively copy & paste, it should not take long.

when i am done with that, i will do some cleanup, and then some simple performance tests/comparisons between the normal C++ and the wrappped C++ interface.
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Re: Interface Redesign

Post by Agon »

hoijui wrote:the commands are done and working too now. everything in IAICallback is done now, now i will do IAICheats. As it is nearly exclusively copy & paste, it should not take long.

when i am done with that, i will do some cleanup, and then some simple performance tests/comparisons between the normal C++ and the wrappped C++ interface.
Great work, so this can be in 0.77 release?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

well...
they said they do not want experimental stuff, and i woudl say this is experimental. also.. are we ready on the how to load/package AIs thread? we may should release/integrate this two things at the same time, or not?
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Re: Interface Redesign

Post by Agon »

hoijui wrote:well...
they said they do not want experimental stuff, and i woudl say this is experimental. also.. are we ready on the how to load/package AIs thread? we may should release/integrate this two things at the same time, or not?
Hm, right. But in the next time we try to test the svn versions, so we could test AIs, too.
If RAI, NTAI and AAI are ported to the new interface and if they work then they not including it in the release?
zenzike
Posts: 77
Joined: 12 Apr 2008, 13:19

Re: Interface Redesign

Post by zenzike »

We're still at the very early stages of development here. I expect it will be another month before this is "production ready".

This AI interface isn't an important part of the next release since the current won works fine, so I don't expect we'll be done for 0.77. I'd rather we had the interface well tested before we have it pushed into the official release.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Interface Redesign

Post by AF »

There are usually release followed by bug fix release, i think this is a very important thing and we should not push it back unnecesarily.

Run this alongside the existing interface until its tested enough that we can remove the old interface entirely.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

..yeah, also a good point! as there will be lots of ppl testing it, it would be good to have it in the release. how would we do it? have all the current AIs (AAI, KAIK, RAI, ...) as normal, plus all of them with the new wrapped interface? (this again interferes with the naming/packaging,dir configuration and loading)
zenzike
Posts: 77
Joined: 12 Apr 2008, 13:19

Re: Interface Redesign

Post by zenzike »

Well once you're happy with what you've done, let me take a look at what you've got. I'll merge it into the SVN with whatever changes might be required so that we can get testing.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Interface Redesign

Post by Forboding Angel »

As a point to note, I have a very vested interest in making sure that AI's perform well. To that end, when you guys talk about testing you mean essentially playing games vs AI's right? If that's the case, let me know and I'll help out with testing.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

hello...
i am kind of finished. most that we need should be in there now. its only for GlobalAI so far.
i am very tired right now, so i can just hope that i included everything that is needed in this patch, if not, tell me please. the contents of it are described next to the file link below.
it is a diff made against r6201.

it compiled and ran for me.
when you applied the patch, you can only use NullAI or RAI afterwards, the other AIs wont work.
i tested with XTA 9.44 on the map Brazilian Battlefield. it seemed to perform like before.

to apply the patch:
cd <directory where you have springSVN6201> # with dir or ls you should see: rts, game, AI, ...
patch -p 0 < caiinterface.txt

i had to zip it cause it was too big for the forum oterwise
Attachments
caiinterface.txt.zip
svn diff against r6201, includes:
* zenzikes work (mainly Engine->AI): C plus C++ wrapper
* the callback completely in C (normal callback plus cheats): C plus C++ wrapper
* RAI converted to use the C interface through the C++ wrapper
* NullAI which uses an Event based C++ interface built uppon the C interface (mainly zenzikes work as well)
(64.65 KiB) Downloaded 19 times
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

..if anyone is doing somethign with the code, or thinks somethign has to be done, please let us others know, so we wont work on the same thing in parallel.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Interface Redesign

Post by AF »

tbh I think this sort of work should be done in the svn, perhaps in a branch or in code that doesn't affect the current workings
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

r6208 contains the branch caiinterface, which has the diff from above applied. lets go on there with changes (right AF, it is better that way).
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

question mainly to tobi:
for the callback function pointers, i did nto specify a calling convention specificly. Should this be done or not?

i compiled r6208 with mingw (gcc version 4.2.1) for windows. if anyone uses an other compiler and wants to exchange the RAI dlls, to test if we can use them with engines compiled with different compilers, let me know by pm, or post a link to your RAI dll here.
mine is here:
C AI interface RAI r6208 MinGW 4.2.1
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

hmm.. as nobody seems to do anything...
we could make all AIs currently in SVN use the wrapper C++ interface (in the C AI interface branch only fo course). Therefore, i think we should take the whole wrapper code currently under RAI, to a subfolder in rts/ExternalAI/, eg rts/ExternalAI/CppWrapper/. Cause the way it is now, we had to copy that code to each AI, and maintain it separately. If no one has anythign against it, i would start doing that.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Interface Redesign

Post by hoijui »

just to let you know.. i am working on it.
what i am doing now is:
* simplifying the engine -> AI interface/intercommunication code
* adding in support for interface libraries as a middleware between Engine and AI

i guess i am the onlyone currently workign on the C AI branch.. if so, then i recommend you not t ostart anything there before my next submit, as it will be huge and change a lot.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: Interface Redesign

Post by hughperkins »

Cool to see stuff happening. Looking forward to see how this goes!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Interface Redesign

Post by AF »

This is good, Im glad some progress is happening and the whole AI community here will benefit greatly because of it.
Post Reply

Return to “AI”