I've been experimenting with making the classes in my AI static to make the code neater, but when I have 2 or more of the same instances of my AI, only the 2nd one acts, the 1st one is idle. I think I read somewhere in the forums that spring has a problem where if many AIs are added, they all think they are the same or something.
Has that bug been fixed? Or is it all my fault?
Edit: I'm talking about AIs in java
Multiple Java AIs in the same game
Moderators: hoijui, Moderators
Multiple Java AIs in the same game
Last edited by abma on 17 May 2014, 03:02, edited 1 time in total.
Reason: adjusted topic
Reason: adjusted topic
Re: Multiple AIs in the same game
Known-ish issue in Java AIs... you should probably wait for someone who knows better than me but I think this is the relevant bug http://springrts.com/mantis/view.php?id=2162
Re: Multiple AIs in the same game
Nope, still broken
I suggest you play against other bots, or if you really want to use your own, create two different bots - perhaps even different packages.
I suggest you play against other bots, or if you really want to use your own, create two different bots - perhaps even different packages.
Re: Multiple AIs in the same game
Ah, I see.... welp guess that means I can make all my classes static then
- PepeAmpere
- Posts: 589
- Joined: 03 Jun 2010, 01:28
Re: Multiple AIs in the same game
Change title of thread pls, this is not general AI question, its limited only for subset of AI creation ways. Lua AIs are not affected by this issue, for example.
Re: Multiple Java AIs in the same game
Hm, while I'm at it, are there any potential downsides for static classes? (Ex. if and when the bug is fixed, my AI will still act like one if I have many instances in the same game right?)
Re: Multiple Java AIs in the same game
Yes, it will work. The reason you shouldn't have "static classes" all over the places is because it's bad design. If you really need a few stuff to be static, use singleton or service locator, but in as few places as possible.