Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Game import MAXScripts & tools

Post questions about game models here, or help out others!
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post 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.
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
yoda
beginner
Posts: 25
Joined: Sun Jun 29, 2008 10:28 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Game import MAXScripts

Post by yoda »

done
weisuolong0
ultra-n00b
Posts: 5
Joined: Wed Aug 20, 2014 5:41 am

Re: Game import MAXScripts

Post 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
)
weisuolong0
ultra-n00b
Posts: 5
Joined: Wed Aug 20, 2014 5:41 am

Re: Game import MAXScripts

Post 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?
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post 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.
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
weisuolong0
ultra-n00b
Posts: 5
Joined: Wed Aug 20, 2014 5:41 am

Re: Game import MAXScripts

Post 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
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post by Chipicao »

Nah, I'm not from China :)
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
PseT
n00b
Posts: 16
Joined: Sun Jun 15, 2014 12:57 pm

Re: Game import MAXScripts

Post 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
huckleberrypie
ultra-veteran
ultra-veteran
Posts: 351
Joined: Mon Apr 26, 2010 6:51 am
Has thanked: 105 times
Been thanked: 15 times

Re: Game import MAXScripts

Post 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.
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post by Chipicao »

@PseT & huckleberrypie I'll have a look
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post 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.
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
huckleberrypie
ultra-veteran
ultra-veteran
Posts: 351
Joined: Mon Apr 26, 2010 6:51 am
Has thanked: 105 times
Been thanked: 15 times

Re: Game import MAXScripts

Post 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.
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Game import MAXScripts

Post 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.
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
PseT
n00b
Posts: 16
Joined: Sun Jun 15, 2014 12:57 pm

Re: Game import MAXScripts

Post by PseT »

Chipicao wrote:@PseT & huckleberrypie I'll have a look
Cool :)
huckleberrypie
ultra-veteran
ultra-veteran
Posts: 351
Joined: Mon Apr 26, 2010 6:51 am
Has thanked: 105 times
Been thanked: 15 times

Re: Game import MAXScripts

Post 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?
Post Reply