Alphabot: An Interview with the founder of robocode, mat Nelson

Source: Internet
Author: User
Tags ibm developerworks radar
By Dana Triplett dana@orange-atelier.com

Thoughts on how to generate robocode and its future development

Dana Triplett

Freelance Writer

July 2002

If you have been paying attention to developerworks and alphaWorks, you will see a huge energy of something called robocode: robocode is an addictive game that can be used to teach Java programming. Mat Nelson has spent some valuable time developing robocode in the past 18 months. At first, I became a serious job to entertain myself and put his beloved project on IBM alphaWorks. Now it's time for him to get it. The success of robocode is described in an explosive way-and this is just the beginning.

Mat Nelson

As early as 1995, before mat Nelson began working full-time at IBM, he began to use the Java language. As the language matures, this avid player sees the opportunity to create a game that he has always wanted to play. In the late 2000 s, robocode was just a personal effort at the beginning. It became a professional job after being downloaded to IBM in the form of alphaWorks in July 2001. As the game (more than 121,000 downloads) grows and its founder's reputation grows, we asked developerworks correspondent Dana Triplett to interview mat, ask him to talk about what inspired him to create robocode and his views on the future development of robocode.

Robocode rumble Link

Download robocode from alphawork.

Read "Rock 'Em, Sock 'Em robocode" (developerworks, May January 2002) and "Rock 'Em, Sock 'Em robocode: Round 2" (developerworks, May 2002)

Enter the robocode rumble debate.

Developerworks: What is the central idea behind robocode?

NELSON: robocode is an interesting competition programming, and "fun" is definitely a keyword here. Use a few simple linesCodeThen, you can watch your robot go around on the screen and crush everything in your way. When doing this, you will learn a real language to solve the current real problem.

DW: Which games were your favorite and what do you like most?

NELSON: worms's Commodore 64 Edition (not to be confused with games with the same name currently) is the first game I have seen. It allows me to "teach" how to act in games, then watch them play. I also like strategy and role-playing games very much. What kind of games have I been addicted to over the past few years? Civilization, master of Orion, Sim City, command and conquer series, Warcraft/Starcraft series, Ultima series, and Diablo series. Of course, I have played hundreds of other games, but what I like most is those that let me build something and then let it go in the game environment, A game that depends on how it develops.

DW: Which of these games is the source of inspiration when you start creating robocode?

NELSON: worms. Certainly, other games include the C64 game mail order monsters. Some of the classic games are amazing. There were no graphics at that time, so everything had to be playable. That's exactly what I'm trying to use in robocode: It's easy to get started, fun to play, and addictive.

However, robocode is mainly inspired by a robot battle game created by Brad Schick (the game itself is inspired by the apple 2 version of Robot Wars ). I discovered robot battle in 1995 and spent countless times creating my own robot "the cleaner ". It is really interesting. I watched the robots created by others drop it out and then designed my own strategy. At that time, the main challenge was a kind of robot called seesaw bot, which would move back and forth and would be hard to hit. Cleaner encountered a lot of trouble when trying to hit them. My solution? I used 1.3 cents of knowledge to estimate the angle of seesaw and then shot at that angle. I completed the preparation with a sigh of relief, and then watched cleaner 3 climb to the competition rankings happily.

DW: Who is your audience when you start developing robocode?

NELSON: At the beginning, I was just myself. Robocode is a game I have always wanted to play, so I wrote it.

I hope that you can play robocode even if you do not know anything, and it can grow with you when you know more. It's easy to learn, but difficult to master, just like playing chess. I designed the API as simple as possible and provided several sample robots to illustrate how to use it. I hope anyone, from architects to middle school students to zoo administrators, can run a simple robot and say, "Hi, I wrote a JavaProgram!". On the other hand, advanced users quickly realized that they can use JavaProgramming LanguageAllows you to build behaviors for your own robots as you like.

DW: Are you surprised when you are playing robocode in real life?

NELSON: The biggest surprise is the success itself. I'm sure people will be interested in it, because I... but I didn't expect so many people! The number of downloads now exceeds 100,000, which surprised me. I have always been surprised to see that people use robocode in different ways, andCommunityIt has always surprised me.

DW: What are the original robot examples created by robocode players?

NELSON: There are many types of targets, including prediction targets (instead of opening fire directly to the robot, but opening fire to the place where the robot is about to arrive), tracking and recording enemy behavior, controlling different aspects of the robot with multiple threads, instant (just-in-time)AlgorithmThere are a lot more to avoid bullets, deadlocks, and optimized radar tracking. The best robots are amazing. I recently introduced a brand new strategy, that is, group, so I am very much looking forward to seeing what will happen next.

DW: What functions do you want to add to robocode?

NELSON: The first thing I want to do is to rebuild the API into a simpler, more object-oriented, more scalable, and more open API. For example, I want to see radar. setturn () instead of setturnradarright (). Once radar becomes an object, we can have different types of radar: setradar (new radar (range, speed )).

As part of the API re-design, I plan to solve two major problems: Degree-to-radians and unit circle math ). The robot will have a separate call to determine whether they want to use degrees or radians, while the other call switches between the Unit Circle mathematics or compass math. The Unit Circle is used in all the triangle methods in Java. Its 0 degrees point to the right, and its counter-clockwise direction is positive. The 0 degree of the compass mathematics is up, and the Clockwise is positive. Different programmers like different things. I hope to make the API simple and support all of them.

Another major problem is physics. Currently, the concept of robocode physics is extremely simple. To increase the realism, I am going to introduce the force vector. For example, acceleration will be partially offset by air resistance and rolling friction, not just by the "maximum rate" limit. Based on the principle of friction and semi-elastic collision, when a robot hits another side of the robot, it is pushed to one side. My previous experiments made the game much cooler than before. It is interesting to slam into a robot and make it sound sharp and slide to one side. In addition, the frontend and backend acceleration will change, and the robot can move forward faster.

Currently, the impact (ramming) has not been fully utilized, so I want to introduce different armor forces of the robot-it is still configurable. Hitting one side of the robot can cause more damage.

I also want to introduce walls and obstacles in the arena, as well as arena of different shapes, which will produce many brand new strategies.

As these changes need to introduce some complex programming, I plan to make it easier to expand robots. An expert can write a reusable machine human who looks for paths near a wall, and a newbie can just use it to quickly create a good robot (while learning how to reuse code ).

DW: Do you think robocode will become a distributed game hosted by alphaWorks in the future?

NELSON: Now I am mainly concerned about simplicity. It is unnecessary to introduce a certain degree of complexity but not make the game more interesting. Is robocode more interesting in a distributed environment than it is now (today's robocode is just a standalone game that can download other robots from it )? I'm not sure. I do think there is a space that can accommodate an infinite number of distributed Java programming games... but I think it is a new game, not robocode.

DW: Why did you choose to write robocode in Java?

NELSON: When I found Java in 1995, I was immediately fascinated. It is a concise and elegant language. Using Java can save half of the time than using other languages, and the made things can run on completely different systems. For example, robocode can run on Mac OS x, and I have never touched Mac.

Currently, Java is fast, although many people are still not aware of this. The processing speed of computers is growing at an astonishing rate. The JVM speed is faster than ever before. Java is mature, and we can even use hardware to accelerate the generation of graphics. Java is now used for the client. I hope robocode can help promote this.

DW: What makes you want to use your own programming skills to create an educational game for programmers instead of a flashy game for entertainment only?

NELSON: Nothing. I did write a flashy game for fun. We later discovered its teaching purpose.

During my 25 years of playing games, I have spent countless times learning how to play games. I read the manual, read the Help menu, read the game references, and read the tips and tips on the web. Of course, like any other game, robocode has to do the same thing. But there is a big difference: the manual is about Java. The reference material is javadoc. The Help menu is a Java tutorial. Learning to play robocode is to learn java. At the beginning, I didn't realize this.

I hope that professors and instructors who serve as Programming beginners can find that robocode is a good way to make learning interesting and promote Java so that people can choose to use Java. Using several tutorials (both inside and outside the game), I believe we can make robocode a better self-learning tool. I will try to use a few simple tasks to complete our in-game tutorials (just like "You Can Understand Java well after completing these 10 tasks "). With some guidance, anyone can become a Java programmer.

Looking back, it is obvious that it is of course an educational tool. But robocode is from a brand new perspective to the present. Robocode is a game. But when you are learning to play robocode, oh, wow! You have learned Java. I did write robocode as an interesting game, not an educational tool, and I will continue to develop it in this spirit. But if you have learned java while enjoying the fun, that's amazing!

References

Download the latest version of robocode from alphaWorks.

Mathew Nelson, founder of robocode, maintains the official robocode site. This should be the first stop for anyone who is serious about robocode. From here, you can join the discussion group hosted by Mathew Nelson. For more information, see the to-do list.

Christian Schnell's roboleleague is a robocode community and also a season manager of robocode. It ensures that all possible groups can truly participate in their competitions, manage results, and generate HTML status reports.

"Rock 'Em, Sock 'Em robocode" (developerworks, February January 2002) breaks down robocode and lets you start building your own custom, lean, and normal combat machine.

In Rock 'Em, Sock 'Em robocode: Round 2 "(developerworks, May 2002), sing Li discussed the construction of Advanced robots and how they work in groups.

Unfamiliar with Java? Please refer to "Java language essen" (developerworks, September November 2000). This is a tutorial to learn the basics of Java programming.

Want to know more about robocode? Learn some tips from experts or discover some content from the founder of IBM alphaWorks's outstanding download. Register today and order IBM developerworks Journal, which is printed on April 2002, for free.

Find more java references in the developerworks Java technology area.

About the author

Dana Triplett is a freelance writer with a major professional interest in information architecture and design as well as humanities computing. Dana is also the assistant director of slide library at Middlebury College Art in Vermont. You can contact Dana via dana@orange-atelier.com.

Submission time:

ArticleSource: None

Views: 713

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.