<?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: raslanove</title>
    <description>The latest articles on DEV Community by raslanove (@raslanove).</description>
    <link>https://dev.to/raslanove</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%2F117724%2Fad964d1f-58b1-4267-b2d1-fb9c208c5af9.png</url>
      <title>DEV Community: raslanove</title>
      <link>https://dev.to/raslanove</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raslanove"/>
    <language>en</language>
    <item>
      <title>Insults &amp; Cutlasses, Local LLM Sword Fighting on Melee Island</title>
      <dc:creator>raslanove</dc:creator>
      <pubDate>Mon, 25 May 2026 05:17:55 +0000</pubDate>
      <link>https://dev.to/raslanove/insults-cutlasses-local-llm-sword-fighting-on-melee-island-1ba3</link>
      <guid>https://dev.to/raslanove/insults-cutlasses-local-llm-sword-fighting-on-melee-island-1ba3</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Insults &amp;amp; Cutlasses&lt;/strong&gt; is a terminal-based insult sword fighting game inspired by &lt;em&gt;The Secret of Monkey Island&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The player enters a world where victory is not achieved through brute force, but through &lt;strong&gt;witty insults, structured comebacks, and AI-judged verbal duels&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Each battle follows a strict loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The opponent generates an insult&lt;/li&gt;
&lt;li&gt;The player responds with a comeback&lt;/li&gt;
&lt;li&gt;A judge evaluates whether the response is strong or weak&lt;/li&gt;
&lt;li&gt;Points are awarded accordingly&lt;/li&gt;
&lt;li&gt;First to 3 points wins the duel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After each victory or defeat, a new pirate opponent appears and the journey continues toward the Swordmaster of Melee Island.&lt;/p&gt;

&lt;p&gt;This project explores how &lt;strong&gt;local LLMs can power structured gameplay systems&lt;/strong&gt;, turning natural language into a competitive game mechanic rather than a free-form chatbot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/Ti82enlH57A"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;GitHub repository:&lt;br&gt;
&lt;a href="https://github.com/raslanove/InsultsAndCutlasses" rel="noopener noreferrer"&gt;https://github.com/raslanove/InsultsAndCutlasses&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;This project is powered by &lt;strong&gt;Gemma 4 E2B IT (quantized GGUF version)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I chose the &lt;strong&gt;E2B model&lt;/strong&gt; because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  It has a small enough memory footprint to run locally without a GPU&lt;/li&gt;
&lt;li&gt;  It performs well on CPU-only environments (even consumer laptops)&lt;/li&gt;
&lt;li&gt;  It maintains strong instruction-following behavior compared to other small models&lt;/li&gt;
&lt;li&gt;  It is ideal for embedding into real-time interactive applications like games&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Why Gemma 4 was essential
&lt;/h3&gt;

&lt;p&gt;Earlier small models struggled with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Consistent roleplay behavior&lt;/li&gt;
&lt;li&gt;  Structured output formats&lt;/li&gt;
&lt;li&gt;  Maintaining "pirate duel logic" across turns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gemma 4 significantly improved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Instruction adherence for strict insult/reply/judge formatting&lt;/li&gt;
&lt;li&gt;  Stability in multi-turn interactions&lt;/li&gt;
&lt;li&gt;  Creativity in generating themed pirate insults and comebacks&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Fine-tuning (LoRA)
&lt;/h3&gt;

&lt;p&gt;To make the model behave like a true &lt;em&gt;Monkey Island-style insult duel system&lt;/em&gt;, I trained a &lt;strong&gt;LoRA adapter&lt;/strong&gt; using a custom dataset:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;MonkeyIslandStylePirateDuelDataset.jsonl&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The dataset teaches the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Insult → Reply → Judge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Training was done entirely on CPU:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  AMD Ryzen 5 PRO 4650G&lt;/li&gt;
&lt;li&gt;  32GB RAM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The LoRA was trained in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;InsultsAndCutlasses.ipynb&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows the base model to consistently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Generate insults&lt;/li&gt;
&lt;li&gt;  Respond in character&lt;/li&gt;
&lt;li&gt;  Evaluate responses fairly&lt;/li&gt;
&lt;/ul&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%2Fuploads%2Farticles%2Faz039oen0okpj8iftynm.jpg" 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%2Fuploads%2Farticles%2Faz039oen0okpj8iftynm.jpg" alt=" " width="699" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
  </channel>
</rss>
