Skip to content

Conversation

@Identity-labs
Copy link
Contributor

Goal of this PR

Port interior-related natives from FiveM to RDR3, enabling interior debugging and manipulation capabilities in RedM. This includes adding comprehensive interior archetype debugging, room/portal management, and reflection probe support specifically for RDR3.

How is this PR achieving the goal

Unified Codebase:

  • Integrated InteriorExtraNatives.cpp from FiveM into RDR3 component via component.lua to eliminate code duplication
  • Used conditional compilation (#ifdef GTA_FIVE / #elif IS_RDR3) to handle platform-specific differences
  • Implemented clean accessor pattern with DECLARE_ACCESSOR macro for consistent API across platforms

RDR3-Specific Structures:

  • Added InteriorProxy::Impl1491 struct with correct memory offsets for RDR3
  • Implemented CReflectionProbe struct based on game file data analysis
  • Updated CMloRoomDef to include reflectionProbes field for RDR3

Enhanced Debugging:

  • Added comprehensive INTERIOR_DEBUG native with archetype info, position/rotation, entities extents
  • Implemented systematic offset testing to verify correct struct layouts
  • Added 256-byte memory dumps for both archetype and proxy structures

Ported Natives from FiveM:

Core Interior Natives:

  • GET_INTERIOR_ROTATION
  • GET_INTERIOR_ENTITIES_EXTENTS

Room Natives:

  • GET_INTERIOR_ROOM_COUNT
  • GET_INTERIOR_ROOM_INDEX_BY_HASH
  • GET_INTERIOR_ROOM_NAME
  • GET_INTERIOR_ROOM_FLAG
  • SET_INTERIOR_ROOM_FLAG
  • GET_INTERIOR_ROOM_EXTENTS
  • SET_INTERIOR_ROOM_EXTENTS
  • GET_INTERIOR_ROOM_TIMECYCLE
  • SET_INTERIOR_ROOM_TIMECYCLE

Portal Natives:

  • GET_INTERIOR_PORTAL_COUNT
  • GET_INTERIOR_PORTAL_CORNER_POSITION
  • SET_INTERIOR_PORTAL_CORNER_POSITION
  • GET_INTERIOR_PORTAL_ROOM_FROM
  • SET_INTERIOR_PORTAL_ROOM_FROM
  • GET_INTERIOR_PORTAL_ROOM_TO
  • SET_INTERIOR_PORTAL_ROOM_TO
  • GET_INTERIOR_PORTAL_FLAG
  • SET_INTERIOR_PORTAL_FLAG
  • GET_INTERIOR_PORTAL_ENTITY_COUNT
  • GET_INTERIOR_PORTAL_ENTITY_ARCHETYPE
  • GET_INTERIOR_PORTAL_ENTITY_FLAG
  • SET_INTERIOR_PORTAL_ENTITY_FLAG
  • GET_INTERIOR_PORTAL_ENTITY_POSITION
  • GET_INTERIOR_PORTAL_ENTITY_ROTATION

New RDR3-Specific Natives:

Reflection Probe Getters:

  • GET_INTERIOR_ROOM_REFLECTION_PROBE_COUNT
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_EXTENTS
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_CENTER_OFFSET
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_INFLUENCE_EXTENTS
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_ROTATION
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_PRIORITY
  • GET_INTERIOR_ROOM_REFLECTION_PROBE_GUID

Reflection Probe Setters:

  • SET_INTERIOR_ROOM_REFLECTION_PROBE_EXTENTS
  • SET_INTERIOR_ROOM_REFLECTION_PROBE_CENTER_OFFSET
  • SET_INTERIOR_ROOM_REFLECTION_PROBE_INFLUENCE_EXTENTS
  • SET_INTERIOR_ROOM_REFLECTION_PROBE_ROTATION
  • SET_INTERIOR_ROOM_REFLECTION_PROBE_PRIORITY

This PR applies to the following area(s)

  • RedM
  • Natives

Successfully tested on

Game builds: RDR3 Build 1491

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

N/A - New feature implementation

Example of usage with dolu_tool
image

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Oct 17, 2025
@prikolium-cfx prikolium-cfx added enhancement Feature or other request that adds functionality or improved usability manual-review PRs that need manual review and work before merging. RedM Issues/PRs related to RedM and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Oct 17, 2025
@Identity-labs Identity-labs force-pushed the feat-rdr3-interior-natives branch from 7857c11 to 07405f8 Compare October 17, 2025 13:13
@Identity-labs
Copy link
Contributor Author

I have added apiset: client on reflection probe native

@Identity-labs Identity-labs force-pushed the feat-rdr3-interior-natives branch from 07405f8 to e1fcaa1 Compare October 17, 2025 13:16
@github-actions github-actions bot added triage Needs a preliminary assessment to determine the urgency and required action invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Oct 17, 2025
@Identity-labs
Copy link
Contributor Author

dolu_tool.zip
Edited dolu_tool, with stub to avoid errors with non compatible natives
You can start the menu with dolu command

---

## GET_INTERIOR_ROOM_REFLECTION_PROBE_GUID

Copy link
Contributor

Choose a reason for hiding this comment

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

This misses a C-style definition of the native.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be OK ? i didn't see any usage of uint64_t return type in other natives
uint64_t GET_INTERIOR_ROOM_REFLECTION_PROBE_GUID(int interiorId, int roomId, int probeId);

Copy link
Contributor

Choose a reason for hiding this comment

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

stdint definitions are sadly not supported, you can probably use unsigned long long if you really need a range of an unsigned 64-bit int.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok it's updated, yes the guid is useful to get reflection prob hash for mlo debug purpose

Thx for your review :)

@Identity-labs Identity-labs force-pushed the feat-rdr3-interior-natives branch 2 times, most recently from edb1e6c to 0b5f01d Compare October 21, 2025 13:39
@radium-cfx
Copy link
Contributor

Native definitions look good now.

Please fix the compile errors for V, will review then.

@Identity-labs Identity-labs force-pushed the feat-rdr3-interior-natives branch from 0b5f01d to bcdeeec Compare October 21, 2025 15:29
@Identity-labs
Copy link
Contributor Author

Identity-labs commented Oct 21, 2025

I have fixed the GET_INTERIOR_PROXY macro for V, compiler was not happy with return type sorry :)
Both are ok now

Edit: screen in game on fivem
image

Copy link
Contributor

@radium-cfx radium-cfx left a comment

Choose a reason for hiding this comment

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

Looks good now, thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature or other request that adds functionality or improved usability invalid Requires changes before it's considered valid and can be (re)triaged manual-review PRs that need manual review and work before merging. RedM Issues/PRs related to RedM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants