So far, my thoughts are still messy, and I have already considered it clearly, just like steeven. I think the framework is very big, and I don't know the sequence to use. Sorry if I'm confused!
In this framework, I want to first put forward two concepts: 1. Field; 2. environment ). And a very common concept involved: Map)
Let's talk about the "field" first ". The so-called field refers to the physical rules similar to the "Gravity Field" and "magnetic field". Of course, the physical field is generally related to the "force, at the same time, it is an abstract environment that is invisible and has a long-distance impact. The field I mentioned here only embodies the concept of a physical environment, which may contain some (simplified and abstract) Physical rules. For example:
Gravity Field: used to restrict the location of objects on a map. If an upward force cannot be generated, the object will eventually fall down.
Sea level field: used to describe the whole sea level. When necessary, you can obtain the energy required for moving on the ground.
Visible Light Field: used to describe the graph we see in common circumstances.
Infrared field: used to describe the heat on the map. All objects emit more or less heat.
Chemical field: used to describe the distribution of chemicals on the map. Information can be released by the legacy chemical smell and obtained by the "smell. Even chemical fields can be combined with "substances. (This is described in post later)
Sound Field: used to describe the sound. It can communicate information through talking and shouting, and mobile will also leak information.
And so on.
So many games are not required. A game may only use one or two of them, but it is also possible to use them, for example, all these fields are required for the terrarium I want to reproduce. So how do we describe these fields? It must be a simplified form. For example, a chemical field uses an int to represent a chemical, and another int to indicate the strength of the chemical. A single location may have multiple substances, or a single location may have only one substance, but there are other substances nearby. I have not considered these two forms clearly, but one thing is certain, that is, let the "game object" think that there are several "chemicals" here ".
For example, sound. One int represents the frequency, and the other int represents the intensity. I think this is enough to pass a lot of information.
Some people may say that there is still a gravity field in the visible light field. Shouldn't it be a map? Yes, most of the time it should be a map, or even a chemical field is also a map, such as the ore and oil on the StarCraft, can it be regarded as a chemical field? However, we need to consider a general framework, so we must strip this concept from the map. Otherwise, it is difficult to define this map object, or the defined map object is very adaptable! For example, we consider: 1. interstellar; 2. quakeii. Therefore, interstellar systems may need chemical fields, but quakeii does not have a gravity field. But what is the role of a chemical field?
Of course, my consideration is not very mature, because so many fields may occupy a lot of resources, including CPU usage and memory usage. However, I still have to propose this concept. As for how to design it and make it acceptable to occupy resources, it is another thing.
The second question is "environment ". The so-called environment refers to some "world" constants, which are equivalent to coefficients. These coefficients affect the physical laws or conservation of the entire "game world. Maybe everyone will say: Isn't coefficient easy? Just find a place to define a public static thing. Why should we develop a concept? Let me describe the following questions:
1. First, there is a major drawback in finding a place, that is, game developers do not know where to set and adjust these coefficients, or they need to find them everywhere. For gravity, you need to go to gravity. For chemistry, you need to go to chemistry ...... It's annoying to find it.
2. Second, I wonder if you have considered this question? Some coefficients may affect other coefficients. To adjust the value of a certain coefficient correctly, developers have to adjust a series of values. This problem must be addressed. For example:
Standard sea-level gravity acceleration value: G
Sea-level gravity acceleration adjustment coefficient: gfix
Earth radius value: rearth
Standard unit weight movement energy consumption value: Burn
Unit Weight movement consumption energy adjustment coefficient: burnfix
The formula for calculating the energy consumed by an object with a mass of m at a sea level H-shift may be as follows)
Needtoburn = m * (gfix * g * rearth/h) * (burn * burnfix) = gfix * g * rearth * burn * burnfix * m/h
We can see that all the values in the last equation must belong to the world constant. To speed up the calculation of this formula, there should be a "sea level unit weight movement consumes energy value burnsealevel = gfix * g * rearth * burn * burnfix ", therefore, the computation of needtoburn can reduce multiplication by four times (after all, the frequency of modifying the world constant must be very low ). The problem arises. If you provide a console command to modify the gfix, this command will be very troublesome. In addition to modifying the gfix, you also need to modify the burnsealevel, and Blablabla, which is not mentioned here.
If there is an "environment", we only need to define some constants and some calculation formulas for "pseudo constants. When a constant is modified, the "Environment" will help us automatically update those "pseudo constants". Developers only need to define them once and modify them once (instead of multiple times ). Is it convenient?
Finally, let me talk about the map. Some concepts have been removed from the map, so it is necessary to talk about what is on the map. The map contains the definition of the map size and the "map" in the traditional sense ". That is to say, there are some objects on the map, including characters, items, buildings, and traps (organs)-used to trigger certain events.
This time, let's continue. Next time, you may say "regular" and/or something else.