My mindset inertia

Source: Internet
Author: User

Yunfeng's latest articleArticleAfter talking about the implementation of buff, I have been doing this during this period of time, so I have made more plans to look at the cloud. After reading this, but I found that I was always in the inertia of thinking.

In my implementation, the interface is basically similar to the solution of my colleagues mentioned by Yun Feng. It is also an effect of executing a buff at the beginning, and the opposite effect is executed at the end. The floating point number error has not been taken into consideration, but we first encountered the problem that some of the upper and lower limits of the attribute values caused by the addition of the value does not match the value subtracted.

Later, I thought of a solution, but it was similar to the solution of saving the basic value mentioned by cloud wind. The solution of recalculating the current value every time the buff changes. However, in our implementation, we do not traverse all buckets to get the attribute append value, but each attribute has two additional values, the append vertex value and the append percentage value, when a value is added to a buff, the appended value is added to the corresponding position. When the current value is recalculated, the value is calculated based on the base value and the two accumulated values. That is to say, each change contains four values.

It seems that this solution still has its advantages. In the game, not only does buff change the player's attributes, but also equipment and passive skills. After this scheme is used, all the attribute change operations have a unified method. If the apply scheme of the buff mentioned by Yunfeng is used, a buff change is made, not only do you need to traverse all buckets, but you also need to traverse the current device list and the passive or talented skill list. Similarly, other changes also need to be done. Of course, if you want to make all the changes to attributes into a buff to unify the interface, there are always methods, and of course there must be better.

The analysis of technology is an out-of-the-box question. I think of the reason why we design it like this instead of another solution. Why didn't we think about the solution mentioned by Yunfeng or other solutions. This is my mindset inertia. When I get the design requirements of buff, my first reaction is to give it a start time effect and an end time effect, the future scheme design will focus on these two actual needs.

When I encountered a problem in the implementation process, I also fully carried forward the spirit of great courage and never looked back until the current solution was introduced, and the planners began to configure it. I have never asked myself whether this solution is the most suitable, whether there are better solutions, and whether these designs are reasonable. Of course, no one else has doubts about this. As the solution advances step by step,CodeWhen the number of rows increases, I don't have the idea of looking back. All I want is to close up the mess as soon as possible.

Now that the entire design has been completed, we can have the opportunity to jump out and look at the previous path. The feeling is like seeing a villain in a maze, constantly jumping east and west, although energetic, but the method is not properly found, so many circles around it.

This is what I feel about the entire project. I didn't see a good plan. It was always like brainstorming. I was also a person brainstorming. I did what I got, when you think of a solution, you can start to write code. When you see the problem, you can think about how to implement the next step. When you want to interact with other modules, you can consider the provision of interfaces. There is no overall sense. Of course, this is just my personal experience. I just want to talk a little bit about it.

Related Article

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.