Week 10 Notes
Final Project Critique #2
Each student present the progress of final project for 10 minutes. We will have about 5 - 10 minutes discusssion afterward.
* Now, we are about in the middle of project development schedule, therefore, your progress should be significant and well-defined to finish it by the end of this semester.
Grid in Virtools
A grid is 3D entity make up of squares and layers that store information in Virtools. It is used mainly for path finding, triggering events based on a square's value, and collision detection. You can think of a grid and 2D property map for 3D environments. You can create a grid by clicking "create grid" button in tool bar group.
a. Collision Detection & Avoidance (example)
Similar to what we used for common collision avoidance, we can use slide BB like method. Recall that we used Object Slideer before. Now, we can use Layer Slider BB from Grid/Basic directory. In this BB parameter setup, we need to specify grid layer to use for collision calculation. Select grid and go to setup panel.
Crate new layer and drag it to execution window, then paint some of squares, which indicating blocked area - obstacles there. Then, your Layer Slider should work properly. Follow in class lecture.
b. Path Finding (example)
Path finding is one of most typical type of artificial intelligence in game, which is very useful for your NPC (Non-Player Character). Imagine that we have environemtns filled with a bunch of obstacles that our charachters can not pass through, then, there should be a way to walk around nicely. Player character can do this as a user controls it while NPC needs some automation.
Let's re-use our maze example from prevous class. We can create grid and its layer to specify walls in the maze. And then, consider two more BBs, Grid Path Solver and Character Grid Path Followe BB. You can find those from Grid/Path Finding directory. To find the path, we need to set target position first. It can be fixed point or we can feed a position parameter (vector) to Solver BB. Once the solver generate path solution, then Follwer will take care of automatic movement to reach goal position.
* In class exercise.
Let's put a magic item in maze example. Once, character find this magic item, system will automatically drive your character to find exit. You may use collision detection BB to identify you character find magic item. (i.e. pass through the item to acquire). Also, Send / Wait Message BBs are useful to trigger events among other entities. Show some effect when you acquire magic item. For intstacne, particles, mesh explosion, sound, and etc.
Interface
* Interface in this context refers 2D UI for an application. Screen space UI components are another type of means to communicate with a user. Mainly, it displays information such as game status, scores, items, and etc. It also can be used as interative part (i.e. buttons for mouse click). We use 2D frame object mostly as place holder for UIs. You can create 2D Frame from tool menu.
2D Frame Object
Among many of parameters this object has, the coordinate scheme is most important. It defined whether we want to specifiy the dimension of 2D rectangle based on absolute value or relateive ratio to screen space. Change this option (Homogeneous Coordinate option in setup panel of 2D Frame object) to see the difference.
Text Display: This is the simplest way to print/display text on screen space. It only need Text Display BB (Interface / Text directory) and specify its contents. (see example GUI_TextDisplay.cmo) This even do not require 2D Frame object.
2D Text: This BB is applied to 2D entity (2D Frame) in the scene to create screen space 2D element. You need to create system font and set its property before use 2D Text BB (Interface / Text directory). See example GUI_2DText.cmo from pick-up directory.
Buttons (push button)
This is interative GUI interface where you can click with mouse button. Create 2D Frame entity first, then apply Push Button BB from Interface / Control directory. This BB has various parameters such as materials for mouse sensitive visuals. See the example composition file, GUI_PushButton.cmo.
* In class exercise.
Let's make a simple item UI for a game. There will be three empty slots at the beginning and as your character acquires items while wandering around, it will appear in the dedicated slot. You should be able to drop item by double-click on one of the slot where it has a item. (Example)