1 / 56

Sega 500

Sega 500. Sumo Bots The AI Interface. Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles. Its finally here…. The final assignment… SUMO Bots!. Nuh…ok?. Right…so what the heck are they? Well I imagine you’ve all heard about a little thing called Robot wars…

brasen
Télécharger la présentation

Sega 500

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sega 500 Sumo Bots The AI Interface Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles

  2. Its finally here… • The final assignment… SUMO Bots!

  3. Nuh…ok? • Right…so what the heck are they? • Well I imagine you’ve all heard about a little thing called Robot wars…\ • You know! That show where the uber geeks build RC-robots and smash the stuffing out of each other?

  4. Uh?...yeah. • Well, this show, combined with Rick Smith’s Fuzzy logic assignment was the inspiration for this class. • Yes…you going to be building an AI for your bot.

  5. Well…cool! • Now, needless to say, ours is going to be a bit different from the show as we simply don’t have time to develop and play with all that code • And I don’t have time to develop the entire interface…

  6. So Why Sumo Bots? • I’ve been wresting with coming up with some more interesting / challenging assignments for some time and based on student feed back, more freedom in what they can do. • Hence, there is a minimal set of rules here.

  7. Ugh!...Rules. • I know, I know. But there has to be some rules in place to prevent “cheating” and make the bots compatible to exist in the same gametype. • But don’t worry, they are minimal

  8. But… • Even with rules , we still can have some real fun with this! • That being said, here are the objectives of the game:

  9. The Gameplay Rules • Push your opponent out of the arena. • The bots can’t be damaged, they must be pushed out. • Don’t fall out, round robin elimination. • Last Bot standing wins. Pretty simple.

  10. However, • There are some more restrictions in how you design / implement you bot. • Don’t panic…they’re not that bad.

  11. Implementation Rules • You must use the interface provide as much as possible. It was designed so that all players will have a common framework to build from.

  12. Implementation Rules • You may not directly set or manipulate your pawns properties. E.g. nailing yourself to the floor via setlocation or other such stunts is strictly forbidden. • Remember, I’m the guy who wrote original the “Kobiashi-Maru code” for Ricks class.

  13. Implementation Rules • You may not directly set or manipulate any of your opponents properties…READ ONLY.

  14. Implementation Rules • You may use whatever means you deem necessary to acquire information about the world your bot is in. However, performance will be of consideration.

  15. The Interface • As you can see from the image, the bots are really simple in their design and in the sample code, you are provided with a very basic example of how to use the interface. • Along with some debugging tools too. But please have all these removed when you submit!

  16. The Interface • The bot, believe it or not, is in fact a Karma vehicle…just like the bulldog. • Well…not exactly like the bulldog.

  17. The Interface • What this means to us, is that all the karma vehicle properties apply. • The Vehicle will accelerate, pitch, roll and break in a similar manner. • This is all build for you, you just have to build the control interface for it.

  18. The Interface • Now, like I said, you bot is much simple in its design. • As you can see, it has 2 wheels of fixed rotation (you can’t turn them on their yaw axis). • Uh…ok? How the heck are we supposed to turn the bot?

  19. The Interface • Simple, the 2 wheels are not on the same axle, nor are they linked to anything but the body of the bot. • Thus by giving the wheels different rates of rotation, you can turn the bot.

  20. The Interface • For example: • The right wheel is full forward, the left is full reverse. • This will cause the bot to spin counter clockwise in place. The net result? It drives like a tank.

  21. The Interface • To state this another way, you have 2 options to apply forces to the wheels. You can either: • Apply torque • Apply Breaks

  22. The Interface • Torque is the amount of engine power that you can apply to the wheels on a per tick basis. • You do so by applying a float between -1.0 and 1.0 where negative is reverse. This reflects the amount of MAXTORQUE which will be added to the current throttle. final function ApplyTorque(float leftwheel, float rightwheel)

  23. The Interface • You also have the option of applying the breaks which simply stops the wheels from spinning in either direction. • Keep in mind, your breaking force is much stronger that the torque. final function ApplyBreak(float leftwheel, float rightwheel)

  24. The Interface • Also, the Bot is also equipped with a short range, forward facing impact gun which is used to give your opponent a good shove towards the edge. • And, because I’m not a modeler, I just used a point sprite. function Fire(optional float f)

  25. Creating your Sumo Bot • This is actually quite simple, and I took a good deal of time in planning out this interface. • Simply, you derive you controller from SUMO_CONTROLLER. This will provide you with a pawn and all the required interface to it.

  26. Creating your Sumo Bot • The SUMO_CONTROLLER itself has some very basic functionality. Simply, every timer interval, there is a random force applied to either wheel. • This was done just to ensure that every bot will have some movement…so be sure to override this.

  27. Creating your Sumo Bot • Now, the SUMO_CONTROLLER was designed to function around two key functions. Tick and processmove which serve to pass the instructions to the pawn. • You are not obligated to go this route if you so choose…so long as your pawn receives it’s instructions.

  28. Creating your Sumo Bot • But if you do, Processmove is intended to be used to calculate all your intended movements ( applytorque / appybreak ) and then tick calls this function which updates the pawn.

  29. Creating your Sumo Bot • The controller is also provided with an interface to the Impact gun. final function FireImpactGun()

  30. Creating your Sumo Bot • And then adding the bot to the game type is as simple as adding it to the SUMO.ini file. • Specifically, the contenderlist array.

  31. Creating your Sumo Bot • The Gametype will then read this array and spawn the appropriate bots. • However, I’ve included some functionality to make your testing easier.

  32. Creating your Sumo Bot • Included is a dev mode where you can specify which bots you are going to work with. Only these will be spawned into the game. • You specify which opponents (index), A or B.

  33. Creating your Sumo Bot • Lastly, there is one thing that you MUST set, and that’s the bots name. • The Controller comes with a Sumo_name parameter which is exactly that. Put your name (nickname…whatever) here. This is how we will be telling the bots apart.

  34. Creating your Sumo Bot • Time permitting, I’ll include a method so that we can include custom skins to your pawns, but for now, if you want to swap the skins, go for it…just make sure it’s ipmorted into the .U. (life is just a bit easier this way).

  35. Creating your Sumo Bot • The reason why I am not having you model your own bots is 2 fold. • First, it has to do with how the bots are assembled. Not quit in the manner your expect. (see the lesson on karma vehicles)

  36. Creating your Sumo Bot • Second and most important, the sizes have to be consistent so that they will line up with the collision mesh I’m using.

  37. Creating your Sumo Bot • Now, this is a fairly high level walk through on setting this up, but for a good example, see the TestAI. • This is a VERY simple AI intended to demonstrate setup and movement, nothing more.

  38. The maps • I’ve also included 3 simple maps for our competition to take place. SUMO-TestArena.ut2 SUMO-SquareArena.ut2 SUMO-BattleDome.ut2

  39. SUMO-TestArena.ut2 • Is a very simple empty room with no hazards. A good safe place to start testing your AI as it can’t be killed here.

  40. SUMO-SquareArena.ut2 • Is a simple square arena ( hence the name ) which is a good place to start developing your fall avoidance / attacking algorithms.

  41. SUMO-BattleDome.ut2 • A more complex and difficult map which will require your bot to maneuver through a rather narrow passage which is only about 300 UU’s wide (you bot is about 60) before it can assault the other player. • This is where the final competition will take place.

  42. Pickups • There are also 3 types of pickup items which will appear at random in the map. • Most of the time, this will help you, but about 25% of the time, they will hinder.

  43. Pickups • Mass: • Modifies the pawns mass, more mass, means more push. • Speed • Changes the wheel size. • Refire • Changes the refire rate of the Igun.

  44. Pickups • All pickups have will time out after a short while, returning the pawn to normal.

  45. Known issues… • Yes, there are a few issues with this code. I ran into a few unexpected speed bumps in the development (always the way), particularly with the gametype. • Therefore, I may be releasing patches and fixes as we approach the end of semester

  46. Known issues… • However, the interface and pawn properties are expected to remain the same and any changes to these should be transparent to you. • That being said, here are the issues:

  47. Known issues… • Currently, the Restartplayer function accesses none, this is a result of one of the super classes trying to access Player Replication Info, which I am not using. • This is a very minor issue.

  48. Known issues… • The round robin functionality is not yet implemented as I encountered some severe problems when I tried to destroy and replace a controller from the list. This resulted in runaway loops and GPF’s. Not fun.

  49. Known issues… • Hence the actual tournament play at the moment simply restarts the same players. • This shouldn’t cause you any trouble in testing / developing your AI.

  50. Issues with the Assignment • First of, it’s going to be very easy to ½ ass this assignment and write an AI that simply goes full forward all the time. • You will be marked accordingly if this is the case.

More Related