Programming is not just so simple, its thinking is rational programming thinking, the manipulation of the machine officer is not a simple thing, what to do, how to do, how to do well.
The concept of script is very important in the program, it is more decisive in the field of game development. The scripting language allows programmers to differentiate between "hard core" and "soft core" parts of game development. The "Hard core section" generally requires a high level of computer performance, with little change in the development process and high importance. The graphics engine and the AI module are among the representatives. These modules are best suited for developing in languages such as C or C + +, which provides better performance. The "soft part" controls the "hard core" to create the final graph and a large number of objects. This section is better suited to scripting language development using LUA, which gives programmers more flexibility in trying, testing, and changing game code.
From the game developer's point of view, scripting languages can help users easily return to the game development process. It may take hours to build a "clean" game project, but the scripting language can help users quickly make changes and see the game's effects immediately. Game designers can try new ideas independently from programmers, and game art designers can create graphical interfaces to combine games and functions.
Scripting languages exist on code written and compiled by software engineers, usually run-time compiled, a simple language that allows designers or programmers to manipulate and control data.
From a game designer's perspective, developing a game using a scripting language can clearly define the underlying code and gameplay code. Typically, in a project that introduces a scripting language, the underlying module is given a core language such as interface interaction, data management, AI, and event handling, which are typically implemented using scripting languages. This division of responsibilities can make the user's game more stable, and make parallel development possible.
Note:
Three ways to develop parallelism:
1, time overlap;
The introduction of the time factor is to allow multiple processes to stagger in time, taking turns using parts of the same set of hardware devices to speed up the use of hardware turnover to win speed.
2. Duplication of resources;
Improve performance by repeatedly setting hardware resources.
3. Sharing of resources;
It is to use the software method to let multiple users rotate the same set of resources in a certain time order to improve their utilization, and improve the performance of the system accordingly.
The essence of concurrency is that a physical CPU (or multiple physical CPUs) is multiplexed across several programs, and concurrency is forcing multiple users to share a limited physical resource to increase efficiency.
Parallelism means that the computer system has the characteristics of simultaneous operation or operation, and accomplishes two or more tasks at the same time. It includes both simultaneous and concurrent meanings. At the same time, two or more two events occur at the same time. Concurrency refers to two or more events that occur at the same time interval of two.
One of the keys to implementing concurrency is how to switch multiple activities (processes) within the system.
Computer language is used to solve some specific problems, from the system control level of C and C + + to AI processing languages such as Lisp. Scripting languages often have something in common, they are commonly used in rapid development (low cost, high efficiency), and with a near-natural language syntax, and for non-programmer backgrounds People are more written and read.
Introduction to Lua
Unlike traditional scripting languages, Lua is an easy-to-integrate language (glue language). The generic scripting language is used to control repetitive tasks, and the easy-to-integrate language allows users to integrate the functionality of other languages. This gives the scripting programmer more room to play, not just to execute commands.
LUA is highly scalable and easy to integrate.
The portability of LUA allows it to run on every platform and is ideal for efficiency.
The small size of Lua can still make the program less bulky when updating programs, because the target machine space is limited.
Lua can also achieve requirements and usage for program development, and is highly efficient.
Lua in the game project
1. Game interface
2. Manage Game data
3. Event handling
4. Save and read the game state
5. Artificial Intelligence
6. Quickly build prototypes
Lua Language Self-study 01. Understanding of Basic concepts