<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Terrillo Walls</title>
    <description>The latest articles on Forem by Terrillo Walls (@terrillo).</description>
    <link>https://forem.com/terrillo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F129107%2F108469c7-e533-4144-bfb2-b463e184a772.jpeg</url>
      <title>Forem: Terrillo Walls</title>
      <link>https://forem.com/terrillo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/terrillo"/>
    <language>en</language>
    <item>
      <title>Theater Alpha - The Rewind Update</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Sun, 09 Nov 2025 20:38:23 +0000</pubDate>
      <link>https://forem.com/terrillo/theater-alpha-the-rewind-update-10ji</link>
      <guid>https://forem.com/terrillo/theater-alpha-the-rewind-update-10ji</guid>
      <description>&lt;p&gt;Alpha 3 introduces the feature that defines Theater Alpha’s identity: the Rewind System. It’s not a panic button. It’s a resource. You get two shots per mission to take back the last 15 seconds and choose a different line. Use them well and you’ll create momentum. Waste them and you’ll feel the weight of every decision that follows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Rewind exists
&lt;/h2&gt;

&lt;p&gt;I tested slow‑motion early on. It worked, but it turned into a tax. If a game gives you a “think longer” button, you’re punished for not pressing it. It becomes mandatory. &lt;a href="https://dev.to/terrillo/the-carrot-not-stick-design-approach-in-game-design-21b9"&gt;The Carrot not Stick design approach in Game Design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rewind flips that. You’re not avoiding mistakes—you’re learning from them. Try the flank. If it fails, roll it back and try a smarter angle. The story still includes the miss, and the adjustment is the point. It feels earned instead of automatic.&lt;/p&gt;

&lt;p&gt;Also, let’s be real: rewind moments are where the best stories come from. That breath before you commit. The oh‑no into the clean redo. That’s the clip you tell your friend about.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Two rewinds per mission&lt;/li&gt;
&lt;li&gt;Up to 15 seconds of time rolled back&lt;/li&gt;
&lt;li&gt;Positioning, orders, and squad state all revert&lt;/li&gt;
&lt;li&gt;Once you’re out, you’re out—every call after that is permanent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hesitation this creates is intentional. Do you save a pinned soldier now, or hold a charge for the final push? That small moment of doubt is where the game lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  New systems in Alpha 3
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Ammunition and reloads
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Soldiers carry limited ammo (180 rounds total capacity)&lt;/li&gt;
&lt;li&gt;Magazines empty and require reloads&lt;/li&gt;
&lt;li&gt;Weapons have distinct fire rates and reload timings&lt;/li&gt;
&lt;li&gt;Running dry in contact is a real risk now&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This combines cleanly with Rewind. Burn a roll‑back to fix a wasteful spray, or live with the cost and adapt your route.&lt;/p&gt;

&lt;h3&gt;
  
  
  Combat pacing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Fire rates introduce rhythm to fights&lt;/li&gt;
&lt;li&gt;Reload windows create brief vulnerability&lt;/li&gt;
&lt;li&gt;The 4‑soldier squad (down from 6 in earlier tests) makes each reload matter&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Design principle: carrot, not stick
&lt;/h2&gt;

&lt;p&gt;The goal isn’t to punish you for skipping systems—it’s to reward you for engaging them. You can clear missions without touching Rewind. If you do use it, it should feel powerful and earned, not required.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I’m watching in playtests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Do players hoard rewinds and regret it?&lt;/li&gt;
&lt;li&gt;Do they spend them too early on minor mistakes?&lt;/li&gt;
&lt;li&gt;Does the ammo economy create tension or just chores?&lt;/li&gt;
&lt;li&gt;What happens emotionally at 0 rewinds—good stress or bad friction?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you test this build, I want to hear about the moment you almost rewound but didn’t. What made you commit instead?&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next
&lt;/h2&gt;

&lt;p&gt;Alpha 3 validates core systems. Next up: mission structure—multi‑phase objectives, escalating threats, and a “gauntlet” format where ammo and health carry across phases. Rewind works. Now I’m building missions that make you desperate to use it.&lt;/p&gt;

&lt;p&gt;Try Alpha 3: &lt;a href="https://theateralpha.itch.io/theater-alpha" rel="noopener noreferrer"&gt;Itch.io&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>gamedesign</category>
      <category>strategy</category>
      <category>indie</category>
    </item>
    <item>
      <title>The Carrot not Stick design approach in Game Design</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Fri, 07 Nov 2025 19:29:00 +0000</pubDate>
      <link>https://forem.com/terrillo/the-carrot-not-stick-design-approach-in-game-design-21b9</link>
      <guid>https://forem.com/terrillo/the-carrot-not-stick-design-approach-in-game-design-21b9</guid>
      <description>&lt;p&gt;You're playing a strategy game where every system seems designed to punish you. Miss a daily login? Penalty. Ignore the crafting system? Your progression slows. Skip the tutorial? Good luck figuring anything out. Sound familiar? This is "stick" design—using punishment to force player engagement.&lt;/p&gt;

&lt;p&gt;But what if games rewarded you instead of punishing you? What if every system felt like an opportunity rather than an obligation? This is the philosophy behind "carrot" design, and it's transforming how we think about player motivation.&lt;/p&gt;

&lt;p&gt;Common Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Durability systems that punish players for using their favorite weapons&lt;/li&gt;
&lt;li&gt;Hunger/thirst meters that constantly drain and demand attention&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These systems work, but they create anxiety. Players engage not because it's fun, but because they're afraid of what happens if they don't.&lt;/p&gt;

&lt;p&gt;"Carrot" design flips this psychology: Do X and get bonuses. Instead of punishing avoidance, you reward engagement. Players choose to interact with systems because they want the benefits, not because they fear the consequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Stick Design&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When designing the tactical combat for Theater Alpha, I faced a classic problem: how do you give players time to think in a real-time tactical game without making them feel like they're being punished for not being fast enough?&lt;/p&gt;

&lt;p&gt;The obvious answer was slow-motion. When your soldier is detected by an enemy for the first time the game slows down. &lt;/p&gt;

&lt;p&gt;Slow-motion creates an invisible pressure: you should be using this. If you don't slow down time when things get chaotic, you're playing suboptimally. You're being punished for not engaging with the mechanic. It becomes a crutch you have to use rather than a tool you choose to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Carrot Design&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead, Theater Alpha gives you 2 rewinds per mission.&lt;br&gt;
That's it. Two chances to say "Wait, let me try that differently."&lt;/p&gt;

&lt;p&gt;It's a gift, not a requirement. You don't need to use rewinds to succeed. Skilled players can clear missions without touching them. But when you do use one? It feels powerful. Strategic. Earned.&lt;/p&gt;

&lt;p&gt;It creates choice, not obligation. Do you burn a rewind on this ambush, or save it for the reinforcements you know are coming? That's an interesting decision. "Should I slow down time right now?" is not.&lt;/p&gt;

&lt;p&gt;It turns mistakes into learning moments. Instead of "Ugh, I have to reload my save," it's "Okay, now I know that approach doesn't work—let me reposition." You stay in flow. You stay engaged with your squad.&lt;/p&gt;

&lt;p&gt;Rewind adds depth: now you can take risks, experiment with aggressive tactics, try that flanking maneuver you weren't sure about. You have safety net, but it's limited. Use it wisely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Carrot, Not Stick
&lt;/h2&gt;

&lt;p&gt;The guiding principle here is simple: game systems are more fun when they reward you for engaging with them, rather than punish you for ignoring them.&lt;/p&gt;




&lt;p&gt;Theater Alpha is a real-time tactical game about high-stakes decisions and limited second chances. You lead a 4-soldier squad through Alpine combat zones where stealth can turn into chaos in seconds, and every bullet counts.&lt;/p&gt;

&lt;p&gt;What do you think? Does rewind sound more interesting than slow-motion? I'm curious how other tactical game fans feel about this approach. Let me know in the comments or try the current build on &lt;a href="https://theateralpha.itch.io/theater-alpha" rel="noopener noreferrer"&gt;https://theateralpha.itch.io/theater-alpha&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>unity3d</category>
      <category>devlog</category>
      <category>gamedesign</category>
    </item>
    <item>
      <title>Games design themselves. From RTS to Tactical Strategy game</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Mon, 27 Oct 2025 14:44:54 +0000</pubDate>
      <link>https://forem.com/terrillo/games-design-themselves-from-rts-to-tactical-strategy-game-3fac</link>
      <guid>https://forem.com/terrillo/games-design-themselves-from-rts-to-tactical-strategy-game-3fac</guid>
      <description>&lt;p&gt;Theater Alpha started out as a RTS game. I setup the Notion project on September 13th, and you can check out the first version of that game in this &lt;a href="//youtube.com/watch?v=mFAklHPI2qc&amp;amp;feature=youtu.be"&gt;YouTube video&lt;/a&gt; I made - Welcome to Theater Alpha — A New Strategic Defense Experience #001 (Devlog).&lt;/p&gt;

&lt;p&gt;This project started out as a custom game engine project. I was up for the challenge, then I noticed I was basically implementing Unity GameObject lifecycle. So I made the move to Unity2D then to 3D. My experience was mostly with small projects using 2D.&lt;/p&gt;

&lt;p&gt;I took a break from the game to focus on other client work, but during this time I started consuming lots and lots of GameDev content. Learning how grids work in 3D and other things like the terrain system.&lt;/p&gt;

&lt;p&gt;Then this &lt;a href="//youtube.com/watch?si=esuOyvFGiBU8GBy6&amp;amp;v=KRMbRYPrSvw&amp;amp;feature=youtu.be"&gt;conversation&lt;/a&gt; really stuck out with me. Thomas and John spent a lot of time talking about a game hook and unique feature. My game at this point didn't really have that.&lt;/p&gt;

&lt;p&gt;What I had was a Game Design document for an RTS game and a grid to move units. My design had some good ideas but I didn't focus on that. I had a big vision: persistent campaigns, adaptive traits, living battlefield but no working prototype. The health/combat math was overly complex, and I hadn't validated if the core idea was actually fun.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problems I Faced
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Complex systems without a clear hook&lt;/li&gt;
&lt;li&gt;Overly complex health/combat mathematics&lt;/li&gt;
&lt;li&gt;Big vision but no working prototype to validate fun&lt;/li&gt;
&lt;li&gt;Focus on RTS mechanics rather than the unique story potential&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Realization
&lt;/h2&gt;

&lt;p&gt;While contemplating the design of a prototype and dedicating time to creating a soldier system, I shifted my focus to the concept of controlling six soldiers within the same world-building framework. The majority of the story and core hook ideas revolved around the units rather than an RTS.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Changed
&lt;/h2&gt;

&lt;p&gt;The shift from RTS to tactical squad management opened up new possibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focus on individual soldier stories and development&lt;/li&gt;
&lt;li&gt;High-level strategic decision making rather than micromanagement&lt;/li&gt;
&lt;li&gt;Meaningful consequences for every tactical decision&lt;/li&gt;
&lt;li&gt;Smaller scope allows for deeper systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of managing hundreds of units, you command a small, elite squad. Instead of complex resource management, you make strategic decisions with real consequences. Instead of abstract warfare, you experience the human cost of tactical command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implemented Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;3 soldier system with named units&lt;/li&gt;
&lt;li&gt;Two operational modes: Stealth &amp;amp; Engage&lt;/li&gt;
&lt;li&gt;Advanced cone-based vision system (130-ray raycasting)&lt;/li&gt;
&lt;li&gt;Distance-based combat with hit chance calculations&lt;/li&gt;
&lt;li&gt;Win/lose conditions with meaningful consequences&lt;/li&gt;
&lt;li&gt;Real-time tactical combat system&lt;/li&gt;
&lt;li&gt;Health tracking (0-100 per unit) with permadeath&lt;/li&gt;
&lt;li&gt;Line of sight blocking via colliders&lt;/li&gt;
&lt;li&gt;Visual feedback with colored rays and bullet projectiles&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Architecture
&lt;/h2&gt;

&lt;p&gt;The game is built in Unity 6.2 with a component-based architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit System: UnitBase, UnitFriendly, UnitEnemy classes&lt;/li&gt;
&lt;li&gt;Combat System: Distance-based hit calculations, stealth bonuses&lt;/li&gt;
&lt;li&gt;AI System: Cone-based vision, automatic engagement&lt;/li&gt;
&lt;li&gt;Manager Systems: SoldierManager, CombatManager, EngagementManager&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On Scope and Focus
&lt;/h3&gt;

&lt;p&gt;The journey from RTS to Minister of Defense has been about finding focus. Sometimes the best games come from constraints, not ambitions. By narrowing the scope from massive RTS to tactical squad command, the unique elements of the game became clearer.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Prototyping
&lt;/h3&gt;

&lt;p&gt;Having a big vision is exciting, but without a working prototype, it's just a dream. The shift to focusing on 6 soldiers and core mechanics first has been crucial. You can't validate fun without something playable.&lt;/p&gt;

&lt;h2&gt;
  
  
  On Finding Your Hook
&lt;/h2&gt;

&lt;p&gt;Every game needs something that makes it unique. For Theater Alpha, it wasn't the RTS mechanics - it was the human stories of individual soldiers and the weight of tactical decisions. Sometimes you have to step back and ask: "What is this game really about?"&lt;/p&gt;

&lt;p&gt;You can play the Prototype today. &lt;br&gt;
🎮 NOW LIVE on Itch.io: [theateralpha.itch.io/theater-alpha[(&lt;a href="https://theateralpha.itch.io/theater-alpha" rel="noopener noreferrer"&gt;https://theateralpha.itch.io/theater-alpha&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>unity3d</category>
      <category>devlog</category>
      <category>gamedesign</category>
    </item>
    <item>
      <title>A quick introduction to using Git/Github — ADD, COMMIT, PUSH</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Thu, 02 Apr 2020 14:00:10 +0000</pubDate>
      <link>https://forem.com/terrillo/a-quick-introduction-to-using-git-github-add-commit-push-4356</link>
      <guid>https://forem.com/terrillo/a-quick-introduction-to-using-git-github-add-commit-push-4356</guid>
      <description>&lt;p&gt;As of April 2nd, 2020 I have 106 Git repositories, which is more than any person should. Git is an open-source project developed by the creator of Linux — Linus Torvalds.&lt;/p&gt;

&lt;p&gt;Git is a (Version Control System). The idea behind Git is very simple. Instead of having only a single place for code for software. Git offers a remote copy of the code in what’s called a repository and that can contain the full history of all changets at a contributor level. It’s also designed with performance, security, and flexibility.&lt;/p&gt;

&lt;p&gt;Git is currently the industry standard. A requirement in any programming environment the level of experience can vary a lot. From a single person to a 50+ team with code reviews. If you are an inexperienced developer wanting to build up valuable skills in software development tools, when it comes to version control, Git should be on your list.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ready to learn a practical example of Git?
&lt;/h1&gt;

&lt;p&gt;Before starting I highly recommend using Git on the terminal instead of GUI. My reason is simple — Git UI doesn’t scale well in a collaborative environment. When I hire a new Software Engineer the first habit I break is using the GitHub desktop app.&lt;/p&gt;

&lt;p&gt;Let’s say you started a new Bootstrap 4 project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example-website
 — index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;index.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;!-- Required meta tags --&amp;gt;
    &amp;lt;meta charset="utf-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&amp;gt;
&amp;lt;!-- Bootstrap CSS --&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"&amp;gt;
&amp;lt;title&amp;gt;Hello, world!&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Hello, world!&amp;lt;/h1&amp;gt;
&amp;lt;!-- Optional JavaScript --&amp;gt;
    &amp;lt;!-- jQuery first, then Popper.js, then Bootstrap JS --&amp;gt;
    &amp;lt;script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1st — Set-up a Git repo. (GitHub and Bitbucket are the most popular)
&lt;/h2&gt;

&lt;p&gt;GitHub Example&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F122jsftt86vpllbfx5yv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F122jsftt86vpllbfx5yv.png" alt="Alt Text" width="800" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2nd — Go to project folder and Initial Git
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd example-website
git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3rd — Add a remote
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin git@github.com:terrillo/example-website.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a remote connects your local computer with remote repositories. This process can be repeated across multiple computers. Alternatively, you can clone a repo to your local to get started.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/terrillo/example-website.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I first started using Git in 2010 I started using GIT as a way for me to try other people code I searched for on Github.&lt;/p&gt;

&lt;h2&gt;
  
  
  4th-Add your files
&lt;/h2&gt;

&lt;p&gt;The Git process is based around three workflow steps ADD -&amp;gt; COMMIT -&amp;gt; PUSH&lt;br&gt;
Each file must be added to a staging environment before you can commit.&lt;/p&gt;

&lt;p&gt;Add a single file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add all files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add —-all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding files you can use the status command to see what you have done for.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git status response —&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;On branch master
No commits yet
Changes to be committed:
 (use “git rm — cached &amp;lt;file&amp;gt;…” to unstage)
new file: index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each file and directory can be easily identified by the green and red &lt;br&gt;
statuses.&lt;/p&gt;
&lt;h2&gt;
  
  
  5th — Commit
&lt;/h2&gt;

&lt;p&gt;After adding your files. The next step is to commit your work. Each commit is attached to a message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m “First commit”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This message is what you will see when browsing your history. In the beginning, you’ll have nice and beautiful messages. With time your messages started to become more crypt-like, “ugh”, “another bug fix”, and “oops”. It happens to all of us.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[master (root-commit) 6581e1b] First commit
 1 file changed, 22 insertions(+)
 create mode 100644 index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After each commit, you get this motivational message with the number of files changed and lines inserted and deleted.&lt;/p&gt;

&lt;p&gt;Before going on to the next step. Git is even better when used with a modern text editor like Atom or VS Code. These editors make Git worth it for personal projects. After changing the title in the index.html Atom highlights that line as a change. A small feature that can have a big impact on your workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcsn9i3a0iqlvxpbkey3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcsn9i3a0iqlvxpbkey3t.png" alt="Alt Text" width="800" height="302"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add --all
git commit -m “Title change”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6th — Push
&lt;/h2&gt;

&lt;p&gt;This next step is the process of updating your remote repo. Its best to push after every commit but it’s really up to you based on your workflow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;origin — the remote name&lt;br&gt;
Master — the branch name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 1.09 KiB | 1.09 MiB/s, done.
Total 6 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
To github.com:terrillo/example-website.git
 * [new branch] master -&amp;gt; master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Done
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2g9szif5youlsgz7fih1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2g9szif5youlsgz7fih1.png" alt="Alt Text" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s a really basic introduction to using Git. With this basic setup, you can start backing up all your code remotely with the option to view the complete history of each file.&lt;/p&gt;

&lt;p&gt;Thanks for reading&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>A quick introduction to Python Multiprocessing Pools. Speeding up your workflow</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Mon, 23 Mar 2020 15:43:45 +0000</pubDate>
      <link>https://forem.com/terrillo/a-quick-introduction-to-python-multiprocessing-pools-speeding-up-your-workflow-17op</link>
      <guid>https://forem.com/terrillo/a-quick-introduction-to-python-multiprocessing-pools-speeding-up-your-workflow-17op</guid>
      <description>

&lt;p&gt;How many times in python have used a for loop and watched your terminal go through each item taking hours on end?&lt;/p&gt;

&lt;p&gt;This article goes over the &lt;a href="https://docs.python.org/dev/library/multiprocessing.html" rel="noopener noreferrer"&gt;Multiprocessing&lt;/a&gt; module for Python. People get excited that Python uses threading. I know I was coming from PHP land. Threading is different than Multiprocessing by the way.&lt;/p&gt;

&lt;p&gt;The threading module uses threads, the multiprocessing module uses processes. The difference is that threads run in the same memory space, while processes have separate memory. This makes it a bit harder to share objects between processes with multiprocessing. Since threads use the same memory, precautions have to be taken or two threads will write to the same memory at the same time.&lt;/p&gt;

&lt;p&gt;The multiprocessing module in Python's Standard Library has a lot of powerful features. - &lt;a href="https://docs.python.org/dev/library/multiprocessing.html" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basic loop without Multiprocessing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def f(x):
    # Run Code
    print(x*x)
for item in [1, 2, 3, 4]:
    f(item)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;time python3 main.py
&amp;gt;&amp;gt; 1
&amp;gt;&amp;gt; 4
&amp;gt;&amp;gt; 9
&amp;gt;&amp;gt; 16
&amp;gt;&amp;gt; python3 main.py  0.04s user 0.01s system 89% cpu 0.059 total
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;0.059s is nothing. Let's say that the f() function executes some code that takes 2 seconds long (Updating a database, Resizing Images, scaping a website, etc).&lt;/p&gt;

&lt;p&gt;Basic loop with 2s delay&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import time
def f(x):
    time.sleep(2) # Wait 2 seconds
    print(x*x)
for item in [1, 2, 3, 4]:
    f(item)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;time python3 main.py
&amp;gt;&amp;gt; 1
&amp;gt;&amp;gt; 4
&amp;gt;&amp;gt; 9
&amp;gt;&amp;gt; 16
&amp;gt;&amp;gt; python3 main.py  0.04s user 0.01s system 89% cpu 8.067 total
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.067s adds up over 200 items. This when Multiprocessing can become your friend. Imagine running multiple items at once over that same two-second period. Parallel processing is getting more attention nowadays. As CPU manufacturers start adding more and more cores to their processors, creating parallel code is a great way to improve performance. Python introduced the multiprocessing module to let us write parallel code.&lt;/p&gt;

&lt;p&gt;There are plenty of classes in Python multiprocessing module for building a parallel program. Among them, three basic classes are Process, Queue and Lock. These classes will help you to build a parallel program. This is an introduction to Pool.&lt;/p&gt;

&lt;p&gt;A process pool object which controls a pool of worker processes to which jobs can be submitted. It supports asynchronous results with timeouts and callbacks and has a parallel map implementation.&lt;/p&gt;

&lt;p&gt;Basic loop with 2s delay using Multiprocessing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import time 
from multiprocessing import Pool
def f(x):
    time.sleep(2) # Wait 2 seconds
    print(x*x)
p = Pool(8)
p.map(f, [1, 2, 3, 4])
p.close()
p.join()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;time python3 main.py
&amp;gt;&amp;gt; 1
&amp;gt;&amp;gt; 4
&amp;gt;&amp;gt; 9
&amp;gt;&amp;gt; 16
&amp;gt;&amp;gt; python3 main.py  0.08s user 0.06s system 6% cpu 2.180 total
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.180s vs 8.067s means each item in the same array took 2 seconds. Impressive right. It's really nice when you do this on a Linux box. Your code can better use the resources available to you. So, that's multiprocessing Pools in Python.&lt;br&gt;
Thanks for reading.&lt;/p&gt;

&lt;p&gt;Sample Code — &lt;a href="https://github.com/terrillo/learn-python" rel="noopener noreferrer"&gt;https://github.com/terrillo/learn-python&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>python3</category>
      <category>multiprocessing</category>
      <category>workflow</category>
    </item>
    <item>
      <title>Using Python to resize and get HEX color values from images</title>
      <dc:creator>Terrillo Walls</dc:creator>
      <pubDate>Mon, 16 Mar 2020 17:23:03 +0000</pubDate>
      <link>https://forem.com/terrillo/using-python-to-resize-and-get-hex-color-values-from-images-ekm</link>
      <guid>https://forem.com/terrillo/using-python-to-resize-and-get-hex-color-values-from-images-ekm</guid>
      <description>&lt;p&gt;Python is by far one of the easiest programming languages to use. Writing functions are intuitive and so is reading the code itself. When dealing with images I found Python to be easier to use compared to NodeJS and PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case
&lt;/h2&gt;

&lt;p&gt;Let’s say you were building a website that’s similar to Unsplash. Users are uploading 10MB images to your website from their DLSR camera. Displaying these images on the front-end is asking for a terrible page load. So how do you resize images with Python?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Locate your image&lt;/li&gt;
&lt;li&gt;Open as an Image&lt;/li&gt;
&lt;li&gt;Resize Save&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;webcolor: &lt;a href="https://pypi.org/project/webcolors/"&gt;https://pypi.org/project/webcolors/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;python-resize-image: &lt;a href="https://pypi.org/project/python-resize-image/"&gt;https://pypi.org/project/python-resize-image/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;colorthief &lt;a href="https://github.com/fengsp/color-thief-py"&gt;https://github.com/fengsp/color-thief-py&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Dependencies
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install webcolors python-resize-image colorthief
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Resize Image
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from resizeimage import resizeimage 
from PIL import Image
image_path = './dog.jpeg'
new_max_width = 1800
new_filename = './dog-1800.jpeg'
with open(image_path, 'r+b') as f:
  with Image.open(f) as image:
  # Resize
  smaller_image = resizeimage.resize_width(image, new_max_width)
  smaller_image.save(new_filename, image.format)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Your image needs to be open as bytes and readable. image.format re-saves the image as the correct type (dog.jpeg is saved back as a jpeg). If you run the code above you just resized an image. The height is auto-calculated based on width keeping the ratio. The PIL package stands for “Pillow” and is installed with “python-resize-image”. Pillow is the ultimate package for dealing with an image. A quick way to get the current height and width plus other metadata.&lt;/p&gt;

&lt;p&gt;With the same open(image_path, ‘r+b’) using ColorThief a palette of colors are found.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the HEX color value from image
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from resizeimage import resizeimage
from PIL import Image
import webcolors
from colorthief import ColorThief
image_path = './dog.jpeg'
new_max_width = 1800
new_filename = './dog-1800.jpeg'
image_colors = []
with open(image_path, 'r+b') as f:
  with Image.open(f) as image:
        # Resize
        smaller_image = resizeimage.resize_width(image, max_width)
        smaller_image.save(new_image_path, image.format)
        # Get Colors
        color_thief = ColorThief(new_image_path)
        color_palette = color_thief.get_palette(color_count=10, quality=10)
        for color in color_palette:
            print(webcolors.rgb_to_hex(color))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;color_palette = returns an array tuples of RGB values then, webcolors.rgb_to_hex converts each tuple in to a hex value.&lt;/p&gt;

&lt;h4&gt;
  
  
  Examples
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import webcolors
&amp;gt;&amp;gt;&amp;gt; webcolors.rgb_to_hex((255, 255, 255))
u'#ffffff'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Get color by name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import webcolors
&amp;gt;&amp;gt;&amp;gt; webcolors.rgb_to_name((255, 255, 255))
u'white'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Sample Code — &lt;a href="https://github.com/terrillo/learn-python"&gt;https://github.com/terrillo/learn-python&lt;/a&gt;&lt;br&gt;
YouTube video — &lt;a href="https://youtu.be/modMAADs71w"&gt;https://youtu.be/modMAADs71w&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>imageprocessing</category>
      <category>pythonprogramming</category>
      <category>python3</category>
    </item>
  </channel>
</rss>
