设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3011|回复: 8
打印 上一主题 下一主题

[交流讨论] APK打包运用WebGL提高速度后的讨论

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1764
在线时间
396 小时
注册时间
2013-8-28
帖子
93
跳转到指定楼层
1
发表于 2018-2-8 09:59:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
AKP在打包的时候强制调用WebGl可以让游戏再手机上允许得到明显提高,特别是在IOS打包的时候,苹果手机的效果和运行是直线上升的,但是有一个问题,

MV没有内存释放的方法,或者手动释放内存,就会导致手机游戏现在是变快了,但是内存一旦堆积很多就会闪退或者崩溃,有没有好的办法呢?

Lv2.观梦者

梦石
0
星屑
676
在线时间
224 小时
注册时间
2006-12-7
帖子
839
2
发表于 2018-2-8 11:05:59 | 只看该作者
  1.        

  2.     //=============================================================================
  3.     // Cache Manager
  4.     // by Shaz
  5.     // Last Updated: 2015.10.30
  6.     //=============================================================================
  7.      
  8.     /*:
  9.      * @plugindesc Selectively clear the image cache for memory usage improvements
  10.      * @author Shaz
  11.      *
  12.      * @param Mobile only
  13.      * @desc Cache management only runs on mobile platforms (N to run on all platforms)
  14.      * @default Y
  15.      *
  16.      * @param --------------------------------------------
  17.      *
  18.      * @param Clear All
  19.      * @desc Clears all cached images except System (if Y, ignore remaining parameters)
  20.      * @default Y
  21.      *
  22.      * @param Clear Animations
  23.      * @desc Clear Animation images
  24.      * @default Y
  25.      *
  26.      * @param Clear Battlebacks
  27.      * @desc Clear Battleback images
  28.      * @default Y
  29.      *
  30.      * @param Clear Battlers
  31.      * @desc Clear Battler images
  32.      * @default Y
  33.      *
  34.      * @param Clear Characters
  35.      * @desc Clear Character images
  36.      * @default Y
  37.      *
  38.      * @param Clear Faces
  39.      * @desc Clear Face images
  40.      * @default Y
  41.      *
  42.      * @param Clear Parallaxes
  43.      * @desc Clear Parallax images
  44.      * @default Y
  45.      *
  46.      * @param Clear Pictures
  47.      * @desc Clear Picture images
  48.      * @default Y
  49.      *
  50.      * @param Clear System
  51.      * @desc Clear System images (not recommended)
  52.      * @default N
  53.      *
  54.      * @param Clear Tilesets
  55.      * @desc Clear Tileset images
  56.      * @default Y
  57.      *
  58.      * @param Clear Titles
  59.      * @desc Clear Title images
  60.      * @default Y
  61.      *
  62.      * @param Custom Images
  63.      * @desc List custom image paths to clear, separated by ; (img/fogs; img/busts)
  64.      * @default
  65.      *
  66.      * @help This plugin does not provide plugin commands.
  67.      *
  68.      * This plugin allows you to specify how often the image cache should be
  69.      * cleared, and what kind of images should be cleared.  This can be used
  70.      * to improve memory usage on low-memory platforms, but will also result
  71.      * in more frequent loading delays.
  72.      *
  73.      * If not using the 'clear all' default option, and you have plugins that
  74.      * use their own custom image paths, list those paths in the Custom Images
  75.      * parameter to clear any images cached from those locations.
  76.      *
  77.      */
  78.      
  79.     (function() {
  80.       var params = PluginManager.parameters('CacheManager');
  81.       var mobile = (params['Mobile only'] || 'Y').toUpperCase().substring(0,1) === 'Y';
  82.       var clearAll = (params['Clear All'] || 'Y').toUpperCase().substring(0,1) === 'Y';
  83.       if (!clearAll) {
  84.         pathsToClear = [];
  85.         if ((params['Clear Animations'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  86.           pathsToClear.push('img/animations');
  87.         if ((params['Clear Battlebacks'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  88.           pathsToClear.push('img/battlebacks1', 'img/battlebacks2');
  89.         if ((params['Clear Battlers'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  90.           pathsToClear.push('img/enemies', 'img/sv-actors', 'img/sv-enemies');
  91.         if ((params['Clear Characters'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  92.           pathsToClear.push('img/characters');
  93.         if ((params['Clear Faces'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  94.           pathsToClear.push('img/faces');
  95.         if ((params['Clear Parallaxes'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  96.           pathsToClear.push('img/parallaxes');
  97.         if ((params['Clear Pictures'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  98.           pathsToClear.push('img/pictures');
  99.         if ((params['Clear System'] || 'N').toUpperCase().substring(0,1) === 'Y')
  100.           pathsToClear.push('img/system');
  101.         if ((params['Clear Tilesets'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  102.           pathsToClear.push('img/tilesets');
  103.         if ((params['Clear Titles'] || 'Y').toUpperCase().substring(0,1) === 'Y')
  104.           pathsToClear.push('img/titles1', 'img/titles2');
  105.         (params['Custom Images'] || '').split(';').forEach(function(path) { if (path) pathsToClear.push(path.trim()) }.bind(this));
  106.       }
  107.      
  108.       ImageManager.clear = function() {
  109.         for (image in this._cache) {
  110.           if (clearAll && image.indexOf('img/system') === -1)
  111.             this.removeFromCache(image);
  112.           else if (!clearAll && pathsToClear.some(function(path) { return image.indexOf(path) > -1}.bind(this)))
  113.             this.removeFromCache(image);
  114.         }
  115.       };
  116.      
  117.       ImageManager.removeFromCache = function(image) {
  118.         if (image !== 'null') {
  119.           if (this._cache.hasOwnProperty(image) && this._cache[image] instanceof Bitmap) {
  120.             if (this._cache[image].baseTexture) {
  121.               this._cache[image].baseTexture.destroy();
  122.             }
  123.           }
  124.           delete this._cache[image];
  125.         }
  126.       };
  127.      
  128.       var _Scene_Map_create = Scene_Map.prototype.create;
  129.       Scene_Map.prototype.create = function() {
  130.         _Scene_Map_create.call(this);
  131.         if (this._transfer && (!mobile || Utils.isMobileDevice())) {
  132.           ImageManager.clear();
  133.         }
  134.       };
  135.     })();

复制代码


转发下这个插件看看有用没
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7422
在线时间
948 小时
注册时间
2017-9-27
帖子
583
3
发表于 2018-2-8 21:15:48 | 只看该作者
用mv用得越久越觉得这不是一个适合做手机游戏的工具。
目前我的项目已经停滞,正补充unity的知识,准备迁移过去。

点评

说的太绝对了,补充一下,不是只能,是更适合做jrpg,做动作类游戏只能自娱自乐了,打击感节奏感稍不到位就会被核心玩家喷的狗血淋头  发表于 2018-2-9 21:16
表示同意,mv只能做jrpg,想做更多功能真的还必须要使用专业的软件  发表于 2018-2-9 21:12
是的 千万别指望,除非你就用少量很简单的素材  发表于 2018-2-9 11:26
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3404
在线时间
461 小时
注册时间
2013-12-7
帖子
333
4
发表于 2018-2-9 01:07:44 | 只看该作者
MV有释放内存的方法啊,Webkit 会自动释放null。直接 = null不比RGSS简单…
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1764
在线时间
396 小时
注册时间
2013-8-28
帖子
93
5
 楼主| 发表于 2018-2-9 10:13:42 | 只看该作者
ekmomo 发表于 2018-2-9 01:07
MV有释放内存的方法啊,Webkit 会自动释放null。直接 = null不比RGSS简单…

实际上没有释放,简单的测试,你做两个地图来回切换,你会发现内存只增加不减少,然后到崩溃
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3404
在线时间
461 小时
注册时间
2013-12-7
帖子
333
6
发表于 2018-2-9 13:57:05 | 只看该作者
本帖最后由 ekmomo 于 2018-2-9 14:13 编辑

没法说。

捕获.PNG (123.58 KB, 下载次数: 1)

捕获.PNG
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-7 17:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表