Pokémon TCG Pocket: توسعه فقط Vulkan را برای بازیهای معمولی به کار میگیرد
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
بازی کارتی تجاری پوکمون (TCG) نزدیک به 30 سال است که در سراسر جهان از آن لذت می برند. Pokémon TCG Pocket اخیراً منتشر شده به گونهای طراحی شده است که به بازیکنان اجازه میدهد مجموعهها و نبردهای پوکمون را در هر زمان و هر مکان و بدون نیاز به کارتهای فیزیکی تجربه کنند. دسترسی به این بازی در گوشی های هوشمند به محبوبیت گسترده آن در بین کاربران کمک کرده است.
در حالی که ممکن است به نظر یک بازی کارتی تجاری معمولی باشد، Pokemon TCG Pocket از سایه بان های پیچیده استفاده می کند که چالش مهمی در کاهش زمان کامپایل ایجاد می کند. برای رفع این مشکل و اطمینان از گرافیک با کیفیت و تجربه بازی روان، نسخه اندروید Pokémon TCG Pocket از Vulkan، API گرافیکی نسل بعدی استقبال کرده است.
این سند به بررسی پذیرش Vulkan توسط تیم توسعه TCG Pokémon، چالشهای پیش روی و مزایایی که Vulkan ارائه میدهد، میپردازد.
شکل 1. صحنه های بازی Pokémon TCG Pocket.
دلایل اتخاذ Vulkan
در ابتدا، تیم توسعه Pokémon TCG Pocket قصد داشت از OpenGL ES استفاده کند. با این حال، آنها تصمیم گرفتند Vulkan، یک API گرافیکی با آینده امیدوارکننده را به کار گیرند. دلایل اصلی انتخاب ولکان عبارت بودند از:
مدیریت برنامه های بلند مدت : با تشخیص روند تبدیل شدن Vulkan به API گرافیکی غالب برای اندروید، تیم تشخیص داد که Vulkan انتخاب بهینه برای مدیریت طولانی مدت برنامه است.
عملکرد پایدار در دستگاه های با مشخصات پایین : برای ارائه یک تجربه روان برای طیف گسترده ای از کاربران، عملکرد پایدار در دستگاه های با مشخصات پایین ضروری است. انتظار می رود توانایی Vulkan برای کاهش بار CPU باعث بهبود نرخ فریم و مصرف باتری شود.
اجتناب از تغییرات در مقیاس بزرگ پس از انتشار : تغییر از OpenGL ES به Vulkan پس از انتشار تغییرات گستردهای را در پی خواهد داشت که به طور بالقوه تجربه کاربر را مختل میکند. پذیرش Vulkan از همان ابتدا نیاز به چنین تغییرات مهمی را کاهش داد.
Vulkan را با یونیتی پیاده سازی کنید
Pokémon TCG Pocket از Unity به عنوان موتور بازی خود استفاده می کند. Unity یک فرآیند ساده برای پیاده سازی Vulkan با یک کلیک ارائه می دهد. با استفاده از Unity، تیم توسعه به طور یکپارچه Vulkan را بدون نیاز به آموزش تخصصی یکپارچه کرد. علاوه بر این، فقدان سازگاری های خاص Vulkan برای محیط ها و ابزارهای توسعه به مقرون به صرفه بودن کمک می کند.
شکل 2. Auto Graphics API در Unity.
چالش های پیاده سازی Vulkan
در حالی که اجرای Vulkan نسبتاً ساده بود، تیم توسعه پس از آن با چالشهایی مواجه شد:
مشکلات مربوط به دستگاه : در مقایسه با OpenGL ES، برخی از درایورهای سازنده پایداری کمتری با Vulkan نشان دادند که منجر به مشکلات خاص دستگاه شد.
پشتیبانی ناقص از Vulkan در میانافزار : برخی از میانافزارها فاقد پشتیبانی کامل از Vulkan هستند، و تیم باید منتظر بهروزرسانی میانافزار باشد.
تیم توسعه این چالشها را از طریق استراتژیهای متعدد، از جمله جمعآوری تیمی از توسعهدهندگان بازیهای مصرفکننده با تجربه برای عیبیابی (از آنجایی که در API گرافیکی سطح پایین یا موتور سفارشی تجربه خوبی داشتند) و همکاری با تیمهای Google و Unity برای حل مشکلات فردی، برطرف کردند. برای گسترش سازگاری دستگاه، آزمایش شامل دستگاههای پیشرفته متوسط تا قدیمی (منتشر شده 2 تا 3 سال پیش) برای تعیین مشخصات دستگاه توصیه شده بود .
مزایای Vulkan
پذیرش Vulkan چندین مزیت را برای Pokémon TCG Pocket به همراه داشت:
کاهش زمان کامپایل شیدر : Vulkan به طور قابل توجهی زمان کامپایل سایه بان را حتی برای تعداد زیادی شیدر کاهش داد. به عنوان مثال، زمان کامپایل OpenGL ES می تواند از 1 ثانیه تجاوز کند، اما این دیگر نگرانی با رندر Vulkan نیست.
گستره وسیعتر دستگاههای پشتیبانیشده : بهبود در نرخ فریم و مصرف باتری به طیف وسیعتری از دستگاههای پشتیبانیشده اجازه میدهد و تجربه نرمتری را برای کاربران بیشتر تضمین میکند.
تله متری بهتر با لایه های اعتبار سنجی Vulkan : لایه اعتبار سنجی Vulkan در شناسایی علت اصلی مشکلات بسیار مفید بود و اطلاعات ارائه شده توسط Vitals ANR/Crash را تکمیل می کرد.
پیام به توسعه دهندگان
تیم توسعه Pokémon TCG Pocket توصیه های زیر را به توسعه دهندگانی که Vulkan را برای پروژه های خود در نظر می گیرند ارائه می دهد:
فراتر از کاهش زمان کامپایل شیدر، Vulkan مزایای عملکرد قابل توجهی را ارائه می دهد.
استفاده از vkQuality برای بازگشت به OpenGL ES میتواند به طور بالقوه پشتیبانی دستگاه را افزایش دهد، حتی اگر Pokémon TCG Pocket هنوز از آن استفاده نمیکند.
نتیجه گیری
با پذیرش Vulkan، تیم توسعه Pokémon TCG Pocket توانست گرافیک را در طیف وسیعی از دستگاهها بهینه کند تا تجربهای روان و جذاب را برای هر بازیکنی تضمین کند. انتظار می رود Vulkan با اضافه شدن ویژگی های مداوم و پتانسیل های آینده در حال تحول، مزایای بیشتری را در طول زمان به ارمغان آورد.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-05-16 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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 بهوقت ساعت هماهنگ جهانی."],[],[],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."]]