Time for action - creating your own archetype

As we just discussed, archetypes are templates based on predefined script values. These parameters are exposed in the Archetype Library tab, which can be found in the DataBase View window.

In this example, we will create two opposing teams of Grunt objects using two archetypes:

  1. Open the DataBase View window by selecting the View menu and then opening View pane | DataBase View.
  2. In the DataBase View window, click on the create new library icon.
  3. Name this new .xml library Book_Example_5_Archetypes.
  4. Add an item to the library with the add item icon.
  5. Name the group Enemies and the names of the enemy to Grunt_1.
  6. Do the same for a second group called Friendly, and name the friend Grunt_2.
  7. Set the Faction parameter of Grunt_2 to Players, as seen in the following screenshot:

    Note

    You will notice that the parameter will be highlighted permanently to visually communicate that the highlighted parameter has been modified from its defaults.

    Time for action - creating your own archetype
  8. Drag Grunt_1 and Grunt_2 from the DataBase View and place them into your level.
  9. Copy a few Enemies and place them throughout your level, making sure that their attackrange is set to a suitable value.
  10. Copy a team of Grunt_2 characters.
  11. Once you switch to game mode, if the Grunt_2 characters are in range of Grunt_1 characters or vice versa, they will attack each other.

What just happened?

Using archetype entities is the best way to avoid the need to open every level across your game to change the settings of the AI. It is also highly useful when balancing and organizing your game entities.

Pop quiz – essential game objects

  1. What is the main tool used within sandbox, for white boxing geometric design assets?
    1. Database view
    2. Solid tool
    3. Road tool
    4. Archetype entities
  2. What is the entity used at the start of a level that set's where the player will be standing when a level is started?
    1. Smart object
    2. Grunt entity
    3. Tag point
    4. Spawn point entity
  3. If you want to use multiple developer collaboration on a level, how would you accomplish this?
    1. Using external layers and version controlling them
    2. Ensuring that one designer works on the level at a time
    3. Dif-merging the .cry file

Exporting to engine

Now that we have some basic gameplay entities in place, we can proceed with saving and getting the level ready to be launched in the launcher.exe application.

Even though saving the level will create a .cry file, it is extremely important to know that the .cry cannot be accessed by the launcher.exe application. To export the level in a format that can be used by the launcher application, we will have to use the Export to Engine function, which even though we used in the first example, we will explore in a bit more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.254.138