Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Crop / compress and re-purpose assets #36

Closed
VectorSatyr opened this issue Oct 27, 2020 · 2 comments
Closed

Crop / compress and re-purpose assets #36

VectorSatyr opened this issue Oct 27, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@VectorSatyr
Copy link
Owner

VectorSatyr commented Oct 27, 2020

Related: #34

An asset is any editable resource found in the resource tree of the project. The task required will depend on the asset type being modified.

Cropping is exclusive to Sprites and Tile Sets. It involves cutting out empty or unseen pixels and cells from the assets so they take less visible (and disk) space on texture pages. Reportedly, the Game Maker Asset Compiler (GMAC) crops textures when creating the .win package, so the time gained from pre-cropping may be negligible.

Compressing can mean using a data compression algorithm to encode a file in a format which removes unnecessary bits of data in order to reduce file size. This form of compression is most relevant for Sounds. GameMaker Studio 2 re-compresses audio to .ogg format if they're streamed, and .wav if they're not, even when they're already in those file formats. Consequently, changing the file format may not increase compilation time substantially; however, it may mean a significant reduction of on-disk space, which is important when cloning the repository and pulling asset changes.

Compressing can also mean re-creating assets in a different way that results in less data used. This is most relevant when it comes to GML code assets, such as Scripts, Shaders, Timelines, Objects and Rooms (ie. "Room Creation Code.") These code changes will be the largest source of time gain.

Re-purposing is similar to compressing where an existing asset is re-created to use less data. This is mainly referring to changing how Sprites are handled - whether they take up their own texture page, or have redundancies that can be effectively cut out through code changes, etc.

Paths, Fonts (unused) and Notes are not included in this enhancement.

@VectorSatyr VectorSatyr added the enhancement New feature or request label Oct 27, 2020
@VectorSatyr VectorSatyr self-assigned this Oct 27, 2020
@VectorSatyr VectorSatyr added this to To do in [1.1.0] Improve compilation time via automation Oct 27, 2020
@VectorSatyr VectorSatyr changed the title [Windows] [General] Crop / compress assets [Windows] [General] Crop / compress and re-purpose assets Oct 27, 2020
@VectorSatyr VectorSatyr added this to the 1.1.0 milestone Oct 27, 2020
@VectorSatyr VectorSatyr removed their assignment Oct 27, 2020
@VectorSatyr VectorSatyr mentioned this issue Oct 28, 2020
12 tasks
@VectorSatyr VectorSatyr self-assigned this Nov 30, 2020
VectorSatyr added a commit that referenced this issue Dec 2, 2020
At the start of the game, the object objProgram instantiates several
persistant objects which handle various critical functions throughout
the game. These objects are now directly instantiated into two separate
layers in the room 'startup': the 'screen' layer used exclusively for
objScreen, and the 'general' layer for the other objects.

Related to #36
@VectorSatyr
Copy link
Owner Author

Re-compression of audio assets was rejected as an option by the owner of the OST. Development will focus on re-purposing existing assets in order to reduce asset usage.

@VectorSatyr VectorSatyr changed the title [Windows] [General] Crop / compress and re-purpose assets Crop / compress and re-purpose assets Dec 15, 2020
VectorSatyr added a commit that referenced this issue Dec 18, 2020
There are many times in the game where a single sprite is 'blown up'
into several pieces that fly out the screen. Currently, these pieces
use a copy of the base sprite that has been split into multiple
sub-images of equal size. This needlessly consumes texture space with
redundant images and slows down compilation.

The script `sprite_explosion_create` takes a base image and creates
'debris' (objSpriteDebris) that can render the image directly, but in
parts. By using this api, the copies can be removed from the project,
saving disk space and achieving a small gain in compilation speed. The
api also grants flexibility in the shape and volume of the 'debris'
that would have been more difficult to achieve previously.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 18, 2020
The sprite sprOstrich had its frames cropped, and the sprite origin was
adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 20, 2020
The sprite sprSnailTrail had its frames cropped, and the sprite origin
was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 23, 2020
The sprite sprDinobot had its frames cropped, and the sprite origin was
adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 23, 2020
A stray white pixel was added to sprDinobot during the previous commit.
That pixel has been removed, the sprite was cropped once more, and its
origin was re-positioned again.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 24, 2020
The sprite sprBubblesBadnik had its frames cropped, and the sprite
origin was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 29, 2020
There are many times in the game where a platform 'collapses' or
'crumbles' beneath a playable character into smaller pieces that fall
off the screen in a set pattern. Currently, these pieces use a copy of
the base sprite that has been split into multiple sub-images of equal
size. This needlessly consumes texture space with redundant images and
slows down compilation.

The object objCrumblingFloor takes a base image and creates pieces
(objCrumblingFloorPiece) that can render the image directly, but in
parts. By inheriting functionality from these objects, the sprite
copies can be removed from the project, saving disk space and
achieving a small gain in compilation speed. The new objects also grant
flexibility in the shape, volume and falling pattern of the pieces that
would have been more difficult to achieve previously.

Related: #36
VectorSatyr added a commit that referenced this issue Dec 29, 2020
The sprite sprTTFFFallingPlatform had its frame cropped, and the sprite
origin was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 2, 2021
VectorSatyr added a commit that referenced this issue Jan 7, 2021
There are many times in the game where a single sprite is 'blown up'
into several pieces that fly out the screen. Currently, these pieces
use a copy of the base sprite that has been split into multiple
sub-images of equal size. This needlessly consumes texture space with
redundant images and slows down compilation.

The script `sprite_explosion_create` takes a base image and creates
'debris' (objSpriteDebris) that can render the image directly, but in
parts. By using this api, the copies can be removed from the project,
saving disk space and achieving a small gain in compilation speed. The
api also grants flexibility in the shape and volume of the 'debris'
that would have been more difficult to achieve previously.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
The sprite sprOstrich had its frames cropped, and the sprite origin was
adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
The sprite sprSnailTrail had its frames cropped, and the sprite origin
was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
The sprite sprDinobot had its frames cropped, and the sprite origin was
adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
A stray white pixel was added to sprDinobot during the previous commit.
That pixel has been removed, the sprite was cropped once more, and its
origin was re-positioned again.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
The sprite sprBubblesBadnik had its frames cropped, and the sprite
origin was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
There are many times in the game where a platform 'collapses' or
'crumbles' beneath a playable character into smaller pieces that fall
off the screen in a set pattern. Currently, these pieces use a copy of
the base sprite that has been split into multiple sub-images of equal
size. This needlessly consumes texture space with redundant images and
slows down compilation.

The object objCrumblingFloor takes a base image and creates pieces
(objCrumblingFloorPiece) that can render the image directly, but in
parts. By inheriting functionality from these objects, the sprite
copies can be removed from the project, saving disk space and
achieving a small gain in compilation speed. The new objects also grant
flexibility in the shape, volume and falling pattern of the pieces that
would have been more difficult to achieve previously.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
The sprite sprTTFFFallingPlatform had its frame cropped, and the sprite
origin was adjusted accordingly.

Related: #36
VectorSatyr added a commit that referenced this issue Jan 7, 2021
@VectorSatyr
Copy link
Owner Author

We have reached a limit to how much compilation time can be saved by further pruning and compressing the existing assets without having to re-write the majority of the code. The task of further cleaning up the project shall be left to another developer.

[1.1.0] Improve compilation time automation moved this from To do to Done Jan 10, 2021
@VectorSatyr VectorSatyr removed their assignment Jan 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant