Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Brotli (de)compression support to core #5002

Closed
DeeJayLSP opened this issue Jul 28, 2022 · 2 comments
Closed

Add Brotli (de)compression support to core #5002

DeeJayLSP opened this issue Jul 28, 2022 · 2 comments
Milestone

Comments

@DeeJayLSP
Copy link

DeeJayLSP commented Jul 28, 2022

Describe the project you are working on

Playing around with data manipulation for my game.

Describe the problem or limitation you are having in your project

Limited only to FastLZ, DEFLATE, Zstd and GZip, it would be cool if we have more compression options.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add brotli as an option to File compression modes and maybe ENetConnection compression modes.

In fact, the brotli library is already present in Godot's source code (it was added as a dependency for WOFF2 support).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The user would be able to use File.COMPRESSION_BROTLI as a compression mode.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

Part of it is already in the source, it just needs to be coded in.

@Calinou
Copy link
Member

Calinou commented Jul 28, 2022

Since Godot 3.5, there's a Brotli decompression library compiled so that Godot can read WOFF2 fonts, but the compression library isn't compiled IIRC.

That said, I think Zstandard has superseded Brotli for all intents and purposes. Zstandard can be tuned to be both faster and have a better compression ratio compared to Brotli. Really, it's that good 🙂
Zstandard also receives regular backwards-compatible updates that keep on improving its performance, while Brotli hasn't received a significant update in a long time.

The reason the web platform is still using Brotli is that it's slightly older (and it was developed by Google instead of Meta).

@Calinou Calinou changed the title Compression Modes: Add brotli Add Brotli (de)compression support to core Sep 9, 2022
@Calinou
Copy link
Member

Calinou commented Oct 27, 2023

Brotli decompression is now exposed to the scripting API: godotengine/godot#75447

Brotli compression isn't implemented in the engine for binary size reasons, so it can't be exposed.

@Calinou Calinou closed this as completed Oct 27, 2023
@Calinou Calinou added this to the 4.1 milestone Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants