Logic Resource (AGI)

From Sierra WikiNew
(Redirected from AGI Logic Resource)
Jump to navigationJump to search
AGI Logic Resource


AGI Logic resources are the “guts” of an AGI game. They are scripts that contain all the commands necessary to control the view, picture and sound resources and to receive and act on input from the player, thus determining everything that happens in the game. Each room generally has its own logic which determines what happens in that room, and the game also has a few other logics to look after things like initialization and error handling.

Games are programmed in a special language specific to AGI and compiled into logic resources. The logic programming language is similar to standard programming languages like C, but a lot less powerful as it is designed for specific purpose.

You can edit logics with a Logic editor. See AGI logic language for more information about how to program AGI logic.


Each room has LOGIC associated with it. This LOGIC is the procedural set of instructions that gets executed describing game play. AGDS always automatically loads, and executes Room 0. From there, the logic programmer must handle everything.

ROOM #0 contains the LOGICS that are common to the entire game, low level functions like "SAVE GAME," "HELP", etc. Instead of coding instructions to handle saving the game into every room, put it in room 0.

DYNAMIC LOGICS are used for the same reason. They are rooms that have no picture, but process commands that occur in multiple ROOMs. Every ROOM that needs swimming can load a LGC.SWIM which deals with commands like SWIM, and standing ego up when he is no longer in water. It would be a nuisance and a waste of disk space to code this redundantly for each ROOM with water in it. If it were in ROOM #0 it would occupy ram even in ROOMs without water. Memory is valuable; anything that cuts down memory requirements is good!

LAST LOGICS are simply the last LOGICS executed. Here you handle things like the player giving a command that the other logics don't recognize. For instance, if the player asks the game to swim when there is no water in a ROOM, no dynamic logic is loaded to deal with water. Somehow the player needs to be told we don't understand what he said. Last logics handles all code trying to provide intelligent responses to input not dealt with by one of the earlier-processed logics.

Sources


References



Also See