Comments (10)
The hash issue is because, for some reason, the signed hashes are calculated with case-sensitivity when they shouldn't be. Take the Sugoi for example:
Name = Sugoi (the S should be lowercase)
Hash = 987469656 (unsigned, this is correct)
(current) SignedHash = -545256593 (case sensitive, incorrect)
(actual) SignedHash = 987469656 (not case-sensitive, how it should be)
I believe the issue stems from the fact that Rockstar sometimes capitalizes the model names in vehicles.meta. I think those really should be all lowercase while being formatted.
from gta-v-data-dumps.
Fixed with latest commit, thx
Hashes were not wrong, but signed instead of unsigned variant
from gta-v-data-dumps.
I know what you mean about signed and unsigned variants.
-1934452204 is a valid hash for RapidGT and 2360515092 is a valid hash for RapidGT.
If can call CreateVechicle(-1934452204,...
or CreateVechicle(2360515092,...
I get RapidGT in both cases.
Two valid hashes for the same vehicle are possible because positive numbers greater than 0x7FFFFFFF turn into negative and vice versa. Hash for RapidGT is 0x8CB29A14 and can be interpreted as positive or negative number.
I can create many more "valid hashes" by adding math.random(1,0xFFFFFFFF)*0x100000000
to any valid hash. All that garbage will be cut before sending the number to the game. For example 71079991828(0x108CB29A14) is still a RapidGT.
It has absolutely nothing to do with hashes in VehicleList.ini
!
They are just wrong. Look at this line, for example.
GetHashKey( RHINO )= 782665360 ~= 976373367
Are you saying that those two numbers are basically the same?
782665360 != 976373367
0x2EA68690 != 0x3A324677
I can call IsModelValid(782665360)
or CreateVechicle(782665360,...
But I have no idea what 976373367(0x3A324677) is, it's just a seemingly random number.
Another example:
GetHashKey( bobcatXL )= 1069929536 ~= 1719944928
Both numbers are positive and completely different. 1069929536 works, 1719944928 is invalid and it's not possible to turn invalid into valid.
from gta-v-data-dumps.
@Tianshee I have no idea what kind of stuff you are trying to explain overly complicated - did you check my commit? 1523cad
from gta-v-data-dumps.
I guess what you are trying to say is that SignedHash in my source file (vehicles.json) is sometimes correct and sometimes not?
https://github.com/DurtyFree/gta-v-data-dumps/blob/master/vehicles.json
from gta-v-data-dumps.
Yes, your SignedHash function contains a bug
from gta-v-data-dumps.
Isn't it obvious that SignedHash for BARRACKS is just completely wrong?
"Name": "BARRACKS",
"DisplayName": "Barracks",
"Hash": 3471458123,
"SignedHash": 720993689,
"HexHash": "0xCEEA3F4B",
It should be -823509173
from gta-v-data-dumps.
If you want to fix your SignedHash, you can simply replace it with something like this.
int64_t SignedHash(char* txt)
{
uint64_t h=Hash(txt);
if(h&0x80000000){ h|=(-1^0x7FFFFFFF); }
return (int64_t)h;
}
Much better than using two different hash functions supposed to be doing the same thing, isn't it?
from gta-v-data-dumps.
Reopened until I have looked into it. Btw I am not using one hash function for each type of hash, which I have way too much in my data dumps - obviously, isn't it?
from gta-v-data-dumps.
Fixed with latest commit, huge thx again to @Wildbrick142 for the detailed hint
from gta-v-data-dumps.
Related Issues (20)
- Movie method names HOT 2
- request: pedOverlayCollections should include TxdName/Hash HOT 1
- Radio Stations Names HOT 1
- Billboards textures and positions HOT 1
- Missing object HOT 1
- Missing animpostfx effects
- Missing Music Events in chinese2.c (Crystal Maze) HOT 2
- [QUESTION] Parking Nodes? HOT 1
- vehicles.json mpsum2 DisplayName missing HOT 3
- Vehicle class error HOT 1
- Object location dump of sat-dishes HOT 1
- objectslocations worldAntennas not complete HOT 1
- [Question/Suggestion] Street names HOT 2
- Nodes have gaps HOT 2
- Non-json accepted symbols HOT 1
- Regarding "TranslatedLabel" of Weapon Components HOT 2
- Backslashes in JSON HOT 4
- Translated labels objects missing languages HOT 4
- RADIO_23_DLC_XM19_RADIO missing label HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gta-v-data-dumps.