Page 9 of 21

Re: Game import MAXScripts

Posted: Sun Sep 07, 2014 8:08 am
by Chipicao
gregkwaste wrote:AI was planning to make a topic about it but since i found this one, if chipicao is ok with that, i can post the blender script here as an additional .pig importer for Blender :keke:
You're welcome to post it here if you'd like.

@yoda post in that topic, maybe someone will help.

Re: Game import MAXScripts

Posted: Sun Sep 07, 2014 9:06 am
by yoda
done

Re: Game import MAXScripts

Posted: Thu Sep 11, 2014 5:46 pm
by weisuolong0
lz
i am very sorry to read this following codes from the script of

if (bit.or vmask 256) == vmask do --dirt map
(
fseek f (readShort f #unsigned) #seek_cur
for v=1 to numVerts do
(
tx = (readshort f #signed)/32767.0
ty = (readshort f #signed)/32767.0
append t2arr [tx, 1-ty, 0]
)

align = readShort f #unsigned
if (align > 16 or align == 0 or (mod align 2) != 0.0) then -- 32bit components
(
free t2Arr
fseek f (-numVerts*4 - 2) #seek_cur
for v=1 to numVerts do
(
tx = readfloat f
ty = readfloat f
append t2arr [tx, 1-ty, 0]
)
)
else fseek f -2 #seek_cur
format "vmask======== % \n" 256
)

Re: Game import MAXScripts

Posted: Thu Sep 11, 2014 5:49 pm
by weisuolong0
up floor script from Gameloft_pig_importer.mcr just to load pig file from asphalt 8 gameloft game

can you explain why the code do this


how to understand 'vmask' word mean?

Re: Game import MAXScripts

Posted: Thu Sep 11, 2014 7:33 pm
by Chipicao
'vmask' is just the name I gave to the FVF code variable.

If you haven't heard of it before, FVF code is basically an integer composed of smaller power of 2 numbers (2^n).
Each 2^n number is assigned to a specific vertex property, so by analyzing the FVF code you can tell which properties are available in a vertex buffer.
These are always different from game to game, but in case of Gameloft Pig format this is what we have:
2^0 = vertex positions
2^1 = vertex normals
2^7 = UV coordinates for channel 1
2^8 = UV coordinates for channel 2

So for example a vmask of 387 has all of the above, and bit.or checks if 256 is in 387 (which it is).
There are other properties such as tangents, binormals or blend weights, but they weren't needed so I'm just seeking over them.
I should also be noted that vertex properties are always in the same order.


The second part of the code is a workaround for an issue I had with this format.
Most elements of a vertex property are 16bit integers, but in some cases they are 32bit floats. There should be an indicator somewhere that tells the game which is when, but I couldn't find it in the time I worked on this format.

So I came up with a quick and dirty solution that guesses if the values were read properly or not. It's based on the fact that after each set of vertex properties there is a 16bit integer for alignment - which I read as 'align'.
'align' should always be higher than 0 but lower than 16, and a multiple of 2. If one of these conditions isn't met, it means the script hasn't reached the end of the set, so it goes back and reads the values again as 32bit floats.
It's not an ideal solution but it seems to work.


I hope I cleared everything up, if not let me know.

Re: Game import MAXScripts

Posted: Sat Sep 13, 2014 3:14 am
by weisuolong0
first thank you very much :D

i study study (in Chinese means 学习学习 (*^__^*) 嘻嘻……)

by the way where are you from、? my Colleague says that maybe we are all in china

o(╯□╰)o

Re: Game import MAXScripts

Posted: Sun Sep 14, 2014 8:29 am
by Chipicao
Nah, I'm not from China :)

Re: Game import MAXScripts

Posted: Mon Sep 22, 2014 10:36 pm
by PseT
Chipicao wrote:I checked Brands_hatch_indy and indeed there's an error in the loading process. I'll post once I have a fix.

IIRC DTM Experience is encrypted, we need tools to decrypt. No idea about Raceroom.
Aluigi offers a first script for RaceRoom ... it advance

http://aluigi.altervista.org/papers/bms ... _kluns.bms

Re: Game import MAXScripts

Posted: Fri Sep 26, 2014 1:04 pm
by huckleberrypie
Any plans on adding support for Asphalt Overdrive on your Pig Engine script? The game's cheesy and reeks of a Minion Rush-esque cash-in, but the cars seem exploitable enough for us to mess with.

Re: Game import MAXScripts

Posted: Fri Sep 26, 2014 2:07 pm
by Chipicao
@PseT & huckleberrypie I'll have a look

Re: Game import MAXScripts

Posted: Fri Sep 26, 2014 2:34 pm
by Chipicao
Asphalt Overdrive just works, they haven't changed the format.
Image

But I can only find 2 cars in the IPA. I think the rest are probably downloaded after you install the game.

Re: Game import MAXScripts

Posted: Sat Sep 27, 2014 4:08 am
by huckleberrypie
Chipicao wrote:Asphalt Overdrive just works, they haven't changed the format.
Image

But I can only find 2 cars in the IPA. I think the rest are probably downloaded after you install the game.
So I noticed. The game downloads the cars ad-hoc as the user chooses them, which accounts for why the .IPA's so small.

Re: Game import MAXScripts

Posted: Sat Sep 27, 2014 7:21 am
by Chipicao
Surprisingly the downloaded cars are in a different format, at least on android.

Can anyone please check on iOS and send me the app folder via PM? You only have to play the first mission (after the intro) then go to the dealer and scroll through cars.

Re: Game import MAXScripts

Posted: Sat Sep 27, 2014 2:17 pm
by PseT
Chipicao wrote:@PseT & huckleberrypie I'll have a look
Cool :)

Re: Game import MAXScripts

Posted: Sun Sep 28, 2014 2:22 am
by huckleberrypie
Chipicao wrote:Surprisingly the downloaded cars are in a different format, at least on android.

Can anyone please check on iOS and send me the app folder via PM? You only have to play the first mission (after the intro) then go to the dealer and scroll through cars.
How different is it? Could they be encrypted, scrambled or something?