180 likes | 333 Views
2. Outline. Building ArenaIntroductionComponents, Unreal Editor and the workflowStatic meshSpecial effects, victim and lightBuilding RobotIntroductionThe robot model and procedureConstruct the robotExampleSummary. 3. Building Arena. ComponentsStatic meshes (Geometric models, obstacles)Sp
E N D
1. 1 USARSim Tutorial
2. 2 Outline Building Arena
Introduction
Components, Unreal Editor and the workflow
Static mesh
Special effects, victim and light
Building Robot
Introduction
The robot model and procedure
Construct the robot
Example
Summary This session introduces how to simulate arenas and robots. For arena building, we at first introduce the components of arenas, unreal editor and the workflow of building arena in unreal editor. Then we introduce how to build static meshes that construct the arena and other issues like special effects, victim and light. For robot building, we introduce the robot model and the procedure of building robot. Then I explain the details about constructing the robot. And at last, an example of robot will be presented.This session introduces how to simulate arenas and robots. For arena building, we at first introduce the components of arenas, unreal editor and the workflow of building arena in unreal editor. Then we introduce how to build static meshes that construct the arena and other issues like special effects, victim and light. For robot building, we introduce the robot model and the procedure of building robot. Then I explain the details about constructing the robot. And at last, an example of robot will be presented.
3. 3 Building Arena Components
Static meshes (Geometric models, obstacles)
Special effects (mirror)
Victims
Lights
Unreal Editor
The interface
UnrealEd Manual: Interface
http://udn.epicgames.com/Two/UnrealEdInterface
The basic operations
Introduction to UnrealEd
http://udn.epicgames.com/Two/IntroToUnrealEd An arena includes static meshes of the geometric models and obstacles and special effects like mirror and victims and lights. Unreal editor is the 3d authoring tool of unreal engine that helps user build unreal maps. We will build our arenas in Unreal Editor. The interface looks like this. It has different views of the 3d world, top view, front view and side view, a tool bar helps you create, adjust model and the material browser helps you find the materials. With Unreal editor, you can create or add a model, adjust the model and assemble the models together. You can also add some effect into the world. For example, we can add lights, sky box etc. to the world.An arena includes static meshes of the geometric models and obstacles and special effects like mirror and victims and lights. Unreal editor is the 3d authoring tool of unreal engine that helps user build unreal maps. We will build our arenas in Unreal Editor. The interface looks like this. It has different views of the 3d world, top view, front view and side view, a tool bar helps you create, adjust model and the material browser helps you find the materials. With Unreal editor, you can create or add a model, adjust the model and assemble the models together. You can also add some effect into the world. For example, we can add lights, sky box etc. to the world.
4. 4 Building Arena (cont.) Breakaway Example
Breakaway Example
http://udn.epicgames.com/Two/BreakAwayExample
The workflow Usually, the procedure of building an unreal map is that 1) create the world space 2) build the terrain 3) build the BSP area 4) add the world geometry, the static meshs 5) add effects and 6) polish the map. For our arena building, the workflow is that create the world space, add/adjust/align the static meshes, then we can add victims, special effects and lights. Then we add ‘player start’ and save the arena. ‘Player start’ is default place to start the game. We will introduce static mesh, victim, special effect and light one by one.Usually, the procedure of building an unreal map is that 1) create the world space 2) build the terrain 3) build the BSP area 4) add the world geometry, the static meshs 5) add effects and 6) polish the map. For our arena building, the workflow is that create the world space, add/adjust/align the static meshes, then we can add victims, special effects and lights. Then we add ‘player start’ and save the arena. ‘Player start’ is default place to start the game. We will introduce static mesh, victim, special effect and light one by one.
5. 5 Building Arena (cont.) Static mesh
USARSim static mesh
Build your static mesh
Build mesh
Texture
Convert to static mesh
Save the static mesh
Build mesh
Build BSP mesh
BSP Brushes http://udn.epicgames.com/Two/BspBrushesTutorial Static mesh.
In USARSim, we provide some static meshes like boards, pillars, stair, ladder, pipe for you. So you can quickly build your arena by assemble them together in the Unreal editor. For example, the NIST arenas are built by these static meshes. You can also build your own static mesh. The procedure of building static mesh is to build a mesh, texture it and convert it to static mesh and then save it. There are two ways to build a mesh. One is directly creating it and one is importing it from other existing models. To create the mesh, you can build BSP brushStatic mesh.
In USARSim, we provide some static meshes like boards, pillars, stair, ladder, pipe for you. So you can quickly build your arena by assemble them together in the Unreal editor. For example, the NIST arenas are built by these static meshes. You can also build your own static mesh. The procedure of building static mesh is to build a mesh, texture it and convert it to static mesh and then save it. There are two ways to build a mesh. One is directly creating it and one is importing it from other existing models. To create the mesh, you can build BSP brush
6. 6 Building Arena (cont.) Brush Clipping http://udn.epicgames.com/Two/BrushClipping
2D Shape Editor http://udn.epicgames.com/Two/ShapeEditor
Import the existing mesh
Supported format: ASE, DXF, LWO etc.
Export from Max/Maya (ActorX plug-in)
http://udn.epicgames.com/Two/ActorXTutorial And then edit it, for example clipping the brush. We also can create the brush from 2d shape. For example, create the 2d shape and then extrude or rotate it to get the brush. To import the mesh, you read in the file in supported format, like ase, dxf, lwo etc. Or we can use the plug-in to export the model from other authoring tools to unreal editor. ActorX is the one of the plug-ins that can export your model in Max or Maya to unreal editor.And then edit it, for example clipping the brush. We also can create the brush from 2d shape. For example, create the 2d shape and then extrude or rotate it to get the brush. To import the mesh, you read in the file in supported format, like ase, dxf, lwo etc. Or we can use the plug-in to export the model from other authoring tools to unreal editor. ActorX is the one of the plug-ins that can export your model in Max or Maya to unreal editor.
7. 7 Building Arena (cont.) Texture
Unreal Texturing Guide http://udn.epicgames.com/Two/UnrealTexturing
Import texture from bmp, pcx, tga, dds etc file.
Texture dimensions in powers of 2
Using UnrealEd texture browser
Convert to static mesh
Add collision mesh
Save the static mesh
Package, Group & Name
Special effects
Materials http://udn.epicgames.com/Two/MaterialTutorial
Mirror
Security Cameras http://angelmapper.com/tutorials/securitycamera.htm After we have the mesh, we need to texture it. To do this, we select a picture from the texture browser and then put it on the surface of the mesh. In unreal editor, we can build our own texture by importing it from bmp, pxc, tga or dds image. The size of the image must be the powers of 2 and don’t forget save your textures. After we are satisfy to the mesh, we can transfer it to a static mesh. And then we may need to add collision mesh to the static mesh. Collision mesh is use by unreal to calculate collision. It decides the collision volume of the static mesh. At last, don’t forget to save the static mesh. I will show you the procedure of building static mesh.
<DEMO>
Ok, for special effects. We can build special materials like glass. And we also can build the effect of mirror. The details are explained in these two papers. This picture is the similar effect of mirror.After we have the mesh, we need to texture it. To do this, we select a picture from the texture browser and then put it on the surface of the mesh. In unreal editor, we can build our own texture by importing it from bmp, pxc, tga or dds image. The size of the image must be the powers of 2 and don’t forget save your textures. After we are satisfy to the mesh, we can transfer it to a static mesh. And then we may need to add collision mesh to the static mesh. Collision mesh is use by unreal to calculate collision. It decides the collision volume of the static mesh. At last, don’t forget to save the static mesh. I will show you the procedure of building static mesh.
<DEMO>
Ok, for special effects. We can build special materials like glass. And we also can build the effect of mirror. The details are explained in these two papers. This picture is the similar effect of mirror.
8. 8 Building Arena (cont.) Victim
Set the skeletal mesh
Specify actions based on bones
start/end position
moving speed
Light
Lighting Basics http://udn.epicgames.com/Two/LightingBasics
Add Lights
Specify properties Victims are simulated by skeletal meshes with moving limbs. Every mesh has it’s own bones and we can specify how the bones move. Light effect is achieved by adding light into the arena. This is the example effect of lighting.Victims are simulated by skeletal meshes with moving limbs. Every mesh has it’s own bones and we can specify how the bones move. Light effect is achieved by adding light into the arena. This is the example effect of lighting.
9. 9 Building Robot The robot model
Objectives
Encapsulate the programming details
Building robot by assembling
Components
Chassis ? Parts
Joints ? Attached auxiliary items
Method
Connect chassis and parts through joints
Attach auxiliary items to chassis or parts In USARSim, we use robot model to simulate robot. The idea is building configurable robot. We encapsulate the programming details in the model and let user build robot by assembling the robot parts. In the model, a robot includes one chassis, multiple parts and joints and attached auxiliary items like sensor, camera, headlight. The chassis and parts are connected through joints and auxiliary items are directly attached to chassis or parts.In USARSim, we use robot model to simulate robot. The idea is building configurable robot. We encapsulate the programming details in the model and let user build robot by assembling the robot parts. In the model, a robot includes one chassis, multiple parts and joints and attached auxiliary items like sensor, camera, headlight. The chassis and parts are connected through joints and auxiliary items are directly attached to chassis or parts.
10. 10 Building Robot (cont) Build robot
Prepare geometric models (modeling)
Build static mesh(es)
Make sure the geometric model has the correct x,y,z axes
Construct the robot (configuring)
Create the robot class
Prepare the attributes and objects used for your robot
Connect the parts
Mount the auxiliary items
Customize the robot (programming)
Optional: Introduced in Advanced Session Basically, we need three steps to build a robot. At first we prepare the geometric models used for the robot. Then we configure the robot model to assemble the robot. Then we customize the robot if we want to add some functions not provided by the model. To construct the robot, we will create the robot class and prepare the properties of the robot and its components. And then we edit the configuration file to connect the parts and chassis and mount the auxiliary items.Basically, we need three steps to build a robot. At first we prepare the geometric models used for the robot. Then we configure the robot model to assemble the robot. Then we customize the robot if we want to add some functions not provided by the model. To construct the robot, we will create the robot class and prepare the properties of the robot and its components. And then we edit the configuration file to connect the parts and chassis and mount the auxiliary items.
11. 11 Building Robot (cont.) Construct the robot
Create the robot class
don't forget to change ut2003.ini
Prepare the attributes
Overall attributes
MotorTorque, batteryLife, FlipTorque etc.
Chassis attributes
ChassisMass, StaticMesh, DrawScale, Kparams etc.
Parts attributes
Karma physical parameters: KarmaParams
Use it at least once in defaultproperties
Steering and tire parameters:
TireRollFriction, TireLateralFriction, TireSlipRate etc.
Compile the robot class (ucc make) A robot class looks like this. It extends from KRobot, the robot model, and use the configuration file USAR. In defaultproperties we define the properties of the robot. For example, we define the overall attributes like motortorque, battery life etc. The chassis attributes like the chassismass, the geometric model and scale and its physical attributes, the karma parameters. We also define the attributes used for the parts. For example, the physical attributes for the linkages and the tire attributes for the wheels.A robot class looks like this. It extends from KRobot, the robot model, and use the configuration file USAR. In defaultproperties we define the properties of the robot. For example, we define the overall attributes like motortorque, battery life etc. The chassis attributes like the chassismass, the geometric model and scale and its physical attributes, the karma parameters. We also define the attributes used for the parts. For example, the physical attributes for the linkages and the tire attributes for the wheels.
12. 12 Building Robot (cont.) Prepare the parts
Linkage
KDPart class
Tire
Create your class based on KTire class
Specify StaticMesh, DreawScale, Kparams etc.
Compile the tire class
Connect chassis and parts
Joint-Part pairs
Connect a part to
its parent through
car wheel joint To build the robot, we need to prepare the parts. There are two kinds of parts, one is linkage and one tire. Usually, we needn’t create our own linkage class. For tire, we need to create our tire class. The class extends from KTire and we define the geometry model, scale and physical properties in this class. After we prepared all the components, we can assemble them by connecting them together. A part and joint construct the Joint-Part pair. This pair defines how the part is connected with its parent through the joint. The joint used in our robot model is car wheel joint. They are connected through two axes. One is hinge axis and one is steering axis.To build the robot, we need to prepare the parts. There are two kinds of parts, one is linkage and one tire. Usually, we needn’t create our own linkage class. For tire, we need to create our tire class. The class extends from KTire and we define the geometry model, scale and physical properties in this class. After we prepared all the components, we can assemble them by connecting them together. A part and joint construct the Joint-Part pair. This pair defines how the part is connected with its parent through the joint. The joint used in our robot model is car wheel joint. They are connected through two axes. One is hinge axis and one is steering axis.
13. 13 Building Robot (cont.) JointPart structure
Part’s attributes: name, class, mesh, scale etc.
Joint’s attributes: parent, two connect axes’ position and direction etc.
Assemble robot
Create you robot section in usar.ini file
Define the joint-part pairs The structure of the Joint-Part pair looks like this. It includes the part’s attributes, like name, class, geometric model, scale and physical properties, and the attributes of the joint which includes the parent, the part it will connect to, and two connection axes’ position, direction and other attributes. We actually connect the parts and chassis by edit the usar.ini file. In the file, we add the robot section and a serials of JointPart definitions.The structure of the Joint-Part pair looks like this. It includes the part’s attributes, like name, class, geometric model, scale and physical properties, and the attributes of the joint which includes the parent, the part it will connect to, and two connection axes’ position, direction and other attributes. We actually connect the parts and chassis by edit the usar.ini file. In the file, we add the robot section and a serials of JointPart definitions.
14. 14 Building Robot (cont.) Mount the auxiliary items
Method
Directly attach to chassis or part
Definition
Structure
Item, parent
Mount position and
direction
Configure
In the robot section of usar.ini, define:
Sensor(s)
Camera
Headlight After we assembled the robot, we can mount the auxiliary items to the robot through specify the sIthem structure. This structure define the item we want to add, the item class and name, and its parent the item will attach to. It also defines the mount position and direction. In the configuration file, we use the sItem structure to define the sensors, camera and headlight of the robot.After we assembled the robot, we can mount the auxiliary items to the robot through specify the sIthem structure. This structure define the item we want to add, the item class and name, and its parent the item will attach to. It also defines the mount position and direction. In the configuration file, we use the sItem structure to define the sensors, camera and headlight of the robot.
15. 15 Building Robot (cont.) Decide the mount or.
connect position
Calculate the position
The position relative to its
parent’s geometric center
Pos = (child’s center pos)
– (parent’s center pos)
Tips (using the t3d file)
Assemble the robot in Unreal Editor
Export it to t3d file
In the t3d file, find out the parts and chassis’ position
calculate the mount/connect position The position used in sItem and joint-part structure is relative value. It’s the position relative to its parent’s geometric center. That is, the position is gotten by subtracting the parent’s absolute position from the child’s absolute position. We can use the t3d file to help us get these relative values. We at first assemble the robot in the Unreal Editor. Then we export it to t3d file. A t3d file looks like this. In this file, we can find the location of the parts and chassis. With the location, we can calculate the mount or connect position.The position used in sItem and joint-part structure is relative value. It’s the position relative to its parent’s geometric center. That is, the position is gotten by subtracting the parent’s absolute position from the child’s absolute position. We can use the t3d file to help us get these relative values. We at first assemble the robot in the Unreal Editor. Then we export it to t3d file. A t3d file looks like this. In this file, we can find the location of the parts and chassis. With the location, we can calculate the mount or connect position.
16. 16 Building Robot (cont.) Example This is the configuration of the P2DX robot. The chassis’ mass is 4. The wheels are connected to the chassis. The camera base is connected to the chassis and camera pan frame is connected to the camera base. The camera and headlight are attached to the camera tilt frame and the sensors are mounted to the chassis.This is the configuration of the P2DX robot. The chassis’ mass is 4. The wheels are connected to the chassis. The camera base is connected to the chassis and camera pan frame is connected to the camera base. The camera and headlight are attached to the camera tilt frame and the sensors are mounted to the chassis.
17. 17 Summary Building arena by UnrealEd
Static mesh
Mesh ? Texture ? Convert
Victims
Special effect
Light
Building robot
Prepare geometric models
Construct the robot by configuration
Properties ? JointPart structure ? sItem structure
Customize the robot In summary, we use Unreal Editor to build arena. An arena usually includes static meshes, victims, special effects and lights. To build a static mesh we can create a mesh in unreal editor or import the mesh from other authoring tools. We can use texture to polish the mesh. And static mesh is accompanied with collision mesh that define the collision volume of the static mesh. There are basically three steps to build robot. We at first, prepare the geometric models of the robot. Then we assemble the robot by creating a robot class and configuring the robot. At last, we can customize the robot if we want.In summary, we use Unreal Editor to build arena. An arena usually includes static meshes, victims, special effects and lights. To build a static mesh we can create a mesh in unreal editor or import the mesh from other authoring tools. We can use texture to polish the mesh. And static mesh is accompanied with collision mesh that define the collision volume of the static mesh. There are basically three steps to build robot. We at first, prepare the geometric models of the robot. Then we assemble the robot by creating a robot class and configuring the robot. At last, we can customize the robot if we want.