Datatype Update
Since the beginning, Flowlab behaviors have always communicated using integer values. While this has provided a certain level of simplicity, the inherent inflexibility has prevented us from being able to freely manipulate text, or easily manage data for sophisticated gameplay, or fine-tune many calculations where non-integer values are needed.
In order to eliminate these creative restrictions, the latest version of Flowlab being released today introduces three new data types:
Number: Instead of being restricted to only integers, behaviors are now able to input, output, and store floating point (decimal) values. Often values less than one are helpful when fine-tuning timing delays or game object physics. All behaviors that were previously restricted to integers now allow floating point values if desired. The existing Number block also gained a Rounding setting that will restrict it back to integer values only.
Text: Games often require complex dialogues and narration which was previously not convenient to manage. Many behaviors can now input, output, manipulate, and store Text values to make these types of game elements more practical in Flowlab. The Following Text-specific behavior blocks have been added:
- Text: Can store a text value, append to it (using the increment input), get a single character, or split it into a list of text values.
- Text Case: Changes case to uppercase or lowercase
- Text Length: Outputs the length of some text
- To Number: Converts the input text into a Number if possible
- Text Compare: checks if some text matched other text
- Text Sanitize: removes non-printable characters from text
Text List & Number List: It can be very useful to group values together into a set and manipulate them as a group for things like a player’s inventory, completed actions, or dialogue options. Flowlab now has support for lists of either Text or Number types, as well as new behavior blocks for storing and manipulating them:
- Text/Number List: Can hold a list of Text or Number values, push items onto the end, pop items off of the end, join it together into a Text value, or search the list for a specific item.
- List Modify: This enables a list to have items added, removed, or updated.
- List Order: Change the order of a list by sorting it alphabetically or numerically, reversing, or randomizing it.
- List Each: Iterate over the list and output the values one at a time, with an optional delay
- List Count: Returns the number of items stored in a list
In order to make it more obvious which types of data are being sent and received by the various blocks, new colors have been introduced to the behavior input and output ports.
- Number ports are white, as before. Number outputs can be sent to Text inputs, and the Number will be converted to Text automatically.
- Text ports are purple, and input ports that can receive Text or Numbers are purple with a white outline
- List ports are green, and can only connect to other List ports
Since not all inputs and outputs are compatible (e.g. you cannot connect a List output into a Number input), when dragging a new link all incompatible ports will fade out showing only the ports that are available.
Behavior window rendering: Manipulating, dragging, etc should be much snappier when you have a lot of behaviors, and running your game from the behavior window should have much better performance as well. The blocks & links also look slightly different, and Trigger blocks have an orange border to make them more easily noticeable.
The behavior window itself is slightly darker to provide better contrast, but fades out when needed to view the game world, i.e. when editing blocks like Label, Camera, or Proximity.
Mouse wheel now zooms the behavior window in and out.
Updated Behaviors
Keyboard triggers now have an “Any” option which changes it to output text instead of a number. When “Any” is selected, typing the letter “z” will output “z”, etc.
All blocks now have a “notes” setting to add comments. This adds a small icon to the block that can be clicked to display the notes, and they can be clicked to close them. When open, they should stay open when reloading the window or game to serve as a guide when looking at the logic.
Updated Expressions - in addition to outputting floating point values, the number of inputs can now be adjusted. No more “A” and “B” only. Existing Expression blocks will still output integers only, so current games are not affected, but any newly added Expressions have the ability to output floating point numbers.
Global blocks have been changed so that they no longer reset between levels. This fixes a design flaw in the original version and allows globals to be used to store scores, etc throughout the game. Existing games will not be affected, only newly added blocks.
Label blocks now have a width setting (in pixels). If this value is set greater than 0, lines will wrap at that width.
Other New Behaviors
Router: This allows you to direct the output to one of any (also variable) number of outputs to control logic flow. It can also be randomized.
Cloud Save: This is an Indie Only feature that allows you to store a value “In the Cloud”. This means that when one player saves a value, all other players will be able to read that value. This can be used for leaderboards or any other place where a value needs to be readable by more than one player. It works in a similar fashion to the existing “Save” block, but saves and loads are not instant - they can take multiple frames to return since they must communicate with the network.
User Info: If the player is logged in, this will return their username and flowlab user id.
Clipboard: Saves a value to the player’s system clipboard. This must be triggered from a mouse or keyboard click, or the browser will prevent it from working.