PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 26, 2022

[FIXED] How can Godot add Code to Export Templates

 September 26, 2022     binaries, executable, game-engine, godot, macos     No comments   

Issue

One feature that I find impressive about the Godot Engine is how it is so lightweight and quick to compile. I realize that Godot exports using its precompiled export templates but I am confused about how it does so. I am working on macOS so that's mostly what I'm curious about. How is Godot able to add code to a precompiled executable. I've spent hours looking through the source code but can't figure it out.


Solution

Godot's export templates are compiled binaries that use a specific set of SCons options. They're always built using tools=no which disables editor functionality, and official export templates use either target=release_debug or target=release optimizations (for debug and release export templates respectively).

Note that Godot doesn't compile native code when exporting a project -- it just bundles data, scripts and the export template together. Game data and scripts are packed into a PCK file, which is a custom archive format that can store arbitrary files (without compression). The export template then runs the main script contained in the PCK file.

Scripts are compiled to bytecode when exporting a project in release mode, which speeds up loading times but otherwise doesn't affect the script execution speed.

See this page on compiling binaries for macOS.



Answered By - Calinou
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing