Quantcast

Jump to content

» «
Photo

3DSMAX - 5. Getting your objects in game.

No replies to this topic
X-Seti
  • X-Seti

    .Retro mod developer. (Currently on break)

  • Feroci
  • Joined: 28 Jun 2005
  • Mars

#1

Posted 23 March 2014 - 10:09 AM Edited by X-Seti, 15 April 2014 - 09:12 PM.

This tutorial is about how to get your objects in game.
 
Just a reminder on the tools needed:
 
Text editing - Notepad ++ -> http://notepad-plus-...oad/v6.5.5.html
Image Conversion tools -> http://www.mwgfx.co.uk/graphix.htm
Gimp or some other Paint editing tool. -> http://www.gimp.org/downloads/
Free ID List Generator -> http://www.gtagarage...ow.php?id=16944
 
To be able to run the tools below use XP compatibility from right clicking the tool.
                     System dlls -> http://www.mwgfx.co....ad/mwgfxdll.EXE
                     ConvIM -> http://www.mwgfx.co....rams/convim.htm
                     Show -> http://www.mwgfx.co....wnload/show.zip
 
Just to make sure you downloaded the textures, here is the link again:
https://www.dropbox....textlist_Sol.7z These textures belong on your Desktop in a folder called textlist/
 
I will be posting images with an explanation allowing time for you to complete each step and reply to your posts. I will be taking questions for each step as we go. We will be learning how to make basic models first (eg buildings) then more complex objects as the weeks advance. If you know MAX you can also help me by taking questions.
 
I will be doing this in sections:
 


1. Face Mash editing. Getting to know the basic tools and panels, Poly /Vertex Mash editing. Forming better shapes like roofs.
2. VU mapping and texturing. Applying textures to your objects the right way. &. Creating the Collisions with surface maps and TXDs.
5. How to get objects in game.
6. Making Complex objects and mapping.
8. MAP-IO and aligning objects in game.
-

 
Getting your objects into the game.

 
I have been thinking about how to go about showing you how to do this the best way possible and the common questions are how do you find free ID's on a game map. I will show you this first with one of my old mods.
 
I would also like to explain how are the IDE, IPL and other data file store the model data later and coordinates system. but first the download link is below - We can have some fun with this map from what we have learned from the first and second tutorial. You can use this mod as a base with the simple map provided.
 
This was a work in progress mod using imagery from google maps and is pretty much unfinished. but this can be used as an example mod where we can get your objects into the game.
 
Download the 0.5 version and not the 0.7. http://gtaforums.com...-released-2011/ scratch that link as I forget about where the file was hosted, My web server is down so try this one http://www.gtagarage...oad.php?f=22916
 
If your starting a total conversion you'll need a map cleaner for either VC or SA these can be found of GTAGarage but I will give you the links below.
 
http://www.gtagarage...how.php?id=9606 Map cleaner for VC. http://www.gtagarage...how.php?id=1070 Cleaner for SA.
 
The engine will use ID's for objects like Peds, Vehicles and Weapons. so depending on the engine the ID range will differ between a range of 0 - 300, leaving ID's 301 to 6200 free without the need for a Limit Adjuster (Image below) for Vice City, SA it's 0 - 616 ID's used up leaving you a range from 617 - 19999. There is no ID limit adjuster for SA.
 
VClimitadjuster.jpg
http://www.gtagarage...oad.php?f=23156 -> SOL Limits adjuster.
 

Adding objects to an existing map - Finding free ID's
 
There are tools for SA engine to find free IDs called 'Free ID List Generator' made by fastman92 however on VC we have to do things the old fashion way by combining all the IDE files in sequential order making one larger IDE file. browse the larger IDE file you'll spot free IDs by the numbers that are missing, so note them down and put #free in between the lines to mark them.
 
Example layout starting with 'objs' - This stands for object definition. 

objs
1300, Dunsfold, dunstxd, 1, 300, 0
1301, Dunsfold01, dunstxd, 1, 300, 0
1302, Dunsfold02, dunstxd, 1, 300, 0
1303, Dunsfold03, dunstxd, 1, 300, 0
#free
1305, Dunsfold04, dunstxd, 1, 300, 0
1306, Dunsfold05, dunstxd, 1, 300, 0
1307, Dunsfold06, dunstxd, 1, 300, 0
1308, Dunsfold07, dunstxd, 1, 300, 0
1309, Dunsfold08, dunstxd, 1, 300, 0
#free
1311, Dunsfold09, dunstxd, 1, 300, 0
1312, Dunsfold10, dunstxd, 1, 300, 0
1313, Dunsfold11, dunstxd, 1, 300, 0
1314, Dunsfold12, dunstxd, 1, 300, 0
1315, Dunsfold13, dunstxd, 1, 300, 0
1316, Dunsfold14, dunstxd, 1, 300, 0
1317, Dunsfold15, dunstxd, 1, 300, 0
1318, Dunsfold16, dunstxd, 1, 300, 0
1319, Dunsfold17, dunstxd, 1, 300, 0
end
tobj
end
path
end
2dfx
end

You can get more information about 'tobj', 'path' and '2dfx' check out the gtamodding.com wiki site, I'm not going to tell you everything. Learning to mod is finding out this information for yourself.
 
So looking at the example ID's above you'll notice 2 are missing, 1304 and 1310. These IDs are free to use for your own models.
 
The original installed Vice City,  there will be a lot less ID's. You can not use the same object ID twice as this has to be unique like the model name. You'll find that each object you add will use up ID's with VC so it is possible to raise the ID limit to a max of 32760 IDs with a Limit Adjuster. http://www.gtagarage...oad.php?f=23156
 
IDE format;

ID, DffModelname, TXDtexture, Clumps, Detail Distance, Render Flags (SA doesn't have Clumps)
 
OR

(SA)
301, mynewhouse01, House01tex, 299, 0 
(VC)
301, mynewHouse01, House01tex, 1, 299, 0 

The draw distance range is from 0.1 - 299.9 where all objects will remain solid in game. everything higher like 300.1 - 3000 will be non-solid with no collision generated - These entries are classed as LODs objects.
 
What are LODs?

LOD models are low level of detail versions of the original models in Vice City and GTAIII. These are the buildings in game you see loaded far far away. As you get closer to the LOD models the normal detail model should take it's place.
 
In Vice City LOD models are designed to have the same name as the original model, say 'Nornalhouse01' except the first three letters of the LOD model are replaced by the letters LOD as an engine Identifier making the model name 'LODnalhouse01'. LOD collisions do not need mesh data. So any LOD collisions you export to Steve M's COL Editor 2 select the LODmodel and right click select delete mesh.
 
For SA LODs you are best to look this up - http://gtaforums.com...-7#entry3177288 as there is a lot of information to take in.
 
Note; Do not use short file names for your objects because if you planning on having a LOD counterpart model you will run into problems. however  Model (Dff) and Collision (Col) file names can be no longer then 19 characters excluding the .dff or .col extension. If any models / collisions exists with names longer then 19 characters you'll crash the game on either SA or VC engines.

 
IMG files;
 
You can make your own custom IMG file called mymods.img, this is where you can to keep your own DFF and TXD files, If you choose to do this then you have to add a path entry to the ./data/default.dat file at the bottom like;

CDIMAGE models/mymods.img

This works for Vice City
 
The SA engine you have to add;

IMG models/mymods.img

To the gta.dat file at the top but just below the other IMG entries.
 
You're allowed to have up to 8 img's files including the gta3.img by default, Fastman92 has released a IMG adjuster for SA and VC that can give you a limit of 128 img files. link -> http://www.gtagarage...oad.php?f=34180
 
IMG files have their own engine limits of about 1.96Gb total Most GTA tools depending on how these were made have a file limit of about 1.4Gb for IMGTool2 before things get messy and you can lose your data. So if you're planning to make a big map, split it down into sections.
 
There is another way to build IMG files. When you export your DFF from 3dsmax you should add each entry to the mymods.ide, like the example shown above. once you have finished exporting all the DFFs and built your TXDs there is another tool that can help you called IDE to IMG sorter.
 
Place all your DFFs and TXDs into one folder called mymodels. Download Fastman92's IMG to IDE Sorter http://www.gtagarage...ow.php?id=20552 this tool will make the img files for you sorted against the IDE and COL file.
 
All you need to do here is config the bat script;

IMGbyIDE.exe /build /ideFile "mymods.ide" /sourceDir "mymodels" /destinationArchive "mymods.img" /IMG_version "1"
pause

Now run the scripts and this will produce a perfectly built and sorted img file.
 
Example below.
image_46893.jpg
 
The Cols;
 
All the single collisions need to be gathered into one COL file called mymods.col, once all the files have been combined we can check the COLs we have against the mymods.ide file with Steve's COL Editor 2.
 
sortbyide.jpg
 
We can also do a duplicate check, but for now the Sort by IDE. These options can later become handy if there are issues. we should have equal amount of COLs, DFFs per entry in the mymods.ide file. 
 
notfoundincol.jpg
 
Sort by IDE gives me and error report of possible issues with the COLs against IDE entries. for each entry there has to be COL and for every COL a DFF file.
 
Now these errors can happen with the bugs in 3dsmax scripts upon exporting broken dffs. I know the map is fine so I can delete these from the IDE but I also check that these files are not in the IMG file or the IPL files.  If I found any of these files in the IPL when we have a problem where we need to check and import the missing COLs.
 
If the IPL file are fine we continue to remove these lines with the errors noted in the above image.
 
Kam's scripts are known for their bugs so when you export a map you have to make sure that each model is correct, VU mapped. and nothing has changed within the model.
 
We should have by now the IMG done, COL built, IDE file ready. Next we need to export the IPL file using Map-IO
 

Now the fun begins.
 
Open up 3dsmax, Click on the Hammer icon to bring up Kams scripts towards the bottom MAP-IO. highlight everything in the scene then click on the uddder.jpg udder icon. Not really sure what its called. We will call this the udderbar. :)
 
udderbar.jpg
 
Click on [Effect Pivot Only] and below [Center to Object] now we can go back to MAP-IO and click on export IPL. This may give an error saying there is no ID for any given object. I find this strange that it would say this because there isn't a way to map the IDE within Kams scripts with the correct TXDname.  IDE files are best done manually with a text editor where you can add each line as you export your models.
 
Moving on...  Click on the white entry box on the bottom left corner to bring up the listener window. (second image below).
 
outputwindow.jpg
 
listener_window.jpg
 
Look at the IDE file for the DFF object Map-IO requests. Look back on the Map-IO panel and click on the [+Object Properties bar] image below, click on the object first then Input the new ID in where it shows ID: 1943, Those #free ID's go in there and not! 1943. Put anyname in the TXD box pressing [Set].
 
Now try the export IPL again on the highlighted object. if this error comes up again you know what to do.
 
objectprop3.jpg
 
The IPL file. (inst) more info go here -> http://www.gtamoddin....php?title=Inst
 
Click on all the objects you want to export using MAP-IO select export IPL. The IPL output data will appear in the listener window where you can cut and paste into a new text file,
 
Example;

3390, NorVCRoundRoad, 0, -1055.62, -2022.77, 4.51743, 1.0, 1.0, 1.0, 0.0, 0.0, -0.325568, 0.945519
3391, NorVCNewDocksW, 0, -922.251, -2043.16, 3.82984, 1.0, 1.0, 1.0, 0.0, 0.0, -0.771625, 0.636078
3364, NorVCNewDocks, 0, -932.012, -2072.97, 14.4952, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0
3295, NorVCdockbridge01, 0, -876.754, -1615.38, -6.16142, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0

You need to add the inst at the top and end at the bottom like this and check the model object name against the IDE file to make sure we have the correct IDs.
 

inst
3295, NorVCdockbridge01, 0, -876.754, -1615.38, -6.16142, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0
3364, NorVCNewDocks, 0, -932.012, -2072.97, 14.4952, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0
3390, NorVCRoundRoad, 0, -1055.62, -2022.77, 4.51743, 1.0, 1.0, 1.0, 0.0, 0.0, -0.325568, 0.945519
3391, NorVCNewDocksW, 0, -922.251, -2043.16, 3.82984, 1.0, 1.0, 1.0, 0.0, 0.0, -0.771625, 0.636078
end
cull
end
path
end

Save this data to the mymods.ipl file and place /data/maps/mymods/.

 

Note; It helps to have all your IDE, IPL files sorted in alpha-numeric order like the example above as this can help the engine sort and render the objects faster increasing FPS and also speeds up loading time.

 

 
The gta_vc.dat file. (gta.dat for SA) this next step. we will be adding your IDE, COL and IPL entries to the gta_vc.dat
In the IDE section add;

IDE data\maps\mymods\mymods.ide

 
The next step is the collision, if your working with SA the col goes in the mymods.img not the gta.dat file.
Otherwise add the col in the collision section.

COLFILE 0 data\maps\mymods\mymods.col

in the IPL section add;

IPL data\maps\mymods\mymods.ipl

 
That should be it, start the game and find your model.

 

Next tutorial -> http://gtaforums.com...dings-and-land/

Complex objects - Buildings and Land.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users