Introduction to MMOs (1)

Source: Internet
Author: User

Introduction to MMOs (1)

-- Starting from begin () end (), the interface is abstract and the function is modular.

Zephyr 201303

When I was a beginner at DirectX,

It was a bit confusing to call the begin and end functions at the beginning and end of the rendering frame,

Why? How? At that time,

I am not very concerned about this problem later.

 

A binary export tool for localized data was written several days ago,

At first, because I used the data of the continuous memory address,

Therefore, the interface for setting the incoming data pointer and data packet size is simple,

After judging the data validity in the module, the I/O operations are serialized directly,

Then,

Because data such as list and tree used by some colleagues also wants to use my ready-made interface,

The problem arises,

How to export?

 

There are two methods,

First, set my export toolCodeSimply copy one copy and implement it with its own modifications;

Second, improve the interface to make it universal;

 

On the one hand, the MMO process is naturally tight and the node time is approaching,

On the other hand, the debugging staff and time are insufficient, and the node requirements are high,

How can we decide?

Not set yet,

I/O handles cannot be closed in a certain time sequence,

As a result, the entire writer and the corresponding data cannot be read,

This is a hidden bug, and it is a coincidence to discover it,

Secretly, my colleagues have a lot of work on hand. If the code is copied directly,

I cannot escape the bug account at that time,

I decided to reconstruct the interface immediately,

Two steps were taken in the coffee house,

I think of the commonly used Lock unlock functions of buffer such as VB IB,

Can this happen to me? Suddenly,

Isn't that the begin and end interfaces in DX ?!

DX command submission, buffer writing, and export of binary data ,,

Isn't it all the same thing ?!

In my heart, there were 10 thousand gradients, and they were so stupid,

Summary

"To cope with complicated and discontinuous data export,

You can first input the target type to be exported to begin (),

Then an archive pointer, such as ue, is exposed by the export module,

After the archive operation is complete.

Then, flush is completed by the end () function of the export module,

Unified interface for free operation ."

Working close to work on Friday, people are also excited,

Final interfaces, encoding, debugging,

The result is about 50 minutes, and it does not take much time,

Far less than expected.

 

Things are simple, and the method is simple,

After the end of the weekend, I felt uneasy,

However, if I did not mention the bug,

Will this module remain unchanged?

The answer is probably always yes...

Working hours are not short,

Project troubles, poor salary,

Make your enthusiasm more and more cold,

Clever, hack, task for task,

I often know and understand,

In this case, it is hard to learn how to grow,

 

Then we need to summarize and improve,

Starting from the root cause of the problem,

It was due to the first resistance,

The prescription is not as simple as "Be brave to reconstruct and repeat again" or "No uugly code anymore,

It's a good habit to learn,

Remember what you think and think habitually,

After work, there are also a bunch of books left behind,

Just calm down and carefully digest and summarize,

Nonsense for half a day, Yan Shu Wen's Zen of MMO,

Leave it alone or simply

Let's just talk about why,

Hope to help later users.

 

First, MMO is a complete software engineering project,

Plan, code, check, improve,

Their respective duties are inseparable,

As a code farmer, what is important first is a broad view.

First copy the book:

"

Software Engineering, phase

Definition phase: Feasibility study preliminary project plan, Requirement Analysis Development Phase: Outline Design, detailed design, implementation, test operation and maintenance phase: operation, maintenance, waste

Meaning

Software Engineering process refers to a series of software engineering activities completed by software engineers with the support of software tools to acquire software products, including the following four aspects:

1, P (Plan): -- Software Specification Description. Define the functions of the software and the restrictions on its running. 2, D (DO) -- software development. Develop software that meets specifications. 3, C (check) -- software validation. Confirm that the developed software meets your needs. 4. A (Action)-Software Evolution. The software is continuously improved to meet the customer's new needs during operation. These also apply to all aspects of life and work. Principles 1, abstraction 2, Information Hiding 3, modularity 4, localization 5, certainty 6, consistency 7, completeness 8, verifiable "as a member of the project, of course, I have only one goal,

Maximize benefits,

How to achieve it?

The answer is "everyone.

In addition to improving the quality of the project, it is naturally impossible to open source,

That is, throttle, and throttle is not only the R & D cost of dead-end workers,

The better way is to improve efficiency,

To return to the essence, I have realized that the efficiency bottlenecks often occur in projects:

"

Architecture cost,

Interaction cost,

Debugging cost,

Communication cost

...

"As the first major block of the principles mentioned above is abstraction, concealment, and modularization.

Strictly control the granularity to prevent excessive coupling,

This can effectively prevent unnecessary project consumption caused by the above costs,

In practice,

That is, interface thinking, reuse thinking,

In the actual encoding process,

Overall architecture, planning,

Continuous abstraction, refinement,

Gates, the richest man, once said that truly talented people are smart and lazy people,

Smart lazy people have extreme spirit,

Will strive for a "once and for all" SOLUTION

Because of their efficiency,

Much larger than the time for subsequent tests and debugging.

Therefore,

We need to constantly sum up and think,

Improve efficiency,

Find a good way to reduce errors and be lazy ~

 

 

@ Todo

There are still a lot of ideas behind it,

Collaboration, cooperation,

Architecture, data structure andAlgorithm,

In line with the principle of just talking about why,

I'm going to say this all over again,

...

 

 

 

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.