Skip to content

The Sims 2 for Android 0.3.1-dev

Choose a tag to compare

@phys-winner phys-winner released this 25 Nov 11:39
a84f658

The Sims 2 for Android 0.3.1-dev improves Lua error handling, material creation, renderer diagnostics, texture conversion, and the launcher. Changes since 0.3-dev, from signed source commit a84f6585caca7a90afe140540714f879800c33bb.

One APK includes arm64-v8a and experimental armeabi-v7a. The minimum requirements are now Android 8.0 (API 26) and OpenGL ES 3.1; the native Vulkan renderer accepts Vulkan 1.0. Game data must come from a compatible The Sims 2 Legacy Collection installation. Android 8.0–8.1 and GLES 3.1-only devices still need further device testing.

Stability and startup

  • Fixed the embedded MSVC setjmp/longjmp implementation used by Lua: returning to an error handler now unwinds the actual native call stack as well as restoring guest state. The bridge covers all 34 original setjmp call sites and both longjmp epilogues.
  • Handle nested and repeated Lua errors, restore exception state, and remove jump contexts when their function returns, a C++ handler unwinds past them, or their thread ends. A jump to a function that has already returned is diagnosed.
  • Check that the game profile can be created and written before loading the engine. A write refusal produces a clear error and a shortcut to file access settings.
  • Recheck the mounted game ZIP and its index before starting. If the archive was moved, deleted, or is no longer accessible, the launcher asks the player to select it again.

Performance

  • Cache successful D3DX shader assemblies by their complete source text, macro definitions, and flags. Repeated calls receive a new game buffer containing the cached tokens; unsupported cases use the original implementation.
  • Accelerate normal-map generation with native pixel and luminance-row routines. The common case uses a simpler loop while preserving the output and execution state expected by the recompiled game.
  • Accelerate RGB24/R8G8B8 row output while preserving channel order, dithering, and rounding. Complex or unsupported inputs retain the original implementation.
  • Run strncmp, memchr, strcspn, and byte-range std::find natively; these are frequent operations in material creation.
  • Cache the configured processor count returned by GetSystemInfo, avoiding repeated system-directory reads during frequent game calls.
  • These changes reduce stalls when lot objects first appear, when changing floors, and when zooming out. Some long loading frames remain.

Cheats and touch controls

  • Add Developer mode (testingcheatsenabled) to the cheat menu, prefilled with boolProp testingcheatsenabled true, with help explaining how to disable it using false.
  • Show a testingcheats checkbox in Live mode when developer cheats are enabled. While checked, tapping a Sim or object acts as Shift-click. This also works after selecting an object from the touch target menu.
  • Read the real in-game property, including changes made through userStartup.cheat. Turning developer cheats off clears the touch checkbox. Add a one-time tip and release Shift after the click or input cancellation.

Compatibility and graphics drivers

  • Lower the Android minimum from 10 to 8.0 and the OpenGL ES requirement from 3.2 to 3.1. Guard newer Android UI calls, including screen insets, cutouts, system gesture exclusions, and dialog styling.
  • Adapt native libraries and packaging to API 26 with emulated TLS, link-time checks for unavailable symbols, compatible aligned allocation, and conditional use of newer AAudio and semaphore functions. The build rejects a PT_TLS segment.
  • On OpenGL ES 3.1, implement base-vertex drawing through attribute offsets instead of the GLES 3.2-only call.
  • Accept Vulkan 1.0 in the native renderer. Both the packaged shader library and on-device compilation target Vulkan 1.0 / SPIR-V 1.0.
  • Update bundled PanVK to the shared pinned ports build with SHA-256 04bde80d…. Packaging verifies the library and license notices against the dependency pins and shared build manifest. Bundled PanVK still requires API 30 and 4 KiB kernel pages.
  • Add the enabled-by-default Turnip on Adreno 6xx: render without GMEM tiles setting. It exposes the existing hang workaround as a player-controlled option and applies on the next game start.
  • Standardize the driver mode IDs as vulkan-turnip and vulkan-panvk. Earlier IDs remain aliases, preserving saved choices.
  • Judge drivers by their own Vulkan version, Turnip/PanVK identity, and measured texture formats. Fix the requested instance version when probing older Vulkan loaders. External drivers can be checked without the bundled driver itself when the required helper libraries are available.

Renderer failures and crash diagnostics

  • If the selected renderer cannot start or loses its GPU device, record the reason, return to the launcher, and end the game process. Remove the silent switch to system Vulkan or the older D3D9-to-GLES layer.
  • After a startup failure, or a GPU device loss before the first presented frame or within 30 seconds after it, offer the next available renderer once. The player can accept or cancel; an accepted choice goes through the normal startup and texture checks.
  • Separately handle a saved renderer that becomes unavailable after a completed driver check: select a confirmed working option and explain the change in a notification.
  • Add a native fatal-signal journal with the process ID and first-frame marker, including on Android versions before 11. Record uncaught Java exceptions as well.
  • Match Android 11+ exit reasons to the actual game process and launch. Distinguish native and Java crashes, ANRs, low-memory exits, exit codes, and renderer failures. Hold automatic startup after a detected failure.
  • Show the last failure in the launch card and copied diagnostics. Include GLES/Vulkan versions and missing texture formats. Forward detailed EGL, Vulkan instance/device, surface, and swapchain failures from native code.

Textures and converted caches

  • Check DXT1, DXT3, and DXT5 support separately for the chosen renderer. Vulkan checks both sampling and linear filtering; ETC2 checks both RGB and RGBA variants.
  • Show actual API versions and supported or missing texture formats in renderer rows. When all original game formats are supported, display a short green All the game's textures are supported line.
  • Convert only the original DXT formats missing from the selected renderer. Supported formats stay native; other textures use the converted cache or RGBA decoding.
  • After a renderer change, extend a cache for the same target format and game data with any newly needed source formats. Skip formats already covered. Append new blocks and the index before updating the header; cancellation or an error before that update preserves the previous cache.
  • Store and display the source formats covered by a cache. Older caches without this field remain readable as complete conversions.
  • Offer suitable ETC2/ASTC conversion before launch when unsupported formats are found. Do not reoffer formats already covered, and avoid a second ETC2 question after the combined Minimal Graphics/ETC2 dialog.
  • Offer conversion targets according to the chosen driver and available encoder, including the lack of an ASTC encoder in ARM32. Add clearer archive-access errors and recovery actions.

Installation, files, and launcher UI

  • When game data is not ready, look in Downloads for readable ZIPs beginning with ts2_game_data_md5_. Use a single match directly or choose among several; manual archive selection remains available.
  • Move MD5 verification to a separate dialog showing the filename, progress, and bytes read. Cancel it with the button or Back without reporting cancellation as an error. Verify the same open file the importer will read.
  • Preserve persistent content-URI permission when mounting a ZIP. If the provider refuses it, use a readable direct path when available. Recheck archive access and seekability.
  • Perform folder walks, installation checks, and archive discovery in the background, using a completed snapshot in the UI. Preserve a file-picker result received during initialization and process it afterward.
  • Fix lost Play taps when a card refresh was waiting for a touch to end: rebuilding now respects the deferred click handler.
  • Show renderer, texture, and cleanup settings after game files are found. Move the mods folder into Options and expose graphics workaround switches directly in the renderer card.
  • Use two columns on sufficiently wide landscape screens and rebuild the layout when the configuration changes.
  • Add game-mode tips for HyperOS/Game Turbo, Samsung/Gaming Hub, realme–OPPO–OnePlus/Game Assistant, vivo/iQOO, and HONOR. Provide a button for known supported ways to open the vendor tool. The tip can be disabled and enabled again in About.
  • Add the new messages and tips in English, Russian, German, and Polish.

FPS display

  • Replace three fixed overlay modes with an FPS toggle and individual settings for 15 optional fields: the graph, frame-time range, CPU, clocks, load/threads, temperatures, GPU, driver/API, memory, thermal status, battery, power, and display information.
  • First-time activation shows FPS only. Preserve the intent of earlier extended-overlay settings during migration.
  • Plot FPS from presented-frame intervals, scaled to the display refresh rate. Keep minimum and maximum frame time as a separate millisecond readout.
  • Avoid unnecessary polling of hidden system fields and bitmap allocation when the graph is disabled. Fit the graph within the available width.

Shared launcher infrastructure, tools, and checks

The commit also updates shared components used by other ports. The following infrastructure does not imply that every feature is enabled in The Sims 2:

  • Add interfaces for background mod-archive conversion, mandatory pre-launch conversion, per-renderer requirements, option offers, and discovery of several editions in one selected folder. The Sims 2 does not connect a background mod-conversion backend or enable mandatory conversion.
  • Add reusable AAudio, Lua-chunk loading, zlib, LZMA-Alone, hardware CRC32, and presented-frame helpers. They do not automatically replace The Sims 2's existing implementations. The game connects the shared crash journal and renderer-failure protocol; the Vulkan probe uses the shared driver loader.
  • Add a stars effect to the shared Play-button theme. The Sims 2 keeps its plumbob theme.
  • Add packaged shader verification and DXBC-container detection, plus a DDS-format inventory tool for files and ZIP archives. The texture-converter CLI gains source-format selection and a cache-index report.
  • Add comparisons between native CRT searches/RGB24 output and the original x86 code, including registers, stack, rounding, dithering, and safe fast-path rejection. Add real Lua/CRT jump tests covering nested errors, multiple threads, and a negative control without the fix.
  • Update cheat-menu, localization, Shift-click, Android compatibility, packaging, PanVK pinning, and renderer-selection checks. Add diagnostic comparisons for normal maps and shader assembly caching, plus renderer-failure injection.
  • Bump the APK version to 0.3.1-dev and version code to 8. Update local release instructions and PanVK notices.

Build and validation notes

  • The APK includes ARM64 and experimental ARM32, as in 0.3-dev; ARM32 support is not new in this update. App debugging is disabled. Bundled Vulkan drivers are ARM64; ARM32 texture encoding supports ETC2.
  • Both native builds and the release regression checks passed. APK verification covered version metadata, both ELF architectures, engine decompression and hashes, signing, compatibility with the previous signing certificate, and ZIP alignment.
  • Android 8.0–8.1 and GLES 3.1-only devices need further testing. Lower minimum requirements do not mean every such device has been validated. The Lua unwind fix does not resolve every possible cause of a crash.

APK SHA-256: abc7853937c57349e16fe4e22582f7f5e3665eafcd29aa0a41f01ad505ceab0b