Java Tutorial

Java Tutorial

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

Moderators: hoijui, Moderators

msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Java Tutorial

Post by msm8bball »

The one that's stickied is out of date and has a few errors. Any chance we could get an updated one? Or maybe a more up to date wiki so that we don't have to mess with PDF's?
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Java Tutorial

Post by Cheesecan »

Why is it out of date? Only a year has passed, and no major java version changes since then?

Edit: Since it seems you have been into the area for a while now, haven't you learned about AI now and can update it? It's better to do it yourself than ask others to do it for you..
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

Cheesecan wrote:Why is it out of date? Only a year has passed, and no major java version changes since then?

Edit: Since it seems you have been into the area for a while now, haven't you learned about AI now and can update it? It's better to do it yourself than ask others to do it for you..
It's out of date because it simply doesn't work. I'm not sophisticated enough to know exactly what's wrong, although it seems to be the pureint changes.

The problem is, you can't have a tutorial geared towards new people if the tutorial is no longer functional.

By having a wiki instead of a PDF, it would be easier to change and easier to find out more information.

My join date is probably an inaccurate representation of how experienced I am. I've taken multiple Java classes in school, but that doesn't adequately prepare you for actually writing code for a real open source project. Before, I was able to write a sophisticated enough AI that it built a single solar collector, even though I thought I had written it to build a line of them, if that gives you any indication of how good a programmer I am.

I would gladly help out with the wiki. But considering at this moment I can't get an AI to compile I'm probably not the best person for this.

By making it easier for people to get started writing an AI, you improve the amount of people that will actually undertake the attempt. I could really see this being a good project for university students and would recommend it to our CS department, if it was only easier to get started.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Java Tutorial

Post by Cheesecan »

msm8bball wrote:
Cheesecan wrote: My join date is probably an inaccurate representation of how experienced I am. I've taken multiple Java classes in school, but that doesn't adequately prepare you for actually writing code for a real open source project. Before, I was able to write a sophisticated enough AI that it built a single solar collector, even though I thought I had written it to build a line of them, if that gives you any indication of how good a programmer I am.

I would gladly help out with the wiki. But considering at this moment I can't get an AI to compile I'm probably not the best person for this.

By making it easier for people to get started writing an AI, you improve the amount of people that will actually undertake the attempt. I could really see this being a good project for university students and would recommend it to our CS department, if it was only easier to get started.
If you have taken a basic programming course you are sufficiently qualified for open source development. You don't need a formal university project to develop your own stuff. Go off on your own and do what you feel like, even if it's something non-serious like games.

Bear in mind that probably half of the developers out there are self-thought. You have the additional benefit of higher education. But as with anything else, if you want to become really good at it, you have to immerse yourself into it during your spare time as well. This the part autodidacts get, but many comp sci students don't because they feel uni course work is heavy enough. It's not.

I can recommend this video:
http://vimeo.com/2723800
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

Cheesecan wrote: If you have taken a basic programming course you are sufficiently qualified for open source development. You don't need a formal university project to develop your own stuff. Go off on your own and do what you feel like, even if it's something non-serious like games.

Bear in mind that probably half of the developers out there are self-thought. You have the additional benefit of higher education. But as with anything else, if you want to become really good at it, you have to immerse yourself into it during your spare time as well. This the part autodidacts get, but many comp sci students don't because they feel uni course work is heavy enough. It's not.

I can recommend this video:
http://vimeo.com/2723800
I'll check the video out.

I'm not saying I'm not qualified to do it. I'm saying that there's a lot of barriers up that are preventing it from being accessible. I would really love to help out with this, I just don't know what to do. For example, I posted up a problem:
http://springrts.com/phpbb/viewtopic.php?f=15&t=25304

and I'm told that I'm developing for an out of date platform by not using pureint. I have no idea what pureint is. I checked out the thread, that doesn't clear anything up. It's like you guys are speaking another language. I'm told it's best to base AI work off of it, but not how.

In addition, I'm told to post my error log in a different way, but not why. Simply telling people "do this" without giving them an explanation isn't going to help. There just isn't a lot of support here for a newbie to get into things.

Spring has a ton of potential. I loved TA, and Spring has been pretty awesome. It's difficult to do multiplayer for me, due to being 3 layers deep into a university network. And most people don't seem open to playing with a new person one on one. So I've really enjoyed playing against some of the AI's and would like to write my own. But I can't even get one to compile because there's no information on how to get started. The documentation is out of date. I know this is an open source platform and everyone is donating their time. But it would make it easier for more people to donate their time if there was more complete documentation in a wiki format.

If someone wants to work with me to help me get started, I don't mind writing the wiki pages or whatever. I just don't know how to get started.

EDIT
Watched most of the video. Was very interesting, and accurately portrays the business students here. Was there an important Spring related lesson in it?

EDIT2
I get it. Don't just code at work, play around with stuff. Yeah, that's kind of why I want to do Spring. Most of the non-work/school stuff I've done has been rather simple and limited to just things I need. But I'd like to help out with Spring.
Last edited by msm8bball on 22 Feb 2011, 20:26, edited 2 times in total.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Java Tutorial

Post by knorke »

In addition, I'm told to post my error log in a different way, but not why.
because its easier to read the forum when you there are no long logs etc to scroll through. with a link to click its simper ;)
For example, I posted up a problem:
no idea of the problem but you got an answer:
what does <spring writeable dir>/AI/Interfaces/Java/0.1/log/interface-log.txt say?
Look for that file and see whats in it or post it? Seems to be a logfile of some sort.

but yeah springs docu isnt that great and i doubt that will ever change..its just how it is.
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

knorke wrote:
In addition, I'm told to post my error log in a different way, but not why.
because its easier to read the forum when you there are no long logs etc to scroll through. with a link to click its simper ;)

but yeah springs docu isnt that great and i doubt that will ever change..its just how it is.
There we go. See to me, I spend a lot of time in forums, and usually the first thing I do is set the page so that it shows like 100 posts per page. I don't mind scrolling. And it's usually a couple clicks to download a file and then open it for viewing (and worry about the new line format). But if it's easier for people to see that way, then I'll do it that way from now on.

It's not just how it is-it's that way because the people who have the knowledge haven't written it down! So then people like me who aren't as familiar can't figure out how they did what they did. Otherwise I'd be helping write some documentation myself. I know, writing documentation can be boring. But it's really helpful to opening up your project to more people.

Have you written a Java (or Python) AI, no matter how sophisticated? Would you be willing to help me get up and running, and in the process I'll write down all the steps and then throw up a wiki page?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Java Tutorial

Post by knorke »

It's not just how it is-it's that way because the people who have the knowledge haven't written it down!
yes, 100% agree and share your pain... even the stickies and wiki are partly guess work. What i mean is we (modders, ai makers, mappers,..) cant do much about it but guess more and add that. But it will never be as good as a docu made by devs :?

Sorry, I dont know anything about Java/Phython AIs, only know a bit of modding and Lua.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Java Tutorial

Post by Cheesecan »

First what is pureint?
hoijui wrote:
  • Java-AIInterface uses only pure JNI (instead of JNA) -> speed & less dependencies
  • Java-AIInterface wraps all commands through functions: handleCommand(UnitMoveCommand(unit, pos)) -> unit.moveTo(pos)
  • JavaOO-AIWrapper has an interface, wrapper-, stub- and abstract-class for each callback OO part.
  • lots of engine internal minor logic tweaks & bug fixes
  • more stuff compiled in parallel (at least with CMake + make)
  • practically zero unneeded recompiles (at least with CMake + make), while before, all non native sources were always recompiled
It's also easier for you to get help with the new framework since that's what they are developing, and any feedback and bugs you find on it will be a lot more relevant than issues you are having with the old one.
msm8bball wrote: In addition, I'm told to post my error log in a different way, but not why. Simply telling people "do this" without giving them an explanation isn't going to help. There just isn't a lot of support here for a newbie to get into things.
The main reason is that people don't want to have to scroll down so far to read the page. There are actually people who have suggested that moderators should have a responsibility to go through posts and turn pasted logs etc into pastebins. So you understand it's the consensus here that everyone should use it.
msm8bball wrote:And most people don't seem open to playing with a new person one on one.
But there have been several 1v1 tournaments in the past and 1v1 games are not that uncommon.
msm8bball wrote: So I've really enjoyed playing against some of the AI's and would like to write my own. But I can't even get one to compile because there's no information on how to get started. The documentation is out of date. I know this is an open source platform and everyone is donating their time. But it would make it easier for more people to donate their time if there was more complete documentation in a wiki format.

If someone wants to work with me to help me get started, I don't mind writing the wiki pages or whatever. I just don't know how to get started.
It's a Java wrapper for an open-source C game, so it's understandable although regrettable that the documentation becomes out of date.
msm8bball wrote: EDIT
Watched most of the video. Was very interesting, and accurately portrays the business students here. Was there an important Spring related lesson in it?



EDIT2
I get it. Don't just code at work, play around with stuff. Yeah, that's kind of why I want to do Spring. Most of the non-work/school stuff I've done has been rather simple and limited to just things I need. But I'd like to help out with Spring.
Glad you enjoyed it! There was no spring lesson, just found it generally inspirational.
Last edited by Cheesecan on 23 Feb 2011, 11:43, edited 1 time in total.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Java Tutorial

Post by hoijui »

Your mum has a PC, and she wants you to write instructions down for her for how to burn a CD with music from youtube. Lets say you do that, and you may even go through the steps with her, and it works.
Two months later, she will try it on her own and because your instructions are accurate, she will succeed.
"What is a file? what is a program? what is 'firefox'?? i can not find this 'mp3' thing, where did you put it? .......
i hate computers, they are stupid!"

analyze, please.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Java Tutorial

Post by Cheesecan »

hoijui wrote:Your mum has a PC, and she wants you to write instructions down for her for how to burn a CD with music from youtube. Lets say you do that, and you may even go through the steps with her, and it works.
Two months later, she will try it on her own and because your instructions are accurate, she will succeed.
"What is a file? what is a program? what is 'firefox'?? i can not find this 'mp3' thing, where did you put it? .......
i hate computers, they are stupid!"

analyze, please.
That brings back old memories. :regret: Ah.. but at least I got paid some of those times(no I wasn't charging my mom money) so it wasn't a complete waste of time.

Basically your point seems to be don't try to write an AI unless you are a programming whiz. Agreed.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Java Tutorial

Post by hoijui »

(practically) all tutorials require some pre-knowledge. i guess you would agree, that we should not explain how to use the keyboard and mouse in a spring AI tutorial.
if only one person finds the tutorial useful, that means it is not totally wrong. we can not write the AI tutorial so that everyone can follow it, because:
* dev time is limited
* if you designed and coded a system, you will not be able to see half of the problems that newbs could run into.

tips:
it is simply bad practice of you, to accuse others that they did their stuff wrong. there is zero benefit in that.
instead do: learn, and learn the right thing. for example, do not learn that only pro coders should write AI, but that if you can not follow the tutorial, enhance it (which may include, porting it to a wiki first, and then asking others what is unclear to you, and add it). look at it as a challenge to learn stuff you should know, and enhance stuff that should be there.
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

hoijui wrote:(practically) all tutorials require some pre-knowledge. i guess you would agree, that we should not explain how to use the keyboard and mouse in a spring AI tutorial.
if only one person finds the tutorial useful, that means it is not totally wrong. we can not write the AI tutorial so that everyone can follow it, because:
* dev time is limited
* if you designed and coded a system, you will not be able to see half of the problems that newbs could run into.

tips:
it is simply bad practice of you, to accuse others that they did their stuff wrong. there is zero benefit in that.
instead do: learn, and learn the right thing. for example, do not learn that only pro coders should write AI, but that if you can not follow the tutorial, enhance it (which may include, porting it to a wiki first, and then asking others what is unclear to you, and add it). look at it as a challenge to learn stuff you should know, and enhance stuff that should be there.
I think you've misunderstood me. I never meant anybody did anything wrong. I'm just saying, there are somethings that could be done better. I find your keyboard/mouse comment extremely condescending.

I understand developers don't have all the time in the world. But that doesn't mean that things shouldn't be documented and made more accessible. It's good programming practice to do that. It makes it easier for others to get involved and help.

I can write Java. A lot of people can. Being able to write Java doesn't automatically make it so that you can just show up and write a Spring AI. There's some background knowledge that's needed. And when I suggest that you should provide it, you reply with the condescending keyboard/mouse thing. I think you'll find that if you document your code it'll be much easier for an outsider to look at, and that by providing some "getting started" style tutorials that work (and preferably in wiki format so that other people like me can easily update it) you'll see more people that are willing to get involved and help out.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Java Tutorial

Post by hoijui »

with this comment you have just proven that you understood nothing of what i tried to say. we have people that are helping.
you never meant anybody did anything wrong, but yo u (again) list things we do/did wrong, and show no intention to do anything yourself, or even ask anything that makes sense.
what you are doing is the equivalent to mums rant about the stupid computers. you can not ask for code to be documented and tutorials being done in a way that you understand. it just makes no sense. it is like mum requesting a computer that works like she is thinking (which, as i guess we all know, impossible).
what you do is the equivalent of a hippie running in the streets, holding up a placard saying "world peace".
it does not work that way, and telling your parents that they are stupid cause they are not hippies, and world peace is not their primary goal does not bring these hippies anywhere closer to their goal.

we know about the benefits of documentation and nice code. you did not lecture us about that, and we do not need that. again, it makes no sense to tell us we did this not well enough, but that is what you did. it changes nothing (for the better). you likely end up on the list-of-arrogant-newbs-without-a-clue list in the heads of some devs, which is mutually exclusive to the list-of-promising-new-potential-contributors.
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

hoijui wrote:with this comment you have just proven that you understood nothing of what i tried to say. we have people that are helping.
you never meant anybody did anything wrong, but yo u (again) list things we do/did wrong, and show no intention to do anything yourself, or even ask anything that makes sense.
what you are doing is the equivalent to mums rant about the stupid computers. you can not ask for code to be documented and tutorials being done in a way that you understand. it just makes no sense. it is like mum requesting a computer that works like she is thinking (which, as i guess we all know, impossible).
what you do is the equivalent of a hippie running in the streets, holding up a placard saying "world peace".
it does not work that way, and telling your parents that they are stupid cause they are not hippies, and world peace is not their primary goal does not bring these hippies anywhere closer to their goal.

we know about the benefits of documentation and nice code. you did not lecture us about that, and we do not need that. again, it makes no sense to tell us we did this not well enough, but that is what you did. it changes nothing (for the better). you likely end up on the list-of-arrogant-newbs-without-a-clue list in the heads of some devs, which is mutually exclusive to the list-of-promising-new-potential-contributors.
You were trying to say that you can't write a tutorial for everybody, because there are people with varying skill levels. I did get that. I don't understand why you're trying to make this out like I'm someone who's trying to say you're stupid. I'm not at all! I made some suggestions. Now, if you're not open to suggestions, I do find that disappointing. I think a reasonable level of assumed knowledge for a tutorial would be "know how to write fairly sophisticated programs in Java", and then the tutorial can teach them the specifics of what needs to be done to write for Spring. Does that sound reasonable?

What things did I list that you do/did wrong?

I said that it'd be nice if you'd say why I should post log files as attachments or paste bin. The reasoning for that wasn't apparent to me, because I don't mind scrolling through a long threads so it never occurred to me that you guys like to do it that way to make it nicer. If you had explained why instead of saying "do this" then it would have been a lot more apparent in the first place.

If you take my cries for more documentation and help as "listing things you did wrong" then I think you're misunderstanding me. I want to write an AI and become more involved with Spring. But I can't really do that if there's no way to learn the Spring specific things necessary to get started. The reason I told you the benefits of more documentation is that you said that it's time consuming to implement, and a lot of errors could arise.

I know there must be lots of errors that can happen. I'm sure the internals of such an ambitious project could cause some problems. But what's so wrong in me asking for a tutorial that would help someone familiar with Java, but not with writing for Spring, on how to get started, and then keeping that tutorial up to date whenever a big change happens, like switching to pureint?

You said I show no intention of wanting to help. Yet, several posts above, did you see where I said that I'd be willing to write a tutorial myself if someone could just show me how to get started? It seems like you're trying really hard to find reasons to dislike me so you can categorize me into your list of "arrogant-newbs....". But all I'm doing is asking for help, giving some constructive criticism (I listed things that could be done instead each time), and offering to help out myself.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Java Tutorial

Post by Cheesecan »

All this time you have wasted arguing you cannot, you could have written a tutorial by now.
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

Cheesecan wrote:All this time you have wasted arguing you cannot, you could have written a tutorial by now.
Probably true-IF I knew what to write. But I don't know what to write because I don't know what steps I need to do to get a working AI that doesn't just instantly crash (or not compile at all). That's why I'm asking for help.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Java Tutorial

Post by hoijui »

you have been told like.. 4 or 5 times now, what to do and how to do it. you still insist (implicitly) you know it better, and continue your path.

people that would actually possibly be useful for the community never have to mention that, because it is evident.

mum could learn what files and programs are, and she could learn basic things like what open, close and delete are (and that the last two are not the same). while following the instructions, and failing, she could tell her son where she is stuck, and they could analyze the problem together.
but even after her son tells her this, she still prefers to do it her way...
-> after 100th time happening, son tells mum: "yeah mum, can't do anything, computers are just stupid!"

do you really believe, that the way you act, potentially will end up in someone doing what you think you need? and if not, is the only problem that we are too stubborn?
there are others that used the same tutorial and succeeded. the reason is not that it was perfect then and broken for current spring.
if i see one more post of you insisting that you did nothing wrong (-> totally useless, whether true of false), you will be dead for me.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Java Tutorial

Post by AF »

Moral of the story:

If someone is wrong, don't just repeat that they're wrong and your right

Applies to all parties in thread, probably including myself.
msm8bball
Posts: 52
Joined: 09 Oct 2009, 08:08

Re: Java Tutorial

Post by msm8bball »

hoijui wrote:you have been told like.. 4 or 5 times now, what to do and how to do it. you still insist (implicitly) you know it better, and continue your path.

people that would actually possibly be useful for the community never have to mention that, because it is evident.

mum could learn what files and programs are, and she could learn basic things like what open, close and delete are (and that the last two are not the same). while following the instructions, and failing, she could tell her son where she is stuck, and they could analyze the problem together.
but even after her son tells her this, she still prefers to do it her way...
-> after 100th time happening, son tells mum: "yeah mum, can't do anything, computers are just stupid!"

do you really believe, that the way you act, potentially will end up in someone doing what you think you need? and if not, is the only problem that we are too stubborn?
there are others that used the same tutorial and succeeded. the reason is not that it was perfect then and broken for current spring.
if i see one more post of you insisting that you did nothing wrong (-> totally useless, whether true of false), you will be dead for me.
I don't understand why you're talking like this.

I attempted to follow the current Java wiki information, there wasn't enough info there to really get started. So several months ago I asked for help and you came up with the current stickied .pdf file. I'm grateful for that. But following those same directions no longer works. Now you're trying to make me sound like I'm a jerk for suggesting you or someone else who is knowledgeable should put a more up-to-date walkthrough on the wiki page?

I didn't do anything wrong, and I don't think you or anyone else did anything wrong either. I just think some things could be improved. That's it. And if I'm dead to you for suggesting some things should be improved (and providing some feedback for how), well that's just too bad.

When have I been told 4-5 times what to do? I've asked 4-5 times for help in creating a tutorial. I've been told 4-5 times "make it yourself", even though I've made it clear that I don't know the proper steps for writing an AI that would compile without crashing.
AF wrote:Moral of the story:

If someone is wrong, don't just repeat that they're wrong and your right

Applies to all parties in thread, probably including myself.
I don't think anybody has done that.
Post Reply

Return to “AI”