BeCompile - Behavior Compiler
Contents of this website are freeware and/or copyrighted material, and may not be sold under any circumstances.
Email: dogsbody@dogsbodynet.com     Home: http://dogsbodynet.com


BeCompile is an optimizing compiler, which generates smaller & more efficient RCode from Master Studio Behavior Arranger files.  It optionally comments the RCode (for readability), uses readable labels for groups, collapses conditional statements, eliminates duplicate code where possible, checks for uninitialized variables (or variable names differing only by case), plus much more! 

For some background, it's important to know Master Studio behavior files do not work directly on AIBO.  Behavior Arranger uses behavior files mainly to support the graphical user interface.  To run on AIBO, behavior files are translated (compiled) into RCode whenever the wireless LAN connection or "Save to memory stick" menu commands are used.   Unfortunately, Master Studio has a poor compiler -- its code is quite inefficient.  As a result, AIBO takes much longer to startup, especially with large behaviors. 

RCode from BeCompile is generally about half the size.  AIBO starts faster, and operates more efficiently.   DogsLife was previously built using BeCompile.   However, today DogsLife is written in extended RCode and compiled with ReCode.

Usage (from dos prompt):

BECOMPILE  target.be  outfile.r   [options]


The command line options are:
-labels  or  -la Output RCode labels corresponding to all behavior blocks.  By default, BeCompile filters unreferenced labels to reduce RCode length (and clutter).
-logopts  or  -lo List all optimizations performed (a verbose list of what BeCompile does to your behavior files).
-debug  or  -d Insert block debug information into generated RCode.  Adds debug PRINT statements describing the current program location.  Similar to Master Studio wireless console debug statement option.  You need a wireless LAN telnet connection for this to be of any use.
-debug2  or  -d2 Insert block and variable debug information into generated RCode.   BeCompile adds debug PRINT statements describing current program location, and outputs the value of referenced variables to aid debug.  This can be VERY verbose while Aibo is running.  You need a wireless LAN telnet connection for this to be of any use.
-debug3  or  -d3 Inserts line, variable, and stack tracing debug information.   Intended for use by Aibnet.   Adds debug PRINT statements for the current program location, values of referenced and assigned variables, and call/return tracking.  This can be VERY verbose while Aibo is running.  You need a telnet connection (wireless LAN) for this to be of any use
-branchwait  or  -bw Inserts "WAIT:1" before all compiled branch blocks.   Matches how Master Studio operates.  These wait statements improve the update rate of system variables.  By default, BeCompile inserts "WAIT:1" before all system variable references instead.  This option adds even more wait statements.  Try using this if behavior code seems sluggish in responding to sensor inputs.
-novarwait  or  -nv Stops BeCompile from inserting "WAIT:1" before all system variable references.  When using "-novarwait", also using "-branchwait" is recommended.  If you eliminate all "WAIT:1" statements from the RCode, Aibo updates system variables very infrequently and your behavior will not operate as desired.
-noinline  or  -ni Disable inline optimization of small groups & action blocks.  By default, this optimization reduces the amount of jumping performed and improves performance.
-noaction  or -na Disables splitting action blocks to permit branch optimization.  Be default, BeCompile recognizes when multiple action blocks contain mostly identical statements.  It rewrites the code to permit optimization of branching, and reduce RCode length.
-noprint  or -np Filters all PRINT statements from behavior file.  Recommended prior to distributing RCode, since PRINT statements can make Aibo's without wireless LAN card's unstable.
-nocomment  or  -nc Disables inserting comments to improve RCode readability.
-novarcase  or  -nr Disable check for variables which differ only by case.  ie:  Trying to use variable names 'AAA', 'Aaa', 'aaa' all at once is considered an error by default.  RCode permits such variable names, but it is poor coding style, and can create difficult to debug problems (when you get them mixed up).

Legalese: These programs are provided AS IS without any warranty, expressed or implied.  This includes without limitation the fitfulness for a particular purpose or application.    People using the software bear all risk as to its quality and performance.   The user of the software is responsible for any damages whether direct, indirect, special, incidental or consequential arising from a failure of these programs to operate in any manner desired.   Etc, etc...

"AIBO" is a registered trademark of Sony Corporation.  "AIBO Master Studio", "R-Code", and "Memory Stick" are trademarks of Sony Corporation.