Join also our Discord channel! Click here.

Acura Mobile Racing Game .json .ktx

Post questions about game models here, or help out others!
Post Reply
zimex25
veteran
Posts: 111
Joined: Thu Feb 04, 2016 9:20 pm
Has thanked: 12 times
Been thanked: 10 times

Acura Mobile Racing Game .json .ktx

Post by zimex25 » Fri Mar 20, 2020 8:41 pm

Hi! I extracted files from Acura Mobile Racing Game, 3d models in .json, textures in .ktx. I looking converter from json to obj but I didn't find. Textrures can't open using PVRTexTool.
Here is all files of this game: https://mega.nz/#!GkF12a6b!yOftbmzcS9kl ... yYVhUnSZTU

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Acura Mobile Racing Game .json .ktx

Post by shakotay2 » Fri Mar 20, 2020 11:53 pm

wheel and arx body:
.
wheel.png
Some preparations required: remove "position": [, ']' etc from the json file, replace commas by blanks
then conversion to .obj is simple in case you can code (stream1: input file, .json; stream: output file: .obj):

Code: Select all

float x, y, z ;
FILE *stream, *stream1 ;
    [...]
    while (fscanf( stream1, "%f", &x) != EOF) {
	fscanf( stream1, "%f %f", &y, &z) ;
	fprintf(stream, "v %f %f %f\n", x*10.0,y*10.0,z*10.0) ;
    }
    [...]
(Added automatic created face indices to the obj file.)
Files need to be opened/closed, of course.
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Sun Mar 22, 2020 8:36 am, edited 1 time in total.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

zimex25
veteran
Posts: 111
Joined: Thu Feb 04, 2016 9:20 pm
Has thanked: 12 times
Been thanked: 10 times

Re: Acura Mobile Racing Game .json .ktx

Post by zimex25 » Sat Mar 21, 2020 2:02 pm

shakotay2 wrote:
Fri Mar 20, 2020 11:53 pm
wheel and arx body:
.
wheel.png
Some preparations required: remove "position": [, ']' etc from the json file, replace commas by blanks
then conversion to .obj is simple in case you can code (stream1: input file, .json; stream: output file: .obj):

Code: Select all

float x, y, z ;
FILE *stream1, *stream1 ;
    [...]
    while (fscanf( stream1, "%f", &x) != EOF) {
	fscanf( stream1, "%f %f", &y, &z) ;
	fprintf(stream, "v %f %f %f\n", x*10.0,y*10.0,z*10.0) ;
    }
    [...]
(Added automatic created face indices to the obj file.)
Files need to be opened/closed, of course.
Probably I'm stupid but where I need replace all "," or ['] to blanks and what next? I need past this code?

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Acura Mobile Racing Game .json .ktx

Post by shakotay2 » Sat Mar 21, 2020 4:37 pm

You need to be a coder to understand what to do. (The replacement of commas by blanks has to be done in the .json file.)
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
reh
advanced
Posts: 60
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 28 times
Been thanked: 55 times

Re: Acura Mobile Racing Game .json .ktx

Post by reh » Sun Mar 22, 2020 5:05 am

Maybe this will help:
delete-bms.zip
It contains three bms scripts for use with Quickbms.
The first "delete-1.bms" script deletes "{.." position ": [ ";
The second script "delete-2.bms" replaces "," with "white space";
The last script "delete-3.bms" should delete " ].} ", But it is not working, I recommend deleting it manually, from what I saw, it only appears at the end of the file.
When you run the scripts with quickbms and see "the following output file already exists: ..." press "y" and "enter" to replace the file or "r" to rename it automatically.
You do not have the required permissions to view the files attached to this post.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Acura Mobile Racing Game .json .ktx

Post by shakotay2 » Sun Mar 22, 2020 10:08 am

There's some ], and I'd suggest to split the json.
Load it into notepad (whatever), replace all commas by blanks
and save the block up to "uv": [ as vertices.txt.
Then save the the block behind "uv": [ up to "normal": [ as uvs.txt.
(Be sure not to have any [, ] or : in them. Also don't leave the strings "uv" and "normal".)
Copy those .txt files into the folder where json2obj.exe resides and start it.

I've appended a codeblocks project json2obj with a 9kB exe and source code.
.
json2obj.zip
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Acura Mobile Racing Game .json .ktx

Post by shakotay2 » Sun Mar 22, 2020 11:24 am

old_nsx.png
.
Important:No commas allowed in vertices.txt and uvs.txt. The exe will produces a giga bytes file otherwise!
.
Don't forget to "remove doubles" in blender for example. There's plenty of them.

Try out submeshes and look how the devs built the meshes:

Code: Select all

void lin_faceind_3(FILE *stream, DWORD cnt)
{
	DWORD i, sm=0 ;			//

	for (i=1; i< (cnt - 3);i++) {	    
        	if ( (i%2000) ==0) {
            		fprintf( stream, "g sm_%d\n", sm) ; sm++ ;
        	}		
        	fprintf( stream, "f %ld/%ld %ld/%ld %ld/%ld\n", i,i, i+1,i+1, i+2,i+2) ;
		i += 2 ;
	}
}
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

Post Reply