YimMenu icon indicating copy to clipboard operation
YimMenu copied to clipboard

vehicles, peds, weapons local cache

Open xiaoxiao921 opened this issue 3 years ago • 7 comments

Create a local cache once per game update. The only issue currently is that if the user inject in SP and go to MP a crash will trigger because of some rpf file that got mounted twice is needed for the loading, its pretty meh but i'm not sure how to fix it, the fidevice system is a huge can of worm in itself and i'm out of energy for this right now. Atleast this crash will trigger "only" once per update because once the cache is done for the current update it just query the json files from disk

xiaoxiao921 avatar Sep 27 '22 18:09 xiaoxiao921

I'm sure if we'd look at how to fix that crash we can figure it out.

Yimura avatar Sep 27 '22 19:09 Yimura

I'd also recommend moving the fiDevice and GXT2 related classes into the GTAV-Classes repo.

SkiddyToast avatar Sep 28 '22 16:09 SkiddyToast

Yeah, right now for simplicity of implementing it I'm going to merge the classes into the repo and at later moment we can move them to the other repo.

Yimura avatar Sep 28 '22 16:09 Yimura

Haven't tested this but loading MP DLC through DLC::ON_ENTER_MP beforehand may stop the crash

maybegreat48 avatar Sep 30 '22 11:09 maybegreat48

Will test that afterwards. Right now I'm busy revamping the whole GTA Data service class. Throwing away the need for JSON files and instead store it binary.

I'm so glad this thing works though as is.

Yimura avatar Sep 30 '22 11:09 Yimura

99% finished

Here and there can be optimised some more where we're copying vectors over where we might get away by moving the memory. I crashed while previewing the vehicles, didn't check which one I crashed one (probably next-gen that we're not filtering out).

Current structure uses the following binary header format:

Order Field Name Field Size (bytes) Type
1 cache version 4 uint32
2 game build 4 uint32
3 online version 4 float
4 data size 8 uint64
5 data / any

Yimura avatar Oct 04 '22 23:10 Yimura

Seems the next-gen vehicles are causing crashes again; I have no idea from where I need to parse the bones of a vehicle model.

These are the current methods of checking for invalid vehicles, I checked handling.meta for monetaryValue but that one never seemed to be 0: https://github.com/YimMenu/YimMenu/blob/d01afda8d360baa527099d8952eb745cf75d5dee/BigBaseV2/src/services/gta_data/gta_data_service.cpp#L238-L240

Edit: I've found the arbitergt.ytf file which contains a stub bone it seems. image

Yimura avatar Oct 05 '22 14:10 Yimura

Should be ready to merge, @xiaoxiao921 tell me if you see anything.

Yimura avatar Oct 18 '22 22:10 Yimura

Could you bump pugixml to HEAD (86c91051541d18a0d24b837a866cf0306fc8db1a)? (it had some bug fixes since 521b2cd)

GeopJr avatar Oct 18 '22 22:10 GeopJr

Going to merge soon, I want to retire the proxy server in the next 2 weeks.

Yimura avatar Oct 18 '22 22:10 Yimura