شركة NEW STATE Mobile تخفض استخدام وحدة معالجة الرسومات بنسبة 22% باستخدام أداة فحص وحدات معالجة الرسومات من Android
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
خلفية
NEW STATE Mobile هي لعبة معارك ملكية من Krafton تم إطلاقها في تشرين الثاني (نوفمبر) 2021 حول العالم، وحقّقت أكثر من 45 مليون عملية تنزيل في الشهر الأول من إطلاقها. إنّ شركة KRAFTON, Inc. هي مجموعة من استوديوهات تطوير الألعاب المستقلة التي اجتمعت بهدف توفير تجارب ترفيهية مبتكرة وجذابة للاعبين من جميع أنحاء العالم. تتألّف الشركة من PUBG Studios وBluehouse Studio وStriking DISTANCE Studios و RisingWings وDreamotion وUnknown Worlds، وتتسم كل شركة بخبرتها الفريدة. تم إنشاء لعبة NEW STATE Mobile باستخدام Unreal Engine 4، وتم إجراء محاولات متعددة لتقليل استهلاك الحرارة والبطارية بسبب الاستخدام المرتفع لوحدة معالجة الرسومات من خلال ميزات الألعاب المميزة.
يستطيع اللاعبون خوض معارك بعيدة المدى، لذلك يجب أن يتمكّن محرّك اللعبة من عرض المشاهد من مسافة بعيدة. بالإضافة إلى ذلك، تتوفّر العديد من النباتات في ساحة المعركة، ما يؤدي إلى تجاوز هذه النباتات تأثيرًا كبيرًا على انخفاض مستوى الأداء. وقد دفع هذا الفريق إلى استخدام أداة Android GPU Inspector (AGI) للمساعدة في تحسين استخدام وحدة معالجة الرسومات في اللعبة وإزالة المؤثِّرات السلبية.

الشكل 1: لقطة شاشة من تطبيق NEW STATE Mobile
الإجراءات التي اتخذتها الشركة
NEW STATE Mobile: تم استخدام أداة AGI للوصول إلى كمية كبيرة من معلومات عدّاد وحدة معالجة الرسومات وتحسين استخدام وحدة معالجة الرسومات وفقًا لذلك. وحددوا تصاريح العرض غير الضرورية بمساعدة بيانات تحليل نشاط وحدة معالجة الرسومات التي تقدمها AGI. بعد تحديد القطاعات التي كانت تستخدم وحدة معالجة الرسومات ومعدل نقل بيانات الذاكرة، واصلوا التحقق من تقدم التحسين باستخدام عدّاد وحدة معالجة الرسومات ونشاط وحدة معالجة الرسومات ذهابًا وإيابًا للتحقق مما إذا كانت الأجهزة تتجه في الاتجاه الصحيح.

الشكل 2: لقطة شاشة من تطبيق NEW STATE Mobile
وفي ما يلي بعض المعلومات التي تعلّمها الفريق حول أداء اللعبة باستخدام أداة AGI:
تحسين البطاقة الأساسية: ساعدت تقنية التمرير العميق، وهي تقنية تزيد من استخدام نمط z في البداية، على تقليل استخدام تظليل الأجزاء. تم استخدام ممر العمق بشكل خاص لـ LOD0 الذي يشغل معظم مساحة الشاشة، مما يقلل من أعباء الرسم الناتجة عن استدعاءات الرسم الإضافية. بالإضافة إلى ذلك، يمكن أن يؤدي استخدام تنسيق ألوان المشهد 32 بت إلى تحسين أداء بطاقة العرض بالكامل. تنسيق SceneColor التلقائي لـ UnrealEngine4 هو FloatRGBA، وهو إصدار 64 بت. في حال استخدام تنسيق 32 بت، يمكن تقليل معدل نقل البيانات للذاكرة بمقدار النصف.
تم قياس التأثير: بعد تطبيق الإعداد المسبق للعمق، انخفض استخدام وحدة معالجة الرسومات بنسبة %7.5. بسبب العمق البادئة، يمكن أن تظهر المزيد من الأجزاء في بداية Z. انخفض معدل الوقت المطلوب لتظليل الأجزاء بنسبة 2%. من خلال تنسيق ألوان المشهد 32 بت، تم تقليل استخدام وحدة معالجة الرسومات بنسبة 5.3%. انخفضت وحدات التظليل المشغولة بنسبة 2%، وانخفض إجمالي القراءة من وحدة معالجة الرسومات من ذاكرة النظام بمقدار 330 ميغابايت/ثانية. قلَّ مقدار وحدة معالجة الرسومات التي تكتبها إلى ذاكرة النظام بمقدار 78 ميغابايت/ثانية، وانخفضت أيضًا قراءة ذاكرة الهيئة بمقدار 43 ميغابايت/ثانية.
تحسين تمرير الظل: عند استخدام الشبكات كـ أشرطة ظلال، فإن استخدام LOD عالي المضلع لا يؤثر في الجودة. يُفضل استخدام LOD منخفض المضلّع والذي يساعد على تقليل عدد المثلثات. في Unreal Engine 4، يمكن استخدام LOD ذات المضلّع المنخفض من خلال أمر وحدة التحكم ForceLODShadow.
تم قياس التأثير: انخفض عدد المثلثات المستخدمة في الظلال بنحو 120,000. أظهرت بيانات عدّاد وحدة معالجة الرسومات في AGI أنّ استخدام وحدة معالجة الرسومات قد انخفض بنحو 2%، وانخفضت مقدار ذاكرة وحدة معالجة الرسومات التي تم قراءتها من ذاكرة النظام بمقدار 130 ميغابايت/ثانية، وانخفضت مقدار البيانات المكتوبة من وحدة معالجة الرسومات إلى ذاكرة النظام بنحو 23 ميغابايت.
الدمج التلقائي: يتيح لك المثيل التلقائي، الذي يمكن تطبيقه على كلّ من تحسين تمرير الظل وبطاقة الأساس، دمج أوامر العرض نفسها في وقت التشغيل ثم عرض كل أوامر العرض دفعة واحدة. وقد أتاح ذلك لتطبيق NEWSTATE للأجهزة الجوّالة تطبيق الإضاءة العامة على العناصر الفردية بدون فقدان الأداء. إنّ ميزة "InrealEngine4" هي ميزة أساسية تقدّمها شركة UnrealEngine4.
تم قياس التأثير: تم خفض مكالمات الرسم بمقدار 500. وانخفضت نسبة الطلبات الناتجة عن السحب بنسبة% 48 تقريبًا. انخفض استخدام وحدة معالجة الرسومات بحوالي 3.5%. تم إجراء هذه القياسات باستخدام OpenGL.

الشكل 3: بيانات داخلية توضح انخفاض استخدام وحدة معالجة الرسومات
النتائج
بفضل استخدام AGI، نجحت ميزة NEW STATE Mobile في تقليل استخدام وحدة معالجة الرسومات بنسبة %22. ومن تحسين العمق المسبق وتمرير الظل، انخفض استخدام وحدة معالجة الرسومات بنسبة 19% و3% على التوالي. كما انخفضت أعداد المستخدمين التي تمت قراءتها وكتابتها بواسطة وحدة معالجة الرسومات من ذاكرة النظام بشكل كبير.
البدء
تعرَّف على كيفية تحليل تأثير لعبتك على أجهزة Android من خلال تحديد مشاكل الأداء والجوانب التي يجب تحسينها في أداة Android GPU Inspector (AGI).
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2022-02-25 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2022-02-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# NEW STATE Mobile reduces GPU usage by 22% with Android GPU Inspector\n\nBackground\n----------\n\n[NEW STATE Mobile](https://play.google.com/store/apps/details?id=com.pubg.newstate) is a battle royale game from Krafton that launched Nov 2021 worldwide, and reached 45M+ downloads in the first month of launch. KRAFTON, Inc. is a collective of independent game development studios brought together to create innovative and engaging entertainment experiences for gamers across the world. The company consists of PUBG Studios, Bluehole Studio, Striking Distance Studios, RisingWings, Dreamotion, and Unknown Worlds, each with its own unique expertise. NEW STATE Mobile was created with Unreal Engine 4, and various attempts have been made to reduce heat and battery consumption caused by high GPU usage from their distinctive gaming features.\n\nGamers can play long range battles, so the game engine needs to be able to render scenes from quite a distance. Also, numerous vegetations are present in the battleground, leading the overdraw of these vegetations to have a substantial impact on decreasing performance. This led the team to [Android GPU Inspector](http://developer.android.com/agi) (AGI) to help optimize the game's GPU usage and eliminate bottlenecks.\n\n**Figure 1**: Screenshot from NEW STATE Mobile\n\nWhat they did\n-------------\n\nNEW STATE Mobile used AGI to access loads of GPU counter information and optimize their GPU usage accordingly. They identified unnecessary render passes with the help of the GPU activity profiling data provided by AGI. After identifying which segments were taking up GPU usage and memory bandwidth, they continued to check the optimization progress using the GPU Counter and GPU activity back and forth to check if they were headed in the right direction.\n\n**Figure 2**: Screenshot from NEW STATE Mobile\n\nHere are a few things they learned about the game's performance using AGI:\n\n- **Base pass optimization**: Depth prepass, which is a technology that increases usage of Early-z, helped decrease the use of fragment shading. Depth prepass was specifically used for LOD0 which takes up most of the screen space, minimizing the burden that can come from additional draw calls. Also, using the 32-bit scenecolor format can increase the performance of the entire render pass. Default SceneColor format of UnrealEngine4 is FloatRGBA, which is 64-bit. If a 32-bit format is used, memory bandwidth can be reduced by half.\n\n- **Impact measured**: After applying depth prepass, GPU utilization dropped by 7.5%. Due to the depth prepass, more Fragments could be Early-Z. The rate of time required for fragment shading has decreased by 2%. Through the 32-bit scenecolor format, GPU utilization was reduced by 5.3%. Shaders Busy decreased by 2%, and total GPU read from system memory decreased 330 MB/s. The amount the GPU writes to system memory was reduced by 78 MB/s and Texture memory read was also reduced by 43 MB/s.\n\n- **Shadow pass optimization**: When meshes are used as shadow casters, using high polygon LOD does not really make a difference in quality. It is preferred to use low polygon LOD which helps reduce the number of triangles. In Unreal Engine 4, low polygon LOD can be used via the console command 'ForceLODShadow'.\n\n- **Impact measured**: The number of triangles used for shadows decreased by about 120,000. The GPU counter data in AGI showed that GPU usage decreased about 2%, the amount of the GPU memory read from the system memory decreased 130MB/s, and the amount written from the GPU to the system memory decreased about 23MBs.\n\n- **Auto-instancing**: Auto-instancing, which can be applied for both shadow pass and base pass optimization, allows you to merge the same render commands at runtime and then be rendered all at once. This allowed NEWSTATE mobile to apply global illumination to individual objects without losing performance. Auto-instancing is a basic feature provided by UnrealEngine4.\n\n- **Impact measured**: Draw calls were reduced by 500. It reduced about 48% of the draw calls. GPU utilization decreased about 3.5%. These measurements were taken using OpenGL.\n\n**Figure 3**: Internal data showing GPU usage reduction\n\nResults\n-------\n\nBy using AGI, NEW STATE Mobile reduced its GPU usage by 22%. From depth prepass and shadow pass optimization, GPU usage was down by 19% and 3% respectively. Draw calls and the total memory read and written by GPU from system memory was also substantially reduced.\n\nGet started\n-----------\n\nLearn how to analyze the impact of your game on Android devices by identifying performance issues and areas to optimize with the [Android GPU Inspector](https://developer.android.com/agi) (AGI)."]]