Talk:Robocode Guidebook

From Robowiki
Revision as of 20:39, 24 May 2010 by Exauge (talk | contribs) (→‎Initial discussion: comment/reply)
Jump to navigation Jump to search

Initial discussion

The other day I was thinking it was a pity that it isn't that easy to get into Robocode really. Sure, we have a "Getting Started" page but that's pretty loose. I was then reminded about Wikibooks. So here's a question: Who thinks it might be a good idea to make a fairly self-contained "Robocode Guidebook" of a similar style to the things on Wikibooks? Many existing tutorials could probably be moved in or adapted, though trying to organize things in that format might, 1) Reveal things that need tutorials still, and 2) Make it easier for a newcomer to follow. Thoughts? --Rednaxela 13:37, 12 May 2010 (UTC)

I need to check out Wikibooks to see the "style", but it sounds like a great idea if we can find people with the time. I'd certainly be happy to contribute. I try to visit the RoboWiki with a "newbie mind" sometimes, and there is definitely a lot of work to be done... --Voidious 13:52, 12 May 2010 (UTC)
It sounds like a good idea to me. I started robocode less than a month ago and I could tell you what I would find helpful / not helpful etc. If you decide to do it and need me help feel free to ask :) --Exauge 21:03, 12 May 2010 (UTC)
I think your input would be very useful. Many of us have been at this for months/years, so it's easy to lose perspective. =) --Voidious 21:49, 12 May 2010 (UTC)
Which brings up another point I wanted to make... It seems important to consider target audience, since there's such a wide range of backgrounds of people that come to Robocode. They may have Java experience and fresh-in-mind trig knowledge, or be new to programming entirely and don't know/forgot trig and other maths. Of course, ideally we write something that anybody can learn from, but target audience definitely affects the style and pace. --Voidious 21:49, 12 May 2010 (UTC)
I think there are a lot of basic of Java book out there, so I don't think we need to write about Java or OOP. But we should have basic trig cuz even programmers may have forgotten about trig already (if you didn't work with geometry/graphics that is) --Nat Pavasant 05:43, 13 May 2010 (UTC)
Yes! ... " Robocode cookbook " ?? :) I would highly suggest a collection of sample AdvancedRobots (in their own directory) packaged with robocode. With a link in the help menu to the "Guide". Include a sample AdvancedRobot with a decent 'base' for melee. It took me 5 years of fighting with ways of storing info for melee. (homeMade silliness) because API's are difficult to understand... (Only to make use of module after) Include useful utils like 'project'.. helps make Trig easy... and If I knew eclipse would of made learning java easier I would switched over from the robocode editor much sooner.. (just some pointers... I gotta run:) -Jlm0924 22:36, 12 May 2010 (UTC)

Well, what I had in mind was making it a relatively linear book-like guide, and progress through the basics very gradually like follows:
Part 1: The basics

  1. How to get Robocode and run a battle in it
  2. How to set up an environment for making a robot in:
    1. With builtin editor in Robocode
    2. With a text editor command line compilation
    3. With Eclipse
  3. How to make a do-nothing robot
    • Optional Java Sub-Lesson: Anatomy of a Java class
  4. Overview of robocode physics, and anatomy of the robocode turn and execution cycle
  5. How to make the robot move in a straight line, and then how to make it move in a circle
  6. How to turn the gun and fire
  7. How to scan, and fire directly at the scanned robot
  8. How to perform very simple ramming
  9. How to perform very simply orbiting
  10. How to to respond to hitting the wall (bounce off)
    • Optional Geometry Sub-lesson: Perpendicularity and how moving perpendicular
  11. How to print to the robot console and make debugging graphics, and how to view them in the battle
  12. How to find the coordinates of a scanned enemy, and paint a box around them in debugging graphics
    • Optional Trigonometry Sub-lesson: How to convert an angle and distance, into relative coordinates
  13. How to perform iterative linear targeting using this
    • Optional Trigonometry Sub-lesson: Pythagorean Theorem - How to get the distance between coordinates
    • Optional Trigonometry Sub-lesson: How to get the angle of a vector
    • Sub-lesson: Concepts of iterative prediction
  14. How to perform approximate non-iterative targeting
    • Optional Trigonmetry Sub-lesson: The math behind the non-iterative approximation
  15. More?

Part 2: Improved Techniques

  1. How to randomly change direction in a simple way
    • Allude to possible improvements, like factoring in bullet-flight-time Raiko-style
  2. How to detect enemy firing, to make a simple stop-and-go movement
  3. Simple pattern matching
  4. Wall smoothing
  5. Melee enemy tracking and target selection
  6. Anti-gravity movement
  7. Competition (Roborumble) and testing (general testing advice)
  8. More?

Part 3: Advanced Techniques

  1. Some common ways to make bot code more modular
  2. Minimum risk movement
  3. Introduction to "Waves"
  4. Simple unsegmented guessfactor targeting
  5. Segmented guessfactor targeting
    • Mention non-guessfactor segmented targeting (i.e. PastFuture)
  6. Simple (no trees) DC targeting
    • Both Guessfactor and PIF based
  7. Simple 'Virtual Guns'
  8. How to deal with rammers
  9. More?

Part 4: Elaborate Techniques

  1. Timing nitpicks, revisiting the execution cycle
    • Consider how enemies see you with a delay, and vice versa
    • Consider how one's own gun rotation is for one's location next turn, not this turn
    • How to predict one's next location, for extra precision
    • Very Briefly mention imaginary gunheat waves maybe?
  2. Basics of team robots
  3. Wave surfing
  4. Anti-surfer techniques
  5. Precise wave intersections
  6. Neural targeting
  7. Wisdom on combining many VCS buffers, combining multiple targeting systems, etc
  8. More?

All sections using AdvancedRobot/TeamRobot, never plain Robot of JuniorRobot. Any thoughts? :) --Rednaxela 06:17, 13 May 2010 (UTC)

Wow, I see you've already put a lot of thought into this. Cool! I'd be happy to start working on drafts for whatever sections if you want to take the lead in handing out assignments. =) Though I may be pretty busy with work for a few days here.

Just brainstorming - I'm not necessarily 100% in favor of any of these ideas:

  • It might be neat to have a few challenges sprinkled in, maybe to end chapters or sections. For instance, "beat this RamBot", or "out-survive sample.MyFirstRobot without firing" (I think I stole that one from Kawigi).
  • Why completely exclude Robot/JuniorRobot? I think a lot of Robocode beginners are using these. Sometimes they have no choice, since it's specified as part of their assignment.
  • RoboResearch might be a good topic. It can be a pain to setup and get running, but it is just such a must-have tool, imo.
  • Wave Surfing could practically be its own top level section as we get more advanced. It's a pretty broad category of movement.
  • It might be fun to touch on a few random topics somewhere, like Twin Duel, large battle fields, Droids, "perceptual" bots. But of course that seems like a low priority.

--Voidious 15:52, 13 May 2010 (UTC)

This is an excellent and I really love the idea! I have had something similar in mind for some time, but never had the time for it. I think you experienced Robocoders will be much better at writing this guide book than me, as I don't go deep into robot developing, but put most efforts into developing the game itself. If you need me to write parts of this guide, please tell be which parts you have in mind, and I will see what I can do. :-) I will definitely keep an eye on this page, which I think will be VERY important for newcomers and as a kind of reference book when it is finished. :-) Don't forget pictures! ;-) --Fnl 20:32, 13 May 2010 (UTC)

I'm not sure I like Wikibooks' use of a Copyleft license, though: GNU Free Documentation License. I imagine a lot of the content going into this book could be related to content on this wiki, either derived from a RoboWiki article, or it could form the basis of a new/revised article. I'm not sure about committing everything on this wiki to that license, which would be required for the latter... (unless just those specific RoboWiki articles use that license, which I guess is do-able, but seems like a big headache.) --Voidious 21:50, 13 May 2010 (UTC)

Actually I'd like CC-BY-SA license with this wiki (see Robowiki_talk:Copyrights). One thing I'd like to comment about the outline, I don't think the Elaborate Techniques part is required. If you understand basic of the first three parts, you should be able to understand the fourth part with information on this wiki. Anyway, many, many interesting things on this wiki are hidden under the massive talk on the old wiki. --Nat Pavasant 05:32, 14 May 2010 (UTC)

@Voidious: Well, personally, I feel that JuniorRobot and plain Robot are no easier than AdvancedRobot, and the mindset/thinking required to code each effectively is very different. About licence, I wasn't thinking of putting this guide on Wikibooks, just on this wiki like any other articles. I was only mentioning Wikibooks for the general style of how to organize a 'book' on mediawiki and such.
@Fnl: Alright. Indeed, pictures are good ;)
@Nat: Well, I'm not sure the "elaborate techniques" section is as needed either, but for completeness I think would be nice to include it. I do definitely consider the earlier sections to be much higher priority than the later sections personally.
--Rednaxela 06:02, 14 May 2010 (UTC)

I played around in photoshop a little bit and made somewhat of an icon or w/e to put on first page of the guidebook. If you don't like it feel absolutely free not to use it. anyways here it is.

Robocookbook.png

--Exauge 21:10, 14 May 2010 (UTC)

Cool! ... I think if you changed just the "Robo" to the same style as used for "Robocode"; It might be irrestible... ;) (Hey, If they don't take it ; You'll have the snaziest Snippet Page :).. Good job... -Jlm0924 is jealous ;) 23:45, 14 May 2010 (UTC)

Alright made the change, how's this look?

Robocodecookbook.png

--Exauge 00:00, 15 May 2010 (UTC) -

- dame your fast! I liked what you had better, though :) I meant if Robo was thicker and divided up like it is on the up screen..(or web page) -Jlm0924 00:15, 15 May 2010 (UTC)
you mean like the top one only the robo wider? and ya i came to check about 2 minutes after u made the comment ;) the change wasnt too hard to do. --Exauge 00:33, 15 May 2010 (UTC)

- no. non.. like in Robocode logo ... sorry dude.. don't take my opion as gospel truth.. :) I liked what yeah had. :) I got company . cheers

I'd suggest Robocode JGAP-like logo. I'd make one when I'm home. --Nat Pavasant

I agree the elaborate techniques sections are not as important as the earlier stuff, but I still think we should include them. There could be lots of would-be Robocoders that would dive into that kind of stuff if it were included, but would not be inclined to seek it out on the wiki. And we could use it to form some more Tutorials on the wiki. Anyway, I think we should have a page for this outline somewhere and move the discussion to the talk page...

And by the way, y'all heard of Code Complete? It's a pretty widely regarded programming book. I'd like to nominate "Robocode Complete" as a possible title. =) --Voidious 02:22, 18 May 2010 (UTC)

(...above migrated from Talk:Main Page...)

Void, Honestly I think that the most helpful name that would best describe it is something like Robocode Guidebook or The Guide to Robocode etc because while Code Complete might be a widely regarded programming book, many people who start robocode won't know that. Anyways don't take my word as law - it's just a comment :) --Exauge

You cannot post new threads to this discussion page because it has been protected from new threads, or you do not currently have permission to edit.

Contents

Thread titleRepliesLast modified
Robocode Guide vie explanation of a top robot1904:50, 7 March 2013

Robocode Guide vie explanation of a top robot

I have been thinking about writing a guide for robocode for a while and was wondering what you guys thought. My initial plan was to go through Gilgalad and explain how everything works. I've been cleaning up Gilgalad's code so it could be used as a frame work and the new users could just mess about with different classifiers, but now I'm wondering if there Diamond on Xandercat would be better. Obviously, I have a better understanding of Gilgalad than I have of these bots, but on the other hand, reading through their code would help me get the perspective of someone who didn't write the robot.

Any thought?

AW15:23, 5 March 2013

Seems like a great idea. We may be in one of those phases where top bots are way ahead of any formal documentation of what they're doing, like Wave Surfing in early 2006.

I do think Diamond is a very clean and presentable code base that would serve this purpose well. But more than that, I think the main barrier to this is just someone having the time / understanding / motivation to do it. So if you're most comfortable with Gilgalad, that would definitely get my vote. And maybe your write-up would inspire some other folks to do the same with their bots. (I'd love to do it for Diamond, it's just a matter of time / priorities.)

Voidious16:04, 5 March 2013
 

Sounds good to me.

If you would like, I could check it for grammar and spelling mistakes.

Sheldor17:05, 5 March 2013
 

Well I'm not sure if some of them are the best idea. I know the current gun I use is pretty simple code wise (not even having any virtual guns, etc). But the movement is a bit of a mess. I was working on a new movement, but its nowhere near ready for something like this (but I am endevouring to keep it just as simple as the gun).

I know Diamond is almost scary in its structure imho, but if it can be neatly explained then I am all for it.

Chase17:16, 5 March 2013

Lol, how is it scary? Just curious. :-)

Voidious17:18, 5 March 2013
 

I don't know. It just seems to be so large with such a unique structure. It is a bit intimidating.

Chase17:59, 5 March 2013
 

I would guess the code in XanderCat is quite a bit different from the code in most other robots. Though it uses a lot of the same concepts as other robots, the code is almost entirely home grown without using other robots as a reference.

I wrote XanderCat on top of my own framework I call the Xander Framework, which I did create a wiki page on, but it doesn't get into specifics.

I do include source with XanderCat if anyone ever wants to look at it.

Skotty17:20, 5 March 2013
 

Well if we are going to do it, I think we should try and go K.I.S.S. with it as much as possible. A lot of structure is just going to confuse people who are not used to dealing with it. Of course a complete lack of structure is equally difficult.

With all that said. I would say GresSuffurd is probably the best bet in that area.

Chase18:16, 5 March 2013
 

I don't know, I think it depends on the goal. I like the idea of something like Melee Strategy/Understanding Coriantumr, with the insight and personal touch of an author writing about his own bot.

I certainly agree there's pros/cons to choosing a simplistic design (GresSuffurd) vs a typical / robust design (Gilgalad). And neither seems like a replacement for the generic "Robocode Guidebook" idea. My vote still goes for whatever choice is most likely to actually get written. :-)

Voidious18:27, 5 March 2013
 

I've been thinking about doing this for DrussGT for a looong time now as a motivation for cleaning up the internals, possibly making a new BasicGotoSurfer as well which incorporates a bunch of the things I've learned about GoTo surfing along the way.

Skilgannon18:28, 5 March 2013
 

Hmm, so I'm fine with using a robot other than Gilgalad since it will mean I have a better perspective on what someone who didn't write the robot would need explained, but it would also make the project take longer. I find Diamond fairly easy to understand, but I was thinking of a tutorial for 1v1 since I haven't tried melee yet, and that would mean there would be a lot of "melee code, ignore this:" going on. I'm willing to put quite a bit of time into this, so I'm more interested in what people think the best bot for a detailed explanation is? How hard is it to understand Gilgalad? Also, this will probably mean that there will be a bunch of new robots based on the one for which the guide is made. How efficient are the other top robots, and how important should speed be? If I did use Gilgalad, perhaps I should make modifications such as using Rednaxela's kd-Tree?

AW23:06, 5 March 2013

Quick note, I'd tend to advise against using my kd-Tree (espescially the "3rd gen' one) in a bot which is meant for use in such a guide as is being discussed here, especially if the guide wishes to touch on what the kd-Tree itself does. While I tried to keep readability reasonable, there are plenty of places where I sacrificed simplicity for raw performance.

For a bot used for this type of purpose, it might be fine to go with a simple linear k-NN search even. For 35 round battles, it's normally not too slow if implemented well, and it a tiny fraction of the amount of code to implement a kd-tree.

Rednaxela00:25, 6 March 2013
 

I guess the idea isn't totally clear to me, so I'm not sure what to suggest. Is the chosen bot analogous to BasicSurfer in the Wave Surfing Tutorial, or Coriantumr in Melee Strategy/Understanding Coriantumr? Or neither? And is the goal to explain some of the latest Robocode bot features that aren't well explained on the wiki, or to give an idea what goes into developing a full-featured modern 1v1 bot?

If it's more like an AdvancedDueler / Advanced Dueling Tutorial, I would just write a new bot with BasicSurfer + distancing + multiple waves + gun heat waves + precise intersection + bullet shadows + reasonable stats (either VCS or KNN) and gun with KNN + VG (main/antisurfer) + MEA. And simplify as much as possible within each of those features.

If it's more about exploring concepts / code in a real world example of a top bot, I wouldn't expect lots of clones coming out like we have with BasicSurfer, since it would probably be complex enough that you'd still have to write a lot of code yourself to have a complete bot. (E.g., Understanding Coriantumr/HawkOnFire don't seem like a basis for clones, though they are super useful for learning about Min Risk.) I know Diamond is pretty clean code, and Gilgalad / XanderCat sound like they are too, but I haven't actually looked at their code to know for sure and give an endorsement. I think having a really high ranked bot would give it a lot of cred, too, and all 3 of those are in the top 5.

Voidious23:19, 5 March 2013
 

Sort of between the two, but more like Coriantumr. I think someone who really wants to can learn how top Duelists work from reading the wiki, but I want something that shows how it all fits together and puts the reader in a position to write an advanced wave-surfer in a short period of time without saying "just do, it's too complex to explain now". So sort of like if you wanted to explain how Diamond works to someone with a programming background who hasn't heard of robocode before. I would probably start the guide with background information, possibly just copying the wikipages for GF's etc. and then jump into the robot.

Part of my idea for this comes from trying to explain robocode to friends. I'm not really interested in explaining how java works, or how trig works, just robocode specific stuff. I really appreciate the tutorials and I find the evolution of robocode strategy over time fascinating, but I think that getting a single, detailed, guide to robocode strategy, integrated with a top robot, would make learning a lot easier (or at least faster). Once they start robocoding they'll spend all of their free time (and more) reading the tutorials anyways... (mad scientist laugh)

AW02:43, 6 March 2013
 

Thanks Chase for pointing out that GresSuffurd has a complete lack of structure ;-)

GrubbmGait18:13, 6 March 2013

I didn't mean to say that. I meant to say that it had a simple structure.

"... Of course a complete lack of structure is equally difficult ... I would say GresSuffurd is probably the best bet ..."

Chase19:06, 6 March 2013
 

I know (note the smiley). For the quick reader it shows: . . . complete lack of structure . . . . GresSuffurd . . . best bet. I don't quite like those two big files containing Gun and Movement, but it works for me as a non-OO guy. Mind you that I use the in-game editor or Araxis Merge to change the code.
Back on topic: I found the page about Melee Strategy/Understanding Coriantumr one of the best pages at that time, because I want to understand why and how (logically, not codewise). Things I don't understand or don't know how to implement, I just don't implement. (and that is one of the reasons I am not at #3 ;-o ). If someone wants to write a topbot, I like the fact that the difficult parts are explained, and that the reader has to produce the 'glue' to make it al working. As for candidates, I hardly look at code of others, so my opinion is blank. Time and a clear explanation are also important.

GrubbmGait00:18, 7 March 2013

Have you ever had any problems with the Robot Editor's compiler? Or with the Robot database? I've been trying to diagnose a serious problem with one or both of them for a few months.

I don't want to derail this thread, so if you have a reply, please post it on my talk page.

Sheldor00:32, 7 March 2013
 
 

Maybe we should all sit down together and have code reviews of our robots. :P

Skotty19:50, 6 March 2013
 

Yeah, ha. That would be interesting.

Chase04:50, 7 March 2013