• Welcome to SC4 Devotion Forum Archives.

How to CAMify?

Started by deemer2404, July 02, 2017, 05:38:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deemer2404

Dear all,

I love this mod and I am using it since a while. Special thanks to RippleJet and also InvisiChem for creating/reworking it.

However, I am always a bit disappointed if a lot is not CAMpatible. I wanted to change them using the x-tool but got stuck. Somewhere I once saw a step by step instruction of how to make a CAM lot out of a non-CAM Lot, but I cannot find it anymore. Is there still such a thing out there?

I was trying to remoddel this lot - Regatta - but already failed as I did not now which file to edit (.DESC or .LOT and why is one .LOT not shown in my x-tool). If this is a 4x4 lot why do I have to enter the size again? Also how do I know it was successful (i.e. I did not make a mistake)?

Can anybody help?  %confuso

mgb204

A basic understanding of the underlying file structure will help you a lot to understand what you are editing.

So let's take a look at your example file, the first issue you are going to have is that the creator made a blank prop to use as the building. Then they placed the building upon the lot as a prop. Why is this an issue? Well PIM-X looks at the size of the building model and works out the properties of everything based on it's size, using the property "filling degree". But if the model is blank, its probably very small, so now the automatic calculations won't work. The best solution is to re-make the lot using the main model as the building, then PIM-X can do it's job properly. You don't even have to completely re-make the lot, we can copy/paste everything from the original to your new one.

So to start, let's clear out the download so it's easier to work, keep just the following four files when you load PIM-X:

  • regatta-0x5ad0e817_0x722f29b5_0x30000.SC4Model
  • regattaDiagonal-0x5ad0e817_0xd198c59b_0x30000.SC4Model
  • R$$$7_4x4_Regatta_Rcorner_f19e9142.SC4Lot
  • R$$$7_4x4_RegattaDiag_Lcorner_b19daa49.SC4Lot

Keep the other files somewhere else for the time being, since they are required for the LM versions. If you don't want the LM lots, you can remove them from your plugins folder. For the sake of this, I'll concentrate on the Res Growables only. Since CAM doesn't really make any difference for Ploppables.

Now load PIM-X and on the left find the model file for the Ortho Lot "regatta-...", listed under "Resources / Standard Models. It'll likely be right at the bottom of the list on the right. Drag it from there to the left side onto the entry Building / RCI / Residential / ($$$) High Wealth. This will create a new buildings exemplar, but now we have the correct building, not the blank prop, so the figures will be correct. I'm going to use a filling degree of .5 here, because quite a bit of the model in the yellow box is not actually occupied. For a more complete understanding of this property, read the SC4 PIM Manual. This brings the occupants up from 1,914 to 2,041, not a big change. But the main purpose here is to get the growth stage right for CAM. Now we just right click the properties and select "Create a growable lot using this building". We keep the lot size of 4x4, I'd use the default Stage 9 at this point too.

Now a new LotConfigurationExemplar has opened up. See all the items listed with LotConfigPropertyLotObject under the "Name" field? Select every line with the type "Texture", be careful not to select the "Building". Right click that and select "Delete Properties". Now our new lot is totally empty, except for the building.

Now we need to find the original Lot, under lots in the left side. Select the correct one and it's LotConfigurationExemplar will also open up, in a new tab. Similar to before, select all the LotObject entries, except for the Building. Right click and select "Copy Properties".

Return to the previous tab with our new lot again, now right click and select "Paste Properties". Now we have our new Buildings Exemplar and Lot, with the original lot items copied over, there is just one thing left to do.

Open the new lot in the Lot Editor in PIM-X. The old building was a prop, this prop will still be on the new lot (invisible), but we don't want it any more. However it's useful, because we also need to move our new building to the same spot the old one (prop) was. Using the bounding boxes (yellow square of the prop, blue for the building), to help you get the building in the right spot, move it into place. Once you've done this, remove the big prop that was the building and save the lot. PIM-X has created the new SC4Lot and SC4Desc files. The old lot should be removed completely at this point. Repeat this for the diagonal variant too.

deemer2404

Thanks mgb, very helpful.

And I manage to get everything done, except for the last step.
The building already sits in the middle of the grid, so that is already ok, right?
There does not seem to be a big yellow box to delete, however, when I edit the diagonal one, then I see a big yellow box to delete. Am I doing something wrong?

BTW: The diagonal one seems to be a 5x5 building and hence when I use the same filling degree it gets to ca. 4000 people. So I reduced it to .25 which brings us close to the 4x4 lot. (On top the 4x4 already had 2,041 occupants after I dragged it down.)

Just for the future: if the problem with the prop as a building does not exist, I just need to use the LOT (!) File and create a new growable lot from that. Set filling degree, save and done, right?

DANKE!  :thumbsup:

deemer2404

Hmmm, in game I just got a big brown box? Model file missing?

Andreas

#4
It depends how the files were designed in the first place. Every lot needs two "exemplar files", the building exemplar file with the building stats, such as number of residents or jobs, power consumption etc. (usually located in the SC4Desc for growables, but it's probably merged with the SC4Lot file), and the lot exemplar file with the layout of the lot (props, textures) and information about zone type and growth stage.

PIM-X will find the information automatically as long as all necessary files are loaded during startup, though. It is designed to calculate proper values for both the building and the lot once you enter a "filling degree". For this, you need the SC4Model, and depending on how the building looks in the preview window in the lower left, you should decide the percentage that it fills the imaginary "box" that wraps around the maximum size in all three dimensions.

A brown box usually means that the model file is missing, or maybe the lot file is pointing to the wrong model ID. In case you created new SC4Descs and SC4Lot files, make sure to remove the old ones before starting up the game, as they might override your changes and conflict with each other.
Andreas

mgb204

#5
Quote from: deemer2404 on July 03, 2017, 12:24:53 PM
The building already sits in the middle of the grid, so that is already ok, right?

Really depends, because the idea is for the building to be in the same place as the original. Not all lots keep the building in the middle, so you can either see what lines up or use the existing prop to help you. This step in no way affects the function of the lot, so if you are happy with the position of the model, you won't run into problems.

QuoteThere does not seem to be a big yellow box to delete, however, when I edit the diagonal one, then I see a big yellow box to delete. Am I doing something wrong?

I was using the Ortho model and it was there for me  ()what()... What we've done is remove the prop exemplar which had the original model as a prop "regattaProp-0x6534284a-0x1191f85e-0x719bd7c2.SC4Desc". So the bounding box will be there, but the model won't. Sometimes it's easier to line everything up with both the prop model and building in place, other times it's easier to do if the prop is out of the way entirely. So you can choose whether or not to load the relevant .SC4Desc file for the last step.

QuoteBTW: The diagonal one seems to be a 5x5 building and hence when I use the same filling degree it gets to ca. 4000 people. So I reduced it to .25 which brings us close to the 4x4 lot. (On top the 4x4 already had 2,041 occupants after I dragged it down.)

Andreas covered what the filling degree is for, what setting you use is partially a personal thing, since it's always subjective. But typically diagonal lots use little of the space of the "bounding box", which often is a box made to cover the extremities of the model. Although looking at the number of sims/jobs seems a good way to decide, it's really not. Because the goal is to have a set of CAM content that works nicely with the growth stages in CAM. As such, the more consistent your use of the filling degree, the better your content will work with CAM. So it's useful to try and get a good feel for this.

QuoteJust for the future: if the problem with the prop as a building does not exist, I just need to use the LOT (!) File and create a new growable lot from that. Set filling degree, save and done, right?

Not even that hard. Open the original Building, right click and Recompute Properties x (where x = Res/Com/Ind type used). This will allow you to use the filling degree to alter the stats of the building. You may then need to open the lot and similarly change the growth stage, but I think that's handled automatically if it changes (just check it matches the new setting to be sure). So you can simply modify the existing lots, rather than make new ones. It's just quicker to re-make them if the building as prop is used, because there is much less mucking around.

Quote from: deemer2404 on July 03, 2017, 12:44:35 PM
Hmmm, in game I just got a big brown box? Model file missing?

If you didn't remove the Building as a Prop, but no longer have the Prop Exemplar installed, this could be why. You need to ensure you've removed the old prop from the copied lot. In addition, as Andreas points out, ensure you've all the new files, both the SC4Desc and SC4Lot files made by PIM-X.

It's also worth nothing that existing buildings (in-game) need to be removed and re-grown, since the ID has changed, the old lots/models will no longer exist. Such changes are not dynamic either, even when you edit an existing Building/Lot, those items already in-game won't be updated with amended stats. Ideally, you should go through this process before using new content in your plugins folder, but if you don't, remove all the pre-existing versions before changing things.

In this case, if you have some already grown, remove the new files, restore the originals temporarily and remove them from your cities. Then switch the files once more to your new ones. People don't realise how sensitive save files can be to such things, it's better to play it safe.

deemer2404

Would there be an easy way in the xtool to merge to buildings?
Example this file: http://descargas.capitalsim.net/?sitio=csc&descarga=422
Seems to be two halfs that would need to be fused to make it a growable CAM.

mgb204

If a building is really big (or tall), due to the way the SC4 Models work, it can be necessary to make two BATs or more to display it in-game. This limitation can not be worked around, so you can't merge two models into one buildings exemplar.

In practice, that means for the purposes of modding, you will need to keep either one or more parts of the model as a prop. Honestly, I'd not convert such buildings using the process above. Instead, I think you may need to manually work out the growth stage and occupancy values. You may find it easier to use Reader just to change the growth stage to the applicable CAM value, although that's subjective so I can't really give you an exact figure.

twalsh102

Actually, figuring this one out wasn't as difficult as it might seem at first.

If you take the "building" overall (building model + prop model), we essentially have a cylinder.  So first, change the first value in the Occupant Size property to match the last value.  This effectively changes the LOD (for computational purposes) to a size that encompasses the entire cylinder.   This would also allow PIM-X to give a more accurate Growth Stage.

Now you've got all the numbers you need to determine a more or less accurate Filling Degree (volume of a cylinder (the entire "building") divided by volume of the "new" LOD (essentially double the size of the original "half cylinder") = Filling Degree) (NOTE:  I usually use a small ruler that has either millimeters, or tenths of an inch to make various measurements of the model as shown in the LOD box in PIM-X; this allows me to use relatively small numbers to get the necessary ratios vs. using the much larger numbers from the Occupant Size).  Using this method, I came up with a Filling Degree of @.76.  Using the larger Occupant Size, PIM-X determined Stage 11.  Your mileage may vary.

deemer2404

Thanks to all of you. With your help I was able to CAMify many buildings - not really that difficult.

From my first efforts I have a few that are not really perfect. Do I have to buildoze all in the game (kind of difficult to find all) when I edit things like Name and jobs/inhabitants? Or will this update the game?
A few of them seem to work fine during the night and during the day but during dusk they look like a dark nite version. Is that normal (even though I always downloaded the Maxis night model)?

Special question: I guess somewhere along the line I made a mistake and now I have one building that only has a LOT and a DESC file but no model. The game obviously gives me a brown box, but the name of the files are not like any building I found here (I probably accidentially renamed it). Is there any way to find out the (original) name of the model through the two files?

mgb204

The number of jobs/inhabitants will never auto-update, this has to do with the way SC4 save files work. It doesn't simply save the data that this building is in this place, but those details are included in the save file. The only way to refresh them is to re-build/re-plop the building in question, updating the save file.

All models made using newer tools (BAT4Max), will look different at the transition from day to night and vice-versa. SC4BAT renders the day model, then it adds the nitelights as an overlay onto the model, which is displayed when it lights up. But models made in 3DS Max have two sets of textures, one for the day and another for the night render. Part of this change is that the building is made dark to reflect the fact that sunlight is no longer reflecting off the building. In practise, that makes them look odd when it's not fully dark, but they are still Maxis Night renders. The only difference being that Dark Nite renders are even darker, despite what many think, you don't need the dark nite mod to use dark nite models. It simply adjusts the day/night cycle to better compliment the way these models night-mode is displayed.

It's difficult to find a missing dependency if you don't know what the name of the lot/model was originally. Did you keep a backup of the files you removed from your plugins folder? If so, you could use tools to work out which model is missing. Otherwise, all you will get is the ID of the missing model, that won't be enough to help work it out usually. Bear in mind, the file name is not the same as the name of the lot/building exemplar, both of which won't update, if you change the file name. To find those, open it with SC4-PIMX, the name of the lotconfig and buildings exemplars will be displayed there.

deemer2404

I would like to request your help again. I believe I am missing some knowledge on the file structure - specifically with old LOTs/BATs - and hence cannot get the buildings to grow in SC4-CAM.

My examples are both Asian lots: 1) the Acchi Poppo and 2) the Condonium Apartments (I used version 2 further down the page as the split zip for Version 1 did not unpack on my PC). Both basically have the same issue (for me): in PIM-X they show up neither as a ploppable - even though at least "Poppo" does in game - nor under RCI exemplars. Now I can create a new exemplar like you told me for the first BAT by dragging it into the RCI fields, but then I end up with a building with no "eye-candy", just the building itself.
Somehow some info seems to be stored in the *.dat files but I cannot understand how it works. That I cannot read Japanese nor Korean does not help either  ()what() :P

By the way: does anybody have a good link to explain the workings of all this? the PIM-X documentation is mostly talking about PIM-X but not about the background info.

mgb204

You can search for items via the Buildings Exemplar or the LotConfiguration Exemplar, determined by selecting either the Building or Lot categories. So if you can't find the building, try and find the lot instead. Once you have that, right click it and you can open the related building exemplars, which should help you to locate them more easily.

deemer2404

I tried doing that:
In the first example it opens a new tab called "Blank_CS$$$" and the box in the bottom left is completely green but no building visible.
Even stranger, in the second example, when I click on "Open buildings from this list", nothing happens...

mgb204

So looking at the files themselves, Poppo is only one lot, but the buildings exemplar (which is simply named blank_CS$$$), links to a building family which is used by Maxis lots. Therefore many lots are linked to this buildings exemplar. Frankly, I fear this may have used an outdated template which is buggy and was later removed from the exchanges. Otherwise it's probably just badly modded, since the properties were all copied and may not be suitable.

As such, I would start once more with the model file and re-make a new lot from scratch. The building is a ploppable only, so if you are looking for a growable, it doesn't exist. But you can use the model file to make either a growable/ploppable/both as required, copy/pasting the lot items as before.

As for the Somy lot, there is no buildings exemplar to find, hence it doesn't work. The SC4 Desc files are props, not buildings. But the download clearly states it requires the v1 files to work, so presumably that's where the missing buildings exemplar can be found. Split-archives are quite a PITA, but this opens fine for me with WinRAR, but not with WinZip/7Zip, so if you aren't using WinRAR, I would guess that's your problem.

As for where to find information on all this, that's not so easy. I'm sure it exists somewhere, but the real key is opening files in the reader and understanding what you see before you. The basic components of a lot are the buildings exemplar and the lotconfigurations exemplar. I guess what you really want to know is how I'm able to work out what's what, but that's mostly experience. I know which files to look in and what I'm looking for. There are plenty of tutorials covering how to make things, but short of encyclopedic entries describing the various parts, I don't know of a in-depth tutorial for this side of things.

For the most part Buildings and Lots are covered in the PIM-X manual. Using the copy paste technique, the hardest part is simply making the new Buildings Exemplar correctly, which PIM-X makes short work of. That's the how, but I realise that's probably not what you are looking for. You might find some useful information in a tutorial I wrote here. But that tutorial is written for the Maxis Tools and is geared once more to the how to do it side of things. Although I do get into the importance of the buildings exemplar and how together with lots, props etc these things are linked to models. Some of that may illuminate your understanding.