<?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 Tiến Dương on Medium]]></title>
        <description><![CDATA[Stories by Tiến Dương on Medium]]></description>
        <link>https://medium.com/@tindng_52800?source=rss-c25e516369ca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mAp2jLNtmoIQ95Uj</url>
            <title>Stories by Tiến Dương on Medium</title>
            <link>https://medium.com/@tindng_52800?source=rss-c25e516369ca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:44:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tindng_52800/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[The 3-Day Journey To Make A 3D Token Town — Chapter 1]]></title>
            <link>https://medium.com/@tindng_52800/the-3-day-journey-to-make-a-3d-token-town-chapter-1-d3f35482194d?source=rss-c25e516369ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3f35482194d</guid>
            <category><![CDATA[webgpu]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[threejs]]></category>
            <dc:creator><![CDATA[Tiến Dương]]></dc:creator>
            <pubDate>Wed, 18 Nov 2026 07:54:05 GMT</pubDate>
            <atom:updated>2026-11-18T07:54:05.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Although I had never worked on a game or animation before, I recently took on a project to build an entire 3D town, combining handcrafted code with generative AI. What you see before you is the FPT Token Town, an animated version of FPT Token Factory. This town was fully built by me in just 3 days.</p><h4>The Introduction</h4><p>I’m Tiến Dương, a Developer Community Manager and AI Engineer at FPT AI Factory. I have some basic knowledge of JavaScript and Three.js, but I’m a complete beginner when it comes to WebGL and WebGPU. On top of that, I’m a gaming enthusiast who enjoys games with smooth, immersive 3D animations.</p><p>Building this little town took me just 3 days of intensive work. If we measure the time spent by the AI agents, that’s approximately 40 hours of work.</p><p>The total token cost was $44, using the Qwen3.8, DeepSeek-V4-Flash, and GLM-5.2 models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Sn7lpEFzCW9Z7qiOF5MsPA.gif" /><figcaption>FPT Token town in day time</figcaption></figure><h4>Before we start</h4><p>Before getting started, I had two existing projects in mind as references.</p><p>The first was <a href="https://messenger.abeto.co/">Messenger by Abeto</a>. It’s a browser-based experience that looks beautiful while remaining incredibly smooth. The entire page takes up only 14 MB when loaded on the client side.</p><p>The second was Token Town by Ryan Sael. In this project, each AI provider is represented by a building. The more frequently an AI model is used, the longer the queue of people waiting outside its shop becomes. The page is beautifully designed, has a distinctive visual identity, and communicates its concept in a way that’s incredibly easy for anyone to understand.</p><p>Once the idea started taking shape, I began exploring two fundamental questions: “How should I build it?” and “What tools should I use?”</p><p>The most helpful resource I came across was an article on Medium titled “<a href="https://medium.com/@sujaltalreja04/messenger-by-abeto-didnt-change-three-js-it-changed-how-we-think-about-building-for-the-web-3349d966748f">Messenger by Abeto Didn’t Change Three.js. It Changed How We Think About Building for the Web</a>.” It offered valuable insights into how the team behind Messenger by Abeto approached building their experience.</p><h4>Read, Plan, and Think Before Vibe Coding</h4><p>After doing my research, I decided to go with Three.js without React Three Fiber, running directly on WebGPU.</p><p>The reasoning was pretty straightforward. First, I only needed a 3D town, not a complex interface with lots of buttons or interactive UI elements. Using Three.js directly would keep things simpler and lighter than adding React as another abstraction layer.</p><p>As for WebGPU, it allows us to offload graphics-related computations to the GPU, making it possible to handle thousands of pedestrians, vehicles, animations, and movements more efficiently. This helps reduce the workload on the CPU and keeps the experience running smoothly. On top of that, WebGPU makes it easier to implement visual effects such as vehicle light trails and nighttime glows.</p><p><strong>Before letting AI write any code</strong>, I also manually refined the project’s design and architecture based on the guidance from the article I mentioned earlier. This was arguably the most important step in the entire process. I prefer writing code directly and manually reviewing AI-generated code rather than blindly relying on AI to build everything.</p><p>Having a clear architecture and reviewing the implementation myself gave me much better control over code quality, performance, and the overall direction of the project.</p><h4>First Concept Check</h4><p>For the first version, I wasn’t trying to make things look beautiful just yet. My goal was simply to find out whether the concept was technically feasible and whether the demo could eventually get approval for actual use.</p><p>Almost every detail in this initial version was still rough and unfinished. Houses, people, vehicles, and pretty much everything else was represented using simple low-poly box shapes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6QOCgSR3Phkiy2RY_HzfA.png" /><figcaption>The first concept, looks like just a few steps more… but no</figcaption></figure><p>The only good thing is that it ran surprisingly smoothly. So I already had the basic elements of a town: a complete environment, queues of people, and token streams flowing through the city. More importantly, the camera could smoothly glide from one area to another. That was enough to convince me that the project was technically feasible.</p><h4>Breaking Down Tasks and Learning Game Development</h4><p>Once I had a working prototype, I started breaking the implementation into smaller, manageable tasks.</p><p>There was one thing I was already certain about: LLMs are generally better at quantitative tasks than qualitative ones.</p><p>In other words, if I could translate subjective adjectives like “beautiful” and “smooth” into a concrete checklist of requirements, the LLM would have a much better chance of executing them correctly.</p><p>The challenge was that I had never designed a game before, nor did I have a professional background in the game development industry. I didn’t even know how to properly articulate the visual results I wanted.</p><p>So, I had to start learning game design from scratch: understanding how professionals in the industry communicate, the terminology they use, and how to describe specific visual effects and design intentions accurately.</p><p>Essentially, I needed to<strong> learn the language of game developers</strong> before I could <strong>effectively tell AI</strong> what to build.</p><h4><strong>Creating the Assets</strong></h4><p>I started by defining a set of visual standards for each component of the town.</p><ul><li><strong>The town:</strong> It needed buildings, trees, roads, moving vehicles, and pedestrians.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyFHFB4EtuwegvNWsalSEA.png" /><figcaption>Asset for the town</figcaption></figure><ul><li><strong>Vehicles:</strong> Low-poly models were perfectly fine since they moved quickly and didn’t need to show too many details.</li><li><strong>Characters:</strong> They needed visible arms and legs to make animations and movements feel more realistic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHEhlGVWHZiDtBrEqo6Iyw.png" /><figcaption>Four view of Grab driver (Vietnamese signature)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*lCO_GBccRgcpAG1z7bpWHA.png" /><figcaption>Character texture for grab driver</figcaption></figure><ul><li><strong>Visual effects:</strong> Vehicles needed visible light trails behind them (<strong>Trailing</strong>), while streetlights and other light sources needed glowing areas around them at night (<strong>Light Beams</strong>).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XQQAbZLjf_OJCpn-ZAiRvQ.png" /><figcaption>Visual effect demo in some first versions</figcaption></figure><p><strong>Buildings, Trees, and Roads</strong></p><p>Rather than creating everything from scratch, I sourced free assets online and modified them to fit the project’s visual style.</p><ul><li><strong>Buildings:</strong> I got permission from the creator of a StreetPack asset collection and exported the models from Blender into GLB format for web use.</li><li><strong>Trees:</strong> Some of the trees came from <a href="https://quaternius.itch.io/textured-lowpoly-trees">Quaternius</a>, a free low-poly tree collection released under the CC0 license, which allows commercial use. The original files were in FBX format without separate textures, so I wrote a script to convert them into GLB and bake the colors directly into the models.</li><li><strong>Logos:</strong> Brand logos came from <a href="https://github.com/lobehub/lobe-icons">LobeHub’s open-source icon collection</a>.</li></ul><p><strong>The Most Important Asset: Custom Characters</strong></p><p>Unlike the other assets, I decided to design the characters myself.</p><ol><li><strong>Generating the initial character:</strong> I started with a text-to-image model (<a href="https://huggingface.co/spaces/tencent/Hunyuan3D-2">Hunyuan</a>) to create a low-poly character concept.</li><li><strong>Generating the 3D model:</strong> I then hosted Hunyuan3D-2.1 on an <strong>RTX PRO 6000 GPU at </strong><a href="https://neo.fpt.ai/"><strong>FPT AI Factory</strong></a> to generate the actual 3D mesh.</li><li><strong>Rigging and animating:</strong> Next, I imported the model into Blender and used an OpenCode Agent connected through MCP to split the model into separate parts: the body, left leg, and right leg. This allowed me to create a basic walking animation. I prompted the Agent to handle the entire process because I didn’t know how to use Blender myself.</li><li><strong>Final integration:</strong> Once I was happy with the result, I approved the model and exported it as a GLB file directly into the codebase.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*lhMhusyAjIQBz4ICOOiQaA.png" /><figcaption>This is me wearing FPT shirts :)</figcaption></figure><h4>Fixing Bugs</h4><p>When coding with AI, especially on projects involving frontend development and visual effects, bugs are inevitable.</p><p>So far, no AI Agent harness has been good enough to truly perceive visual bugs. That’s why I had to inspect and evaluate the results myself after every prompt.</p><p><strong>Case 1: The Flattened Shipper</strong></p><p>For example, when I first placed the Shipper character into a crowd, something went terribly wrong: the character became extremely short and squashed, almost like a pancake.</p><p>Of course, the AI didn’t recognize this as a bug.</p><p>The root cause was a coordinate mismatch. The 3D model stored its coordinates as floating-point values within a range of −1 to 1, while the character in the scene used a different scale convention. This caused the model to overflow its expected proportions.</p><p>The fix was relatively simple: convert the coordinates into the appropriate representation before performing the calculations. This ensured that the character’s dimensions remained consistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmyyfgLvVX7UvQfQighv3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdn5Qjb_0gxonzkP--B1Eg.png" /><figcaption>The green “Grab driver” appears after my fix</figcaption></figure><p><strong>Case 2: Door Alignment and Light Beam Segmentation</strong></p><p>Another example involved making pedestrians walk toward the correct front doors of buildings, while ensuring that window areas emitted the appropriate light effects (<strong>Light Beams</strong>).</p><p>Currently, the model behind Token Factory isn’t particularly good at <strong>Front Door Segmentation</strong>. It tends to identify building entrances rather randomly. Some areas are selected too broadly, while others miss significant portions of the actual entrance.</p><p>To fix this, I had to export visualizations of the buildings as JSON mapping files, then manually identify and mark the window regions where the Light Beam effects should appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxhfqR6fKRv0a4N9J9pTYQ.png" /><figcaption>Manually select the shining regions out of the building</figcaption></figure><p>The lesson here is simple: when AI can’t get the visual details right, a human still needs to spot what’s wrong and correct it.</p><p>AI can generate the code, but it doesn’t always understand what the final result is supposed to look like. That’s where manual inspection makes all the difference.</p><h4>Token Usage and User Traffic</h4><p>This was actually the easiest part of the entire project.</p><p>I retrieved the token usage data and carefully verified the figures against ClickHouse. The number of people queuing outside each building and the volume of token traffic were then visualized using scaled proportions based on real-world usage.</p><h4>A Small Note on the District Layout</h4><p>As you can see, the town features seven buildings, each representing one of the seven highlighted models. There are two details worth mentioning:</p><ul><li><strong>DeepSeek-V4-Flash:</strong> As the most heavily used model, I placed it right in the center of the town to reflect its prominence.</li><li><strong>FPT.TTS-ultra:</strong> The seventh building represents a voice-generation model. Since it processes text into speech, its usage is measured in characters rather than tokens. This is also a special one for me, as FPT.TTS-ultra is a model I personally deployed onto the FPT Token Factory infrastructure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fbju28m7XnlvkqlRrC1-dQ.png" /><figcaption>DeepSeek-V4-Flash, the most-used model, sits at the center of town</figcaption></figure><h4>Performance Optimization</h4><p>For smoothness, optimization, and overall performance, my main reference was Abeto’s Messenger. After studying blog posts, technical documentation, and analyzing the implementation myself, I came to understand one important principle: Measure first, then optimize.</p><p>The initial version was quite heavy, with more than 360 blocks. Every block was packed with details, on top of multiple overlapping blur effects.</p><p>When I profiled the city center, I found that each frame was rendering approximately 1.76 million triangles.</p><p>Interestingly, buildings weren’t a problem. Around three-quarters of all the triangles on screen came from rendering pedestrians.</p><p>Each pedestrian was rendered more than a hundred times. Shadow effects then added several more rendering passes for every character.</p><p>This taught me an important lesson: developers need to observe what matters visually and make their own adjustments to strike the right balance between visual quality and performance.</p><p>Here are the main optimizations I implemented:</p><ul><li><strong>Reduced character complexity:</strong> Simplified pedestrian models while keeping enough detail to remain recognizable from a distance and preserve their walking animations.</li><li><strong>Reduced the town from 360+ to just 81 blocks:</strong> Only the parts visible to the camera were rendered. I handled much of this adjustment through prompting.</li><li><strong>Instanced repeated objects:</strong> Elements such as windows, trees, pedestrians, and vehicles were rendered together in batches rather than individually.</li><li><strong>Removed unnecessary shadows:</strong> Shadow rendering was disabled for objects where the difference was barely noticeable, such as thin lamp posts and headlights during daytime.</li><li><strong>Simplified blur effects:</strong> Replaced multiple overlapping blur layers with just two lower-resolution layers.</li></ul><p>For lower-end devices, the client also needed to dynamically reduce rendering resolution during loading, then restore it afterward. I made loading and rendering happen in parallel, with a loading screen that clearly visualizes which assets are currently being loaded.</p><p>Optimization made a significant difference.</p><p>The number of triangles rendered per frame in the city center dropped from 1.76 million to just 0.62 million. Even more impressively, the Shipper character’s 3D model went from 3 MB down to just 64 KB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*7EOj8gXtJ_XXmaDa19smwA.png" /><figcaption>FPT.TTS-ultra on mobile, with usage measured in characters instead of tokens</figcaption></figure><h4>What Does the Final Product Look Like?</h4><p>As you can see, the FPT Token Factory experience has become much more visually engaging, almost like an RPG game.</p><p>Some people who tried it for the first time seemed to really enjoy the experience. One user even commented that being able to rotate the camera, explore individual buildings, and visually count how many people were using each model made the whole experience quite interesting. That said, time was limited, so I couldn’t incorporate all the deeper information about each model into FPT Token Town just yet.</p><p>I’m still confident that this project has plenty of room to grow, both in terms of content and other aspects of the experience. I see this release as<strong> </strong>Chapter One of the project, and I hope to continue developing it and sharing more along the way. Here are a few ideas for what the future might look like:</p><ul><li><strong>Version 2</strong> — Develop a more distinctive visual identity and a stronger artistic direction. Users might also be able to enter buildings and interact with objects inside.</li><li><strong>Version 3</strong> — Allow users to interact with one another through virtual avatars.</li></ul><p>Of course, these are just ideas for now. I haven’t committed to any of these features, and I can’t promise that they’ll all become reality. But it’s exciting to think about what’s possible.</p><h4>What Did I Learn from This Project?</h4><p>Looking back, the biggest lesson I took away from this project is that supervised Vibe Coding is fundamentally different from simply letting AI run on its own.</p><p>The final product is much more likely to match your expectations when you have a clear vision of what you want to build and then guide the AI to understand and execute that vision.</p><p>Here are a few key takeaways:</p><ul><li><strong>Research and design first, code later.</strong> Study the framework, tools, and documentation. Plan the architecture manually before letting AI execute. Break the work down into simple, concise instructions so you can understand and control each step.</li><li><strong>Ask AI before asking it to do the work.</strong> This is especially important when dealing with technologies or areas, you’re unfamiliar with. Understand the approach first, then let AI implement it.</li><li><strong>Trust your eyes, not just the AI’s output.</strong> Inspect and evaluate what AI produces at every stage. Whenever possible, quantify performance and visual quality instead of relying on subjective descriptions.</li></ul><p>These are just a few of the lessons I learned from building FPT Token Town. More than anything, the project showed me that AI can be an incredibly powerful development partner, but having a clear vision and maintaining human oversight still make all the difference.</p><h4>Appendix: Performance figures and references</h4><p>Github link: <a href="https://github.com/littlebeanhp/fpt-token-town-oss">https://github.com/littlebeanhp/fpt-token-town-oss</a></p><ul><li><strong>Static town geometry:</strong> 487,878 → 28,522 triangles</li><li><strong>Number of town blocks:</strong> 361 → 81 (only 60 contain background buildings)</li><li><strong>Triangles per frame in the town center (daytime):</strong> 1.76 million across 3 render passes → 620,000 across 2 render passes</li><li><strong>FPT character:</strong> 3,288 → 948 triangles</li><li><strong>Grab character:</strong> 3,594 → 1,776 triangles</li><li><strong>Number of trees:</strong> 39 → 31</li><li><strong>Delivery driver’s 3D model file size:</strong> 3.0 MB → 64.2 KB</li><li><strong>Total size of GLB files loaded with the page:</strong> 1.60 MB → 1.25 MB</li></ul><h4>P.S. A quick word about FPT.TTS-ultra!</h4><p>FPT.TTS-ultra is a Text-to-Speech model that delivers highly natural, lifelike speech and supports voice cloning.</p><p>I personally deployed it onto the FPT Token Factory infrastructure. Stay tuned — I’ll be sharing more content about this model soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3f35482194d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>