Java AI API: bug SIGSEGV or dirrerent API interface?
Moderators: hoijui, Moderators
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
vecmath.jar is not generated by the build process. i actually don't remember how it was supposed to be obtained, but it is an external dependency. version 1.3.1 is used by spring, which you can get it from here:
http://mvnrepository.com/artifact/java3d/vecmath/1.3.1
cmake should find it if you put it into the spring sources at this location:
AI/Wrappers/JavaOO/jlib/vecmath.jar
http://mvnrepository.com/artifact/java3d/vecmath/1.3.1
cmake should find it if you put it into the spring sources at this location:
AI/Wrappers/JavaOO/jlib/vecmath.jar
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
My cmake files do not find this library automatic. Don't undestatd whay. Maybe reason for bad fount that I using 'ccmake .'?
I found how I can compile this. I edit AI/Wrappers/JavaOO/CMakeLists.txt file:
replace
on absolute path
I know, it's bad, but it work for me. I pass Java Wrapper compile with this.
I found how I can compile this. I edit AI/Wrappers/JavaOO/CMakeLists.txt file:
replace
Code: Select all
FindJavaLib(vecmath_jar "vecmath" "${myJLibDir}")
set(myJLibs "${vecmath_jar}")
Code: Select all
FindJavaLib(vecmath_jar "vecmath" "${myJLibDir}")
set(myJLibs "/home/user/Documents/spring-develop 97/spring/AI/Wrappers/JavaOO/jlib/vecmath.jar")
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
on ubuntu its installed with "apt-get install libvecmath-java", imo this should be a dependency from java-jdk.
i've never used ccmake, afaik this is just a gui for cmake.
i've never used ccmake, afaik this is just a gui for cmake.
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
thanks, I think it is main reason fo my problems. But I have finish compiling siccess nowabma wrote:on ubuntu its installed with "apt-get install libvecmath-java"
Now I see other problem. Now, if I start 2 or more Java bot's I see in game message "Click to take 2 abandoned units !". All work (2 bot working nice). But whay this message showing for me? (Spring 96, AI Interface from Spring 97 dev + some AI Interface config files from 94.1 for JVM settings)
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
> Spring 96, AI Interface from Spring 97 dev
DON'T DO THAT!
very likely because of that you get bugs. mixing versions isn't supported, ai interface isn't made for backwards-compatibility.
regardingless of that, infolog.txt should help.
stick to one engine specific & current engine version, then we maybe can help. ideally current development version, this way you'll get patches/fixes the fastes way.
DON'T DO THAT!
very likely because of that you get bugs. mixing versions isn't supported, ai interface isn't made for backwards-compatibility.
regardingless of that, infolog.txt should help.
stick to one engine specific & current engine version, then we maybe can help. ideally current development version, this way you'll get patches/fixes the fastes way.
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
also, there is (or at least was) a bug in the Java AI Interface that did not allow for two instances of s single AI implementation. i remember vaguely that someone said to have a dirty fix for it, but then i am not sure if it worked... or i was just dreaming this up.
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
niiiice! thanks abma!
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
You about "Click to take 2 abandoned units !"? It fixed? Nice.
If reason for problem double-call initinit then I hope you fixed double-call relase() too.
BOT log:
If reason for problem double-call initinit then I hope you fixed double-call relase() too.
BOT log:
Code: Select all
release: reason=2
release: reason=2
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
I test my bot on "97.0.1-206-g8576ee8 develop" for Linux 64.
Where I call "unitDef.getCustomParam()" I have crash:
It is only I can not call on Java AI:
Where I call "unitDef.getCustomParam()" I have crash:
Code: Select all
[f=0000000] Connection attempt from ME
[f=0000000] -> Version: 97.0.1-206-g8576ee8 develop
[f=0000000] -> Connection established (given id 0)
[f=0000000] Player ME finished loading and is now ingame
[f=0000000] Error: Ошибка сегментирования (SIGSEGV) in spring 97.0.1-206-g8576ee8 develop
[f=0000000] Error: Stacktrace for Spring 97.0.1-206-g8576ee8 develop:
[f=0000000] Error: This stack trace indicates a problem with an AI Interface library.
[f=0000000] Error: <0> /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so(+0x79c4e5) [0x7fbe639d44e5]
[f=0000000] Error: <1> /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0x179) [0x7fbe639d84c9]
[f=0000000] Error: <2> /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fbea4300340]
[f=0000000] Error: <3> /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so(+0x5d0d16) [0x7fbe63808d16]
[f=0000000] Error: <4> ??:?
[f=0000000] Error: <5> [0x7fbe6024a698]
[f=0000000] Error: [ErrorMessageBox][1] msg="Spring has crashed:
Code: Select all
java.util.Map customP = unit.getCustomParams();
sendTextMsg(" Custom params size = "+customP.size() );
sendTextMsg(" Custom params data = "+customP.toString() );
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
I just write about you'r Interface AIP documentation.
You'r Interface documentation is very bad!
For example see next you'r documentation
I see that this function have parameter otherTeamId. I do not see range of value. I see only "int". "int" mean for me that I can send to this parameter next value: 0,1,2,...100, Integer.MAX_VALUE, -1, -2. This documentation was not have rules for developer, what value I can send. I see "int getTeamAllyTeam" then what you think the return range? Do this can return 0,1,2, or 9999, -1, -2, -3, Integer.MIN_VALUE?
If you answer that "It can return only true value" then whay true value of "int getPlayerTeam(int playerId)" may be not true for parameter "getTeamAllyTeam"?!
You'r Interface documentation is very bad!
For example see next you'r documentation
Code: Select all
int getTeamAllyTeam(int otherTeamId)
Returns the ally-team of a team
int getPlayerTeam(int playerId)
If you answer that "It can return only true value" then whay true value of "int getPlayerTeam(int playerId)" may be not true for parameter "getTeamAllyTeam"?!
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
MAP keyword in awk generator script is not implemented (or rather not finished) for Java. And all getCustomParams functions marked as MAP. Thus abandon Java, go C++ (:playerO1 wrote:I test my bot on "97.0.1-206-g8576ee8 develop" for Linux 64.
Where I call "unitDef.getCustomParam()" I have crash
...
It is only I can not call on Java AI:Code: Select all
java.util.Map customP = unit.getCustomParams(); sendTextMsg(" Custom params size = "+customP.size() ); sendTextMsg(" Custom params data = "+customP.toString() );
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
it makes more sense for a dev to learn what is the valid range of a teamId, then to plaster this info everywhere a teamId appears.
reasons:
* less work
* less cluttering
* no risk of spreading outdated info (probably the most important reason)
* no wasting of time of devs reading the same, lengthy info a million times
* no risk of over-reading actual important info, where there might be some, in the jungle of the repeated info
.. and maybe more
of course it has negative side effects, like you having to find such info in other places, like the spring source directly. this in turn though, has again positive side effects too (you learn the force.. aehh source, you will be fixing bux, maybe, you will understand spring better, and be able to write better AI, you can write the documentation that you think is missing, ....)
reasons:
* less work
* less cluttering
* no risk of spreading outdated info (probably the most important reason)
* no wasting of time of devs reading the same, lengthy info a million times
* no risk of over-reading actual important info, where there might be some, in the jungle of the repeated info
.. and maybe more
of course it has negative side effects, like you having to find such info in other places, like the spring source directly. this in turn though, has again positive side effects too (you learn the force.. aehh source, you will be fixing bux, maybe, you will understand spring better, and be able to write better AI, you can write the documentation that you think is missing, ....)
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
Such a motivation for inferior docs sounds kinda machiavellian.
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
imo thats just an excuse why few docs exist :)
i agree that a dev should know what he is doing, so he either has to read docs or read source code to understand whats happening. its arguable what uses less time / leads to better results in some cases.
still most/many ai api functions are documented!
i agree that a dev should know what he is doing, so he either has to read docs or read source code to understand whats happening. its arguable what uses less time / leads to better results in some cases.
still most/many ai api functions are documented!
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
I think the API is documented well enough. There is a lack of a good guide, as well as a lack of example usage and common problems with solutions.
That said, I tend to have trouble reading your posts that I usually don't bother. No idea what you wanted to say in your last sentence. Could your main issue be with your lack of English knowledge perhaps?
That said, I tend to have trouble reading your posts that I usually don't bother. No idea what you wanted to say in your last sentence. Could your main issue be with your lack of English knowledge perhaps?
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
Even the best-documented part of AI API (java) occasionally has things that are very hard to parse.
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
crash because of calling unitDef.getCustomParam() should be fixed in current development version:
https://github.com/spring/spring/commit ... b3478f10f9
buildbot builds:
http://springrts.com/dl/buildbot/defaul ... -g28fadd8/
https://github.com/spring/spring/commit ... b3478f10f9
buildbot builds:
http://springrts.com/dl/buildbot/defaul ... -g28fadd8/
Re: Java AI API: bug SIGSEGV or dirrerent API interface?
I found other method to get morph info. I just parsing string from CMD.getTolTip(). It is slow, bit it is work.