Beginner's Guide

Source: Internet
Author: User

1. Split into guidelines group

Take the guideline step and try to break it down as much as possible. For example, although creating a hero's altar and recruiting heroes is a sequential step, it should be split into two sets of guidelines, created, and recruited for each representative group. Ideally, each step is synchronized with the server only once. This makes it easier to return breakpoints.

Each group has a number such as 1000, and each step in each group has a small step number, such as a three-in-one. So each step of the guide has a unique number = Group number + step number, such as 1001.

   2, each step of the trigger conditions

Each step of the guidance system should not be driven by its own step, nor should it be controlled by timing, but should be driven by business logic with the game. There are several types of trigger conditions:

* Enter the scene
* Open Interface
* received the packet and successfully
* Close the interface

In order to keep the code from being scattered around the game code, it is difficult to maintain, and in these locations, let them throw out some generic messages. Then set the listener in the guidance system. and handle the logic. Of course, in order to optimize, you can set the monitoring when a steering group is opened, and then clear all the monitoring of the group after the team has finished.

   3. Limited conditions

Because the trigger condition is a generic message that is emitted very frequently (such as opening a hero interface and sending such a message each time it is opened), the guideline needs to be judged by a certain condition to determine whether the message is really triggering this guideline.

There are two things here:

1) The guidelines within the group are simple, because the team has already started, so after receiving the message, just to determine whether the current group is right, and whether the previous guideline id is a match, you can conclude that this guideline should not be issued.

2) The guidance of the group starts, this judgment will be more troublesome, the judgment condition probably divides into the following categories:

* is not currently in the guidelines (ensure that no two steering groups are present at the same time)
* The first time you open, or enter a certain
* Whether a function is turned on
* Player level
* Base Level

The combination of these judgment conditions must be a necessary and sufficient condition to open the guidelines. Otherwise there will be a problem. This is the most troublesome point, the most test of the details of the point.

   4. Breakpoint return mechanism

Each of the steering groups has two possibilities, turn on breakpoint return, and do not turn on breakpoint return. The former as long as the critical steps have not been carried out (for example, to guide the creation of the building process, to create a successful server back to the package), if the condition is met again, will also open the guidelines. The latter is as long as the guide has been opened, it will not be guided again.

The implementation method, in order to guide the team, on the server or local record a bool value, to record whether the guidance group has been opened. You need to turn on the step of the breakpoint return, set the bool value to true at the end of the critical step, and it will be the judging condition for whether this step is turned on. For a steering group that does not use a breakpoint return, the first step in the guidance is set to true.

If a guideline, the need for more preconditions, the guidelines are complex, that for the sake of insurance, or do not support the return of the breakpoint as well.

Beginner's Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.