Skip to content
Vadym Diachenko edited this page May 8, 2024 · 3 revisions

This page details less-obvious items in Preferences.

Auto-completion mode

This defines how auto-completion filtering works.

  • Start of string

    This is how things worked in legacy versions of GameMaker - if you typed ds_, you only get names that start with ds_.

  • Containing

    This is how auto-completion works in GameMaker Studio 2 - if you type debug_, you'll get debug_get_callstack, show_debug_message, and so on.

  • Smart

    This is an auto-completion mode offered by GMEdit's code editor component (Ace.js).
    It matches names that contain all letters from the input, and in order.
    So, sdm will match show_debug_message and icl matches io_clear.

  • Per-section

    This is an auto-completion mode written specifically for GML's naming specifics.
    It matches names that have each "section" (separated by _ or lowercase->UPPERCASE transitions) start with according letter of input.

    So, sdm will still match show_debug_message, but icl will get you instance_create_layer.
    You can also use SDM or ICL if you prefer (it'll still be completed to the normal name).

    If this produces too many results, or you do not, in fact, remember the name of a thing, you can "clarify" section(s) by adding opposite-cased letters after the first one.
    So, if you wanted to only get device_mouse_ functions but not ds_map_ ones, you could write dmO/DMo (d*_mo*) or dEm/DeM (de*_m*).

    For convenience, this completion mode can also access full matches in global variables (gsv -> global.someVar).

Asset cache

Reading a large number of small files can be one of the slower things for GMEdit, particularly if:

  • The project is stored on a perfectly regular hard drive.
  • The project contains thousands of resources (and even more files).
  • There's a slightly over-zealous antivirus double-checking every file that GMEdit reads.

GMEdit has a policy of not doing anything unless asked, but still you can see this impacting the project [re-]load times.

These few settings can help with that.

Cache text files in memory after load

If enabled, whenever GMEdit reads a text-based file (such as GML or YY) from the project directory, it will note down the contents and the file's Last Modified time.

On subsequent reads, it will check whether Last Modified time has changed, and if not, it will re-use the previously noted contents.

And cache small text files in a combined "index" file on disk

If enabled, GMEdit will store sufficiently small files inside the #cache/texty file and later load it along with the project, sparing it from reading individual unchanged files from disk.

Subsequent settings relate to this:

  • Maximum size per item (in characters)
    Files over this size are not included in the "index" file.
  • Minimum item count in "index" file
    An index file is created once there are this many matching files.
    This setting is mostly here to avoid creating a #cache directory in every project that you open.
  • Index update threshold (in %)
    An index file is only updated once there are this many changed files in it.
    Regardless of this setting, GMEdit only updates the "index" file when [re-]loading the project and when closing GMEdit.
  • File extensions
    Only files with these extensions will be included in the "index" file.
    There's not much reason to touch this setting, but might as well have that.

Backups

GMEdit can make a backup copy of your code whenever you save a file.

Such backups are stored in #backups sub-directory of the project and can be accessed through file manager or by right-clicking a file tab and picking "Backups".

This is not a substitute for version control, but a mechanism to prevent loss of short-term changes.

Specifics, in order:

  • GMS1 is, unfortunately, eager to overwrite external changes on any occasion.
    Essentially, when you open a resource in GMS1, it caches it in the memory, and may later decide to flush that to disk, overwriting any external changes. For this reason GMEdit will keep two backups of GMS1 files by default.
  • GMS2 is much better with external changes.
    Ticking "Automatically reload changed files" in "File > Preferences > General Settings" will save you from pretty much all trouble. Still, you may find it desirable to have a backup just in case.
  • For custom modes (see: Nuclear Throne Together), there is very little that can go wrong, as no other software is writing into the file(s).

Better workflow:

Syntax extensions:

  • `vals: $v1 $v2` (template strings)
  • #args (pre-2.3 named arguments)
  • ??= (for pre-GM2022 optional arguments)
  • ?? ?. ?[ (pre-GM2022 null-conditional operators)
  • #lambda (pre-2.3 function literals)
  • => (2.3+ function shorthands)
  • #import (namespaces and aliases)
  • v:Type (local variable types)
  • #mfunc (macros with arguments)
  • #gmcr (coroutines)

Customization:

User-created:

Other:

Clone this wiki locally