The Function of software

A computer is one part electronic circuitry and mechanical components connected together. Software provides the digital instructions to these various components on how to operate and function together to complete a task or objective, and what the sequence and duration of the various functions shall be. Software is a program, which in turn is a series of instructions.

The microprocessor of the computer only responds to on / off electrical charges that represent simple instructions in binary notation code patterns. These “1” and “0’s” are known as machine code. Machine code adds up to address locations of data and simple operating instructions (add, subtract, etc.). Machine Language produces this code and is the first software level above the actual circuitry and processing hardware itself. Line after line of machine code are decoded by the microprocessor and its various sub-systems to further decode and execute instructions, access various memory locations for data and then manipulate the data to produce a desired end result.

However, rather than write code in binary machine language, the author of a program will use an alphanumeric language which is easier for humans to read in order to produce a source code that can be translated into machine code by either an interpreter application or a compiler application. At a basic level, these languages correspond with pre-determined binary patterns, and are designed for the particular construction of a specific microprocessor. Most recently, the higher languages are compatible with a CPU platform / architecture. Some languages are structured to either be Interpreted into machine language or Compiled into machine language (some programming languages can be both).

An Interpreter works with alphanumeric programming languages that are a level above machine language. This program works through a line of the programming language and the programming language is simultaneously interpreted / translated into object code or executable machine code and then is immediately executed (just the one line), by-passing the requirement that the entire programming language be converted to machine code prior to execution. The process is less efficient due to, as indicated, it usually is interpreted and executed at a line at a time and if it repeats a line then it must interpret that same line again. The Interpreter is beneficial for debugging a program as it will display exactly where a bug (especially syntax errors) is as the line will not execute and the program will cease running.

A Compiler can also translate alphanumeric programming language source code to machine language. The difference with and Interpreter is that the programming language is all translated to machine code (compiled) by the Compiler program prior to execution. Then all lines are executed sequentially rather than having an alternating line-by-line translation and execution similar to an Interpreter. A complied programming language source code is also alphanumeric and can be written in abstract ideas rather than specifying actual parts of the microprocessor. The compiled program language instruction file at this level is independent of the specific microprocessor. Rather, it is a universal instruction file understood by various different programmers. It is the Compiler Program (not the programming language) that needs to be specifically tailored to the individual microprocessor architecture. The end result of the Compiler program still tends to be slightly less efficient as the programming language itself needs to be generalized to be flexible enough to solve different types of programming objectives.

Assembly Language, one of the original low level programming languages, is an alphanumeric code that is converted into machine language/code by an Assembler program. There is normally an intervening step when the lines of code (the character strings), again known as the source code, are converted by the Assembler to an executable or object code (again, machine code). These languages side step the need for a compiler and are prevalent within the computer’s processors and card (circuit boards).

Most programs contain a Kernel, which is the main program. This main program is written to call up additional sub-programs, routines and sub-routines which expand the capabilities of the main program. For instance, in a digital audio application, the Kernel, sub-programs and routines are all loaded into RAM when the application is opened. If you wish to search your directory for a saved file, the kernel calls up the necessary programs to respond to the key strokes, search the directory, import a file in a certain format, open dialog boxes, adjust the graphic representation on the screen, communicate with the driver of the hard drive and soundcard, load the file, and then play the file.

Each programming language has its own unique syntax. However, there are two overall approaches in actually designing a program to obtain the best result possible: Structured Programming and Object Oriented Programming (OOP). The structured programming approach is that the program should be written in an exact, sequential order, which in turn will result in a clear, concise and accurate program. Object Oriented Programming encourages reuse of code within the program.

The original low-level programming languages consisted of short statements, quickly compiled to machine code and did not require much computer resources to run. Now, languages are ANSI-compliant (Amjerican National Standards Institute), which specifies a standard set of commands for a language recognized by the organization.

Writing a program is about creating a code that will receive and accept inputs, process the inputs and produce a desired output. The programming language is used to write unambiguous statements (YES / NO) that will process the data input as it moves through the program. The programming language is used to create that code, in many ways the two are synonomous. However, in approaching the actual coding one must first define what the output should or will be and what are the logical steps to process the data input to obtain that output.

An Editor (either a Line Editor or a Full Screen Editor) is an application used to type the lines of text of the programming language (code), edit the lines of code and save a copy of the program to the hard drive. A line editor accomplishes exactly as it is named: it allows one to either write or edit one specific line of code at a time. A full screen editor allows one to move the length of width of the code within the ediing area with the use of the cursor keys or by mousw click, and also includes drop-down menus for basic functions (open file, save, copy, paste, print). An editor can also have a compiler or interpreter application incoporated into it, thus one can immediately compile the source code then run the program and observe the output for any error.

A programming language contains some basic, fundmental common items (constructs): sequence (a series of instructions uninterrupted by a decision or looping), decision (two possible answers and resultant code sequence, exclusive of the other possible sequence, based on the either possible answer), branching (based on a decision or a GOTO) and looping (repetition of sequence code prefaced with a decision).

The higher languages that are popular with developers today are Visual Basic, C, C++, C#, Visual C++ (C and C++ compiler), Visual J++ and Java. These are languages used to write stand-alone program source code. This programming source code must be stepped down to machine language either by a one step compiler or in a two step interpreter.

Essential to writing programs is API (Application Program Interface). API are pre-written routines that can be used as reusable templates in writing a program to operate with a specific operating system or another application. Every operating system provides APIs to programmers: Unix (POSIX), Linux, MS Windows (Win32 and MFC) and Apple Mac (Classic, Carbon, Cocoa). An API saves the programmer time by allowing them to inset an API call into their application and precluding the need of having to rewrite the specific routine. APIs also provide a consistency to applications: this is why so many MS Windows-based applications have similar looking dialog boxes and drop-down menus. Similarly, DirectSound is a component of the DirectX API that allows audio related applications to work with many types of sound cards. The audio related application is written with DirectX API calls to the appropriate library file (.dll file) which are in turn compatible with the hardware, thus the programmer does not need to be familiar with the sound card, just with DirectX API (as the API either directly translates line commands into machine code or transmits data to the specific driver for the hardware). As the Creative Labs SoundBlaster sound card is so prevalent as the factory installed sound card by several computer manufacturers, there is also an EAX extension to the DirectSound API which allows programmers to write applications to take advantage of the attributes of that sound card.

Recent web authoring scripting languages that are embedded / included in HTML documents (and execute within the client-side browser) should not be confused as programming languages (although they can perform some sophisticated functions). These include DHTML (which combines CSS / Cascading Style Sheets and JavaScript), Java Applets (written in Java), JavaScript (which is an exception), VBScript (for executing Visual Basic ActiveX applications), XHTML (which combines HTML with XML syntax), XSL (XML style sheets), XSLT and SMIL. Server side scripting languages include CGI scripts (written in Perl, AppleScript, C++, Visual Basic), ASP (Active Server Pages), ColdFusion, Java servlets (written in Java), JSP (Java Server Pages), PHP and Perl, all of which can be used to query and/or update a database on the server.

Programming and scripting language development also continues to steadily move in the direction of enterprise computing, which is the server and client relationship that allows a desktop computer to run applications but access data and additional resources from a network. As the Internet is a network and has become exceedingly more important for business, presentation, information and communication, one focus of programming languages has become Web Services, which is the requirement to make applications and data operate seamlessly across desktops, local networks, mobile hardware and the internet. In addition, Web services coding should be less complex than C or C++ and should also have components that are reusable. Web programming languages / web application development tools for Web Services include PHP, SOAP, UDDI, WSDL (of which all three are cornerstones for integrating applications and share data across the internet), ASP.NET, ADO.NET, VC++.NET, VB.NET, PERL, Microsoft.NET (the Eiffel programming language is integrated in Microsoft.NET), IBM WebSphere Studio.

XML (Extensible Markup Language) is a scripting language that is used to describe the static content encased in HTML tags (or eliminate HTML and model data just with XML) and make the content available over networks for processing by any software application. XML can be used to model audio data. Unfortunately, various versions of XML are developing which affects its strength and purpose of being a unifying language. XML is being modified by various disciplines (scientific, economic, manufacturing, etc.). For instance, there are several XML-based business related standards being developed: BPML (Business Process Markup Language) developed by BEA Systems, CSC, SAP and Sun Microsystems which allows a company to model and define every function in its entire business process. Thus, any company that utilizes BPML now has data that is interchangeable with another company regardless if both companies are engaged in entirely different products and services. Similarly, there is BPEL (Business Process Execution Lanaguage) developed by BEA, IBM and Microsoft. BPEL is actually based on the combination of Microsoft’s XLANG (Extensible Language) and IBM’s WSFL (Web Services Flow Language), which had been recent and developing scripting languages, thus one can see how quickly the standard is changing. The whole idea behind XML-based language is similar to having an open standard: write an application once and have it run on any system operation.


Quinn Dunki interview

G5: When Pandemic started Full Spectrum Warrior (FSW), how important was the AI to the project?
These responses are given by Quinn Dunki – the AI programmer on Full Spectrum Warrior.

We always considered AI to be very important to the project. The nature of the game is such that the player’s own units are AI agents carrying out requested commands. That divorcing of direct control from the characters requires that their AI be top notch in order for the game experience to be fun and satisfying. AI bugs would be potentially very frustrating, since the player is relying on the AI agents to do the right thing with minimal input.

G5: How much of the AI in FSW is scripted, and how much of it is dynamic??
The enemy units are entirely scripted. We wanted the game play to be tightly controlled so that the Designers could present a specific experience to the player at each moment in the game. The best way to do that is to have carefully scripted enemies with minimal autonomy. The player’s soldiers, on the other hand, exhibit a lot of dynamic decision making and self sufficiency. They have no scripting at all. Because they are placed in dangerous situations, and the player is relying on them to protect themselves, they need to act independently much of the time. However, they have to balance that with carrying out player orders in a timely fashion.

G5: There are quite a large number of scenarios in FSW that the AI would need to account for. Could you explain how some of the dynamic enemy AI works??
The enemy units are completely scripted. We found this was the best way to present a precise tactical series of encounters. They do exhibit some minor dynamic behaviours through the use of hierarchical state machines and branching scripts within their given encounter situation. We experimented with more dynamic and autonomous enemies, but the game play just didn’t feel right.

G5: The friendly AI in FSW is fantastic — you never need to worry about your squad doing something stupid. Could you explain how some of the friendly squad-based AI works??
I could go on for hours about the US Soldier AI, as it was without a doubt the biggest AI challenge on the project. Their decision making is based on a set of layered state machines. They take stimuli from various sources in the environment, and select their states based on a voting architecture. The members of the squad are always aware of each other, and they perform prediction of each other’s motions and states in order to coordinate activities. They also communicate directly at a low level to keep from stepping on each other, and getting in each other’s lines of fire. We use a combination of top-down authoritative control (for things like Bounding Overwatch) and bottom-up agent cooperation (for things like self preservation). The path finding system is based on a marked-up cell map from which path data is generated. There are static and dynamic cell layers to handle static and moving objects as efficiently as possible. The path system is also tightly linked to the cover mechanism, and the game rules. In order to eliminate foot sliding, all paths are computed completely ahead of time, so that animations can be precisely pre-calculated and strung together. This required some complex multi-agent planning and prediction systems for movement, since no dynamic avoidance mechanisms such as repellers could be used. The animation sequence for following a path is completely atomic once it is started. This was a challenging approach, but it really helped make our character motion look as smooth and natural as possible.

G5: Any amusing stories you can tell us that occurred during the development of the FSW AI??
The funniest parts of the AI development were certainly the bugs. The AI bugs were rarely dull. They invariably involved soldiers mowing each other down in hails of friendly fire, running each over, hurling obscenities at the wrong moments, and so forth. Bugs also frequently involved animated being strung together incorrectly, which tended to create spontaneous synchronized dance numbers. The next FSW game ought to have a Broadway Musical mode.