# Welcome

![Image](<lib/DeltaX-Logo-1024.png>)

# Welcome\!

*"Welcome to DeltaX :P"*

### Introduction

DeltaX is a DeltaTime (DT) extension for frame-rate independent apps with time scaling for slow/fast motion, pause/resume support, fixed and variable time-step handling, and access to Fusion's internal Movement Timer's Coefficient and Base.

&nbsp;

**DeltaTime (DT for short), is very important for games than one would initially think\!** Usually, Fusion users typically limit the FPS of their games to 60. Which while may be fine for some games, it can significantly worsen the experience for many, **or even completely break certain games**, such as **online-multiplayer** and **rhythm** games where frame-independence is crucial.

&nbsp;

But understandably, it can be difficult at times. Which is especially the case for people who are new to the concept. It can be hard to even get started, let alone, fully learn how to deal with frame-independence properly and implement it for a full game...

&nbsp;

To help solve this, the extension is designed to make it easier, faster, and more convenient to implement DeltaTime in your apps and games. **It offers access to 3 different types of DeltaTime variants**: (Variable DeltaTime, Fixed DeltaTime, and Internal Movement Timer) + additional helpers like ability to get milliseconds from FPS and vice versa. **It's also cross-platform**, supporting **Windows, Android, iOS, macOS, HTML5, and UWP** runtimes ![Image](<lib/Runtimes.png>). **So NO need to worry about the extension being Windows only\!**

&nbsp;

The extension aims to be the definitive, most accessible solution to DeltaTime in Fusion. No more DeltaTime drama\! (or so I hope\!\!\!)

![Image](<lib/DeltaTCoachNew.png>)

&nbsp;

***

### FULL Access to Movement Timer

Usually, the internal, built-in **Movement Timer is locked only for the Fusion SDK**, as in, only for built-in/extension movements, and extension objects. **It was never interfaced to Events by Clickteam**. DeltaX fixes that\!

&nbsp;

Full access is provided to Movement Timer's Coefficient (calculated delta), Base (raw time-scale), and State (enabling/disabling frame-independent movements).

&nbsp;

***

### Variable DeltaTime: Precision \& Independence

Variable DeltaTime offers a pretty similar functionality to the built-in Movement Timer. In fact, it's the same core concept, but with the main difference being it's a custom implementation. This makes it independent from the built-in, engine calculated Movement Timer. Can also be useful if you want to have multiple, different deltas calculated at once (like a delta for each enemy, or deltas for different systems in your app), which can offer more flexibility compared to the global-ish Movement Timer. Each DeltaX object gets it's own independently calculated Variable DeltaTime.

&nbsp;

In addition to independence from Movement Timer, it implements real time-scaling without affecting the DT Ratio (the base). This allows to go for real precise results compared to adjusting just the Movement Timer Base. In testing, Variable DeltaTime proves to allow for much slower time-scales\!

&nbsp;

***

### Fixed DeltaTime: Easy \& Reliable

Meanwhile, **Fixed DeltaTime is the fastest, and easiest path to frame-independence**. But it doesn't come without costs\!

&nbsp;

**All you need to do is to put any "Always" code (events that run every frame)** under [On Fixed DeltaTime Update](<Conditions.md>) and you get frame-independent logic that runs the same speed on any FPS...

But of course, **the main con to this is, it's fixed step**. So for example, if the app is running 120 FPS, and user's monitor is 120 Hz, but Fixed DeltaTime Ratio is ~16.67 MS (60 FPS): No in-between frames would be utilized, it will always run fixed step, **and look as if it was running on 60 FPS** even if it's actually 120 FPS. **The additional smoothness would simply be lost**...

&nbsp;

While this can fine for many scenarios, it could be a deal breaker for some, especially movements, where input and visual smoothness work hand-in-hand for a better experience. But still, **Fixed DeltaTime can be a great first step into implementing DeltaTime**, especially for existing projects without much effort.

&nbsp;

It can also be useful for complex, simulation-heavy systems, where not only is implementing Variable DeltaTime for them requires a lot of time and effort. It can also mess with the accuracy of it all. **Fixed DeltaTime ensures everything runs at perfect accuracy and speed no matter the FPS**.

Some systems like a slasher trail, or shooting bullets with a consistent delay heavily benefit from Fixed DeltaTime.&nbsp;

***

### Utilities: Wizard / Helpers / Debugger

There are many tools to help you in development. This includes:

* **Integration with the built-in Fusion Debugger:** Inspect and modify properties on the fly. Just add the DeltaX object to the Debugger\!
* **Conversion functions:** Converting FPS to MS and vice-versa. Or converting time-scale to Movement Timer Base (and vice versa).
* **Set Movement Timer Base via Wizard:** Feature-rich tool to set the one value based on other factors.This also helps with previewing how things would function before even running the main app. Doubles as a great learning tool.
* **More convenience features:** Such as an option to retrieve Movement Timer Base as 1.0 if Movement Timer is disabled.

&nbsp;

![Image](<lib/DeltaXSetMvtTimerBaseWizard1.png>)![Image](<lib/DeltaXDebugger.png>)

&nbsp;

***

### Slow-mo / Fast-mo / Pause / Resume

The extension allows for easy slow-motion and fast-motion effects for DeltaTime-based systems. Including but not limited to: built-in movements (like Bouncing Ball), some extension movements (like Pinball), built-physics movements, animations, and more\!

**As long as it's on Movement Timer or Variable DeltaTime, it's easy\!**

&nbsp;

**All that needs to be done is modifying the Movement Timer Base** (either directly, or indirectly from time-scale to MvtTimerBase value conversion applied to Base). **Same with Variable DeltaTime, but by modifying the real Time Scale or DT Ratio**.

&nbsp;

And as you may have already guessed by reading, this also means easy and flexible **pause / resume functionality is possible by just adjusting the aforementioned values**. For example, to pause, you can set Movement Timer Base to 0, and to resume, set to how it was before pausing.

![Image](<lib/PauseResume.png>)

&nbsp;

***

### Free \& Open-Source

DeltaX is free and open-source: I believe that a standard thing like DeltaTime (which is already implemented in 90% of modern game engines), shouldn't be locked behind a paywall. Not to mention, **extension development isn't profitable anyways**, so might as well make it more accessible than earn a worthless cut of $$ :P

&nbsp;

**Same rule applies to most of my projects** *(extensions, examples, tools, guides, etc)*. So it's not only tied to ExtensionName\!

&nbsp;

* **NO affiliation is required\!** But I would of course appreciate crediting. You can use my online name, or real name, or even both\! :)
* Due to the open-source nature of DeltaX, **contributions are heavily encouraged\!** It can be anything from fixing a minor bug, adding new features, or even just testing out the extension well and suggesting improvements\!
* You can reach me out on Discord: @linky.m, or the the official Clickteam Community Forum: Linky.

![Image](<lib/Heart.png>)

***
_Created with the Personal Edition of HelpNDoc: [Create iPhone web-based documentation](<https://www.helpndoc.com/feature-tour/iphone-website-generation>)_
