This tutorial helps you set your imagination free.
This is it folks, the culmination of all the knowledge I’ve attempted to share with you has led us to this point. It’s time to talk about building skill games. Building a skill game will require many of the tools we’ve discussed in previous tutorials, if you are not yet familiar with impulses, triggers, events, data sources, filters and operators you are going to want to go back and check out those lessons before you jump into skill games.
As I’m sure many of you are aware, in Trials Evo the possibilities when it comes to skill games are immense, using the tools in the triggers and events category it is basically possible to program your own game that has nothing to do with riding trials, the bike or the rider.
These types of skill games however can get very complicated so in the interest of time we are going to create a basic skill game using the bike and rider so I can show you how to actually set up the skill game in the track settings. Coming up with crazy new ways to use this is on you.
So we are going to build a hill climb skill game. For those of you who are not familiar with Trials HD the hill climb skill game is simply an uphill track and the goal is to get as high as you can, the rider who reaches the highest point is the winner. There is an example of this type of skill game in the example tracks that you can load up in the editor through the start menu.
I’ve already built the basic logic to score the game so I’ll just quickly describe what is happening here. We’ve got a set value event that pulls its value from a distance operator and sends it to a variable data source.
This event is activated by an interval trigger that is sending an impulse every tick, but first it passes through a generic filter which checks the value in the distance operator to make sure it is greater than the value in the variable data source, this ensures that maximum height achieved is always the value in the data source, otherwise that value would decrease if the player started to descend.
We also have an end event activated by either the player crashing or bailing out.
Now that we’ve got that out of the way we can check out how to set up a skill game in the track settings. We’ll begin by hitting start in the editor and scrolling down to “track setting,” then we will select “Game Mode Settings” and from there slide the “game type” slider to “skill game.” This will bring up the options for creating a skill game.
-Difficulty, allowed bikes, medal times and track description are all options we’ve discussed before. Although one difference in medal times is that this will adjust how you input the values based on what you choose as your primary score which we will discuss in just a moment.
-Instructions, just like track description, will bring up the virtual keyboard so you can enter any special instruction the player will need to know in order to play your game, these instructions will appear onscreen during the countdown at the start of your game just as they do for the in game skill games.
-“Set Primary Score” will bring up a sub menu that lets you choose how the game will be scored and how that score will appear on screen for the player. By default this is set to time, you can also choose “faults” or “data source.” In our example we will be using the height the rider reaches as our primary score so we will set this to data source.
-Next we decide where our score will be displayed on screen. We have three options here, “Top Left,” “Top Center” & “Top Right” will all display the score as a number in those positions on the screen. “Left” and “Right” will display as a meter on either side of the screen. You will see a visualization of what each one will look like to the right of the menu as you scroll through the options.
-The “Visualization” slider lets you change the appearance of the score. For the numerical scores the options will be different shapes for the black frame that the score appears in, for the meter types it will change the color and shape of the bar, again you can see what these will look like to the right of the menu.
-Next I’m going to skip down a few to “Format.” This basically decides how it interprets and displays the values. Our first option, generic is a basic whole number. Time obviously uses the time format of minutes and seconds and thousandths of a second. And distance uses meters, with up to one thousandth of a meter. You will be able to see how this value will be displayed on screen just as you could with placement and visualization.
-Now we can jump back up to Min and Max. Using these two options you can set the minimum and maximum score. When using the numerical displays it’s good to make sure the maximum value is at least as high as the highest possible score. However when using the meter you need to be a little more exact.
If your max score is set to twice as high as the highest possible score the meter will only ever be able to reach half full, likewise if your max score is set lower than the highest possible score the meter will fill up all the way but the player will be able to continue playing.
Since we are using a numerical score and I don’t yet know the max height of the level, I will just set the max to 100. If in testing we find that the player can get higher than this we can come back and adjust it later.
-The “sorting order” determines how players will be ranked on the leaderboards. Descending means that the highest score is best, while ascending means lowest score will be top of the leaderboard.
-The “label” will appear on screen with the score. As you scroll through the options they will appear in the preview to the right of the menu. There are quite a few to choose from, since our score is based on height that is what we will pick.
-Finally we will select our value target. Since our score type is set to data source we need to let it know which data source to use. Selecting “select value target” will bring up a cursor which we will use to select our variable data source that is holding our height information. Once we make this selection the words “primary score” will appear above the data source in the editor. Now let’s back out and do a quick test to make sure it’s working.
We still have some more options in the track settings so let’s go back in and check them out.
-Next we have “set secondary score” The secondary score will determine how players who achieve the same primary score are ranked on the leaderboards. Selecting this option will bring up a sub menu basically the same as the one we just looked at for primary score however you can choose to have no secondary score so in Type you will have the extra option of “none.”
For our example a good secondary score is time so I’ll set that. I’ll place it in the center and change the visualization to the rectangle. Minimum value is of course 0 and maximum is automatically set to 30 minutes which is the maximum time you can use in any game type.
For sorting we set it to ascending since we want the faster times to be best. Now that we’ve set that up, if two riders get the same height the rider who gets it faster will be first on the leaderboards.
Our next three options are to add additional counters to the game. These counters will not affect the score but can help the player by giving them visual cues to other things going on in the map.
Say for example we want to also have our rider on fire and we want to let the player know how close they are to dying from the fire.While you weren’t paying attention I set up the logic for this which is pretty basic. A fire effect with an area trigger to a fire event will start the rider on fire at the start and we can use the game variable data source set to bike fire amount to track how close the rider is to death.
-Now back in our track settings we will select “set counter 1.” This is again basically the same sub menu we had when setting the score. “Type” will be “data source,” and “placement” will be “left.” Our minimum value is zero and we know from the game variable data source info that the maximum fire amount is 1000 so we will set our max to 1000.
“Format” will be “generic” and there is no label that says “fire amount” so our best choice is probably “danger” as we are letting the player know how much danger they are in. And of course our value target will be the game variable data source that is tracking the bike fire amount.
And now we’re done, we’ve created an in flames hill climb skill game. Let’s give it a test run.
Now before I sign off and let you loose with the editor there is one last game mode setting we need to take a look at, “game character.” Changing the game character here will change it for any item in the game like our camera and physics bubble that is set to use the game character.
We don’t have the time to cover building the logic to make our custom object controllable but just to show what happens I’ve placed a chrome ball off to the side of my track on an incline. I’ll set my game character to custom object and select the ball.
Now in the editor you can see the camera and physics bubble are now connected to the ball and if I do a quick test these items follow the ball as it rolls.