Author Topic: Caviar Kitbashing of mechanized Infantry/Tracked model  (Read 1713 times)

0 Members and 1 Guest are viewing this topic.

Offline Chiu ChunLing

Caviar Kitbashing of mechanized Infantry/Tracked model
« on: January 21, 2018, 04:56:53 AM »
Quote from: Initial post
Hello to everyone, and especially to Ford Prefect and company for helping me reach first base with .cvr editing.

In my case, first base was being able to cobble together bits of several .cvr files together with a hex editor to produce a reasonable looking tracked vehicle for infantry to use rather than just walking around in metal overcoats (lolwut).

Here's a first version.  To describe the process, basically I just added the looted x04040000 (CVRCHUNK_OBJECT_CONTAINER) chunks to the end of an existing file, updated the sizes for the x04000000 (CVRCHUNK_SCENE_CONTAINER) and x00 "CVR" (CVRCHUNK_FILE_CONTAINER) chunks, and then messed around a bit with the scaling and randomly assaulted the positioning coordinates to get it to fit.  Kinda working in the dark, and not really knowing what I'm doing, but I got a result I like.

I had to also replace infantry reactors and armors, but those were pretty straight copies of the existing ones.

I'd like to learn more about how the positioning data works so I can create a version where the tracked vehicle matches up with the gun and special ability bits (like the other vehicles do), right now it's off to the side.  But at least it's less awful than it looked at first.

Update:  The centered version, which is basically what I wanted all along, is now attached as VI-centered.7z (it includes VI, Vipta00, Viptapsi, Viptasgn, Viptawal, Viptr00, Viptr01, Viptr02, Viptr03, and Vpt).  The Psi Armor is still bugged, one of the stalks doesn't appear if it's on the side nearest the view (lolwut?  It's something to do with the mesh being oriented weird or something, I can't figure it out).  On the other hand, I included a model for the Probe Team, so there's that.  I think that pretty much everything but the Psi Armor looks great (and I now hate Psi Armor for being sideways as well as generally useless).

Anyway, if there are other issues aside from the Psy Armor, let me know.  Not that I'll definitely fix them, but it's not impossible.

Also, it seems that for all the desire for models and the natural ease of kitbashing the .cvr (once you know the chunk structure, and if you're not trying to mess with the Psy Armor), there aren't a lot of kitbash models.  Though the silly guys walking around in their pajamas was the only thing that really bugged me personally.  I think that the pictures of the alien units look cool (and make sense, because they have compatible biology with Planet before reaching MMI and all uploading themselves into computers).

PS. It's not absolutely required, but I find it preferable to rename/move VGMTp, VGMT, and AVGMTGUN.  These are the SP pintle gun-mount and tracks the infantry guys use, and the animation that places the gun on top of the pintle rather than in the usual position.  I think that the effect is pretty interesting if you leave them in, but I prefer to have the gun mounted directly on the vehicle (which has tracks and mounts the reactor, so you don't have to hump it on your back along with a metal overcoat while wearing a respirator to even breathe and nothing between you and mindworms crawling out of the ground but your stylish yellow boots...okay okay, I wanted my guys to be inside their vehicles for a reason, enough said).
« Last Edit: January 23, 2018, 10:08:25 AM by Chiu ChunLing »

Offline Geo

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #1 on: January 21, 2018, 04:37:03 PM »
Oh man, you can't imagine how much this makes my day. I've been trying to interchange the alien and human colony pod like forever ingame, and then you drop this out of the blue. :D

You speak about a hexeditor. What kind of app lets you cobble together new caviar like that?

Offline Chiu ChunLing

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #2 on: January 21, 2018, 10:23:35 PM »
Any hex editor will do.  I use XVI32, an old, simple, but reasonably powerful program (a little too powerful, since it edits files without updating their file history, meaning you can lose track of what you've been doing).

I'm looking into shifting the tracked vehicle (and reactors and armor) to be in the center and line up with the weapons and special abilities, but I've hit a problem in that the other coordinate information controls "camera" (and lighting, but who cares about that?) and the camera decides from which angles a given voxel mesh is 'visible' and displayed.  Right now the centered version looks hilariously and randomly...disassembled, like it's in the shop for major repairs.  Every angle has at least some major missing pieces.

When I've time and energy I'm going to work on understanding the camera vectors well enough to orient them intentionally rather than just kicking them sorta randomly till they work (that was enough to get the off-centered version working, but to make the centered version work I need to aim the camera's in a specific direction).

The specific details of kitbashing .cvr files in the manner described is to open the file with a hex editor, search for instances of 00 00 04 04 (in hex search, or 0x notation), look and see that they are indeed CVRCHUNK_OBJECT_CONTAINER headers (if so, they'll be followed by a chunksize and then by 00 01 04 04, the CVRCHUNK_OBJECT_NAME header, followed by that chunksize and then a text string that usually corresponds to the file name).  Count these up (there will usually just be one).  Then go up to the area above the first one, which will be the CVRCHUNK_SCENE_CONTAINER (00 00 00 04 = 0x04000000, because of least significant byte first representation).  If you add CVRCHUNK_OBJECT_CONTAINERs from other files, you'll need to update the CVRCHUNK_SCENE_CONTAINER chunksize (all chunksizes are the four bytes immediately after the chunk header bytes) and the CVRCHUNK_FILE_CONTAINER chunksize (that is the "CVR" 00 and following four bytes at the very beginning of the file).  You also need to increase the CVRCHUNK_OBJECT_COUNTER (be sure not to mistake the size for the counter, even chunks that are invariably the same size have a chunksize immediately after the header, the counter is the four bytes after the chunksize, which is always 0x0000000C for counter chunks).

All of this information is in the http://alphacentauri2.info/wiki/Caviar article, which can be a little daunting to interpret.  I still haven't fully grasped the section on what all the vectors do, (I understood the voxel meshes, but editing those by hand in hex is way beyond what I'm willing to try).

If what you want is just swapping out a model for another model, then you can just use the Cavierplay.exe to view the models and then swap the files by copy/renaming them (back up the replaced file, of course).

P.S. Just found the cleverly disguised edit button ("modify", hah!  I like such little jokes).  Thought I'd add the WIP version of the centered mech infantry crawler.  BTW, if anyone wants to have a little infantry guy next to the crawler (behind the gun), I could put that guy back, including with his dumb armor overcoat (not putting a reactor on his back though, because seriously, lolWUT?).  I just thought it was cooler to think that the gun mount was remote controlled or whatever, and while I can see miniaturizing the vehicles when your tech supports self-propelled guns, I don't get miniaturizing the dudes.  Anyway, the WIP centered version looks okay in Caviarplay, but in-game the pieces randomly disappear depending on the angle (I realize it's totally not random, but till I understand the camera vectors it might as well be).
« Last Edit: January 21, 2018, 10:50:00 PM by Chiu ChunLing »

Offline Chiu ChunLing

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #3 on: January 21, 2018, 10:32:30 PM »
I made a list of all the SMAC .cvr files (don't have SMAX, sorry), to speed up your search.

Let's see if this forum supports spoiler tags...
(click to show/hide)

Offline Geo

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #4 on: January 22, 2018, 06:31:27 AM »
Made that list years ago, but thanks.  ;)

Offline Chiu ChunLing

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #5 on: January 22, 2018, 02:57:36 PM »
Okay, I took a closer look at what it says on the wiki and it was actually very helpful.  The relevant bit is (after some editing for clarity):
Quote
3d Voxel Data Section

01 02 04 04 ## ## ## ##   CVR_VOXEL_OBJECT
+04 uint32 VHFlags:
   1 = mesh has its own VHFlags
   2 = Multiple mesh object with JUMP_HEADER before each mesh
   4 = Unused
   8 = Used but unknown what it means
+04 uint32 Size of voxel object from start of first VOXEL_HEADER
+04 float32 Units per 3D pixel (scale)
+04 uint32 bytes from this VOXEL_HEADER to end of mesh
+04 uint32 bytes to last byte of this voxel mesh
+04 SVECTOR3 Scale
+06 SVECTOR3 Position
+06 SVECTOR3 Rotation Center
+06 uint32 total voxels in this object

JUMP_HEADER
   +06 SVECTOR3 Position
   +06 SVECTOR3 v2--unknown vector, used determining max size
   +06 SVECTOR3 v3--unknown vector, used determining max size
   +06 SVECTOR3 PositionOffset--start drawing at Position+PositionOffset
   +06 uint32 # of voxels in next mesh
   +04 uint32 JumpFlags: 1 = Has Offset
   if JumpFlags then +04 uint32 Offset to next JUMP_HEADER.
So basically, after assembling the kitbash as directed above, if you need to adjust any positions, then make sure to adjust the Position SVECTOR3 in each the JUMP_HEADER of each individual mesh, while also adjusting the Rotation Center of the entire object.  You should also increase the SVECTOR3 Scale dimensions, to ensure that the object is still fully rendered rather than any meshes being considered too far away (this is different from the scalar ratio of pixels to voxels, though of course you can adjust that too, as I did to make the tracks a little more sleek).  If you have a single mesh object, then you have to kitbash it to a multi mesh object with JUMP_HEADERs, and only adjust the Rotation Center of the single mesh object.

The resulting VI.cvr is attached, I like it very much now.  After I rework the armors and reactors to match, I'll update the first post with the full centered version.  I note that the effect is much improved by removing VGMTp.cvr, VGMT.cvr, and  AVGMTGUN.cvr (the Infantry gun pintel, the SP track, and the animation file that adjusts the Infantry weapons to sit on top of them), but of course that's quite optional (but using the revised tracked vehicle is NOT, NOT I say!).

Offline Chiu ChunLing

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #6 on: January 23, 2018, 07:41:44 AM »
Okay, I finished the centered version, pretty much.  The psi armor is still bugged, but after I had to do all kinds of messing with it because it's somehow adjusted to be at a weird angle, I'm not eager to get into it again.

The attachment will be in the top post.

Offline Geo

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #7 on: January 24, 2018, 01:06:36 AM »
That's great work.

Personally I won't miss the lack of 'perfect' fitting psi armor since it likely won't be used in my mod.

Offline Chiu ChunLing

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #8 on: January 24, 2018, 01:28:38 AM »
I suppose you can also just use the existing Psi Armor, now that I think about it.  It just sticks out over the roof of the vehicle (and wiggles when you move), which should be fine since it is supposed to be generating a neural energy field that makes attackers go crazy with fear (unfortunately, this just makes them shoot everything in sight, which is sorta what they'd be doing anyway, only you have no actual armor).  I'm going to try that, since the original Viptapsi is smaller after all.

Offline Maximus Thalos

Re: Caviar Kitbashing of mechanized Infantry/Tracked model
« Reply #9 on: August 24, 2021, 02:50:08 AM »
This is fantastic. I'm glad I searched for this before attempting to do this on my own. I'm going to try and replace the grav-ship in the game instead of the infantry though. A stand alone tank will be a good middle ground between inf, speeders, and all of a sudden grav-tanks.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

To understand a thing is to know the manner by which it might be destroyed. A fundamental understanding of the basic building-blocks of the Universe is essential, then, to the total destruction of everything.
~Foreman Domai 'One Tool, One Thought'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]