DEV Community

Cover image for Mobile Gameplay Performance Optimization
Weird Codes
Weird Codes

Posted on Originally published at weirdcodes.itch.io

Mobile Gameplay Performance Optimization

MOKSHA — v0.1.1 Devlog

Date: 2026-08-18
Milestone: v0.1.1 — https://github.com/weirdcodesofficial/MOKSHA/milestone/11

Highlights

  • Major mobile-focused performance work: reduced per-frame CPU/GPU cost in render path.
  • Replaced hot trig math with a lookup table (LUT) to remove repeated Math.sin/cos calls.
  • Cached per-frame gradients and reduced expensive shadowBlur calls to lower GPU blur passes.
  • Added quality-tier controls and explicit render-state resets for more predictable mobile behaviour.
  • v0.1.1 release PR merged.

Merged pull requests (summary)

  • PR #147 — perf(render): replace remaining Math.sin/cos with lutSin/lutCos

    Replaced ~25 per-frame trig calls in drawScene() with reads from the existing 2048-entry radian LUT (affects ring ticks, pulses, orbit waves, arc heads, timer pill pulses, etc.) — reduces CPU trig cost significantly.

    https://github.com/weirdcodesofficial/MOKSHA/pull/147

  • PR #145 — render: Done gradient caching.

    Implemented caching/baking for commonly created gradients and offscreen sprites (pickup glow, naama, chakravaata, rein gradient buckets) to avoid per-frame gradient allocations and GPU work.

    https://github.com/weirdcodesofficial/MOKSHA/pull/145

  • PR #144 — render: quality tier control, explicity reset, 40 shadowBlur calls wr…

    Added device/quality-tier checks to disable or lower shadowBlur on low-end devices; isolated shadowBlur via save()/restore() and explicit ctx.shadowBlur = 0 resets to avoid leaks. GPU blur pass count reduced.

    https://github.com/weirdcodesofficial/MOKSHA/pull/144

  • PR #146 — V0.1.1 (release PR) — bump / release merge.

    https://github.com/weirdcodesofficial/MOKSHA/pull/146

Top comments (0)