Object Motion & Controller

Introduction


The comprehensive functionality of moving object instances to their target by selecting a motion template and setting parameters.

The official name is ByName Object Motion And Controller, but usually abbreviated as Object Motion Control or simply Motion in this document.


ASTER :: Object Motion Control

While there are several similar functions for moving objects with simple parameter settings, such as Clickteam’s official “Movement” and the third-party extension “Easing”, Motion & Controller as an extension combining REGEX and JSON is unique to ASTER.

When registering instances to a controller, it features grouping by arbitrary identifiers, and operations can be performed on groups by name, such as stopping, pausing, resuming, unregistering, and destroying the instances.

Comparison with Clickteam :: Movement

The following text will be explaining the uniqueness of ASTER :: Motion Controller in comparison with Clickteam :: Movement.

Image 1
Image 2

With CF25's official registered Movement, you can easily move objects automatically.

With Clickteam::Movement, parameters are uniformly sent at the time of instance creation. Therefore, to assign different parameters or behaviors to each object instance, it is necessary to separately import Clickteam Fusion 2.5’s official “Motion Controller” extension.

Specifying unique parameters for each instance during application execution requires considerable effort when using Clickteam::Movement due to the event creation process.

ASTER, on the other hand, groups pre-created instances at arbitrary times during application execution, rather than at the time of instance creation. It allows the selection of behavior templates and sends parameters in batches for each group.

Description of the image
ASTER's Motion Templates introduce the concept of 'swarms,' treating multiple instances as a single group. Parameters are sent to the swarm, enabling automatic calculations that allow multiple instances to operate collaboratively as a single unit.
Registerable Object Type

The type of object that can be registered in ASTER :: Motion Controller is limited to active (sprite) objects with animation capabilities.

Clickteam :: Movement can be applied motions to almost all types of objects except for “background.”

Frame-Based

ASTER calculates movement only based on frame time ( FPS ). Clickteam :: Movement, however, also supports time-based calculations and takes into account compatibility for time-based movements when setting parameters.

ASTER simplifies calculations by discarding compatibility and specializing in frame-based movements.

Serialization and Hot Swap of Parameters

ASTER serializes multiple parameters and sends them in bulk. To put it in a way that’s easy for the general public to understand: “ASTER converts multiple parameters into a string and sends them all at once.” The sent string is internally parsed and decomposed into individual parameters.

The serialized parameters are fully compatible with the string type, which is a JSON primitive type, and can be saved in a JSON format file.

If you change some of the parameters in a text editor while watching the application run, simply restart the application to load the new parameters. No rebuild is required. This speeds up partial parameter changes, trial and error, and operational verification.


ASTER :: Motion .. Registration and Control

Name ( Motion Group Name ) is used for registering and controlling Motion.

As a usual workflow, the ByName Motion Registration registers the motion group to the controller, and the ByName Motion Controller controls the instances via the registered group name.

The following illustrates the standard procedure for registering object instances to the controller.

---
title: ByName Motion Registration
---
flowchart LR
  MOT(Select the Motion Template) --> A{Object}
  A{Object} --> NAME(Set Motion Group Name)
  NAME(Set Motion Group Name) --> PARAM(Motion Param)
  PARAM(Motion Param) --> B((Motion Controller))
Group Management

ASTER’s Object Control enables grouping by motion units and allows group registration and deregistration during application execution.

ASTER’s Object Control does not allow duplicate registration of instances, so only instances not registered with the controller can be registered in the group.

reserved variables

Some of the instance variables of an object instance are used as “reserved variables” from the extension.

For detailed specifications, see “Reserved Variables”.

The purposes of use are

  1. Automatic assignment of sequential numbers

  2. to streamline database searches within the extension

These are the above two purposes.

Specification: Max Registrations
  • The ASTER motion controller can register up to 255 motion groups.

  • Per motion group can register up to 255 instances, meaning that theoretically the controller manages up to 255 * 255 = 65,025 instances.

However, this is the theoretical upper limit, and from the creator’s perspective of practicality, having approximately 100 instances running smoothly is sufficient. The actual operation tests have not yet tried reaching the specified upper limit.

While 100 instances is a modest number, please use this as a rough guideline, as the upper limit depends on the specifications of the PC being used and how events are structured.


The Motion Templates
  • Null
  • Horizontal Wrap | Flip
  • Horizontal Wrap | Flip :: Sinewave
  • Vertical Wrap | Flip
  • Vertical Wrap | Flip :: Sinewave
  • Orbital :: OwnXy
  • Orbital :: TargetXy
  • Movetowards
  • Movetowards :: Swap
  • Movetowards :: RefVec
Motion Template

The motion template without motion is Null Motion. Because the load after group registration is reduced, it is designed for frequent registration and deregistration. For specific usage, please refer to the motion samples.

Wrap / Flip is a motion template that moves back and forth within a specified range. It is broadly divided into horizontal and vertical movements, with derivatives such as Wrap | Flip and Wrap | Flip::Sinewave.

Wrap warps to the opposite side when it touches outside the range. Flip reverses the direction of movement when it touches outside the range. SineWave mimics the motion of a sine wave.

It is named a satellite orbit (Orbital) because its design depends on the target for the center coordinates of the circular motion. OwnXy uses its own coordinates as the center coordinates for the circular motion, while TargetXy orbits around the coordinates of the object instance specified as the target. If TargetXy loses the target, it automatically becomes OwnXy. When a target is set to OwnXy, it becomes TargetXy and orbits around the target.

A motion template that moves an instance to the target location within a specified time-bound value.

The amount of movement is determined by distance and time.

Swapping the positions of paired instances (Swap) is a derivative motion of Movetowards.


Attach behavior to the instance