Friday, July 22, 2022
HomeGame DevelopmentCocos Improve Package: Cocos Creator engine for efficiency optimization, enhancements to the...

Cocos Improve Package: Cocos Creator engine for efficiency optimization, enhancements to the open supply undertaking – Cocos Creator


In my improvement historical past, initiatives at all times want some options that the engine doesn’t have, or the prevailing options of the engine can’t meet the demand.

So I put all of the options I needed so as to add to the engine in a single undertaking: Cocos Improve Package.

I hope everybody can take part within the improvement of this undertaking (repair bugs), so it will likely be open supply.

I hope this undertaking would be the first to implement among the options that individuals count on the engine to have and convey a “native” expertise.

I hope this undertaking will be like an alpha model of the engine, it may be a reference within the software impact, and assist the engine crew to implement the options that individuals count on the engine to have quicker.

The merchandise of including multi-texture rendering options to the engine, for instance, has been completed by many individuals, however.

  • There are people who do it by inheriting engine courses, which I believe will increase the price to the consumer and isn’t as silky clean as utilizing the engine’s native options.

  • There are people who do it by plugin scripts, however this strategy at all times requires copying among the engine code and will be awkward to implement, and I don’t assume it’s any extra maintainable than a customized engine when Cocos Creator 2.x stops updating options.

Precedent for making multi-texture rendering options native to the engine.

The PixiJS engine has formally applied multi-texture rendering within the v4 launch in 2016.

The > Phaser engine relies on the PixiJS engine, so it additionally helps multi-texture rendering.

And the most important benefit of utilizing a customized engine is that it may well help native platforms, the drawback is that for the reason that mini-game platform has an engine plugin function, utilizing a customized engine will forestall you from utilizing the engine plugin.

Help for multi-texture rendering

  • Sprite, cc.Label, cc.RichText, cc.MotionSteak, Backbone elements, simply drag within the elements to make use of.
  • Gives multi-texture batcher and automated materials switching mechanism, which makes it simpler to dynamically generate and handle multi-texture supplies, and is the premise for lots of the following options.

Help for top DPI textual content rendering

Beforehand, we might improve the fontSize and reduce the Scale of the node to attain this, however now it’s instantly applied contained in the engine, and the size will be adjusted with one line of code.

cc.sp.labelRetinaScale = 2;

And supply a worldwide change and a single-component change, you’ll be able to management the vary of this function on as you want.

Dynamic merge reconstruction

  • Due to the multi-texture rendering base, it’s attainable to remain at 1 Draw Name with not less than 8 units of photographs.
  • It helps automated multi-texture batching, optimized algorithms, reuse of discarded area, and different options.
  • Permits Backbone to take part in dynamic merging as effectively.
  • Help world default change, and add a change for elements to take part in merging or not.
  • Expose extra merge interfaces to manage using dynamic merge maps in a extra detailed approach.

CHAR Cache Mode Refactoring

  • Due to the multi-texture rendering base, the utmost variety of character atlases has been elevated from 1 to eight, which considerably alleviates the issue of textual content not being rendered when the atlases run out.
  • Computerized multi-texture batching can also be supported, which implies that Char character units will be merged with dynamic merging in a single batch.
  • Help for reuse of discarded area

So long as the dynamic merge and Bitmap cache modes are used correctly, most scenes now not have to do particular Draw Name optimization (hitting the set, adjusting the node order, layering rendering) to have a great variety of Draw Calls.

The Backbone part helps merging with different elements, merging into dynamic units and SpriteFrame swap

As talked about within the title, as a result of we discovered that the discussion board typically want to make use of SpriteFrame to decorate up Backbone, and there are a lot of firms use Backbone to implement widespread animations, even body animations, which can have an enormous efficiency burden if they will’t be mixed with different elements.

You may get the total detailed documentation under, and it solely takes just a few steps (establishing a customized engine) to use all of the above options.

Github repository: GitHub – smallmain/cocos-enhance-kit: 这是一个提供 Cocos Creator 引擎特性增强、修复与优化的开源非官方增强包。

The improve equipment is extraordinarily restrained in making adjustments to the engine, and can attempt to make sure compatibility and never modify the unique defaults of the engine, so that you don’t have to fret about “abruptly utilizing it one way or the other”, and nearly all new options are enabled and disabled by default.

So after set up chances are you’ll discover that nothing appears to have modified within the undertaking, we advocate that you just learn the Getting Began tutorial to grasp the really useful approach to make use of it.

Lastly, if you’d like a one-click set up, then take into account my private paid engine extensions.

Cocos Retailer: Cocos Service Pack | Cocos Retailer

After all you’ll be able to write a script to implement it in minutes, so take into account this a sponsored hyperlink and thanks on your help

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments