Font
Large
Medium
Small
Night
Prev Index    Favorite Next

Chapter 100 Life and Death Fight

Xu Yi's streamlined version of the small virtual machine core was quickly completed within a few days after he came back. The virtual machine simulates the computer's hardware, which is equivalent to the human body, but has no soul, that is, the computer's software. The virtual machine is a computer in the operating system, and the software running in the virtual machine is the software in the software. Since this is a streamlined virtual machine, it can only support a few machine instructions. When writing programs that can be run by the virtual machine, you must also pay attention to only using the functions of these instructions, otherwise an error will be reported and the instructions cannot be recognized.

The core of the virtual machine that has been completed is equivalent to a CPU. What Xu Yi has to do next is to add other hardware resources to the bare CPU, such as adding graphical input and output excuses, plus virtual memory, etc.

After a few days, these formations were finally completed. Finally, they were well combined and integrated into a large software. Finally, Xu Yi added two layers of "shells" with excellent encryption performance outside. Xu Yi has a foundation in art, so he specially beautified the interface. According to Xu Yi's original concept, he named the game "Darwin Survival".

After the game was written, he didn't play it much, because it seemed to him that it was too simple and boring. Then he passed the game to Zhou Song and asked him to try it. Zhou Song did show great interest in it. So, after obtaining Xu Yi's consent, he put the game on the forum. As a result, Xu Yi was greatly disappointed. Not many people were interested in this game, and these people were just playing new things. When they knew what was going on, they abandoned it. Zhou Song conducted a survey and everyone agreed that the game was too uninteresting. After the program was written, a few small black dots moved on the monitor, and then they just waited to see them crawl slowly, and then it turned out to be too boring!

At this time, they proposed that it is best to complicate the game, such as diversity of action, more challenging, more passionate game, etc.

Debunk! Xu Yi really wanted to slap them after seeing their reply. He worked hard to write this thing, but no one appreciated it. He was a mistake! Xu Yi's attempt to "teach and entertain" was still in the womb.

However, Xu Yi did not give up. The suggestions of these people gave him inspiration, and even he himself became interested in the game they proposed. Xu Yi spent a long time in the conception and design of the hacker game. According to his idea, if the game was successfully written, it would be very likely to form a large-scale event.

Xu Yi no longer sleeps in class, but instead lie on the desk and stares blankly. Sometimes he will suddenly pick up a pen and record something on the manuscript paper. Yan Yu saw it strangely and asked Xu Yi many times if something happened. She has also seen the things recorded by Xu Yi on the manuscript paper, which are all block diagrams or codes, and she can't understand them at all.

Xu Yi considered that the method of executing the code completely in a virtual machine has not yet been implemented, because the project of writing a virtual machine is too difficult, and it takes a long time and great effort. In addition, the purpose of his writing this game is to increase everyone's interest in learning programming and improve the programming level. So he changed his initial idea and no longer wrote a complete virtual machine, but instead simulated the system. The code is still left to the actual computer for execution. There is no need to rewrite a virtual machine.

Simulation, as the name suggests, imitates reality. It means using certain means to establish related models and imitate some concrete things in real life. For example, the overall planning model of a certain community is a kind of real model simulation, which belongs to real modeling, and uses real objects to make the things you want to express with models. There are also some abstract simulations, such as virtual reality simulation and pure mathematical simulation. Virtual reality uses computer technology to make real things into animation (two-dimensional, three-dimensional). Here computers and software are tools for simulation; pure mathematical models are pure abstract concepts, without figurative expression methods, and mathematical functions are used to represent systems, and mathematical functions are their tools.

The method Xu Yi used was virtual reality simulation, which was expressed in two-dimensional animation. After several weeks of conception and design, he finally completed the overall framework. He named the game "Life and Death Fight". As the name suggests, the main behavior of this game is that each "gladiator" fights life and death, whether it is fighting alone or in a big melee, the purpose is to kill the other party and win the gladiator.

The most important thing in the entire game is the server of the simulation system - fightserver. All data and instructions are processed and run in the fightserver. It is equivalent to the heart of the game. The player cannot see it, but just runs at the bottom. Of course, fightsever provides a virtual venue - fightmonitor, also called "Colosseum". The external graphic representations of all gladiators participating in the fight are fought in this Colosseum.

In fact, it can be said that the simulation system server contains two programs: fightserver and fightmonitor.

Fightserver is responsible for the movement of the "Gladiator", communicates with the client, and controls the game process according to certain rules.

Fightmonitor, that is, the Colosseum, is responsible for using the operating system's graphic display function to display the virtual venue in the fightserver. The fightserver can be connected to multiple fightmonitors at the same time, so that everyone can display the situation of the fight of life and death on multiple monitors at the same time.

If there is a server, there must be a client. The fightclinet of life and death is written by game participants. It is equivalent to the brain of a "gladiator" and directs the movements and movements of the gladiator. The communication between the client and the server is information interaction through the udp/ip protocol, so the player can practically support any program system of the udp/ip protocol. Through this information interaction, the client sends instructions to control the gladiator in the Colosseum. At the same time, the gladiator can also feedback some information to the server.

The "Gladiator" in the game is an abstract data model. "He" is based on some of his own attributes: movement and combat. The movement includes "walking", "running", "acceleration", "deceleration", "turning", etc. Xu Yi designed it very detailedly, basically according to a person's actual situation. The combat model Xu Yi simplified, with only two attacks, "boxing", "kicking" and corresponding defense actions. In fact, this design is not difficult. According to the object-oriented design idea, "Gladiator" is abstracted into an object, and the others are his attributes, and the attributes can also be objects, that is, attributes can also have attributes, and so on.

The entire project is very large, so Xu Yi did not rush to write it at the beginning, but thought about it repeatedly and supplemented it carefully. Not only did he consider its overall structure from the overall perspective, but he also had to pay attention to adding new functions in the future. After all, his conception is relatively rough now, and there are still many details that have not been considered, and he will definitely upgrade it. As a large project, these factors must be considered. Requirements analysis and feasibility analysis are all knowledge of software engineering. People who have not participated in the development of large-scale projects cannot understand the importance of these steps. Secondary programmers usually start to do whatever they think of, do nothing in preparation, and just write it like this, solve the problem temporarily, and in the end, some unacceptable code will be added. Therefore, the most

The source code written is already "terrible", and even after a while, he can't even understand these codes himself. This way of writing software based on his own feelings usually does not have any problems when dealing with small software. Even if there is a problem, it doesn't take much time to write it from scratch, but when encountering large software, this development method often forces people to hit the wall. It takes several months to write a small part, so how can you start from scratch? Really experienced programmers know the principle of "sharpening a knife and chopping wood". They will carefully plan the implementation, and the entire program will be divided into several parts. It is estimated that those functions will be supplemented in the future, etc. They extract these experiences, and then after scientific research, they abstract the subject of software engineering.

Of course, most hackers' code writing habits are not very good in the eyes of orthodox programmers. They pursue program efficiency almost harshly. Therefore, some difficult codes often appear in their works. These codes are so strange that those regular programmers can't figure it out. They often sigh: "This is OK?", "How can variables be used like this?", "Oh my God! This algorithm is too clever, how did he think of it?" This can be found in the linux source code written by linus.
Chapter completed!
Prev Index    Favorite Next