Skip to content

Add ps2scorchedvehicles world special property#5012

Open
QueryOfficial wants to merge 5 commits into
multitheftauto:masterfrom
QueryOfficial:feature/ps2-scorched-vehicles
Open

Add ps2scorchedvehicles world special property#5012
QueryOfficial wants to merge 5 commits into
multitheftauto:masterfrom
QueryOfficial:feature/ps2-scorched-vehicles

Conversation

@QueryOfficial

@QueryOfficial QueryOfficial commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new world special property ps2scorchedvehicles (default: false) to darken destroyed vehicle chassis closer to PS2 SA behaviour.

When enabled:

  • Hooks WorldReplaceNormalLightsWithScorched to use 0.0f instead of PC's 0.18f
  • Darkens blown vehicle paint colours in the existing VehCol render path

Usage:

setWorldSpecialPropertyEnabled("ps2scorchedvehicles", true)

Motivation

Fixes #4946 .
On PS2 SA, destroyed vehicles appear nearly black. On PC SA and MTA, the chassis stays visibly coloured because PC uses a weaker scorched lighting multiplier (0.18f) and MTA reapplies synced paint colours during render.

This is vanilla PC behaviour, not an MTA bug. SkyGFX reproduces the PS2 look externally; this change exposes it as an opt-in server setting via setWorldSpecialPropertyEnabled.

Test plan

  • Build client (Win32) and server
  • Run Tests_Client and confirm SWorldSpecialPropertiesStateSync round-trip uses 21 bits
  • On a test server, run setWorldSpecialPropertyEnabled("ps2scorchedvehicles", true)
  • Blow up a passenger car and confirm the chassis is near-black with only faint colour hints
  • Disable the property and confirm behaviour matches vanilla PC/MTA
  • Run resetWorldProperties and confirm the property resets to false
  • Join the server with a fresh client and confirm the property syncs via map info

Hook addresses are for GTA SA 1.0 US: 0x553E6A, 0x554FC2, 0x7357E0.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

- Introduced a new world special property for PS2 scorched vehicles, allowing for enhanced vehicle lighting effects.
- Implemented enabling/disabling functionality in CClientGame and CMultiplayerSA.
- Updated packet handling to synchronize the new property across clients and servers.
- Adjusted vehicle color darkening logic based on the new property state.
- Added necessary hooks and enums to support the new feature.

This change enhances the visual experience for vehicles in the game, particularly for PS2 users.
- Added support for PS2 scorched vehicles as a new world special property.
- Updated CClientGame and CMultiplayerSA to manage the enabling/disabling of this feature.
- Enhanced packet handling to synchronize the new property across clients and servers.
- Modified vehicle color darkening logic to reflect the state of the new property.
- Introduced necessary hooks and enums to facilitate the feature.

This update improves the visual effects for vehicles, particularly enhancing the experience for PS2 users.
@FileEX FileEX added the enhancement New feature or request label Jul 22, 2026
Comment thread Client/multiplayer_sa/CMultiplayerSA_ScorchedVehicles.cpp Outdated
Comment thread Client/multiplayer_sa/CMultiplayerSA_ScorchedVehicles.cpp Outdated
Comment thread Client/multiplayer_sa/CMultiplayerSA_ScorchedVehicles.cpp Outdated
Comment thread Client/multiplayer_sa/CMultiplayerSA_ScorchedVehicles.cpp
- Added noexcept specifier to SetPs2ScorchedVehiclesEnabled method in CMultiplayerSA and CMultiplayer interfaces for improved safety.
- Updated comments for clarity in CMultiplayerSA_ScorchedVehicles.cpp regarding lighting setup.
- Adjusted hook installation comments for better accuracy in CMultiplayerSA.

These changes enhance code readability and maintainability while ensuring consistent behavior in the PS2 scorched vehicles feature.
@QueryOfficial

Copy link
Copy Markdown
Contributor Author

Addressed — thanks:

noexcept on SetPs2ScorchedVehiclesEnabled
Hook address → 0x554FB7
Comment → CRenderer::SetupLightingForEntity
Noted the WorldReplaceNormalLightsWithScorched call

@FileEX

FileEX commented Jul 24, 2026

Copy link
Copy Markdown
Member

It would be better to make it graphical option in settings rather than server-based solution.

- Introduced a new setting for PS2 scorched vehicles in CClientVariables, allowing users to enable or disable this feature.
- Updated CCore to apply the PS2 scorched vehicles setting in multiplayer.
- Added GUI elements in CSettings for user interaction with the PS2 scorched vehicles option.
- Enhanced the Reset and SaveData methods in CSettings to handle the new setting appropriately.

These changes improve user control over the visual effects related to PS2 vehicles, enhancing the overall gaming experience.
@QueryOfficial

Copy link
Copy Markdown
Contributor Author

It would be better to make it graphical option in settings rather than server-based solution.

Reworked it as a client Video setting instead of a synced world special property.

Settings → Video → "PS2 scorched vehicles" (CVAR: ps2_scorched_vehicles, default off).
No more setWorldSpecialPropertyEnabled / map-info sync for this.

FileEX
FileEX previously approved these changes Jul 24, 2026

@FileEX FileEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix clang issues

Comment thread Client/core/CSettings.cpp Outdated
Comment thread Client/core/CClientVariables.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destroyed vehicles don't turn black

2 participants