<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lana Elfstrom on Medium]]></title>
        <description><![CDATA[Stories by Lana Elfstrom on Medium]]></description>
        <link>https://medium.com/@lanaelfstrom?source=rss-61ed4f1e3456------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M0hFZSY672fk3dnHmQzvIw.jpeg</url>
            <title>Stories by Lana Elfstrom on Medium</title>
            <link>https://medium.com/@lanaelfstrom?source=rss-61ed4f1e3456------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:21:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lanaelfstrom/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unity: Efficient File Management Matters]]></title>
            <link>https://medium.com/@lanaelfstrom/unity-efficient-file-management-matters-9f9a3f390d2d?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f9a3f390d2d</guid>
            <category><![CDATA[unity-development]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity2d]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Fri, 14 Feb 2025 10:39:56 GMT</pubDate>
            <atom:updated>2025-02-14T10:39:56.796Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started working in Unity, I didn’t think much about how my project files were organized. I imported assets and used them as they were, without considering the effect of moving or deleting them later. Now, my project folder is a chaotic mess, and I’ve learned the hard way why good organization matters.</p><p><strong>Understanding Unity’s Project Structure</strong></p><p>When you create a Unity project, it automatically generates a few essential folders:</p><ul><li><strong>Assets</strong> — This is where everything you import or create lives: scripts, sprites, audio, prefabs, materials, and more.</li><li><strong>Library</strong> — A cache of imported assets; Unity manages this, and you generally don’t touch it.</li><li><strong>Temp</strong> — Stores temporary files, mostly for the editor. It gets regenerated.</li><li><strong>Logs &amp; Packages</strong> — These handle dependencies and project logs.</li></ul><p><strong>Best Folder Structure for a Clean Project</strong></p><p>To keep things tidy from the start, create folders inside the <strong>Assets</strong> folder:</p><ul><li><strong>Animations</strong> — Store all Animator Controllers, animations, and related files.</li><li><strong>Audio</strong> — Background music, sound effects, and voice clips.</li><li><strong>Materials</strong> — All materials and shaders.</li><li><strong>Prefabs</strong> — Prefabricated GameObjects to reuse across scenes.</li><li><strong>Scenes</strong> — All scene files.</li><li><strong>Scripts</strong> — C# scripts should be categorized further if needed (Player, Enemy, UI, etc.).</li><li><strong>Sprites/Textures</strong> — Organized by categories like Characters, Backgrounds, UI.</li><li><strong>UI</strong> — Anything related to user interface elements.</li></ul><p><strong>What About Unused Files?</strong></p><p>If a file isn’t being used, don’t just delete it on impulse. Instead, move unused files into a <strong>Backup</strong> or <strong>Unused</strong> folder before deletion. This gives you a safety net in case you need them later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*kS-mPBi2XeZHw7ZtMeXp9w.png" /><figcaption>Unity Inspector — Missing Prefabs</figcaption></figure><p><strong>The Consequences of Moving or Deleting Files</strong></p><p>I once moved my prefabs into a different folder, and suddenly, I had <strong>missing prefabs everywhere</strong> in my game! That’s because Unity tracks asset locations based on their original path. Moving files breaks references in scenes and scripts, leaving you with missing GameObjects and broken connections. The same goes for audio, materials, and textures.</p><p><strong>How to Move Files Safely</strong></p><p>If you need to reorganize your project:</p><ol><li><strong>Move files inside Unity</strong>, not through the file explorer. This ensures Unity updates references.</li><li><strong>Use the search bar</strong> to check for missing assets after moving them.</li><li><strong>Refactor in small steps</strong> to avoid breaking too many things at once.</li></ol><p><strong>Industry Standards &amp; Efficiency</strong></p><p>While there’s no single “industry standard,” most professional teams follow structured naming and folder conventions like the ones mentioned above. Keeping things organized makes collaboration easier and speeds up development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*reMAI5fMCfjce1agJtZTMg.png" /><figcaption>Missing Folders — Project Folder</figcaption></figure><p><strong>If You Delete Something</strong></p><p>If you delete a file from Unity, it usually disappears completely. However, if you’ve moved a folder outside of Unity, you might still see its “ghost” in the project because Unity’s metadata files weren’t properly updated. If this happens, try refreshing the project (right-click <strong>Assets</strong> &gt; <strong>Reimport All</strong>) or restarting Unity.</p><p><strong>Final Thoughts</strong></p><p>Had I known all of this earlier, I would have saved myself so much trouble. Setting up an organized folder structure from the start is crucial, and moving or deleting files without understanding the consequences can cause major headaches. If your project is already a mess, it’s worth taking the time to clean it up properly — just <strong>move files within Unity</strong> and check for broken references along the way.</p><p>If you’re just starting a Unity project, plan your folders early. Future-you will thank you!</p><p><strong>What about you?</strong> Have you ever broken your game by moving or deleting files? How bad was it? Do you have a system for keeping your Unity projects organized? Share your experiences and tips in the comments! Let’s help each other keep our projects clean and efficient!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f9a3f390d2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling Remainders in Sequential Spawning]]></title>
            <link>https://medium.com/@lanaelfstrom/handling-remainders-in-sequential-spawning-9262083e28d3?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/9262083e28d3</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[cshar]]></category>
            <category><![CDATA[unity3d]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Tue, 11 Feb 2025 08:18:01 GMT</pubDate>
            <atom:updated>2025-02-11T08:18:01.707Z</atom:updated>
            <content:encoded><![CDATA[<p>When designing <strong>spawning systems</strong>, it’s crucial to account for edge cases. For my <strong>Space Station</strong> fleet, I initially set the fleet size to 40, which worked perfectly with my <strong>array </strong>of 10 enemy types. But what happens if I want a fleet of 35? Handling remainders is an often-overlooked aspect of <strong>sequential spawning</strong>, but coding for it ensures your system is robust and adaptable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*CL_rnfJ_4GomZF8lJp6jTw.png" /><figcaption>Fleet — Sequential Spawning</figcaption></figure><p>If the fleet size isn’t a multiple of the <strong>array </strong>length, the system still needs to loop through the <strong>array </strong>correctly. For example, with a fleet size of 35 and 10 enemy types, the last loop would use only the first 5 enemies in the <strong>array</strong>. Without proper handling, this could lead to errors or unintended behavior.</p><pre>IEnumerator SpawnEnemyFleet() <br>{<br>for (int i = 0; i &lt; totalEnemyFleet; i++) {<br>int index = i % enemyFleet.Length;<br>Instantiate(enemyFleet[index]);<br>yield return new WaitForSeconds(0.5f);<br>}</pre><p>By using the <strong>modulo operator (%)</strong>, the system automatically cycles through the <strong>array</strong>, regardless of the fleet size.</p><p><strong>Why This Matters</strong></p><p>Ignoring edge cases can lead to unexpected bugs, especially as your game scales. Planning for remainders ensures your system can handle any fleet size, making it more versatile and reliable.</p><p><strong>Advice for Developers</strong></p><p>When designing <strong>spawning systems</strong>, always:</p><ul><li><strong>Test with Different Numbers:</strong> Check how your system handles non-standard inputs.</li><li><strong>Plan for Flexibility:</strong> Use techniques like <strong>modulo </strong>to keep your code adaptable.</li><li><strong>Think Ahead:</strong> Anticipate future needs and edge cases to save time later.</li></ul><p>Accounting for remainders may seem like a small detail, but it’s these details that elevate a game from functional to polished. With the fleet <strong>spawning system</strong> complete, I’m ready to tackle the next phase of the<strong> Space Station</strong> <strong>boss</strong>’s design — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9262083e28d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sequential Spawning: Space Station Fleet]]></title>
            <link>https://medium.com/@lanaelfstrom/sequential-spawning-space-station-fleet-253af8a511ae?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/253af8a511ae</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[gamedev]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 07:21:16 GMT</pubDate>
            <atom:updated>2025-01-21T07:21:16.448Z</atom:updated>
            <content:encoded><![CDATA[<p>When designing the first attack for my<strong> Space Station boss</strong> battle, I needed a way to <strong>spawn </strong>a fleet of 40 enemies. Unlike earlier systems that used <strong>randomization</strong>, this fleet required <strong>sequential spawning</strong>. Each ship had a unique appearance but identical behavior, and they needed to appear in order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*bFYbHyQd2jOPFxm-7Mpb6g.png" /><figcaption>Enemy Fleet</figcaption></figure><p>For this scenario, <strong>randomization </strong>would have disrupted the visual cohesion of the fleet. The sequential order added a sense of deliberate design and pacing to the attack, making it feel more intentional and impactful.</p><p>I started by creating an<strong> array</strong> to hold the fleet’s enemy <strong>prefabs</strong>:</p><pre>[SerializeField]<br>private GameObject[] enemyFleet;<br>[SerializeField]<br>private int totalEnemyFleet = 40;</pre><p>Next, I wrote a<strong> coroutine</strong> to <strong>instantiate</strong> the enemies in order:</p><pre>IEnumerator SpawnEnemyFleet() <br>{<br>for (int i = 0; i &lt; totalEnemyFleet; i++) {<br>int index = i % enemyFleet.Length;<br>Instantiate(enemyFleet[index]);<br>yield return new WaitForSeconds(0.5f); // Adjust timing as needed<br>}<br></pre><p>Using <strong>i % enemyFleet.Length </strong>ensured that the <strong>array</strong> looped seamlessly if the total number of ships exceeded the<strong> array</strong>’s size.</p><p><strong>Benefits of This Approach</strong></p><ul><li><strong>Inspector Control:</strong> By making <strong>_totalEnemyFlee</strong>t a <strong>serialized field</strong>, I could easily adjust the fleet size without modifying the code.</li><li><strong>Flexible Timing:</strong> The <strong>coroutine</strong> allowed me to control the pacing of the spawning process, adding dramatic tension to the attack.</li></ul><p><strong>Sequential spawning</strong> required a shift in mindset from randomization to intentional design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=253af8a511ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arrays and Randomization]]></title>
            <link>https://medium.com/@lanaelfstrom/arrays-and-randomization-66ae539f95f4?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/66ae539f95f4</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 07:47:36 GMT</pubDate>
            <atom:updated>2025-01-21T04:23:20.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dKZe-muKtiKSzbrES01qg.png" /><figcaption>Enemies &amp; Powerups</figcaption></figure><p>Game development often requires revisiting past solutions to tackle new challenges. Building the enemy fleet for my Space Station boss battle, I revisited how I transitioned from else if statements to arrays and randomization when managing powerups and enemies. While those methods don’t directly apply to my current needs, they laid the foundation for scalable spawning systems and shaped my approach to problem-solving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*72tdJneZTt6yY7R2_9DR4A.gif" /><figcaption>PowerUp/Enemy Arrays</figcaption></figure><p>Early in development, I used else if statements to handle powerup and enemy spawning. For example:</p><pre>if (powerupType == 1) <br>{<br>    Instantiate(ShieldPowerup);<br>} <br>else if (powerupType == 2) <br>{<br>    Instantiate(SpeedBoost);<br>}</pre><p>This approach worked for a while, but as I added more powerups and enemy types, the code became unwieldy. Each new addition required modifying multiple lines, which increased the risk of bugs and made the system harder to maintain.</p><p>To simplify and future-proof my code, I replaced the else if structure with arrays and randomization. Here’s an example of how I implemented this for powerups:</p><pre>[SerializeField]<br>private GameObject[] powerups;<br><br>void SpawnPowerup() <br>{<br>    int randomIndex = Random.Range(0, powerups.Length);<br>    Instantiate(powerups[randomIndex]);<br>}</pre><p>This change grouped related objects into arrays, allowing for cleaner and more flexible code. Adding a new powerup became as simple as dragging it into the array in Unity’s Inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*vaLhMYGNdNjrDuoOkr1OSA.gif" /><figcaption>Powerup, Enemy &amp; Probability Arrays — Unity Inspector</figcaption></figure><p>Revisiting this system while working on the Space Station fleet reminded me of the importance of adaptability. Arrays and randomization worked well for powerups and earlier enemies, but weren’t suitable for the sequential spawning required for my fleet. Even so, the structured thinking I developed during those early stages helped me evaluate and design the new system.</p><p>Reflecting on past methods isn’t about reusing the same solutions but about building on them to solve new challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66ae539f95f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Waypoints for Space Station Attack: Swarming Strategy]]></title>
            <link>https://medium.com/@lanaelfstrom/exploring-waypoints-for-space-station-attack-swarming-strategy-4f6dcef9df45?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f6dcef9df45</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 09:02:15 GMT</pubDate>
            <atom:updated>2025-01-12T09:02:15.538Z</atom:updated>
            <content:encoded><![CDATA[<p>As I develop my first Space Station attack in my space shooter game, I’ve decided to experiment with waypoints to create a more dynamic and challenging enemy behavior. My goal is to introduce a swarming effect reminiscent of classics like <em>Space Invaders</em> or <em>Centipede</em>, where enemies move in a coordinated pattern but with unpredictable elements to keep the player on their toes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*ahd56a1bffMw2euI0_IkWA.gif" /><figcaption>Space Station</figcaption></figure><p>Waypoints are predefined positions that objects (like enemies) follow in a game. In this case, I’ll use waypoints to control the movement of enemies across the screen, allowing them to patrol in set paths while also having the flexibility to move randomly between certain points. By utilizing waypoints, I can create a more structured yet unpredictable swarm, where enemies coordinate their movements but still retain some randomness. This new approach is an exciting challenge for me, as I’m learning how to implement waypoint systems to bring more depth and complexity to the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*CL_rnfJ_4GomZF8lJp6jTw.png" /><figcaption>Enemy Fleet Serpentine</figcaption></figure><p>For this particular attack, I’m aiming for a patrolling behavior for the enemies, with random, occasional laser shots fired at a low rate. This randomness will make it harder for the player to predict which enemies will shoot and when, adding tension and excitement to the gameplay. To heighten the challenge, I plan for all enemies in this wave to need to be destroyed before the next wave spawns. Additionally, any collision with an enemy will result in damage to the player, making strategy crucial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*TTgbhxLaURyR-svB4TKM9A.png" /><figcaption>Enemy Fleet Formation</figcaption></figure><p>I’ll be adding an element of unpredictability by having enemies change colors randomly. Some will be worth more points when shot, and I’m considering including special “scatter ships” that offer a larger point value. This will encourage players to identify and target specific enemies in the swarm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*r_Q7CX8PbIFPBohdeHv63A.png" /><figcaption>Space Station</figcaption></figure><p>I’m also implementing a self-destruct mechanic for all enemies within a set timeframe, ensuring that players can’t just sit back and wait for enemies to become easy targets. This will ramp up the urgency, making each attack feel like a fresh challenge.</p><p>This new wave mechanic aims to keep players engaged, testing their reflexes and strategic thinking while adding layers of complexity to the gameplay.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f6dcef9df45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Default Transitions in Unity Animator Controllers]]></title>
            <link>https://medium.com/@lanaelfstrom/understanding-default-transitions-in-unity-animator-controllers-6e9f69a414a5?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e9f69a414a5</guid>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 09:25:15 GMT</pubDate>
            <atom:updated>2025-01-07T09:25:15.345Z</atom:updated>
            <content:encoded><![CDATA[<p>When I looked back at some of my earlier <strong>Animator Controllers</strong> for review and reference, I noticed something surprising: every one of them only used the <strong>default transition</strong>. These controllers worked fine for simple animations, but at the time, I wasn’t aware that the default<strong> </strong>transitions couldn’t be previewed. This has not yet been an issue because those controllers didn’t rely on complex transitions or blending — the default setup simply played the connected animation when triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45_qiM1gtKnoI2aD2dHBGw.png" /><figcaption>Asteroid Animator Controller</figcaption></figure><p>Every <strong>state machine</strong> begins with an <strong>Entry</strong> node connected to a default transition. This transition determines the starting <strong>state</strong> of your animations when the <strong>Animator</strong> is first activated. Default<strong> </strong>transitions link the <strong>Entry</strong> <strong>node</strong> to a specific animation state, acting as the initial entry point when the Animator Controller starts running. Unlike other transitions:</p><p>· They don’t involve blending between two animations.</p><p>· They lack parameters, exit times, or conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6I-hxrIff2DVJskjK46aw.png" /><figcaption>Enemy Explosion Animator Controller</figcaption></figure><p>These characteristics make default transitions unique, but also limit their functionality — and, importantly, <strong>you can’t preview them</strong> in <strong>Unity’s Animator </strong>window. Default transitions start the Animator without transitioning from a prior state. Since they act as a direct entry point, there are no configurable conditions to evaluate or test. The connected animation state plays immediately when the <strong>Animator</strong> starts, leaving no room for previewing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4g9KlHdnm7Z5zKJc7rv_Bw.png" /><figcaption>Triple Shot Animator Controller</figcaption></figure><p>For my latest project, I’m stepping beyond default transitions. This will be my first time integrating animation<strong> </strong>transitions to create more dynamic and responsive animation flows. By defining conditions and blending durations, I’ll achieve smoother transitions between states, moving closer to a polished final product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ym4axmGWXqye7hzsh6QBIA.png" /><figcaption>Space Station Animator Controller — State Machine</figcaption></figure><p>Default transitions are a foundational part of <strong>Unity’s</strong> <strong>Animator</strong> <strong>Controller</strong>, but their limitations make them unsuitable for complex animation setups. If you’re exploring advanced animation workflows, understanding transitions and how to configure them is essential.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e9f69a414a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Space Station State Machine]]></title>
            <link>https://medium.com/@lanaelfstrom/space-station-state-machine-a8d21a099910?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8d21a099910</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 09:33:47 GMT</pubDate>
            <atom:updated>2025-01-11T02:56:12.610Z</atom:updated>
            <content:encoded><![CDATA[<p>My <strong>Space Station State Machine</strong> is an organized framework controlling the Space Station’s behavior and animations as it interacts with the player and the Boss. I’ve created a structured sequence of entering, idling, engaging in attacks, disengaging from the Boss, and finally exiting the scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*q-cvAPtg-TziDJJzZ7hQgw.gif" /></figure><p><strong>Entry Point</strong>:</p><ul><li>The state machine begins in the Entry state, transitioning through a series of <strong>enter animations</strong>:</li><li>Space_Station_Enter_anim1</li><li>Space_Station_Enter_anim2</li><li>Space_Station_Enter_anim3</li><li>Space_Station_Enter_anim4</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUvCT0onL3ynfZeuwqqbcA.png" /><figcaption>Space Station</figcaption></figure><p><strong>Idle States Between Animations</strong>:</p><ul><li>After each <strong>enter animation</strong>, the Space Station transitions back to the Space_Station_Idle state.</li><li>During <strong>Idle</strong>, enemy attacks occur, adding action between animations.</li><li>Once the attacks are complete, the Space Station progresses to the next <strong>enter animation</strong>, repeating this cycle until Space_Station_Enter_anim4.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ym4axmGWXqye7hzsh6QBIA.png" /><figcaption>Animator Control — State Machine</figcaption></figure><p><strong>Disengagement and Exit</strong>:</p><ul><li>After completing Space_Station_Enter_anim4, the Space Station transitions to Space_Station_Exit_anim.</li><li>During this phase, the Space Station disengages from the attached Boss and exits the scene entirely.</li></ul><p><strong>Boss Centering</strong>:</p><ul><li>Once the Space Station has exited, the Boss transitions into the Boss_Enter_anim state.</li><li>This state moves the Boss to the center of the scene, setting up the stage for the next phase of gameplay.</li></ul><p><strong>End for Now</strong>:</p><ul><li>As the Boss states haven’t been implemented yet, the flow currently ends with the Boss entering the center of the scene.</li></ul><p>The <strong>Idle states</strong> interspersed with attacks keep the gameplay active and engaging, avoiding prolonged animation sequences without interaction.<br>The sequence of animations and the Space Station’s dramatic disengagement and exit effectively set the stage for the Boss encounter, heightening tension and anticipation. The clear delineation between the Space Station’s and the Boss’s behaviors allows for easy expansion. When you define the Boss states, they’ll integrate seamlessly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8d21a099910" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding and Implementing States in Your Boss AI for Unity Games]]></title>
            <link>https://medium.com/@lanaelfstrom/states-allow-us-to-structure-ai-behavior-into-manageable-chunks-74e516ea367e?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/74e516ea367e</guid>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Sun, 05 Jan 2025 11:44:19 GMT</pubDate>
            <atom:updated>2025-01-05T11:49:14.828Z</atom:updated>
            <content:encoded><![CDATA[<p>States allow us to structure AI behavior into manageable chunks. Instead of writing a single script that tries to cover every possible scenario, we can break down the boss’s actions into discrete states such as <em>Idle</em>, <em>Attack</em>, <em>RapidFire</em>, <em>Shield </em>or <em>Deploy</em>. This simplifies code organization, makes debugging easier and allows for more readable and scalable scripts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyE2S1Tu523qyFU-0rO24g.png" /><figcaption>BossState Enumerators</figcaption></figure><p>In Unity, you can implement states using enumerations (enums) combined with a state machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KS--kw5b4umO1jlSrJInmQ.png" /><figcaption>BossAI Script</figcaption></figure><p>Add a variable to track the current state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V2V4zcR1FQf_048NVA4ljw.png" /><figcaption>Boss Update()</figcaption></figure><p>Using states determines when and how the boss transitions between them. You can use timers, health thresholds, or player actions as triggers. If your boss has intricate behaviors, you might want to add sub-states within a main state. For instance, the <em>Attack</em> state could have sub-states like <em>ShootLaser</em> and <em>DropBombs</em>. You can nest enums or use separate methods to manage these.</p><p><strong>Debugging Tips</strong></p><ul><li>Use Debug.Log to print the current state during gameplay. This helps ensure transitions are happening as expected.</li><li>Test each state independently before integrating them into the full boss behavior.</li><li>Make use of Unity’s Animator for visualizing state transitions if your boss has complex animations.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74e516ea367e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keyframe Animation: A New Adventure in Game Development]]></title>
            <link>https://medium.com/@lanaelfstrom/keyframe-animation-a-new-adventure-in-game-development-8737a91b561b?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/8737a91b561b</guid>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Sat, 04 Jan 2025 11:03:25 GMT</pubDate>
            <atom:updated>2025-01-04T11:14:05.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*4Xqf1azIibVc6b8Xkadkhg.gif" /><figcaption>Key Frame Animation</figcaption></figure><p>Much of my early animation experience relied on sprite sheets. From the fiery asteroid explosion at the start of the game to the engine flames, flashing pickups, and shield visualizers, sprite sheets were my go-to. As I approached the final boss wave of my Unity space shooter, I’ve discovered a new set of tools and possibilities using keyframe animation.</p><p><strong>Sprite Sheets: A Foundation for Animation</strong></p><p>Sprite sheets have been a fantastic introduction to animation for me. They allowed me to bring life to the game’s explosions, thrusters, and powerups. For example:</p><ul><li><strong>Enemy Explosions</strong>: A sequence of frames creating a dynamic visual as enemies are destroyed.</li><li><strong>Powerups</strong>: The speed, triple shot, and shield powerups were animated with flashing colors to draw attention.</li></ul><p><strong>Enter Keyframe Animation</strong></p><p>For the final boss wave, I needed something more intricate: a space station making an ominous entry and signaling upcoming attacks. This was my first attempt at keyframe animation, and it has opened up new creative possibilities.</p><p>Instead of relying on sprite sheets, I used Unity’s Animation window to create and manipulate the station’s movements directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2o8631gH-5csk-glodG9IA.png" /><figcaption>Boss and Space Station</figcaption></figure><ol><li><strong>Designing the Entrance</strong>: The space station starts by dropping into the left corner of the screen, then rotates and moves across the top. It speeds up, rotates faster, and finally drops to the center.</li><li><strong>Splitting into Clips</strong>: Once the entire sequence was complete, I split the animation into four shorter clips. Each clip corresponds to a unique movement or attack signal.</li><li><strong>Triggering with Code</strong>: These animations are triggered through scripts, ensuring smooth transitions and syncing with player progress.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExHb97R8mQIs3FuwohK3jg.png" /><figcaption>Space Station Script</figcaption></figure><p><strong>Why Keyframe Animation?</strong></p><p>Keyframe animation allows for greater flexibility and precision compared to sprite sheets.</p><ul><li>Adjust movements, rotations, and speeds directly in Unity.</li><li>Create complex patterns without needing extensive art assets.</li><li>Easily tweak animations without starting from scratch.</li></ul><p><strong>Lessons Learned</strong></p><p>Stepping into keyframe animation taught me valuable lessons:</p><ul><li><strong>Planning is Key</strong>: Mapping out the animation sequence beforehand saved time.</li><li><strong>Experimentation Pays Off</strong>: Trying new tools and methods broadened my skill set.</li><li><strong>Patience is Essential</strong>: Learning Unity and C# has required me to embrace challenges and keep expectations realistic.</li></ul><p>The final boss wave is a work in progress. Each movement and attack sequence will build upon this foundation. It’s an incredible tool to add depth and polish to your games.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8737a91b561b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Final Wave: Boss AI]]></title>
            <link>https://medium.com/@lanaelfstrom/final-wave-boss-ai-53b3da58517d?source=rss-61ed4f1e3456------2</link>
            <guid isPermaLink="false">https://medium.com/p/53b3da58517d</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Lana Elfstrom]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 10:06:27 GMT</pubDate>
            <atom:updated>2025-01-03T10:06:27.232Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAqTSdSPKNvfBmG0hNBu-g.png" /><figcaption>Space Station — Final Wave</figcaption></figure><p>The final wave of my space shooter game culminates with an epic showdown against a boss that descends to the center of the screen, where it remains until the player either wins or is defeated. This climactic encounter features a series of unique attacks, culminating in the ultimate destruction of the boss to claim victory.</p><p>As an added twist, I’ve included a “bonus” element to the final boss wave: a space station animation. This deceptive feature introduces a fleet of new enemies and space mines, which add chaos and excitement to the scene. Here’s how it works:</p><p>The space station enters dramatically, dropping into one corner of the screen before traveling across the top. It spins, reverses direction, and returns to the center. During each directional change, the space station launches a new attack on the player. The goal is to trick the player into believing this is the final boss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*GObinK8eBsNSNDPWSYVTGA.png" /><figcaption>Animation — Space Station</figcaption></figure><p>Once the station reaches the center of the screen, it enters an idle state. After a brief animation — which I hope to enhance with an electric energy effect — the space station disengages from the boss, exits the scene, and leaves the player to face the true final challenge. At this point, the boss begins its own sequence of unique and relentless attacks.</p><p>To manage this complex sequence, I’ve opted to combine animations and states using switch statements. This approach keeps everything organized and manageable, especially when dealing with multiple attack patterns and transitions. Each state within the switch corresponds to a distinct behavior, from movement paths and attack patterns to idle animations and the boss’s ultimate showdown.</p><p>Designing this finale has been a rewarding exercise in balancing challenge, deception, and spectacle. It not only raises the stakes but also introduces an unexpected narrative twist that keeps players on their toes. Organizing the logic with switch statements has been crucial for maintaining clarity in the code while enabling smooth transitions between the space station’s and boss’s behaviors.</p><p>The final wave represents the culmination of everything I’ve learned throughout this development process — from animation techniques and state management to creating engaging gameplay. By blending these elements, I hope to deliver an unforgettable conclusion that rewards players for their persistence and skill.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53b3da58517d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>