1595 Commits

Author SHA1 Message Date
vincent.p.mercier 1e85a77276 perf: accelerate web startup and French pack extraction 2026-08-21 12:45:55 +02:00
vincent.p.mercier 262983a8b0 feat: deploy autonomous French web edition for Joy 2026-08-21 12:30:00 +02:00
Adrien Ufferte 643ad6a2b5 Merge pull request #337 from Excello-Recherche-Education/sponsor
Add FUNDING.yml
2026-07-07 10:25:25 +02:00
Adrien Ufferte e7c4405a82 Add FUNDING.yml 2026-07-07 10:23:28 +02:00
Adrien Ufferte b6acbdfbed Merge pull request #328 from Excello-Recherche-Education/3.0.1
Merge 3.0.1 into main
2026-06-18 11:55:04 +02:00
Adrien Ufferte a29a5f21f8 build version update 2026-06-11 12:21:51 +02:00
Adrien Ufferte 89b0ad05ec Merge pull request #327 from Excello-Recherche-Education/optimization
Optimization global
2026-06-11 12:03:20 +02:00
Adrien Ufferte b975b5e805 Debug possible corrupted scene file 2026-06-11 11:49:29 +02:00
Adrien Ufferte 30c1a9863f Optimization global 2026-06-11 11:16:03 +02:00
Adrien Ufferte 90ce89f880 Merge pull request #326 from Excello-Recherche-Education/debug
Debug
2026-06-11 10:42:47 +02:00
Adrien Ufferte dadc6f69ef Add missing file uid 2026-06-11 10:32:15 +02:00
Adrien Ufferte 5bba77c8ea Show a specific error message for each language pack failure
All failure paths of the download/extract/swap flow displayed the same
generic ERROR_DOWNLOADING popup, which made user reports impossible to
map to an actual cause (the recent .DS_Store swap failure surfaced as a
plain "download error" even though the download and extraction had both
succeeded).

- Replace the magic error indices with a DownloadError enum, so call
  sites read _show_error(DownloadError.REPLACE_FAILED) instead of
  _show_error(2) with a comment.
- Add three specific messages with fr/es/pt_BR/it translations:
  - ERROR_EXTRACTING_PACKAGE: archive missing or extraction failed
  - ERROR_INVALID_PACKAGE: extracted pack failed the validity check
    (kept distinct from INVALID_LANGUAGE_DIRECTORY, which describes the
    local pack found while offline)
  - ERROR_REPLACING_PACKAGE: previous pack could not be removed or the
    new one could not be renamed into place; tells the user to restart
    and retry rather than suggesting a download problem
- ERROR_DOWNLOADING is now used only for actual download/server
  failures.

Localization completeness check, naming lint and GUT suite (65/65) all
pass.
2026-06-11 10:23:14 +02:00
Adrien Ufferte 239643c325 Fix directory deletion failing on hidden files, breaking the pack swap
The new extract/verify/swap flow surfaced a long-standing bug in
Utils.clean_dir(). On macOS, browsing a folder in the Finder drops a
hidden .DS_Store file in it, and clean_dir() had two flaws around that:

- DirAccess listings skip hidden files by default, so .DS_Store was
  never listed nor removed and the directory was never actually empty.
- The return value of dir.remove(subfolder) was ignored, so the failed
  removal of a subdirectory (non-empty because of its own hidden file)
  was silently swallowed and clean_dir() still reported success.

As a result, delete_directory_recursive() emptied the old language pack
but could not delete its directory, the rename of the new pack onto
that still-existing directory failed, and the downloader showed the
download-error popup. Since the version on disk was never updated, the
app re-downloaded and failed again in a loop on every launch. The old
pre-swap flow had the same deletion failure but masked it: it extracted
directly into the existing directory and ignored rename errors.

- clean_dir() now lists hidden files (include_hidden) and checks every
  removal, trying to remove everything (best effort, so callers like
  clear_all_local_data still wipe as much as possible) and reporting
  the first error encountered instead of a false OK.
- The downloader verifies that the previous pack directory is really
  gone before renaming the new one into place; if not, it aborts the
  swap, keeps the temporary directory and shows the error instead of
  attempting a rename that cannot succeed.
- Add regression tests covering hidden-file deletion, full content
  cleanup and the missing-directory error path.

Verified with the GUT test suite (65/65 passing).
2026-06-11 10:15:40 +02:00
Adrien Ufferte 0b9d5f216e Extract language packs to a temp directory and verify before swapping
Follow-up to the previous download fix: the old pack was no longer
deleted before the download, but it was still deleted at the start of
the extraction step. If the app crashed mid-extraction or the archive
was truncated, the device was left without a valid pack; worse, a
partially extracted directory containing language.db would pass
is_language_directory_valid() on the next offline launch and be
accepted as a working pack.

The extraction thread now follows an extract / verify / swap sequence:

1. Extract the archive into <lang>_tmp instead of the final location,
   leaving the current pack untouched and avoiding any risk of merging
   old and new files.
2. Validate the extracted pack (non-empty, language.db present) before
   touching the current one; on failure, discard the temp directory and
   the archive, show the invalid-directory error, and keep playing with
   the current pack.
3. Only then delete the previous pack and rename the new one into
   place. The window without a valid pack shrinks from the whole
   extraction to two filesystem operations.

If the final rename fails, the temp directory is kept (the data is
intact on disk) and the error popup is shown; the next launch detects
the missing pack and downloads it again. A leftover temp directory from
a crash is removed at the start of the next extraction.

Verified with the GUT test suite (62/62 passing).
2026-06-11 09:44:50 +02:00
Adrien Ufferte 896e2740b3 Compress large textures to VRAM formats and enable 2D mipmaps
All 747 imported PNGs were imported losslessly (compress/mode=0) without
mipmaps. Lossless textures are decompressed to raw RGBA8 in GPU memory,
so the big gameplay assets were extremely expensive: the 4100x2448
bush_curtain alone used ~40 MB of VRAM, and the 6400x8001 minigame
spritesheets ~205 MB each. Summed over the affected files, the
worst-case footprint was ~2.4 GB of texture memory for a game that
targets low-end 1-2 GB tablets with the gl_compatibility renderer. The
absence of mipmaps also caused shimmering and wasted bandwidth whenever
these textures were drawn below their native size, which is almost
always the case with the 2560x1800 canvas_items stretch.

- Switch the 119 textures with a dimension >= 512 px to VRAM
  compression (compress/mode=2) with generated mipmaps. The project
  already enables etc2_astc import, so mobile gets ETC2/ASTC and
  desktop gets S3TC/BPTC. The total footprint for these textures drops
  from ~2.4 GB raw RGBA8 to ~770 MB including mipmaps (~3x smaller
  resident set, plus faster texture uploads).
- Keep small UI textures (< 512 px, 626 files) lossless: their VRAM
  cost is negligible and block-compression artifacts would be most
  visible on small crisp UI art.
- Set the default 2D texture filter to Linear Mipmap so the generated
  mipmaps are actually sampled by canvas items (without this, mipmap
  generation would only add memory).
- Remove viewport/hdr_2d=true: HDR 2D allocates RGBA16F framebuffers,
  doubling framebuffer memory and bandwidth at 2560x1800 on exactly the
  GPUs that can least afford it. No scene uses glow or HDR values (no
  WorldEnvironment anywhere), so this was pure cost. As false is the
  default value, Godot drops the line entirely.

Texture quality should be eyeballed in the editor on the largest
illustrations; any texture where compression artifacts are noticeable
can be switched back to lossless individually.

Verified with the GUT test suite (62/62 passing).
2026-06-11 08:45:57 +02:00
Adrien Ufferte 3b597d92d5 Debug test parsing error 2026-06-11 08:15:31 +02:00
Adrien Ufferte 921d13b0cb Keep the current language pack until the new one is downloaded
The package downloader deleted the installed language pack as soon as a
version difference with the server was detected, before the download had
even started. If the download then failed (connection drop, server
error), the device was left with an empty language directory: on the
next offline launch, the directory check failed and the app was unusable
until internet access was restored.

The early cleanup was also redundant: _copy_data() already removes the
existing directory right before extracting the new archive, i.e. after
the download has succeeded (HTTP 200).

Changes in package_downloader.gd:
- Remove the pre-download cleanup of the current language directory; the
  previous pack now stays usable for offline play until the new one has
  been fully downloaded.
- Check the return value of HTTPRequest.request() and show the download
  error popup when the request cannot be started, instead of leaving the
  screen waiting forever on a request that was never sent.
- Surface extraction failures (missing archive, unzip error) through the
  error popup instead of silently returning from the extraction thread
  and leaving the user stuck on a frozen progress screen.

Changes in login.gd:
- Handle the result of UserDataManager.login_student(), which was
  previously logged and ignored. The synchronization performed right
  before the login can delete or move the student locally (e.g. the
  server requested a local deletion), in which case the child was sent
  to the gardens scene with no student session loaded, ending up on a
  dead screen. On failure, play the wrong-password feedback and reset
  the code keyboard instead of changing scene.

Verified with the GUT test suite (58/58 passing).
2026-06-11 08:09:56 +02:00
Adrien Ufferte c77e9b90ec Fix synchronization reliability: freed popup refs and unvalidated payloads
The UserDatabaseSynchronizer outlives the scenes that use it, which made
the periodic background synchronization fragile in two ways:

1. A freed loading popup permanently broke the sync.
   The teacher settings screen injects its LoadingPopup into the
   synchronizer but never cleared the reference on scene exit. Since a
   freed Object is not equal to null in Godot 4, the next timer-driven
   synchronization called into the freed node, crashed the coroutine
   after `synchronizing` had been set to true, and every subsequent
   synchronize() call was then silently cancelled by the re-entrancy
   guard until the app restarted.
   - All popup guards now use is_instance_valid() (plus is_inside_tree()
     where get_tree() is needed).
   - The teacher settings screen clears the synchronizer's popup
     reference in _exit_tree().

2. Server payloads were applied without shape validation.
   _apply_server_response() indexed JSON fields (lesson unlock data,
   remediation score tuples, confusion matrix entries) without checking
   their types, as flagged by the five "TODO ADD SECURITY" comments. A
   single malformed or legacy record raised a script error mid-sync,
   which also wedged the `synchronizing` flag as described above.
   - Lesson unlock entries, remediation score pairs and confusion matrix
     entries are now validated before use; malformed records are logged
     and skipped individually so one bad record cannot abort the whole
     synchronization or corrupt local student data.
   - The three copy-pasted remediation parsing blocks are factored into
     a single _parse_score_remediation() helper.

Verified with the GUT test suite (58/58 passing).
2026-06-10 17:00:31 +02:00
Adrien Ufferte 48ad70d7db Debug completed game color on the minigame wheel 2026-06-10 09:58:39 +02:00
Adrien Ufferte e21c3aec21 Debug prof_tool 2026-06-09 16:31:56 +02:00
Adrien Ufferte 10e66ffffc Merge pull request #325 from Excello-Recherche-Education/optimize-turtle-minigame
Optimize turtle minigame
2026-06-09 15:46:43 +02:00
Adrien Ufferte 87c53ba5c0 Dynamically adapt POOL SIZE for ring effect 2026-06-09 12:21:40 +02:00
Adrien Ufferte 4ee513c543 Handle turtle in boss minigame 2026-06-09 11:50:40 +02:00
Adrien Ufferte f50a739b3d Optimize turtle minigame 2026-06-09 11:45:50 +02:00
Adrien Ufferte 708f0fe091 Auto-heal language account at every login 2026-06-09 10:52:42 +02:00
Adrien Ufferte be2ddba6db Merge pull request #324 from Excello-Recherche-Education/prevent-crash-frog
Prevent crash when launching frog minigame
2026-06-09 10:07:08 +02:00
Adrien Ufferte 07770f0a01 Prevent crash when launching frog minigame 2026-06-09 09:40:12 +02:00
Adrien Ufferte 94c841bf7a Debug device selection list too long 2026-06-08 18:11:48 +02:00
Adrien Ufferte cb2edd07de Export settings 2026-06-08 17:51:11 +02:00
Adrien Ufferte 5fffa870b1 Change version number 2026-06-06 19:23:19 +02:00
Adrien Ufferte 3da2428f55 Merge pull request #323 from Excello-Recherche-Education/wheel
New minigame wheel system
2026-06-06 19:21:17 +02:00
Adrien Ufferte fcd84fdb35 Protect against out of bounds for minigame index 2026-06-06 18:11:45 +02:00
Adrien Ufferte fe696c8b20 debug lessons numbers different from 3 2026-06-06 17:44:17 +02:00
Adrien Ufferte 2db21b597b Minigames wheel version 2 2026-06-06 11:13:22 +02:00
Adrien Ufferte 42118fad1b Merge pull request #322 from Excello-Recherche-Education/prevent-crash
Prevent boss minigame crash
2026-06-01 09:52:31 +02:00
Adrien Ufferte bab4d8da27 Prevent boss minigame crash 2026-06-01 09:46:41 +02:00
Adrien Ufferte 3146a33b08 Merge pull request #321 from Excello-Recherche-Education/stars-colors
New star colors in background of gardens
2026-05-28 16:58:05 +02:00
Adrien Ufferte a5c374ab24 New star colors in background of gardens 2026-05-28 16:27:00 +02:00
Adrien Ufferte 8e65df45b8 Merge pull request #320 from Excello-Recherche-Education/debug
Security if language pack has less than 3 exercices in lesson
2026-05-28 15:53:16 +02:00
Adrien Ufferte 6a45cd4fc2 Security if language pack has less than 3 exercices in lesson 2026-05-28 15:42:15 +02:00
Adrien Ufferte 268c7e49cf Merge pull request #319 from Excello-Recherche-Education/help-speech-one-time
Ensure the help speech of Kalulu is triggered only once
2026-05-28 15:11:37 +02:00
Adrien Ufferte 0ac4967486 Ensure the help speech of Kalulu is triggered only once when the threshold is crossed, and not every mistake after that. 2026-05-28 13:38:11 +02:00
Adrien Ufferte 612d58496a Merge pull request #318 from Excello-Recherche-Education/new-garden-02
New gardens
2026-05-28 12:56:38 +02:00
Adrien Ufferte 2c2e6f654a Debug boss button texture 2026-05-28 12:05:30 +02:00
Adrien Ufferte 14f1d68a47 Update boss button 2026-05-28 11:59:10 +02:00
Adrien Ufferte 9e512ec4a5 Boss buttons does not stop scrolling 2026-05-28 11:42:27 +02:00
Adrien Ufferte 0e55e5d464 Small corrections for gardens assets 2026-05-28 10:29:23 +02:00
Adrien Ufferte c9bdedb576 Bold font for lesson buttons 2026-05-28 10:29:10 +02:00
Adrien Ufferte ba8646c1bd Place clouds behind UI buttons 2026-05-28 10:21:51 +02:00
Adrien Ufferte d55c05b53d Debug clouds "world bounds" 2026-05-28 09:31:11 +02:00