GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gamespice-platform/settings: Godot 4 addon for game settings as a validated document: declare each setting once, scope it to a device, account or server, and save through a store you choose. A settings screen, a console and a migration all read the same declaration. Part of the GameSpice addon family.

BranchesTags
Open more actions menu

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
addons/gs_settings
addons/gs_settings
 
 
ci/efficiency
ci/efficiency
 
 
docs
docs
 
 
examples
examples
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
icon.svg
icon.svg
 
 
icon.svg.import
icon.svg.import
 
 
project.godot
project.godot
 
 

Repository files navigation

Settings - GameSpice addon

Game settings as a validated document: declare each setting once, scope it to a device, an account or a server, and save it through a store you choose. A settings screen, a console and a migration all read the same declaration.

GameSpice addon, MIT, built with Claude Code. examples/settings_selftest.tscn is the headless test. Every game in Zee's Games keeps its settings through this addon on live servers. Bug reports go to the issue tracker.

Install

  1. Get Godot 4.7.
  2. Either use GameSpice Bootstrap, which clones every project and links the addons, or copy addons/gs_settings/ and GameSpice Core's addons/gs_core/ into your project and enable gs-settings in Project > Project Settings > Plugins.

GameSpice Core and GameSpice Save (copy its addons/gs_save/ beside gs_core) are the dependencies.

Use

var schema := GSSettingsSchema.new()
schema.add(GSSettingsDef.number(&"master_volume", 0.8, 0.0, 1.0, &"audio"))
schema.add(GSSettingsDef.integer(&"fov", 90, 70, 120, &"video")
    .with_scope(GSSettingsDef.Scope.SERVER_CLAMPED))
schema.add(GSSettingsDef.binding(&"chat_open_key", "Y", &"chat")
    .with_scope(GSSettingsDef.Scope.ACCOUNT))

var settings := GSSettingsManager.new()
settings.schema = schema
settings.local_store = GSSettingsStoreFile.new()
settings.app_namespace = &"my_game"
settings.shared_namespace = &"tmc_account"      # optional
add_child(settings)
settings.setup()

settings.get_float(&"master_volume")
settings.set_value(&"master_volume", 0.4)       # saved shortly after, atomically

A key binding is stored as readable text ("Y", "Shift+A", "Mouse 1"), not a keycode, so the file means the same on every keyboard layout. GameSpice UI's GSInputBinding converts it to and from an InputEvent.

Scopes

Scope For Behaviour
DEVICE Resolution, audio device, thread count Never synchronised, so switching machines does not break it.
ACCOUNT Sensitivity, crosshair, subtitles, language Stored under shared_namespace. Games that use the same name share the value; others are unaffected.
SERVER_CLAMPED Field of view, view models, third person A server may cap it.

Server clamps

A server can cap a setting but can never read one: asking clients for key bindings, audio device or resolution would build a fingerprint that survives new accounts and bans, so this addon has no read direction at all.

A clamp is a bound, not a value. What is saved is the player's choice.

settings.apply_server_clamps({"fov": 90})
settings.get_value(&"fov")      # 90 for a player who wanted 110
settings.chosen_value(&"fov")   # 110, what the screen shows

Settings screen

GSSettingsManager.to_config() returns a GSConfig whose properties are the schema's keys. GameSpice UI builds a panel from any GSConfig, so you do not write one.

Saving

Behaviour Why
Written on change, debounced Dragging a slider is one write, and a crash loses nothing.
Atomic (temporary file, then rename) A crash mid-write cannot corrupt the file.
Web builds flush the IndexedDB mirror after every write, removals included user:// on the web is only a mirror.
Unknown keys are kept and written back Going back to an older build does not lose settings a newer one added.
A bad hand-edit loses one line An out-of-range value is corrected, an unreadable one falls back to the default, and the two are reported separately.

Stores

GSSettingsStore has three methods. A file store and a memory store ship. An account store is an HTTP client against whichever back end you use; this addon does not choose it for you.

Testing

Import the project once, then run the self-test scene in examples/ headless with Godot. Design notes: docs/design.md.

Used by

Zee's Games

Zee's Games is a collection of games I made on GameSpice, for demonstration and for fun. They show what the platform can do, and they run on live servers you can join. Anybody can create games on GameSpice, and each addon is its own repository and can be used separately from the games and from the rest of GameSpice.

These games vendor this addon:

  • Fatal Contact
  • Airdrift
  • Playlot
  • Hungario
  • Buses From Hell
  • Smash Copter
  • Zombie Zone
  • Hide n Seek
  • Prop Hunt
  • Murder Mystery
  • Deathrun
  • Wipeout
  • Dangerous Delivery
  • Look At Me

The whole collection is at zeesgames.com.

Licence

MIT licence, see LICENSE. The only closed part of the GameSpice platform is the web back end; you can use your own instead of GameSpice's.

About

Godot 4 addon for game settings as a validated document: declare each setting once, scope it to a device, account or server, and save through a store you choose. A settings screen, a console and a migration all read the same declaration. Part of the GameSpice addon family.

gamespice.net

Topics

gamedevgamedevelopmentgamespicegdscriptgodotgodot-4godot-addongodot-enginegodot4godotenginesettingsuser-settings

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.