Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "CAOS"

From Creatures Wiki
Jump to navigation Jump to search
m (add link to CAOS codes)
(Undo revision 69976 by 192.42.116.187 (talk))
Tag: Undo
 
(34 intermediate revisions by 18 users not shown)
Line 1: Line 1:
'''CAOS''' ('''C'''reatures '''A'''gent '''O'''bject '''S'''cript) is the generic name for the embedded scripting language used in all games in the [[Creatures series]]. Note that the details of CAOS vary from [[engine]] to engine, but all incarnations have some overarching similarities.  CAOS is used to make objects such as [[COB]]s or [[agent]]s, and even controls breeding patterns - there are many tutorials (see External Links) which can help you to learn the CAOS language.
+
'''CAOS''' ('''C'''reatures '''A'''gent '''O'''bject '''S'''cript) is the generic name for the embedded scripting language used in all games in the [[Creatures series]]. Note that the details of CAOS vary from [[engine]] to engine, but all incarnations have some overarching similarities.  CAOS is used to make objects such as [[COB]]s or [[agent]]s, and even controls breeding patterns in [[world]]s - there are many [[tutorial]]s (see [[CAOS#External links|External links]]) which can help you to learn the CAOS language.
  
 
:''Looking for a quick fix? Here are some [[C3/DS CAOS Codes]].
 
:''Looking for a quick fix? Here are some [[C3/DS CAOS Codes]].
  
CAOS is a register-based language, with a set of opcodes with fixed argument lists. Local variables are not supported. The basic unit of CAOS code is the command which can be injected and executed by the engine. However, CAOS is mostly used in [[script]]s, blocks of code identified by four integers - three identifying the object for which the script applies (0 may be used as a wildcard), and one identifying the event the script triggers on. Those are the backbone of the actual game, declaring the different forms of interactions between the different [[agent]]s (a term for the programming objects introduced with Creatures 3 - every gadget or even creature in the world is an [[agent]]) by defining actions to be taken when certain events happen (from time triggered ones to collisions with other objects or even clicks).
+
:''CAOS is itself the name of a CAOS command! See [[CAOS (command)]].''
  
Each script may contain subroutines; however as these cannot be shared and do not have local variables, they are little more than a convenience.
+
==Overview==
 +
CAOS is a register-based language, with a set of opcodes with fixed argument lists. Local variables are not supported. The basic unit of CAOS code is the command which can be injected and executed by the engine. However, CAOS is mostly used in [[script]]s, blocks of code identified by four integers - three identifying the [[class number|object for which the script applies]] (0 may be used as a wildcard), and one identifying the [[event]] the script triggers on. Those form the backbone of the actual game, declaring the different forms of interactions between the different [[COB]]s or [[agent]]s (a term for the programming objects introduced with [[Creatures 3]] - every [[gadget]] or even [[creature]] in the [[world]] is an [[agent]]) by defining [[action]]s to be taken when certain events happen (from time triggered ones to [[physics|collisions with other objects]] or even clicks).
  
CAOS scripts have 100 registers of the form VA<i>xx</i> to use to hold temporary variables. In addition, an object may be selected into the special register [[TARG]], and then 100 attributes of the object may be accessed with registers of the form OV<i>xx</i>. In most cases an object must be selected into [[TARG]] before it is acted upon. Using the command AVAR to access the OV<i>xx</i> variables of an agent without having to fiddle with [[TARG]], one can implement simple arrays.
+
Each script may contain [[subroutine]]s; however as these cannot be shared and do not have local variables, they are little more than a convenience.
  
Note that while [[Creatures]] and [[Creatures 2]], for performance reasons, use unsigned bytes (0-255) as integer types, latter versions of the engine use 'normal' 32-bit integers (which can be very large) as well as floating point numbers (eg: 3.141592).
+
Objects in Creatures are written using an [[wikipedia:object-oriented programming|object-oriented programming]] approach.
 +
 
 +
CAOS scripts have 100 registers of the form [[VAxx|VA''xx'']] to use to hold temporary variables. In addition, an object may be selected into the special register [[TARG]], and then 100 [[attributes]] of the object may be accessed with registers of the form [[OVxx|OV''xx'']]. In most cases an object must be selected into TARG before it is acted upon. Using the command [[AVAR]] to access the OV''xx'' variables of an agent without having to fiddle with TARG, one can implement simple arrays.
 +
 
 +
Note that while [[Creatures]] and [[Creatures 2]], for performance reasons, use unsigned bytes (0-255) as integer types, later versions of the engine use 'normal' 32-bit integers (which can be very large) as well as floating point numbers (eg: 3.141593).
 +
 
 +
==Lists of CAOS Commands by Game==
 +
''Note: These are incomplete.''
 +
* [[:Category:C1_CAOS_Commands|Creatures 1]]
 +
* [[:Category:C2_CAOS_Commands|Creatures 2]]
 +
* [[:Category:C3_CAOS_Commands|Creatures 3]]
 +
 
 +
----
 +
Also all C3 CAOS commands listed in a batch file
 +
* [[CCLOCFC3|C3CAOSLister]]
 +
* [[Statistics]] of commands used in the games
  
 
==History of CAOS versions==
 
==History of CAOS versions==
 
* [[Creatures]]: Initial incarnation of CAOS.
 
* [[Creatures]]: Initial incarnation of CAOS.
* [[Creatures 2]]: New game [[engine]]. CAOS now supports [[physics]].
+
* [[Creatures 2]]: Improved game [[engine]]. CAOS now supports [[physics]].
* [[Creatures Adventures]]: New game engine. Support for strings and file I/O is added. CAOS exceptions are much less likely to cause engine crashes.
+
* [[Creatures Adventures]]: New game engine - the [[Creatures Evolution Engine]]. Support for strings and file I/O is added. CAOS exceptions are much less likely to cause engine crashes.
* [[Creatures 3]]: Incremental improvements to [[Creatures Adventures]] engine.
+
* [[Creatures 3]]: Incremental improvements and changes to [[Creatures Adventures]] engine.
* [[Docking Station]]: Incremental improvements to Creaures 3 engine. Networking support.
+
* [[Docking Station]]: Incremental improvements to [[Creatures 3]] engine. Includes networking support ([[Babel]]).
 +
* [[Sea-Monkeys]]: Incremental improvements and changes to [[Docking Station]] engine, without DS's [[Babel]].
 +
 
 +
==Full commented scripts==
 +
*[[Creatures 1 scripts]]
 +
*[[Creatures 2 scripts]]
 +
*[[Creatures 3/DS scripts]]
 +
 
 +
==Tutorials==
 +
*[[:Category:Tutorials]]
  
 
==External links==
 
==External links==
* [http://www.gamewaredevelopment.co.uk/downloads/cdn/creatures_caos_guide.pdf Creatures 1 CAOS guide (PDF)]
+
* [https://web.archive.org/web/20170814234719/http://www.gamewareeurope.com/GWDev/downloads/cdn/creatures_caos_guide.pdf Creatures 1 CAOS guide (PDF)]
* [http://www.gamewaredevelopment.co.uk/downloads/COBcompiler/C2CAOS.doc Creatures 2 CAOS guide (DOC)]
+
* [https://web.archive.org/web/20071015154335/http://www.gamewaredevelopment.co.uk/downloads/cdn/C2CAOSGuide.pdf Creatures 2 CAOS guide (PDF)]
* [http://www.gamewaredevelopment.co.uk/cdn/cdn_more.php?CDN_article_id=27 How to generate the Creatures 3 CAOS guide]
+
* [https://web.archive.org/web/20170814225722/http://www.gamewareeurope.com/GWDev/cdn/cdn_more.php?CDN_article_id=27 How to generate the Creatures 3 CAOS guide]
* [http://joey.publicthesis.co.uk/creatures/ C1 and C3 CAOS tutorials]
+
*[https://web.archive.org/web/20140205202257/http://www.gamewaredevelopment.com/cdn/CDN_more.php?CDN_article_id=112 Getting Started with CAOS - C3/DS]
* [http://www.helephant.com/creatures/ Helen's Bibble Directory - C2 CAOS tutorials]
+
*[https://creaturescaves.com/community.php?category=&searchFor=CAOS+Chaos+|&section=Resources AquaShee's CAOS Chaos - C3/DS]
*[http://www.gamewaredevelopment.co.uk/cdn/cdn_more.php?CDN_article_id=112 Getting Started with CAOS - C3/DS]
+
*[https://web.archive.org/web/20170625004638/http://mobilefieldbase.com/creatures/garbage.html Thoughts for writing agents that are relatively nice]
*[http://www.edash.net/members/caos_chaos.php AquaShee's CAOS Chaos - C3/DS]
+
*[http://lambda-the-ultimate.org/node/view/455 Discussion on CAOS as image-based programming language, and history of CAOS]
*[http://lambda-the-ultimate.org/node/view/455 Discussion on CAOS as image based programming language, and history of CAOS]
+
*[[wikipedia:Control flow|Control flow]]
 +
*[https://hello-robotto.dreamwidth.org/4230.html A comparison of Creatures Village, C3, DS, and the Virtual Sea-Monkeys CAOS commands]
 
[[Category:CAOS]]
 
[[Category:CAOS]]

Latest revision as of 14:38, 22 March 2024

CAOS (Creatures Agent Object Script) is the generic name for the embedded scripting language used in all games in the Creatures series. Note that the details of CAOS vary from engine to engine, but all incarnations have some overarching similarities. CAOS is used to make objects such as COBs or agents, and even controls breeding patterns in worlds - there are many tutorials (see External links) which can help you to learn the CAOS language.

Looking for a quick fix? Here are some C3/DS CAOS Codes.
CAOS is itself the name of a CAOS command! See CAOS (command).

Overview[edit]

CAOS is a register-based language, with a set of opcodes with fixed argument lists. Local variables are not supported. The basic unit of CAOS code is the command which can be injected and executed by the engine. However, CAOS is mostly used in scripts, blocks of code identified by four integers - three identifying the object for which the script applies (0 may be used as a wildcard), and one identifying the event the script triggers on. Those form the backbone of the actual game, declaring the different forms of interactions between the different COBs or agents (a term for the programming objects introduced with Creatures 3 - every gadget or even creature in the world is an agent) by defining actions to be taken when certain events happen (from time triggered ones to collisions with other objects or even clicks).

Each script may contain subroutines; however as these cannot be shared and do not have local variables, they are little more than a convenience.

Objects in Creatures are written using an object-oriented programming approach.

CAOS scripts have 100 registers of the form VAxx to use to hold temporary variables. In addition, an object may be selected into the special register TARG, and then 100 attributes of the object may be accessed with registers of the form OVxx. In most cases an object must be selected into TARG before it is acted upon. Using the command AVAR to access the OVxx variables of an agent without having to fiddle with TARG, one can implement simple arrays.

Note that while Creatures and Creatures 2, for performance reasons, use unsigned bytes (0-255) as integer types, later versions of the engine use 'normal' 32-bit integers (which can be very large) as well as floating point numbers (eg: 3.141593).

Lists of CAOS Commands by Game[edit]

Note: These are incomplete.


Also all C3 CAOS commands listed in a batch file

History of CAOS versions[edit]

Full commented scripts[edit]

Tutorials[edit]

External links[edit]