I think I have found a bug in the new Java AI interface.
The class specified in the AIInfo.lua (key: className) is only constructed once no matter how many AIs are added to the game.
E.g. if I make a game with 2 of the same AIs, the engine creates one instance of the class and calls each event twice on the same class.
NullJavaAI and NullJavaOOAI also have this behavior. If you add 2 of the same to a game, they both think that they are the same player/team (see the team ID when they message there resource stats every 10 secs), because the team ID is overridden in the init event when its called a second time.
As I answered you in the chat, it feels oddly similar to http://springrts.com/mantis/view.php?id=2162. I haven't tested it recently, so I can't confirm if it's still happening for me, but I'll give it a try these days and see what happens.
i tried to fix it last vacation, and when i though i had it.. did multiple instances of a class and all.. it was still the same.. and that after like 1.5 days of unfun coding, so ... motivation left me, as i had much other nicer stuff to do. i hope to get at it next vacation again.
i wanted to do sort of a "quick" fix, but that failed, and i dont know why thing is, as you probably gfuessed... one little change of how it works in java needs lots of ugly coding/changes on hte C side.
the propper fix in my eyes, which is probably what i will try to go for next time right away, is to do even less on the C side. currently, setup of one class-path per AI impl. is done from the C side too, for example. and i would like to instantiate AIs as OSGi modules. The OSGi stuff would (by default) be compleetly hidden by the AI Interface already. the main donwside of this is of course, the additional dependency on OSGi and at least one implementation of it. again, this may sound like no big deal for a java guy, but integrating this in spring is quite some pain, especially for linux.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum