Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Invalid Texture Atlas JSON Hash in Godot 4 — what the numbers actually mean

When a sprite sheet stops animating in Godot 4, two atlas-related errors show up more often than any other. One complains that the texture atlas JSON hash is invalid; the other reports a frame out of bounds. Both look cryptic at first, but each one is really a geometry or consistency check failing against a PNG and its sidecar JSON. This post walks through what the numbers mean, reproduces the…

When a sprite sheet stops animating in Godot 4, two common errors appear: an invalid texture atlas JSON hash and a frame out of bounds. These errors stem from a mismatch between the PNG image and its corresponding JSON sidecar file. This post explains what these error numbers actually signify, demonstrates an out-of-bounds case using a real sample, and provides instructions for correcting the JSON regions to fit within the sheet.

The "Invalid Texture Atlas JSON Hash" error occurs when the JSON sidecar file and the PNG image no longer describe the same image. This happens if you re-export the PNG (resized, repacked, or saved from a different tool) but keep the old JSON file. Godot refuses to trust the outdated sidecar and rejects the atlas. The root cause is simply stale numbers in the JSON, not a corrupted project file.

The "p_frame is out of bounds" error means that a frame rectangle specified in the JSON does not fit within the actual image dimensions. The rectangle's x, y, width, or height falls outside the image's boundaries, either with negative coordinates or extending past the PNG's width and height. Godot attempts to access pixels outside the bitmap, causing a bounds check failure before any sprite is drawn.

To reproduce the out-of-bounds error, a small sample pack containing three deliberately broken sheets is available. The out-of-bounds sample is a 96×64 PNG with three frames. By dragging the two sample files into a designated drop zone, the report highlights two rectangles that fall outside the 96×64 sheet: one with negative coordinates and another whose bottom-right corner runs past both edges.

Fixing the JSON regions involves ensuring that every frame region adheres to specific inequalities: 0 ≤ x, 0 ≤ y, x + width ≤ img_w, and y + height ≤ img_h. If any frame fails to meet these conditions, the coordinates must be clamped or re-cut to fit within the bitmap. For example, the frame "b3.png" originally had coordinates (70,50) with a width and height of 40.

These values exceed the image dimensions (70+40 = 110 > 96, 50+40 = 90 > 64), so the rectangle must be adjusted to (56,24) with a width and height of 40 to fit within the 96×64 sheet.

After editing the JSON, the SpriteFrames resource must be realigned to reference the corrected frame regions. Frames that previously pointed to the faulty rectangles will continue to read the stale coordinates if not updated.

A final consistency check links the meta.size in the JSON to the actual PNG dimensions. If the bitmap was re-exported at a different size, the recorded size in the JSON must be updated accordingly. This prevents the "Invalid Texture Atlas JSON Hash" error from surfacing after a repack.

The diagnostic page and error index, along with a free tool and sample pack, are permanently available without charge. The tool also includes three broken sample sheets and a real Windows executable for users to test and fix their atlas issues. Additional resources, including a knowledge pack offering a playbook, CSV index, and sample sets, are available for $19. This early access release does not require any payment upfront, with a download link becoming available upon submission of an email address.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

The Deposit Arrived. The Real Engineering Challenge Starts After That.

AMLdark · Screen TRC20 USDT addresses for free Live AML screening for Tron-based USDT addresses against OFAC designations, Tether's freeze list and darknet datasets. Free tier included.

  • AMLdark offers free live AML screening for Tron-based USDT addresses.
  • Traditional finance invested in customer understanding, transaction analysis, and risk detection.
  • Cryptocurrency introduces challenges in transaction context understanding and risk assessment.

Why Shopify Sends a Green "Import Complete" Email Right Before Ghost SKUs Burn $1,048 in Stripe Fees

When a supplier emails a Friday afternoon catalog update, Shopify's green "Import complete" confirmation email only tells you that the rows inside the uploaded file were parsed without syntax errors.

  • Shopify's green email fails to inform about discontinued SKUs.
  • 40 discontinued items slip through unnoticed in Friday catalog updates.
  • Refunds from cancelled orders incur non-refundable Stripe fees.

More from Tuesday, 1 December 2026 →