1. Lost Twins 2
  2. News

Lost Twins 2 News

Devlog # 54 - Water mechanics (Simulating Water Flow Between Connected Pieces)

Hi guys! Welcome to today’s devlog. Today we dive into a fascinating mechanic: simulating water flow between two connected pieces. It's always exciting to explore how programming can mimic the behavior of natural phenomena, like water levels rising and falling. In this post, the team will take you through the process of developing a dynamic water flow system that reacts autonomously, adding a realistic touch to the game environment.

To create this effect, the team first set the pivot point of the water prefab to its center bottom. This positioning ensures that when the water is scaled, it appears to be filling up or emptying out realistically. The next step was defining two levels for the water: maximum and minimum. The maximum level represents the current water level for each piece, while the minimum level indicates the empty state.

The flow mechanism comes into play when there are two distinct water pieces: one at its full state (maximum) and the other at its empty state. A variable called `wantedScale` is used to control the water's state. When the `wantedScale` value is 0, the water’s Y scale is interpolated from its maximum value to 0, using Unity’s Update function as shown below:

if (canChangeScale && !isWaterFlowPaused && IsRequiredPieceConnected || (!isPieceDependent && !isWaterFlowPaused))
{
pondVisual.localScale = Vector3.MoveTowards(pondVisual.localScale, wantedScale, MyTime.deltaTime * scalingSpeed);
}


This interpolation effect creates the illusion of the water gradually rising or falling, based on the scaling speed. Once the value reaches 0, the water state transitions to empty, and the other piece begins to fill up with water. The two water pieces operate independently, responding only to their current state.

[previewyoutube][/previewyoutube]

For the flow sequence to begin, the correct piece must be connected to the current piece. If an incorrect piece is connected, the water flow will not initiate, ensuring the mechanic behaves as expected only under the right conditions.

And that’s a wrap on today’s devlog! By using this system, the team was able to replicate the natural behavior of water flow, which adds a layer of immersion to the game world. It's always exciting to bring these mechanics to life, and the team looks forward to refining this feature further.

Stay tuned for more updates, and as always, keep experimenting with dynamic systems in your own projects!

Best regards,
Playdew team

https://store.steampowered.com/app/1752540/Lost_Twins_II/

Devlog # 53 - Designing achievements for game

Hello!
Welcome to another behind-the-scenes look at Lost Twins 2! This week, we’re diving into a feature that adds depth, creativity, and a sprinkle of challenge to the game—Achievements.

Achievements aren’t just about collecting rewards; they’re about redefining how you approach the game. They encourage exploration, experimentation, and sometimes, a little out-of-the-box thinking. Whether it’s finding a clever solution to a puzzle or discovering hidden interactions, achievements in Lost Twins 2 are designed to enhance your journey in exciting and unexpected ways.

The Philosophy Behind Achievements

From the outset, we approached achievement design with a simple yet ambitious goal: to make them as rewarding and delightful as the core gameplay itself. We wanted achievements to challenge players in meaningful ways, pushing them to pause, think, and experiment.

In Lost Twins 2, achievements aren’t just about ticking off tasks—they’re invitations to explore the game’s puzzles from fresh perspectives. Every level includes its own unique achievement, encouraging players to rethink conventional solutions and uncover new ways to interact with the game world.

Let’s take a closer look at how our achievements elevate gameplay.

Example 1: Feathers with Abi

[previewyoutube][/previewyoutube]

In this level, it’s natural to use Ben to collect the feathers—it’s the easier option. But the achievement flips the script, challenging players to use Abi instead. This seemingly small change shifts the strategy, encouraging players to see Abi’s unique abilities in a whole new light.

Example 2: Rethinking Boulder Placement



Here, the standard solution involves placing a boulder on a button to open the path to the portal. The achievement, however, encourages players to find an alternate solution. It’s a clever twist that turns a straightforward puzzle into a moment of creative problem-solving and satisfaction.

Balancing Fun and Challenge
We worked hard to strike the perfect balance between challenge and accessibility, ensuring that every achievement feels rewarding without becoming frustrating. Our aim? To make 100% completion an achievable goal for everyone, while adding replayability and depth to each level.

Thank you for joining us on this deep dive into the achievements of Lost Twins 2. We hope this glimpse behind the curtain has inspired you to see these challenges as more than just goals—they’re opportunities to explore, experiment, and experience the game in new and exciting ways.

Your feedback and support mean the world to us, and we can’t wait to hear about the creative solutions you discover while unlocking these achievements. Don’t forget to share your favorite moments with us on social media!

Until next time, happy puzzling and see you next week!

Best regards,
Playdew Team

https://store.steampowered.com/app/1752540/Lost_Twins_II/

Devlog # 52 - Water effects

Hi guys! Hope you are enjoying our water devlog series. Water is a crucial element in the game, adding depth and interactivity to the game world. From creating immersive visuals to simulating realistic physics and effects, the implementation of water was a multi-faceted challenge that pushed our creativity and technical skills. In this devlog series, we’ve explored various aspects of how we brought water to life. The last two parts focused on character and interactive physics in water. Today, let’s dive into water visuals and the various effects that bring it to life.

[previewyoutube]https://youtu.be/s3SYq48etoM[/previewyoutube]

Water Visuals and Shader Implementation

Water in Lost Twins 2 is generally cuboid in shape, whether it’s in a tank or sometimes suspended in the air. To achieve this, we added planes on five sides of the cuboid, excluding the back plane. We created a custom water shader with parameters like tint, specular highlights, and most importantly, distorted refraction—a key element in making it feel like water.

The front plane, positioned close to the camera, distorts everything behind it, including characters, interactables, and the environment. This distortion is achieved using a normal map integrated into the material. The distortion effect is dynamic, influenced by a noise factor that changes over time.

Although all five planes use the same shader, their materials have slightly tweaked parameters to enhance the overall look and feel. For instance, the side, top, bottom, and front planes each have unique material settings to ensure visual consistency and immersion.

[previewyoutube][/previewyoutube]

Character Interaction

When a character or interactable enters the water, we simulate bubbles, foam, and turbulence using spritesheet effects. We utilize two distinct spritesheets: one for the water surface reaction and another for underwater turbulence.

The effects dynamically adjust based on the object’s velocity, particularly in the Y-axis. For example, objects dropped from a greater height create more pronounced turbulence before buoyancy takes over. The FX scale and movement adapt to the object’s behavior, adding a sense of realism.

While we initially experimented with Unity’s particle system, it didn’t achieve the desired visual quality. Ultimately, we opted for custom spritesheets to better match the aesthetic we envisioned.

A similar approach was taken for when characters climb out of the water. We used a different spritesheet to simulate water splashing onto the character and surrounding environment. This effect adds a finishing touch, enhancing the interaction’s believability.

[previewyoutube][/previewyoutube]

The Water Wall

Another unique feature is the “water wall,” which characters can pass through while still containing water when objects are thrown into it. Initially, we tried creating the wall using two parallel planes with a 0.2-unit distance between them, adding front and top planes for thickness. However, for optimization, we simplified the design to a single side plane. Despite this reduction, the addition of front and top planes creates the illusion of thickness, maintaining the desired visual effect.

[previewyoutube][/previewyoutube]

Thanks for sticking with us through this deep dive into water implementation! We hope you enjoyed learning about the techniques and creativity that went into making water a key feature in the game. See you next time!

Best regards,
Playdew Team
https://store.steampowered.com/app/1752540/Lost_Twins_II/

Devlog # 51 - Character physics in water Part 2

Hi again!
In our last devlog, we tackled the intricacies of character physics in water, exploring how buoyancy and fluid dynamics affect movement. This time, we’re taking it a step further by diving into the interactions between characters and in-game objects submerged in water. From floating boxes to sinking boulders, we’ll walk you through the mechanics behind how these objects behave when they enter the water, and how we’ve enhanced their physics to create a more immersive and dynamic experience. Let’s jump in!

These objects already have rigidbodies, colliders, and ground physics implemented, so adding buoyancy to them was the logical next step. Just like the characters, we added buoyancy forces to make these objects behave more naturally when submerged. The boulder, being denser, sinks slowly compared to how it behaves in air, while the box rises to the surface at a steady pace.

[previewyoutube][/previewyoutube]

Floating Box Physics

The floating box required a few extra tweaks to make it feel more natural. To achieve a gentle wobble when the box floats at the water’s surface, we added a slight variation to the buoyancy force. Initially, the box rises and falls more noticeably when it first reaches the surface, as the buoyancy force gradually decreases and stabilizes. As the forces of gravity and buoyancy find a balance, the box settles, but we continuously introduce slight fluctuations in the FixedUpdate() to maintain a subtle wobble effect.

Additionally, we had to account for when a character lands on top of the box. Since all our physics are custom, we applied a small downward impulse when the character jumps onto the box. This decreases the buoyancy just enough to submerge the box slightly more than when the character is not on it. To add a bit of realism, we also introduced a small torque force. The torque is based on the character’s X position relative to the box’s center, causing the box to rotate toward the character’s landing position. If the character lands too far to the side, the box rotates by up to 90 degrees, eventually submerging the player if they fall off.

To ensure the box remains upright in the water, we applied a lerp function to rotate the box back to the nearest 90-degree angle relative to the water’s surface.

[previewyoutube][/previewyoutube]

Pushing Boxes Underwater

When the character pushes a box underwater, we use the OnCollisionEnter() function to detect when the player collides with the box. If the player presses any directional key, force is applied to the box in that direction. Additionally, it switches the character’s animation from normal swimming to a “pushing box” animation to reflect this action.

Unstucking Boxes and Boulders

Sometimes, the box or boulder can get stuck in corners between a wall and a roof. When this happens, we added an extra layer of logic: when the character presses the up key while stuck in a corner, an additional force is applied in the opposite direction of the wall to free the object. This ensures the box or boulder can escape these tight spots and continue interacting with the character.

[previewyoutube][/previewyoutube]

In the next part of this water series, we’ll be covering how we implemented some of the special water-based effects for both characters and interactable objects. Stay tuned for more!

Best regards,
Playdew Team

https://store.steampowered.com/app/1752540/Lost_Twins_II/

Devlog # 50 - Character physics in water Part 1

Hi guys!
Water is finally here! Adding it to our game wasn’t just about making it look cool—it completely transformed how the world and the player interact. From realistic buoyancy to swimming mechanics, creating water physics has been both a technical challenge and a rewarding experience. In this devlog, we’ll take you behind the scenes to show how we implemented character physics in water, tackled unexpected hurdles, and made swimming feel natural and fun. Let’s dive in!

Custom Physics for the Player:
In our game, we’ve built custom physics for all player interactions. While the character uses Unity’s Rigidbody and CapsuleCollider, there’s no gravity by default. Movement is handled manually in the Update() function using boxcasts to determine accurate X and Y positions. With water, we had to extend this custom approach.

Detecting Water Interaction:
To switch between normal platforming and water physics, we added four child transforms to each water area to define its bounds. These allow us to detect when the player enters or exits water. Once in water, the physics shift. A buoyancy force is introduced alongside gravity. For example:

If the player enters from above, they sink initially until buoyancy kicks in, eventually bringing them back up to the surface.

For special water areas (like those suspended in air by magical force fields), the player can enter from any direction, but the buoyancy-gravity interaction still ensures a natural flow.

Swimming Mechanics:
When the player provides input (using arrow keys), the dynamics change: Buoyancy and gravity are temporarily disabled, and the player accelerates in the direction of input. Velocity is clamped to avoid unnatural speeds, creating a deliberate swimming motion.
Additionally, the character’s head rotates to align with the direction of movement, enhancing immersion and giving the swimming motion a natural feel.

[previewyoutube][/previewyoutube]

Handling Physics in FixedUpdate:
Unlike ground movement, which is processed in Update(), water movement is handled in FixedUpdate() for better collision accuracy. Unity’s physics engine takes over here, ensuring the player is stopped by obstacles like walls or floating debris.

However, this introduced an unexpected issue: the camera became jerky since it was still updating in Update(). To fix this, the CameraController now dynamically switches to FixedUpdate() when the player enters water, providing smooth tracking.

[previewyoutube][/previewyoutube]

What’s Next?
This was just the foundation for water physics. In the next devlog, we’ll explore:

Interactions with objects in water, like floating boxes and sinking boulders.
The FX that make water feel alive, from ripples to splashes when the player interacts with it.
Thanks for reading, and as always, feel free to share your thoughts and feedback. Stay tuned for more! 😊

Best regards,
Playdew Team

https://store.steampowered.com/app/1752540/Lost_Twins_II/