======Pogamut 3 Lectures 2012/2013======
We welcome you our student/s :-) or anybody who has ventured up to this point while gathering info about the Pogamut 3 platform, welcome!
This page contains materials for the practice lessons of the [[https://is.cuni.cz/studium/predmety/index.php?do=predmet&kod=NAIL068|Human-like Artificial Agents (NAIL068)]] course that is/has been tought during summer semester 2012/2013 at [[http://www.mff.cuni.cz/|Charles University]] in [[http://www.praha.eu/jnp/cz/home/magistrat/index.html|Prague]], Czech Republic. The course is/was lead by [[http://ksvi.mff.cuni.cz/~brom/|Cyril Brom]]. The practice lessons are/were (mainly) backed up by [[http://pogamut.cuni.cz/main/tiki-index.php?page=About+authors|Jakub Gemrot, Michal Bída and Martin Černý]].
======Contact======
Monday's lectures, Jakub Gemrot: [[mailto:jakub.gemrot@gmail.com|jakub.gemrot@gmail.com]]
Thursday's lectures, Michal Bída: michal /tecka/ bida /zavinac/ gmail /tecka/ com
======Final test/course exam days======
=====Course exam days=====
* Monday 20.5. 2013 – 9:00-15:40 in SW1
* Thursday 23.5. 2013 – 9:00-15:40 in SW1
Exam will last cca 3-4 hours (coding) + 30 minut questionnaires filling + 5 minut „informal chat“
**Let us KNOW if none of the terms suits you!**
=====Practice Final test=====
* Friday 17.5. 2013
* 9:00-12:00 in SW2
* 12:00-15:00 in SW2
* [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Zapocet_Umele_bytost_LS_2012-2013.pdf|Practice Final test assignment (PDF)]]
* Not easy, not hard ... be smart and design your yaPOSH primitives well
* Good luck!
======How to pass the practice======
First, you should see [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-HoursDotation.xlsx| hours-dotation (XLSX)]] for the whole course.
Then you should study [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-PracticeTerms.xlsx| scoring-system (XLSX)]] for the practice that gives you hints how you can obtain points and how many you need them to pass the practice (+strategy guidelines). You know, life is a game :-)
Long story short, you have to get at least **140 points** to be admitted to Practice Final Test. If you obtain **170 points or more** you automatically pass the practice (you don't have to go to Practice Final Test). You can get points for the attendance (2 for lesson), short tests (done ONLY during the lesson, 8 max), doing your homework assignments (typically 10 points) or by having high-quality tournament bots (up to 24 points per tournament). \\
If you obtain at least **110 points** and want to pass, we will give you an extra assigment - based on your performance we will then admit you to Practice Final Test.
Test scoring details: you get 3 points if you will fill the test at the beginning of the lesson (in class ~ just by attending the lesson, you get 5 points for free!), you can get extra 5 points by answering questions correctly.
In order to get to the Final Exam of the Course you have to:
* pass the Practice (by getting enough points and/or passing Practice Final Test)
* do whatever Cyril says you have to do (participating in experiments, etc.)
======Tournaments History======
=====DeathMatch=====
* [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut-2013-DM-Tournament-Debriefing.zip|DeathMatch Tournament Debriefing Presentation]] [62 MB] including videos, tournament setup details, results, comments and hints for future work
* [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture9-DMBot.zip|All bots (compiled), match batch files for tournament replication, replays and full results]] [143 MB]
* Use [[http://pumpt.net/rK_DemoWatcher/Finest_demowatching_since_2004.html|rK DemoWatcher]] to run the replays
=====Hide&Seek=====
* [[http://artemis.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Tournament-HideAndSeekGame-Debriefing-Presentation.zip|Hide&Seek Tournament Debriefing Presentation]] [23 MB] including videos, tournament setup details, results, comments and hints for future work
* [[http://artemis.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Tournament-HideAndSeekGame-Bots_and_Matches.zip|All bots (compiled), match batch files for tournament replication, replays and full results]] [122 MB]
* Use [[http://pumpt.net/rK_DemoWatcher/Finest_demowatching_since_2004.html|rK DemoWatcher]] to run the replays
=====Tag!=====
* [[http://artemis.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Tournament-TagGame-Debriefing-Presentation.zip|Tag! Tournament Debriefing Presentation]] [24 MB] including videos, tournament setup details, results, comments and hints for future work
* [[http://artemis.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Tournament-TagGame-Bots_and_Matches.zip|All bots (compiled), match batch files for tournament replication, replays and full results]] [147 MB]
* Use [[http://pumpt.net/rK_DemoWatcher/Finest_demowatching_since_2004.html|rK DemoWatcher]] to run the replays
======Lectures History======
**Lecture 11** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-11-Slides-Conclusion.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-11-Slides-Conclusion.pdf|(PDF)]]
* Today's lesson concludes our lectures
* We will go through last tournaments - Hide & Seek and DeathMatch
* We will go through everything we have done
* We present a checklist of things you should know before practice final test and exam
* **Bonus Assigment for those with less than 140 points - Create CTF Bot team in yaPOSH!**
* The do everything single CTF bot from previous assigment does
* They cooperate with each other, details on slides
**Lecture 10** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-10-Slides-CTF.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-10-Slides-CTF.pdf|(PDF)]]
* Today's topic is Capture the Flag (CTF) UT2004 game mode and CTF Bot in yaPOSH
* Few navigation tips
* Learn about CTF game rules
* Try to combine CTF Bot actions and senses to create meaningfull CTF behavior
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-10-yaPOSH-CTFBot.zip|yaPOSH CTF Bot Stub 3.5.2-SNAPSHOT]]
* **Create CTF Bot in yaPOSH!**
* Bot arms himself before going into the action
* Bot tries to get enemy flag
* Checks whether he can score
* Bot fights enemy flag carriers and pick up own flag when he sees it on ground
**Lecture 9** - Updated slides from lecture 8: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-09-Slides-BOD-yaPOSH-DeathMatch.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-09-Slides-BOD-yaPOSH-DeathMatch.pdf|(PDF)]]
* Today's topic is advanced POSH and DeathMatch Bot
* We have shown how to make parallel actions in POSH (using action pattern and ActionResult.FINISHED)
* We have shown how to parameterize actions and senses (see slides for examples)
* We have shown that ActionResult.FINISHED triggers immediate POSH plan re-evaluation and can lead to infinite loop if not used correctly (preventing new updates from UT2004 to come and reach your plan)
* We have shown that POSH plan re-evaluates until it finds new action to execute - if it doesn't find and action to execute it will be stuck in infinite loop again!
* Always have last default rule in the POSH plan with action doNothing - this will prevent this kind of problem
* Short duration action (or immediate actions) should return ActionResult.RUNNING_ONCE, only reason to return ActionResult.FINISHED is in actions in action pattern when you want to have them parallelized (see slides for correct usage)
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-08-Sposh-AttackBot.zip|SPOSH Attack bot 3.5.1]]
* **No new Assigment for lecture 9**
* We were coding Assigment 8 from last lecture. Send us DeathMatchBot in POSH!
**Lecture 8** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-08-Slides-BOD-POSH-DeathMatch.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-08-Slides-BOD-POSH-DeathMatch.pdf|(PDF)]]
* Today's topic is Behavior Oriented Design (BOD), POSH and DeathMatch Bot
* Learn about BOD - methodology how to code intelligent behavior
* Learn about POSH - reactive planner built on top of this methodology
* Try it yourself, implementing a DeathMatch bot, remember:
* ItemType, ItemType.Category and WeaponPreferences - how to use weapons effectively
* Modules: items, weaponry, weaponPrefs and shoot
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-08-Sposh-AttackBot.zip|SPOSH Attack bot 3.5.1]]
* **Assigment 8**
* Create DeathMatchBot
* Collects weapons, ammo and armor on the map
* Fight other players
* Does not stuck (its ok, if he occasionally freezes somewhere for a few seconds, but not forever!)
* Use DM-1on1-Albatross map
**Lecture 7** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-07-Slides-Items-Weapons.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-07-Slides-Items-Weapons.pdf|(PDF)]]
* Today's topic is Weapons and Items!
* Learn about ItemType, ItemType.Category, Items and Weapons descriptors
* Know your weapons to use them well
* WeaponPreferences - how to use weapons effectively
* Modules: items, weaponry, weaponPrefs and shoot
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-05-EmptyBot.zip|EmptyBot 3.5.1-SNAPSHOT]]
* **Assigment 7**
* Create CollectorBot
* Collects weapons, ammo and armor on the map
* Try to be really clever about this, prioritize items in best-you-can do order
* I.e., don't make obvious mistakes like "rocket ammo better than 50 armor"
* Does not stuck (its ok, if he occasionally freezes somewhere for a few seconds, but not forever!)
* If he sees the item he wants is not there (e.g. you run three collector bots and the other one got it first), he re-plans and goes for a different item
* Use DM-1on1-Albatross map
**Lecture 6** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-06-Slides-AStar+Visibility.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-06-Slides-AStar+Visibility.pdf|(PDF)]]
* Tag! Tournament Debriefing
* Static visbility information
* Visibility Matrix
* A-Star implementation within Pogamut 3
* UT2004AStar
* IPFMapView
* Hide&Seek Game
* Hide&Seek Tournament announcement
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_06-HideAndSeekBot.zip|HideAndSeekBot Template 3.5.1-SNAPSHOT]]
* It contains specific DM-HideAndSeekMap.ut2 file, put that into UT2004/Maps directory in order to be able to run it
* Then you have to alter UT2004/System/startGamebotsDMServer.bat to start DM-HideAndSeekMap instead of DM-TrainingDay
* **Assigment 6**
* Implement HideAndSeek Bot, both roles
* Tournament will be held on a different map, so we do not recommend using static information, e.g. run to [1000,500,0]
**Lecture 5** - [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-05-Slides-Navigation.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture-05-Slides-Navigation.pdf|(PDF)]]
* Pogamut World Abstraction review
* Pogamut Navigation Introduction
* UT2004Navigation
* FloydWarshallMap
* StuckDetectors
* We will start from: [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-05-EmptyBot.zip|EmptyBot 3.5.1-SNAPSHOT]]
* **Assigment 5**
* Create a navigation bot that will be running around a map
* And will be able to handle gracefully stucks
**Lecture 4** NO SLIDES FOR THIS LECTURE
* Steerings and Steering Game, [[http://pogamut.cuni.cz/pogamut_files/misc/SteeringGame/SteeringGame2.0-install.exe|get Steering Game 2.0]]
* Download [[http://pogamut.cuni.cz/pogamut_files/misc/SteeringGame/PracticalsScenes.zip|practical steering examples]] for the steering game
* **Assigment 4** is OPTIONAL
* Install SteeringGame2.0, do campaign missions and send us proof you did them
* How to send proof - Save Scene after completing each mission, send us the resulting xml files
* For each completed mission you will earn one bonus point (max 10)
**Lecture 3** [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_03-Slides.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_03-Slides.pdf|(PDF)]]
* Running around UT2004 environment
* Sensors - self, players
* Effectors - move, jump, dodge
* Tag! Game
* Tag! Tournament announcement
* Download [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_03-TagBot.zip|TagBot project template]].
* It contains specific DM-TagMap.ut2 file, put that into UT2004/Maps directory in order to be able to run it
* Then you have to alter UT2004/System/startGamebotsDMServer.bat to start DM-TagMap instead of DM-TrainingDay
* **Assigment 3**
* TagBot! First real scenario that requires smart AI!
* Create the best TagBot, win the tournament and score extra points!
* Don't forget that the TagBot should implement both roles 1) seeker as well as 2) runner
* GOOD LUCK!
**Lecture 2** [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_02-Slides.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_02-Slides.pdf|(PDF)]]
* Pogamut gentle introduction
* Virtual worlds, virtual agents
* Basics of Pogamut - interface, API
* How to run your first bot
* Download [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-02-EmptyBot.zip|EmptyBot example]] and [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Lecture-02-ResponsiveBot.zip|ResponsiveBot example]].
* Want to know more? Or did you forget something from the lecture? Read [[http://pogamut.cuni.cz/pogamut_files/latest/doc/tutorials/00-EmptyBot.html|EmptyBot tutorial]] and [[http://pogamut.cuni.cz/pogamut_files/latest/doc/tutorials/01-ResponsiveBot.html|ResponsiveBot tutorial]]!
* **Assigment 2**
* Easy and fun! :-)
* Fool around with your first Pogamut bot
* Create a follow bot that will listen to your commands! :-)
**Lecture 1** [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_01-Slides.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_01-Slides.pdf|(PDF)]]
* Practice scoring details - read them very carefully
* Java Revisited
* Which Java version is required (recommended for advanced users), what IDEs you can use
* How to install SVN and Maven + "how-to-use" links
* **Assignment 1**
* Install Subversion and Maven
* Finish implementation of Java classes inside the project [[svn://artemis.ms.mff.cuni.cz/pogamut/trunk/project/Incubator/Lectures/JavaRevisited]]
* Confirm that your implementation is correctly working by successfully passing all bundled JUnit tests
* Implementation of "Listeners class" is for extra points (challenging task) ~ you can let all "Flag" tests in "failing" state
**Promo** [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_00-Slides.pptx|(PPTX)]], [[http://diana.ms.mff.cuni.cz/pogamut_files/lectures/2012-2013/Pogamut_3-2013-Lecture_00-Slides.pdf|(PDF)]]
* Slides that gives you an overview what ordeal (translate as 'fun') awaits you during practice lessons :-)
* Ok, we do not want to scare you - honestly, we think that practice lessons we have prepared for you are lot-of-fun and will inspire you to experiment with AI within the boundaries of UT2004 virtual environment
======Score tracking=====
* We will continually track your Attendance/Tests/Homeworks/Tournaments
* Provided as Google Doc, mail us to receive the link (cannot be made public due to the law)
======Pogamut 3 platform======
**Installers:**
* Pogamut UT2004 3.5.0 and Pogamut Emohawk Installer 3.5.0. Get them at [[http://pogamut.cuni.cz/main/tiki-index.php?page=Download|Pogamut download page]]
* Date: 25.2.2013
* For Pogamut UT2004 Installer you have to have UT2004 installed somewhere.
* Both installers will install: Maven 3.0.4, NetBeans plugins, Pogamut Example archetypes. Note that you need [[http://netbeans.org/downloads/7.1.2/index.html|NetBeans 7.1.2]], otherwise Pogamut archetypes won't be accessible from NetBeans context menu (New Project -> Maven -> Project From Archetype -> Local Archetypes Catalog).
* Before you launch the bot, you need to start Unreal server:
* For UT2004, go to directory Unreal Anthology/UT2004/System and there launch startGamebotsDMServer.bat. To observe the bot in the environment launch startUT2004low.bat from the same directory.
* For UnrealEngine2Runtime, go to directory UnrealEngine2RuntimeDemo/System/ and there launch startEmohawkServer.bat. To observe the bot in the environment launch startUE2Runtime.bat (after the server is launched).
**Alternatively**
* If you have UT2004 installed, you can follow guidelines of tutorial Pogamut 3 quickstart tutorial found at [[http://pogamut.cuni.cz/main/tiki-index.php?page=Documentation|Pogamut Documentation page]]. However, we recommend to use installers above.
======FAQ======
**Q:** **I am missing help on all methods, attributes and classes (Javadoc is not working). :-/**\\
**A:** In NetBeans open your project and right click the **Dependencies** folder, click **Download Javadoc**, NetBeans should now download Javadoc and the help should be working. If it is not, click also **Download Sources** and after it is done (watch lower right progress bar) restart NetBeans. Sometimes NetBeans refuse to show help - it can be usually resolved by trying to **Download Javadoc** several times.
----
**Q:** **How to get account in our computer laboratory for non-MFF students?** \\
**A:** \\
* **a)** Print and fill up this form: http://www.ms.mff.cuni.cz/students/externisti.html.cs
* **b)** Get the network administrator of students school to sign the form above (if you are unable to get the signature, then ask Cyril Brom)
* **c)** Go to the SISAL, Mala Strana, fourth floor - in the corridor in the back and there they will create an account for you\\
----
**Q:** **How do I create PogamutUT2004 Bot project in NetNeans from archetype?** \\
**A:** Its easy. Simply click New Project, from categories choose Maven. From projects choose Maven project. Click on Next. Click on Add... button and the NetBeans will ask you about archetype details. That is :
* **Group Id:** cz.cuni.amis.pogamut.ut2004.examples
* **Artifact Id:** 00-empty-bot-archetype
* **Version:** 3.5.0
* **Repository:** http://diana.ms.mff.cuni.cz:8081/artifactory/repo
Full list of available archetypes can be found [[http://diana.ms.mff.cuni.cz:8081/artifactory/libs-snapshot-local/archetype-catalog.xml|here]]. (always use repository above)
Also be sure that NetBeans is using Maven 3.0.4! Obtain Maven from here: [[http://maven.apache.org|Maven 3.0.4]]. After unpacking, go to NetBeans->Tools->Options->Miscellaneous->sheet Maven->set Maven home directory.
----
**Q:** **I have a problem with imports - the NetBeans help doesn't work. :-/**\\
**A:** Two solutions, either add PogamutUT2004.jar and PogamutCore.jar to libraries to
your project (the help should be working), or add imports to your class manually.
Some useful imports:
import cz.cuni.amis.pogamut.base3d.worldview.object.*; //for Location, Velocity..
import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.*; //GB commands
import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.*; //GB messages
----
**Q:** **I am a student and want to use Pogamut, but I don't have UT2004.** \\
**A:** Unfortunately school cannot provide you with UT2004 - however you are free to use Pogamut in SW1 laboratory (when it is free) and there is one Pogamut computer in MS lab (far end against the entrance) where we can create an account for you. Second solution is to use UnrealEngine2RuntimeDemo exclusively, which is free for educational purposes and which is installed with Pogamut Emohawk installer.
----
**Q:** **How to disable master server authentication in UT2004?**\\
**A:** In UT2004/System/UT2004.ini find **[IpDrv.MasterServerUplink]** and set the following:
[IpDrv.MasterServerUplink]
DoUplink=False
UplinkToGamespy=False
SendStats=False
----
**Q:** **I'm trying to setup @EventListener or @ObjectClassEventListener in POSH actions (or senses) and they are not working, why?** \\
**A:** These listeners works only in XxxContext classes. You have to declare them there and then access them from actions or senses.
----
**Q:** **How can I tell what version of Unreal Tournament 2004 I am running (v. 3369 required)?** \\
**A:** Just start Unreal Tournament 2004 GUI, open the Join Game tab and the news page will have the number in the upper right corner.
======Acknowledgement======
Creation of this course was partially supported by the project Integration of IT Tools into Education of Humanities, which is financed by the European Social Fund, the state budget of the Czech Republic, and by the budget of Municipal House Prague.
Inovace kurzu v letech 2011/2 a 2012/3 byly podpořeny projektem CZ.2.17/3.1.00/33274 financovaným Evropským sociálním fondem a rozpočtem hlavního města Prahy.
{{:lectures:loga.png|}}
**Evropský sociální fond** \\
**Praha & EU: Investujeme do vaší budoucnosti**