Gamecraft

Gamecraft MAJOR UPDATE: Powerful Physics blocks, plus Counters, Timers, & Loops - LIVE NOW

Version
MAJOR UPDATE: Powerful Physics blocks, plus Counters, Timers, & Loops - LIVE NOW
Version Date
April 7, 2020
Links

Patch Notes

MAJOR UPDATE: Powerful Physics blocks, plus Counters, Timers, & Loops - LIVE NOW

Hello Gamecrafters!



We have another jam-packed update to share with you! Continuing with the focus of providing tools for the ‘building’ side of Gamecraft we have a range of powerful new parts, from Generic Physic blocks to HUD blocks, as well as some parts that expand the capabilities of the previous Logic blocks. Check out the full patch notes below.

Generic Physics Blocks


We’ll open with the amazing Generic Physics Blocks first. These parts provide either a force or torque to the body they are attached to.



The Mover provides a force along one specific axis, namely the direction the arrow is facing. This force allows anything connected to the block to move along that axis. The force is reduced as the speed increases, up to the maximum speed set to give a consistent output. The Mover has a single input which can take a signal from -1 to +1, so a signal of -0.5 will apply a force “backwards” at half the defined value. With no input at all, the Mover will simply apply its maximum force constantly.

There is an additional stat on this part as well! “Axis Reference” gives you the default option of “local”, which simply means the force will always be applied in the direction of the arrow, no matter what position it ends up in. The other option is “Time Start” which defines a fixed axis for the entire simulation. If the Mover starts by facing upwards and somehow tips over, the force will continue to be applied upwards instead! Fantastic if you want to create an elevator that always moves up, but can also rotate to keep the player on their toes.

The Advanced Mover behaves the same way, but allows all three axes to be controlled from a single block! This part has three separate inputs; Green, Red and Blue axes. If you wanted to set up a flying vehicle you can use a single Advanced Mover to control the elevation on one axis, the forward/backwards movement on the second and left/right on the third.



Next, we have the Rotator and Advanced Rotator. These parts apply torque around an axis. Wildly different from Motors, these parts apply torque on the body as a whole, rather than on each connection point. Placing a Rotator on top of the flying vehicle example and connecting that to the left/right input of a Pilot Seat would allow you to spin the entire build, around its center. Using an Advanced Rotator you can even add in pitch and yaw to make a crude airplane!

Pro Tip: While these blocks apply their force on the center of the body they are attached to, it is possible to ‘split’ bodies with joints, allowing you to apply the force at a specific point.

That’s not all either. We have Movement and Rotation Dampeners as well. These parts can be used independently of the Mover and Rotator. Dampeners reduce the velocity and angular velocity of the body they are attached to. This means that a Movement Dampener attached to a car would slow it down by a fixed percentage each frame. Rotation Dampeners could be attached to the outside of wheels to drastically reduce the speed at which they rotate, providing make shift breaks!

HUD Blocks


Next up are the HUD blocks. These provide a way of displaying text, objectives, values and other game details on screen. The first three HUD blocks we have for you are the Centre HUD, Objectives HUD and Game Stats HUD.



The Centre HUD block displays a piece of text right in the middle of the screen. This is great for making announcements to the user such as the start of a race or a quick call to action. Simply place one of these parts, enter some text in the text field stat and choose how long you want the text to appear for. When the Center HUD block is triggered, the text will appear on screen and fade away after a few seconds.

The Objective HUD block can be used to set up goals or guidance for your game. Objectives appear in the bottom right corner and up to 6 at time can be shown. Objectives will appear when the “on” input is triggered, which can be at the start of your game or as the player progresses through it.

Objectives can be marked as “complete” with the second input. Setting a simple objective like “Reach the end of the level!” is as easy as placing a Character OnStay Trigger at the goal and wiring it to the Objective HUD.

Last but not least we have the Game Stat HUD block. This block will display a small piece of information at the top of the screen, such as a Timer or the number of attempts the player has left (created through logic). Up to 6 of these can appear at any time.

The biggest difference with this block is the way it handles that information. The text stat of this block defines the label, shown at the bottom of the HUD. To display the stat, you’ll need to wire a Text Port. To go into a bit more detail on how that works, you can wire the Text Output of a Timer (which we’ll cover soon) to this HUD block to display the time on-screen!



The Game Stats HUD block will always appear for all players, but the Center and Objectives HUD blocks can be toggled to a special Player or Team channel. These channels can be used to give specific players different information or objectives! A Center HUD block on the ‘Player’ will only appear for the player that triggered it. A short example of this can be a race track where each player will see their own popup every time they complete a lap.

Pro Tip: Those of you that are familiar with the Rich Text support we have for Text Blocks will find you can use the same tags in these blocks too, with one small exception. Vertical offset is disabled to make sure the HUD stays consistently in the same place. Other tags can be used to move text around within the boundaries though.

State Blocks


Next, we’re going to cover the new State Blocks. These parts complement the Logic and Math blocks from the previous update extremely well and can offer a lot of gameplay potential.



First, the Bit block. The Bit block can be used as a sort of “local memory” in your logic, storing a single on/off value. The value can be set manually through the input port “one” or “Zero” input, or you can also toggle the current value with a third input.

This block also has a functional digital display built-in to show the current state, which will make debugging easier.

Next we have the Counter. The Counter block lets you set a target value, up to 999. The counter always starts at 0, but can be increased and decreased with one of two inputs. These inputs act on any signal greater than +0.5, so you could increase the Counter every time the player presses a Button and decrease it any time they enter a Trigger. The third input on thi part acts as a Reset, setting the Counter back to 0.

This part has three distinct outputs. The first is “Completed”, which will then output a signal of +1 once the target has been reached. The next is “Progress”, which provides a float value between 0 and +1 that acts as a percentage of the progress the Counter has made to the target. Finally, you’ll even be able to output the value of the Counter as “text”, straight to other blocks that support it, like the HUD blocks above!

Last but not least we have the Timer. This block lets you define a start and end time, which will then count by itself. The three inputs for this part are ‘Start’, ‘Stop’ and Reset. Start simply gets the Timer running and Stop will pause the Timer. Reset will bring the timer back to its start time. The timer can count up or down, depending on how it is set up. It can also display in either MM:SS format or MM:SS.ms. The format setting applies to the display on the Timer and the special Text Port too! The outputs for the Timer are the same as the Counter.



These parts all work on the unique player/team channels too, which means you can use the same counter for multiplayer players, with each player storing their own ‘count’ for use later!

Number 2 Text block


We’d like to quickly mention the Number 2 Text block here as it ties in nicely with the HUD and State blocks.



This block converts any numerical input, such as a Levers output signal or the result of a Math Multiplier block, into text readable by a Text Port. You’ll be able to display a huge range of information in a clean way, either for your own debugging purposes, or as game related information for players.

You can tweak the way the output is displayed by changing the maximum number of digits and how many decimal places can be shown as well. If you wanted a simple way to display the number of keys a player has collected, you can probably limit the number of digits to 1 and show 0 decimals. If you want to show the precise position of a Lever, to 4 decimal places, you can do that too!

Filter Blocks & Object ID Blocks


Last on the list for new parts are the Filters and Object ID blocks! Filters offer a means of splitting signals that come from certain objects or players and providing different behaviour, while the Object ID block can mark a unique collection of parts to check against later.



We’ll start with the Object ID block first. This part can be attached to a connectable surface of any part. Once attached this will label that part and anything on the same body with a specific ID, from A-Z. Marking a single cube with an ID of “A” means that you can combine this with a Filter block to make some logic that will only respond to that block,while ignoring any other parts that may happen to pass through.

As for the Filter blocks, we have three types. We’ll cover each of these below but we’ll start with how they work in general.

Filter Blocks can be set to a specific channel. In the case of Objects this will be A-Z, for Player this will be 1-100. If a Player Filter is set to channel “1”, any signal that enters the Filter will be checked to see who it came from. If it came from the player marked as “Player 1”, the output from this block will be +1. If any other player is found, the output is 0. This could be used to prevent Player 2 from opening a door that you only wanted Player 1 to pass through, for example.

Object Filters can be used together with Object Triggers. Each object that enters the Trigger will be checked to see if it has an ID. If it has no ID or the ID does not match, then the signal coming out of the filter is 0. If the ID of the part matches then you get an output of +1.

Let’s say you wanted to create Tic-Tac-Toe; The crosses could have an ID of “A” and the noughts could have an ID of “B”. Triggers on each space could react to each ID and know which piece is in each space. Combine that with some Bit and AND logic and you have yourself some win conditions!

Player and Team Filters work in much the same way. By default the player is on Team “A’ as Player “1” (when multiplayer later supports it you’ll be able to define what Team each player spawn in as). These filters also work with controllers like buttons and Pilot Seats, so you can create different behaviour for each player that interacts with it.

Additional Changes


Text Ports
Expanding on that HUD and State blocks new Text Ports, we’re adding a new input/output port type to certain parts. This Text Port allows you to pass text from block to block. In the case of a Timer, this will pass the time stored in the block, in whichever format chosen. If a HUD or Text block receives this, it will be added to the end of any existing text (or used as the Game Stat in that block).

Improved Stats Panel
We’re also making some much needed improvements to the tweakable stats panel. The main changes here are the improved slider, which offers much more flexibility and the ability to manually type values. Parts such as the Servo Hinge now have full 180 degree settings, rather than 10 distinct steps while other parts like the Motor can now have their Maximum Speed stat set to a degree of 0.5 precision.

All of these values can be set manually (within the boundaries and precision we’ve defined) by clicking the number under the slider. Once you’ve typed a new value you can save the change by pressing Enter or clicking outside of the input field.

Text Block Improvements
Text blocks have received a bit of an overhaul as well. Rather than bringing up a new window to enter text in, you can now change the content via a stat panel. All of the same functionality remains, we just think it is a little less intrusive this way.

Loops
Loops are here! This should be fairly straight forward so we won’t go into too much detail here. It is now possible to create loops within the wiring system.This means that you can chain a few timers together, then reset the first one as the final one finishes, or create a looping counter that adds one input to itself, while sending the result on to another part.

Each loop introduces a single frame delay (roughly 1/30th of a second) so they can also be used to create short delays. We’ll be working on other, simpler ways of doing this in future as well but it is worth keeping in mind that system using loops will run slightly differently than those without.

Wire button count increase
We’ve made a small change to the little blue dots that appear when you look near parts that can be wired in Empty Hand mode. We’ve got some bigger changes planned in future to really polish up this area of wiring but in the short term we’ve increased the maximum number visible at once. This should make it easier to get into those compact, hard to reach areas of logic that we’ve seen.

Bug Fixes

  • Fixed a bug that caused Logic gates to behave incorrectly when multiplier are present but not all inputs are used
  • Fixed a bug that caused Object OnExit Triggers to act as if they were triggered as soon as simulation starts
  • Fixed a bug that caused Game/Prefab Workshop results to overlap if the filter changed while results were still generating
  • Fixed a bug that caused Text Blocks to appear incorrectly in multiplayer
That’s everything for this epic update. We’re sure some absolutely crazy things are going to come out of these new parts and we really can’t wait to see how you all put them to use. With all of these new systems benign launched at once there’s a chance they aren’t all going to come out perfectly right away. If you run into any bugs or have any issues or feedback on these parts in general, please do let us know. Thanks again for sticking with us on this journey and helping us shape Gamecraft!

The Gamecraft Team