CS 470 ARTIFICIAL INTELLIGENCE
Winter 2003, Instructor:
Jeffrey Horn
- Due in one week (Tuesday, Feb, 18, 2003)
- Go to C:\Program Files\GStudio\template
- Make a backup copy of the file move.wdl
- Download this copy of move.wdl and copy it over the existing move.wdl
- Run 3DGS. Open up office or terrain and run the game (no need to build). Try out our "HUD". (try hitting the "k" key to see the cursor where the distance sensor should be pointing.
- Then edit move.wdl with a text editor.
- Go to line 158, and implement the following:
- Place three duplicate distance sensors, one looking right, one looking left, and one looking directly behind.
- FINAL EXAM
- Part I 3D GAME STUDIO, Flocking
- Due by end of Finals week!
- Implement flocking behavior. By "flocking" I mean Craig Reynold's work:
- Concentrate especially on the second item. Print out this paper, or save it locally. It is great!
- Specifically, I want to see a bunch of people, staying together in a group while moving together following a leader across a terrain while avoiding obstacles. Think of a tour leader and a group of tour takers, in virtual NMU. So an additional goal is to make the crowd look realistic. Think of them as extras in a movie, and you're the director! In other words, make them each move a bit randomly, looking around, turning towards each other and talking for a bit. E.g., what should you do it you lose track of the group?
- Here are other useful pieces of code and data:
- But here is all you really need, and it all compiles and works right now! Try it, and then see if you can improve it, as described below:
- Derek's Dungeon (already loaded with "crew" guys, defined to use the sheep_follow action in the file herding.wdl . Copy all of the files you will find in the link to Derek's Dungeon, to your folder C:/Program Files/GStudio/work
- The Herding script files, which actually just consists of the single file herding.wdl right now. Copy this file to your folder C:/Program Files/GStudio/template. Then edit it with a text editor. See comments in the code, and discussion below.
- This assignment is an experiment. I will grade it very subjectively.
- I want to code up a bunch of Craig Reynolds' steering behaviors as Cscript functions, then use them modularly, in different ways. For example, how does Craig Reynolds combine separation, cohesion, and alignment behaviors to get flocking? Does he do it different ways?
- For us, we have four angle_vectors to combine: player_follow, separation, cohesion, and obstacle avoidance. See the code in herding.wdl. Right now, we are linearly combining these with weighted coefficients. Try changing these to improve the natural look of the "tour group". To do this, first open up herding.wdl with a text editor. Change the coefficients. Then save. Then open up the "DEREK_~1.WMP" file by double clicking. This should start up the WED (world editor from 3D Game Studio). If not, then open up WED from your Programs menu, and then go to "file" and "open" up "DEREK_~1.WMP" from in there. Then simply "run" the game (click on "!" in upper menu bar of WED). This will read in the latest version of all WDL (script) files. Note that if you change the actual level in the WED (e.g., adding entities, or changing the action defined by an entity's "properties") then you have to re-compile the level (but make sure you choose "entity update" only, in the compiler menu box. Otherwise, if you compile the whole level, you will have to wait up to an hour (on last year's model ThinkPad)!
- Here is what to turn in:
- Do one of the following:
- get better, more realistic tour-group behavior, by modifying the coefficients in herding.wdl (c_follow, c_obstacle, c_cohesion, c_separate) and modifying the code for those behaviors, (including possibly adding a bit more randomness, via random(x), or changing the neighborhood radius, or making the neighborhood radius change with the situation, or having a different radius for each behavior, a la Craig Reynolds), or
- improve on any one of the behaviors, such as player following, cohesion, obstacle avoidance, or separation, by modifying the code for those behaviors, (obstacle-avoidance in particular can be improved by adding some more traces!), or
- adding a fifth behavior, to be combined with the other four using a weighted sum, (e.g., leader-avoiding, to get out of the way of the tour leader, as Craig Reynold's describes), or
- achieving another interesting group behavior through blending of the individual behaviors (e.g., surrounding the player, by chasing and then achieving a fairly uniform distribution around the player once the player stops, or secret-service, where the group surrounds the player while the player moves wherever he/she wants to, providing a blocking "screen" around the player).
- Turn in your herding.wdl file, and any others you edited, such as DEREK_~.wmp. If just one or two small files, you may email them to me. If too much to email, then ftp to "virtual.nmu.edu" using your username and password which I will get to you shortly.
- Also, in a README or email message, BRIEFLY explain WHAT you did, and HOW (not in detail, just overall, so I know where to look in the code, which should be commented enough to allow me to find your original code and grade it quickly!
- Part II (TBA)
- Part III (TBA)