in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.15k stars 353 forks source link

Do we need EntryName in GXT? #25

Closed lexnewgate closed 4 years ago

lexnewgate commented 5 years ago

In GXT File Format, check the GTA San Andreas TKEY.

The EntryName is stored as CRC32. After some research, I can't find a way to get entryname from CRC. Do we need really them?

If we do, do you know where we can find this info?

in0finite commented 5 years ago

I don't know much about gxt format. CRC is like a hash, so probably there is no way to get entryname from CRC. But take a look at this: The game calculates the CRC32-value out of a given string and checks if they exist in the GXT.. Does this mean that you need to calculate CRC based on given string, and then find it in a table ?

lexnewgate commented 5 years ago

I suspect the game find a entiryname somewhere then calculate the CRC. By using CRC, it will locate those dat belong to the entryname.

in0finite commented 5 years ago

Yes, something like that. Entryname is probably hardcoded or inside main.scm.

lexnewgate commented 5 years ago

Does this mean that you need to calculate CRC based on given string, and then find it in a table ?

Yes. I agree with it. Problem lies in how to find the given string then. Based on this statement, I think it should be in other file format. I will check main.scm.

Is main.scm a lisp file?

lexnewgate commented 5 years ago

I think I should probably just show the CRC in the UI now. After I check other data format, maybe I will find some clues and I will fix it then. Do you think it is Ok?

in0finite commented 5 years ago

main.scm is a script file. It controls game behaviour. It probably holds entry names for text shown in missions. You should not try to extract strings from it.

Problem lies in how to find the given string then.

You don't need to find a string. It's provided by game.

in0finite commented 5 years ago

Yeah, it's ok.

There are some gxt viewers available out there. You can use them to compare results.

lexnewgate commented 5 years ago

Ok. I just realize the original game logic will be run by GTA3ScriptSharp. I thought we would implement the logic before. : )

lexnewgate commented 5 years ago

There are some gxt viewers available out there. You can use them to compare results.

Yeah. Will do it.

in0finite commented 5 years ago

Ok. I just realize the original game logic will be run by GTA3ScriptSharp. I thought we would implement the logic before. : )

That's what I wanted to say. These entry names are probably stored in main.scm, but we can't test them, because GTA3ScriptSharp is not finished.

Also, some of entries are probably hardcoded in gta_sa.exe .