Need help for an AI in C++
Moderators: hoijui, Moderators
Need help for an AI in C++
Hi all,
That is a project in progress I have to create an AI for KernelPanick in c++.
The first problem is that I have no knowledge of c++ and the second is that I have no idea where to start.
I tried to read the file "example" but they seem to be generated automatically whereas I really have to coding raw ... This is not really my strong point for once....
If one or more of you can give me advice ...
My goal is not specifically to successfully beat the machine but just to make my AI do some stuff ...
I really depressed and relies on your generosity;)
Thank you in advance.
That is a project in progress I have to create an AI for KernelPanick in c++.
The first problem is that I have no knowledge of c++ and the second is that I have no idea where to start.
I tried to read the file "example" but they seem to be generated automatically whereas I really have to coding raw ... This is not really my strong point for once....
If one or more of you can give me advice ...
My goal is not specifically to successfully beat the machine but just to make my AI do some stuff ...
I really depressed and relies on your generosity;)
Thank you in advance.
Re: Need help for an AI in C++
I would recommend doing AI in lua now.
Its simpler and the AI can be distributed more easily - in the game itself. (Zero-K lobby for example does not support C++ AI at all).
You can start by looking at existing AI - CAI from Zero-K
http://code.google.com/p/zero-k/source/ ... ai_CAI.lua
Its simpler and the AI can be distributed more easily - in the game itself. (Zero-K lobby for example does not support C++ AI at all).
You can start by looking at existing AI - CAI from Zero-K
http://code.google.com/p/zero-k/source/ ... ai_CAI.lua
Re: Need help for an AI in C++
Thank you for your answer.
The problem for me is that I have to code in C++ and only on the game ByteBattle or KernelPanick ... so...
But I'll try to learn from this. Thank you again!
If someone else have a proposition
The problem for me is that I have to code in C++ and only on the game ByteBattle or KernelPanick ... so...
But I'll try to learn from this. Thank you again!
If someone else have a proposition
Re: Need help for an AI in C++
You don't know C++ but you insist on writing it in C++? What's the catch here, is it for homework, competition or something like that?
If you also don't know C or any C-like language, I suggest you learn that first, or it's going to be a rough ride.
If you do know a bit of C at least, get the engine sources, and I suggest you just make a copy of the CppTestAI and base your work on that. Look at the other existing C/C++ AI for hints, and read the wiki.
Most importantly, if you need help, tell us what you tried so far, and exactly where you're having trouble.
If you also don't know C or any C-like language, I suggest you learn that first, or it's going to be a rough ride.
If you do know a bit of C at least, get the engine sources, and I suggest you just make a copy of the CppTestAI and base your work on that. Look at the other existing C/C++ AI for hints, and read the wiki.
Most importantly, if you need help, tell us what you tried so far, and exactly where you're having trouble.
Re: Need help for an AI in C++
Oh sorry, yeah it's for homework...
I don't know C++ at all ^^, i'll follow your advise, learn it first, then work on CppTestAI!
Thanks
I don't know C++ at all ^^, i'll follow your advise, learn it first, then work on CppTestAI!
Thanks
Re: Need help for an AI in C++
are you using this? http://www.irit.fr/ProgAndPlay/index_en.php
found it by googling bytebattle. Might matter in case it is a bit different to normal spring but Idk. Looks interessting though.
found it by googling bytebattle. Might matter in case it is a bit different to normal spring but Idk. Looks interessting though.
Re: Need help for an AI in C++
Oh great!
Thank you so much, there's a programmation guide!
http://www.irit.fr/ProgAndPlay/progAndP ... ion_en.php
thanks i'll watch it :)
Thank you so much, there's a programmation guide!
http://www.irit.fr/ProgAndPlay/progAndP ... ion_en.php
thanks i'll watch it :)
Re: Need help for an AI in C++
i recommend quitting the C++ course, and take an other course.. prefferably... any language that is not C++.
we need to kill this language.. noobs learning it is not the right way to go!
we need to kill this language.. noobs learning it is not the right way to go!
Re: Need help for an AI in C++
C++ isn't going away, even if no new C++ projects are started, and it does have its value, it explains a lot, the training of it could even spark Hoijui rivals ;D
Re: Need help for an AI in C++
The C++ can be cool, but it's complicated with all this pointers....
I can't take another language, this is why I need your help...
I can't take another language, this is why I need your help...
Re: Need help for an AI in C++
I'm confused as to how you would be required to program in a language you don't know for a course. Did you skip a prerequisite?
Do you know any programming languages?
Do you know any programming languages?
Re: Need help for an AI in C++
c++ is quite a cool language. And.. well look around you.. everything were speed really matters.. what is it written in?
Right.
Now that this is solved.
http://springrts.com/wiki/AIWrapper:Cpp
And AF is your friend, he is the developer of Shard
Right.
Now that this is solved.
http://springrts.com/wiki/AIWrapper:Cpp
And AF is your friend, he is the developer of Shard
Re: Need help for an AI in C++
Thank for the link, i'll watch it later.
In fact, i know java, but i have to code un c++, i change university this year, and here, they learned c++, not java =P
In fact, i know java, but i have to code un c++, i change university this year, and here, they learned c++, not java =P
Re: Need help for an AI in C++
LOL, My College switched the CS program from C++ to Java when I was two years in... one of the many many reasons I dropped out...leka wrote:Thank for the link, i'll watch it later.
In fact, i know java, but i have to code un c++, i change university this year, and here, they learned c++, not java =P
You should actually have a much better time of it going from Java to C++, there are going to be a lot of gotchas and weird glitches but the syntax, structure and logic is going to be mostly transferable... at least at the level you'll be using it... You might be better off finding a "Moving from Java to C++" type deal.
It's been years since I've done any "real" programming but this result that came up for me in google seems nominally useful:
http://www.horstmann.com/ccj2/ccjapp3.html
Re: Need help for an AI in C++
Honestly, I always saw it much easier to go from C++ to Java than the other way around, especially if you were ever taught OOP properly.
In fact, usually for C++ you need to have a good C understanding as an additional prerequisite and you end up dealing with a much more complicated including, declaring, compiling, linking, etc. process which C++ inherited to be backwards compatible with C, which doesn't really teach you anything about OOP.
@OP:
1) Learn C++
2) Write A* outside of Spring using C++
3) Compile Spring
4) Create the simplest AI that just spams units and sends them to the enemy
5) Improve your AI to fit the course requirements
PS: Were you assigned Kernel Panic AI as a project, or did you pick it yourself? Because I (am a TA starting with this semester) would never give my students a project using specific tools without giving the instructions how to setup those tools (if not obvious). If you were assigned that, you should at least ask your TAs to help you set it up.
In fact, usually for C++ you need to have a good C understanding as an additional prerequisite and you end up dealing with a much more complicated including, declaring, compiling, linking, etc. process which C++ inherited to be backwards compatible with C, which doesn't really teach you anything about OOP.
@OP:
1) Learn C++
2) Write A* outside of Spring using C++
3) Compile Spring
4) Create the simplest AI that just spams units and sends them to the enemy
5) Improve your AI to fit the course requirements
PS: Were you assigned Kernel Panic AI as a project, or did you pick it yourself? Because I (am a TA starting with this semester) would never give my students a project using specific tools without giving the instructions how to setup those tools (if not obvious). If you were assigned that, you should at least ask your TAs to help you set it up.
Re: Need help for an AI in C++
Thanks all or you!
I "finished" learn base of c++, now i try gajop methods thanks :))
I "finished" learn base of c++, now i try gajop methods thanks :))
Re: Need help for an AI in C++
it is juck norris!
Re: Need help for an AI in C++
I have a small question, I see there are two ways to attack an ennemy:
CMD.ATTACK
(->expect 1 parameters in return (unitid) or 3 parameters in return (mappos))
CMD.AREA_ATTACK
(->expect 4 parameters in return (mappos+radius))
If i understand, the first one only take the ID of the enemy or it's exact postition... The second take a map position and the radius...
The second seems much interesting, could you explein how to use the radius please
CMD.ATTACK
(->expect 1 parameters in return (unitid) or 3 parameters in return (mappos))
CMD.AREA_ATTACK
(->expect 4 parameters in return (mappos+radius))
If i understand, the first one only take the ID of the enemy or it's exact postition... The second take a map position and the radius...
The second seems much interesting, could you explein how to use the radius please
Re: Need help for an AI in C++
The area-attack one is what you use when holding the "A" key in game.
To use it, you should specify a map position with x, y and z coordinates, and radius, which specifies the area of the circle.
Wikipedia has a decent explanation of the radius, but you probably met with it when you were in elementary school: https://en.wikipedia.org/wiki/Radius
PS: I don't really think that command is of much use for an AI, you can easily implement it with a simple for loop, and you will almost always want to set targeting yourself.
PPS: Where are you from, i.e what is your native language?
To use it, you should specify a map position with x, y and z coordinates, and radius, which specifies the area of the circle.
Wikipedia has a decent explanation of the radius, but you probably met with it when you were in elementary school: https://en.wikipedia.org/wiki/Radius
PS: I don't really think that command is of much use for an AI, you can easily implement it with a simple for loop, and you will almost always want to set targeting yourself.
PPS: Where are you from, i.e what is your native language?
Re: Need help for an AI in C++
Thanks for wiki link..
I'm french
I'm french