แม้ว่าจะดูเหมือนเกมการ์ดสะสมแบบสบายๆ แต่ Pokemon TCG Pocket กลับใช้ชิเดอร์ที่ซับซ้อน ซึ่งทำให้เกิดความท้าทายอย่างมากในการลดเวลาคอมไพล์ เพื่อแก้ไขปัญหานี้และเพื่อให้มั่นใจว่ากราฟิกมีคุณภาพสูงและประสบการณ์การเล่นเกมราบรื่น Pokémon TCG Pocket เวอร์ชัน Android จึงรองรับ Vulkan ซึ่งเป็น API กราฟิกรุ่นถัดไป
เอกสารนี้จะเจาะลึกการใช้งาน Vulkan ของทีมพัฒนา Pokémon TCG Pocket, ปัญหาที่พบ และข้อดีของ Vulkan
รูปที่ 1 ฉากในเกม Pokémon TCG Pocket
เหตุผลในการใช้ Vulkan
ตอนแรกทีมพัฒนา Pokémon TCG Pocket วางแผนที่จะใช้ OpenGL ES
แต่ตัดสินใจที่จะใช้ Vulkan ซึ่งเป็น API กราฟิกที่อนาคตสดใส
เหตุผลหลักที่เลือกใช้ Vulkan มีดังนี้
การจัดการแอปในระยะยาว: ทีมตระหนักดีว่า Vulkan กำลังกลายเป็น API กราฟิกที่โดดเด่นสำหรับ Android จึงพิจารณาว่า Vulkan เป็นตัวเลือกที่ดีที่สุดสำหรับการจัดการแอปในระยะยาว
ประสิทธิภาพที่เสถียรในอุปกรณ์ที่มีสเปคต่ำ: ประสิทธิภาพที่เสถียรในอุปกรณ์ที่มีสเปคต่ำเป็นสิ่งจำเป็นเพื่อให้ผู้ใช้จำนวนมากได้รับประสบการณ์การใช้งานที่ราบรื่น ความสามารถในการลดภาระของ CPU ของ Vulkan คาดว่าจะช่วยปรับปรุงอัตราเฟรมและการสิ้นเปลืองแบตเตอรี่
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-05-16 UTC"],[],[],null,["# Pokémon TCG Pocket: Adopting Vulkan-only development for casual games\n\nThe Pokémon Trading Card Game (TCG) has been enjoyed across the globe for nearly\n30 years. The recently released Pokémon TCG Pocket is designed to let players\nexperience Pokémon collections and battles anytime, anywhere, without the need\nfor physical cards. The game's accessibility on smartphones has contributed to\nits widespread popularity among users.\n\nWhile it may appear to be a casual trading card game, Pokemon TCG Pocket utilizes\ncomplex shaders, posing a significant challenge in reducing compilation time. To\naddress this and ensure high-quality graphics and a smooth gaming experience, the\nAndroid version of Pokémon TCG Pocket has embraced Vulkan, the next-generation\ngraphics API.\n\nThis document delves into the Pokémon TCG Pocket development team's adoption of\nVulkan, the challenges encountered, and the advantages Vulkan offers.\n**Figure 1.** Pokémon TCG Pocket game play scenes.\n\n#### Reasons for adopting Vulkan\n\nInitially, the Pokémon TCG Pocket development team planned to use OpenGL ES.\nHowever, they decided to adopt Vulkan, a graphics API with a promising future.\nThe primary reasons for choosing Vulkan were:\n\n- **Long-term app management**: Recognizing the trend of Vulkan becoming the dominant graphics API for Android, the team determined that Vulkan is the optimal choice for long-term app management.\n- **Stable performance on low-spec devices**: To provide a smooth experience for a wide range of users, stable performance on low-spec devices is essential. Vulkan's ability to reduce CPU load is expected to improve frame rates and battery consumption.\n- **Avoidance of large-scale post-release changes**: Switching from OpenGL ES to Vulkan after release would entail extensive modifications, potentially disrupting the user experience. Adopting Vulkan from the outset mitigated the need for such significant changes.\n\n#### Implement Vulkan with Unity\n\nPokémon TCG Pocket uses Unity as its game engine. Unity offers a streamlined\nprocess for implementing Vulkan with a single click. By using Unity, the\ndevelopment team seamlessly integrated Vulkan without requiring specialized\ntraining. Additionally, the lack of Vulkan-specific adaptations for development\nenvironments and tools contributed to cost-effectiveness.\n**Figure 2.** Auto Graphics API in Unity.\n\n#### Challenges in implementing Vulkan\n\nWhile Vulkan implementation was relatively straightforward, the development team\nencountered some challenges afterward:\n\n- **Device-specific issues**: Compared to OpenGL ES, some manufacturers' drivers exhibited lower stability with Vulkan, leading to device-specific issues.\n- **Incomplete Vulkan support in middleware**: Some middleware lacked full Vulkan support, requiring the team to wait for middleware updates.\n\nThe development team addressed these challenges through multiple strategies,\nincluding assembling a team of experienced consumer game developers for\ntroubleshooting (as they were well experienced in the low-level graphics API or\ncustom engine) and collaborating with Google and Unity teams for individual\nissue resolution. To expand device compatibility, testing included mid- to old\nhigh-end devices (released 2-3 years ago) to determine the\n[recommended device specifications](https://app-ptcgp.pokemon-support.com/hc/en-us/articles/39076135557145-What-is-the-recommended-smart-device-for-this-app \"Recommended device specifications\").\n\n#### Advantages of Vulkan\n\nAdopting Vulkan brought several benefits to Pokémon TCG Pocket:\n\n- **Reduced shader compilation time**: Vulkan significantly reduced shader compilation time, even for a large number of shaders. For example, the OpenGL ES compilation time could exceed 1 second, but this is no longer a concern with Vulkan rendering.\n- **Expanded range of supported devices**: Improvements in frame rate and battery consumption allowed for a wider range of supported devices, ensuring a smoother experience for more users.\n- **Better telemetry with Vulkan validation layers** : The [Vulkan validation layer](/ndk/guides/graphics/validation-layer) was very useful in identifying the root cause of problems, supplementing the data provided by Vitals ANR/Crash reports.\n\n#### Message to developers\n\nThe Pokémon TCG Pocket development team offers the following advice to\ndevelopers considering Vulkan for their projects:\n\n- Beyond shader compilation time reduction, Vulkan offers substantial performance benefits.\n- Using [vkQuality](/games/engines/unity/unity-vkquality) to fall back to OpenGL ES could potentially expand device support, even though Pokémon TCG Pocket is not using it yet.\n\n#### Conclusion\n\nBy embracing Vulkan, the Pokémon TCG Pocket development team was able to\noptimize graphics across a broad range of devices to ensure a smooth and\nengaging experience for every player. With ongoing feature additions and\nevolving future potential, Vulkan is expected to bring even more benefits\nover time."]]