<?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>DEV Community: Aladdin Gu</title>
    <description>The latest articles on DEV Community by Aladdin Gu (@alwaysaladdin).</description>
    <link>https://dev.to/alwaysaladdin</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4099653%2Fc0cf83ac-ce44-46bc-8f5d-840dfe60228f.jpg</url>
      <title>DEV Community: Aladdin Gu</title>
      <link>https://dev.to/alwaysaladdin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alwaysaladdin"/>
    <language>en</language>
    <item>
      <title>Designing a useful preview for an AI-generated comic</title>
      <dc:creator>Aladdin Gu</dc:creator>
      <pubDate>Thu, 19 Nov 2026 11:06:04 +0000</pubDate>
      <link>https://dev.to/alwaysaladdin/designing-a-useful-preview-for-an-ai-generated-comic-4217</link>
      <guid>https://dev.to/alwaysaladdin/designing-a-useful-preview-for-an-ai-generated-comic-4217</guid>
      <description>&lt;p&gt;A preview should answer the question the user is about to act on. For a personalized comic, that question is whether the people and a moment in the story are recognizable. A random sample from a gallery can demonstrate visual style, but it cannot answer that question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate the decisions
&lt;/h2&gt;

&lt;p&gt;A story outline, character artwork, and a story panel have distinct jobs. The outline answers whether events are in the right order. The character artwork lets someone check who is pictured. The panel shows whether one scene works with the selected characters and dialogue. Put these checks before the point where users commit to a full book.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let users name the exact change
&lt;/h2&gt;

&lt;p&gt;Give the user a way to compare what they entered with what the preview shows. “The umbrella belonged to the person on the left” is easier to act on than a generic thumbs-down. Keep the previous preview available during a revision so that improved details can be compared without reintroducing a problem in another scene.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan for slow generation
&lt;/h2&gt;

&lt;p&gt;A progress indicator is most helpful when it says which step is running and what is already available. If the scene takes longer than expected, let the user return to the same project and see the character preview while they wait. For a failed step, make it clear whether a retry starts from the current story or asks for new input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://paneluv.com/" rel="noopener noreferrer"&gt;Paneluv&lt;/a&gt; is our example of this pattern. It turns shared memories into a personalized comic and lets users preview the characters and one story panel before deciding whether to buy a full book.&lt;/p&gt;

</description>
      <category>design</category>
      <category>product</category>
      <category>ux</category>
    </item>
    <item>
      <title>Moving a browser game's controls into the arena</title>
      <dc:creator>Aladdin Gu</dc:creator>
      <pubDate>Sun, 15 Nov 2026 16:36:37 +0000</pubDate>
      <link>https://dev.to/alwaysaladdin/moving-a-browser-games-controls-into-the-arena-2p1m</link>
      <guid>https://dev.to/alwaysaladdin/moving-a-browser-games-controls-into-the-arena-2p1m</guid>
      <description>&lt;p&gt;A timing game can have simple rules and still make the player look in too many places.&lt;/p&gt;

&lt;p&gt;That was the problem I worked through while building &lt;a href="https://slaploop.com/" rel="noopener noreferrer"&gt;SlapLoop&lt;/a&gt;, a free cartoon browser game against the CPU. The early layout put the arena in one area and the strategy controls, power meter, and a large action button in another. It was understandable as a web page, but it split the player's attention at the exact moment the game needed it.&lt;/p&gt;

&lt;p&gt;The useful change was to treat the arena as the input surface and make the character's movement communicate the same timing information as the meter.&lt;/p&gt;

&lt;h2&gt;
  
  
  One place to look, one place to act
&lt;/h2&gt;

&lt;p&gt;The current interaction is deliberately small: click the arena for an instant slap, or hold and release to time the swing. A short hint explains both actions inside the game, while a separate &lt;a href="https://slaploop.com/how-to-play" rel="noopener noreferrer"&gt;controls guide&lt;/a&gt; provides the detail.&lt;/p&gt;

&lt;p&gt;Character selection lives in arena settings. Tactics and the once-per-match skill remain close to the action. This matters because the player is making two different kinds of decisions: a slower choice about approach, and a quick choice about release timing. They need different emphasis even when they share the same screen.&lt;/p&gt;

&lt;p&gt;Removing the large action button also created a responsibility: the clickable surface had to be discoverable. A canvas that responds to input without a visible hint is not automatically more immersive. The hint is part of the interaction, rather than an instruction paragraph competing with the match.&lt;/p&gt;

&lt;h2&gt;
  
  
  Animation should describe the timing state
&lt;/h2&gt;

&lt;p&gt;A moving meter is a precise indicator, but the hand movement gives the action a physical meaning. If they disagree, the player has to decide which one to trust.&lt;/p&gt;

&lt;p&gt;A useful way to think about the renderer is as a consumer of the same normalized power value used by the game. The following is a conceptual sketch, not a copy of the game's source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;timingView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;power&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bounded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;power&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;meterPosition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bounded&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;windupAngle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;bounded&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact angles depend on the character art and shoulder placement. The important boundary is that the visual system does not invent another timing signal. The meter and the windup should explain one state together.&lt;/p&gt;

&lt;p&gt;That still leaves room for personality. Different characters can vary their idle movement, follow-through, and reaction without gaining stronger gameplay attributes. In SlapLoop, all 12 characters share those attributes; the differences are visual and expressive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback needs a useful vocabulary
&lt;/h2&gt;

&lt;p&gt;The initial result display relied heavily on percentages. A precise number was easy to calculate, but a string of percentages was not an especially memorable match summary.&lt;/p&gt;

&lt;p&gt;Timing grades give players a more useful vocabulary for comparing their hits. There is an important distinction, though: a timing grade describes the original input, while effective power and damage can also be affected by tactics or a skill. Changing damage should not silently rewrite the timing feedback into a better grade.&lt;/p&gt;

&lt;p&gt;The same separation helps with the health bars. Distinct colors identify the player and CPU, and changing colors make low health easier to notice. Numeric health can support that signal without being the only way to read it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Waiting is also a game state
&lt;/h2&gt;

&lt;p&gt;A browser tab is easy to leave idle. The current match has a 15-second automatic-slap timer so that a turn does not wait indefinitely for input. When time expires, the game swings at the power available at that moment.&lt;/p&gt;

&lt;p&gt;This should be visible before it happens. A countdown inside the arena explains the deadline; pause controls provide an explicit way to take a break. The result is more predictable than an unexplained automatic action after a long silence.&lt;/p&gt;

&lt;p&gt;Input, timing, and pause behavior also need to agree on when an action is accepted. An interesting animation cannot compensate for a release that appears to count twice or lands after the match has already changed state.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would check in another small game
&lt;/h2&gt;

&lt;p&gt;I would start with a few concrete questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can someone discover the main action without opening a tutorial?&lt;/li&gt;
&lt;li&gt;Does the character motion communicate the same state as the indicator?&lt;/li&gt;
&lt;li&gt;Are slow configuration choices visually distinct from the immediate action?&lt;/li&gt;
&lt;li&gt;Can a player understand a hit and the match outcome without interpreting several raw percentages?&lt;/li&gt;
&lt;li&gt;Does the interface explain what happens when the player waits or pauses?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These checks do not require a large control scheme. They require the page, animation, and rules to agree about the action the player is taking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://slaploop.com/" rel="noopener noreferrer"&gt;SlapLoop is available to try in the browser&lt;/a&gt; without a download or account. The current release is CPU play; sharing a battle card sends friends to their own match rather than a live multiplayer room. Feedback about whether the swing feels readable on mouse and touch would be especially useful.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: this development write-up was prepared with AI assistance and checked against the project's implemented features. The code sketch above is illustrative.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Building QueensGamers: 1,800 Free Puzzles and an Open-Source TypeScript Engine</title>
      <dc:creator>Aladdin Gu</dc:creator>
      <pubDate>Sat, 29 Aug 2026 02:38:14 +0000</pubDate>
      <link>https://dev.to/alwaysaladdin/building-queensgamers-1800-free-puzzles-and-an-open-source-typescript-engine-2ddj</link>
      <guid>https://dev.to/alwaysaladdin/building-queensgamers-1800-free-puzzles-and-an-open-source-typescript-engine-2ddj</guid>
      <description>&lt;p&gt;A Queens puzzle looks simple at first: place a few queens on a colored grid.&lt;/p&gt;

&lt;p&gt;Then the constraints start interacting.&lt;/p&gt;

&lt;p&gt;A queen placed to satisfy one region may block an entire row, eliminate a column, or make two other queens touch. What begins as a small placement game quickly becomes a satisfying constraint-solving challenge.&lt;/p&gt;

&lt;p&gt;That is why I built &lt;a href="https://queensgamers.com" rel="noopener noreferrer"&gt;QueensGamers.com&lt;/a&gt;: a free browser-based place to play colored-region Queens puzzles, from quick daily boards to much larger challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the game works
&lt;/h2&gt;

&lt;p&gt;You need to place queens while following four rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every row must contain exactly one queen.&lt;/li&gt;
&lt;li&gt;Every column must contain exactly one queen.&lt;/li&gt;
&lt;li&gt;Every colored region must contain exactly one queen.&lt;/li&gt;
&lt;li&gt;Queens cannot touch—not even diagonally.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No chess knowledge is required. The queen is simply the marker used for each confirmed position.&lt;/p&gt;

&lt;p&gt;The interesting part is the interaction between the constraints. A single placement can eliminate several cells and reveal the next forced move. Good solving is less about guessing and more about repeatedly finding rows, columns, and regions with only one legal position left.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily, unlimited, and larger challenges
&lt;/h2&gt;

&lt;p&gt;QueensGamers currently offers several ways to play.&lt;/p&gt;

&lt;h3&gt;
  
  
  Daily Challenge
&lt;/h3&gt;

&lt;p&gt;The Daily mode provides three shared puzzles each day. Complete all three to extend your streak, then return after the daily UTC reset.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unlimited Play
&lt;/h3&gt;

&lt;p&gt;If one daily challenge is not enough, the full library contains &lt;strong&gt;1,800 puzzles&lt;/strong&gt; across six board sizes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;7×7&lt;/li&gt;
&lt;li&gt;8×8&lt;/li&gt;
&lt;li&gt;9×9&lt;/li&gt;
&lt;li&gt;10×10&lt;/li&gt;
&lt;li&gt;11×11&lt;/li&gt;
&lt;li&gt;12×12&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each size contains 300 numbered boards. Smaller grids are useful for learning recurring patterns, while 11×11 and 12×12 puzzles require longer chains of deduction and more careful board management.&lt;/p&gt;

&lt;h3&gt;
  
  
  Daily Archive
&lt;/h3&gt;

&lt;p&gt;Past Daily challenges remain available in the archive, so missing a day does not mean losing the puzzle forever.&lt;/p&gt;

&lt;p&gt;The game runs directly in the browser with no download or required account. It includes X marks for eliminating cells, undo, hints, conflict feedback, local progress, and optional completion timing.&lt;/p&gt;

&lt;p&gt;You can try it here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://queensgamers.com" rel="noopener noreferrer"&gt;Play Queens Game free online&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Opening up the puzzle engine
&lt;/h2&gt;

&lt;p&gt;I also wanted the underlying puzzle logic to be useful outside the website, so I created an independent open-source project:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/alwaysaladdin/queens-game-engine" rel="noopener noreferrer"&gt;Queens Puzzle Engine on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a browser-first TypeScript engine for generating, validating, and solving colored-region Queens puzzles.&lt;/p&gt;

&lt;p&gt;The current &lt;code&gt;v0.1.0&lt;/code&gt; pre-release supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic puzzle generation from a seed&lt;/li&gt;
&lt;li&gt;Region and placement validation&lt;/li&gt;
&lt;li&gt;Backtracking-based puzzle solving&lt;/li&gt;
&lt;li&gt;Unique-solution verification&lt;/li&gt;
&lt;li&gt;Board sizes from 7×7 through 12×12&lt;/li&gt;
&lt;li&gt;Browser and Node.js environments&lt;/li&gt;
&lt;li&gt;A versioned JSON puzzle format&lt;/li&gt;
&lt;li&gt;A command-line interface&lt;/li&gt;
&lt;li&gt;Zero runtime dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The npm package has not been published yet, but you can clone and test the project now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/alwaysaladdin/queens-game-engine.git
&lt;span class="nb"&gt;cd &lt;/span&gt;queens-game-engine

pnpm &lt;span class="nb"&gt;install
&lt;/span&gt;pnpm check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The tricky part: proving uniqueness
&lt;/h2&gt;

&lt;p&gt;Generating a valid-looking board is not enough. A useful puzzle should have exactly one solution.&lt;/p&gt;

&lt;p&gt;The engine places queens row by row and prunes candidates whenever they conflict by column, colored region, or adjacent diagonal. During uniqueness verification, it searches for at most two solutions.&lt;/p&gt;

&lt;p&gt;That distinction matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finding one solution proves the puzzle is solvable.&lt;/li&gt;
&lt;li&gt;Failing to find a second solution proves it is unique.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generator creates a deterministic candidate solution, grows connected colored regions around it, and keeps the result only after the solver confirms uniqueness.&lt;/p&gt;

&lt;p&gt;Using a seed also makes puzzle generation reproducible within the same engine version—the same board size and seed produce the same puzzle.&lt;/p&gt;

&lt;h2&gt;
  
  
  What comes next
&lt;/h2&gt;

&lt;p&gt;The roadmap currently includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Publishing &lt;code&gt;@queensgamers/engine&lt;/code&gt; to npm&lt;/li&gt;
&lt;li&gt;SVG puzzle rendering&lt;/li&gt;
&lt;li&gt;Performance benchmarks&lt;/li&gt;
&lt;li&gt;A hosted browser playground&lt;/li&gt;
&lt;li&gt;Human-style deduction explanations&lt;/li&gt;
&lt;li&gt;Reusable React board components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last two are roadmap items rather than current capabilities, and I would especially appreciate feedback from developers interested in constraint solving, puzzle generation, or explainable solving techniques.&lt;/p&gt;

&lt;p&gt;If you enjoy logic puzzles, try a board at &lt;a href="https://queensgamers.com" rel="noopener noreferrer"&gt;https://queensgamers.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are more interested in how the puzzles are generated and verified, explore the &lt;a href="https://github.com/alwaysaladdin/queens-game-engine" rel="noopener noreferrer"&gt;Queens Puzzle Engine repository&lt;/a&gt;. Issues, puzzle samples, tests, documentation improvements, and algorithm contributions are all welcome.&lt;/p&gt;

&lt;p&gt;Which part would you be most interested in seeing next: the npm package, an interactive solver visualizer, or human-readable deduction steps?&lt;/p&gt;

</description>
      <category>freegame</category>
      <category>puzzlegame</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
