Quick Reply
Search this Thread
Site Helper
Original Poster
#1 Old 28th Apr 2009 at 12:23 AM Last edited by Mootilda : 3rd May 2009 at 6:10 PM.
Default LotMerger - Combine two lots into one.
When apartments came out, I really thought that it would be nice to take existing houses that I enjoy and combine them into an apartment complex.

This seems like it might be do-able, but a lot of work.

Strategy:
- Copy the appropriate records to the new lot, making sure to adjust the location. Code to do the adjustment already exists in the LotAdjuster.

Research required:
- Does the game reuse GUIDs between different lots? If so, this will be more difficult. If not, then it should be easier to avoid problems. [Update: object instance ID are reused between lots].

Issues:
- As far as I can tell, the wall structures have an array which includes the room numbers. We would need code to identify unique rooms and renumber.
- Controllers need to be better understood. They may contain lot info. Must understand well enough not to arbitrarily duplicate or omit. Note: so far, I have avoided deleting objects from lots, since this seems like a somewhat dangerous operation.
Advertisement
Captain Louie
retired moderator
#2 Old 2nd May 2009 at 7:29 PM
Unique rooms?

Now streaming on at Twitch.tv/SeveralNerds or UglyHoesConnect.com - whichever is easier for you to type in your browser.
Site Helper
Original Poster
#3 Old 3rd May 2009 at 1:30 AM
The wiki contains almost everything that I know about walls:
http://www.sims2wiki.info/wiki.php?title=WLL
http://www.sims2wiki.info/wiki.php?title=WGRA

The wall graph contains 3 separate arrays:
- A list of wall vertices (x, y coordinates, plus level), used in the wall list below
- A list of room IDs, used in the wall list below
- A list of walls. Each wall has two vertexes (start and stop location) and two room IDs, one for each surface. If a wall does not separate two rooms, then the room IDs will be identical. The outside of the house is also considered to be a room.

When you combine two separate lots, you could conceivably create new rooms. Think of two pseudo-rowhouses created using plasticbox's technique. I haven't checked for sure, but I believe that the two pseudo-party walls are actually considered to be outside (looks sort of like [ on one lot and ] on the other). Neither of those spaces is enclosed, so the room is "outside". But, if you combine the two lots, you could end up with a real room in that space (6 sections of wall combined into one room, like this []). That new room needs a new Room ID.

In additional, some of the rooms will be merged. For example, the outside from one lot should be combined with the outside from the other lot to form one big outside.

So, the program would need to have logic to identify unique rooms within the combined lot. Without a correct list of rooms, the program is bound to malfunction.

Does that make it any clearer?
Fat Obstreperous Jerk
#4 Old 3rd May 2009 at 7:51 AM
Quote: Originally posted by Mootilda
Strategy:
- Copy the appropriate records to the new lot, making sure to adjust the location. Code to do the adjustment already exists in the LotAdjuster.
Not quite as sane as it sounds. For example, object instance IDs will be reused between lots. Also, controllers would be arbitrarily duplicated or omitted, depending on the strategy used. Such an attempt would require intimate knowledge of both how each controller on a lot functions, and how they are represented in the savefiles, as many controllers contain lot specific data stored on their attributes. You have less than a month to acquire this knowledge, which no one has.

Quote: Originally posted by Mootilda
- Does the game reuse GUIDs between different lots? If so, this will be more difficult. If not, then it should be easier to avoid problems.
The game reuses object instances, as a known. GUIDs, I'm not sure if lots even have GUIDs.

Quote: Originally posted by Mootilda
- As far as I can tell, the wall structures have an array which includes the room numbers. We would need code to identify unique rooms and renumber.
Well, room 0 is the only unique "room", so things in room 0 are in the same room, things not in room 0 are different rooms, period.

Given the timeframe in which you have to make this item, it seems impractical.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Site Helper
Original Poster
#5 Old 3rd May 2009 at 2:55 PM Last edited by Mootilda : 3rd May 2009 at 6:06 PM.
Thanks for the info about the GUIDs.

Yes, I agree that this tool is difficult, if not impossible. This group is the place where people can post ideas. That doesn't mean that they're feasible. However, I get requests for tools in all sorts of places and I thought that it would be nice to gather them together in one place where they can be discussed and research can be posted.

I don't intend to write all of these tools in one month. I think that I'll be lucky to get one or two done. Some of these ideas may be things that people want for TS3 as well. And, there's always a possibility that people will reject TS3, if it isn't an improvement on TS2.

Again, this is sort of a request forum. And a brainstorming area. And a developer's diary.

In the lot package, every room must be assigned a unique ID. If you're combining two lots, you need to determine every room on the lot and assign it a unique ID. Not too difficult if the walls don't touch the edge of the lot, but requires additional work if they do.

I'll add some of your comments to the original post, so that they don't get lost.
Fat Obstreperous Jerk
#6 Old 3rd May 2009 at 7:35 PM
Quote: Originally posted by Mootilda
I don't intend to write all of these tools in one month. I think that I'll be lucky to get one or two done.
Heh, if that.

Quote: Originally posted by Mootilda
Some of these ideas may be things that people want for TS3 as well.
This is true, but how things work in TS3 is not going to be the same as what we've found in TS2, so applying these ideas to TS3 moves firmly into the realm of "wild-assed speculation".

Quote: Originally posted by Mootilda
And, there's always a possibility that people will reject TS3, if it isn't an improvement on TS2.
Optimism is not supported by thermodynamic reality.

Quote: Originally posted by Mootilda
In the lot package, every room must be assigned a unique ID. If you're combining two lots, you need to determine every room on the lot and assign it a unique ID. Not too difficult if the walls don't touch the edge of the lot, but requires additional work if they do.
Well, it's trivial to do so for multiple lots, just add an arbitrary offset: No rule seems to stipulate that room IDs must be contiguous. Walls-at-the-edge-of-the-lot are a major problem, though: While normal WALLS cannot normally do this and this represents an illegal case, fences CAN, and fences cause room boundaries, so if someone were to draw a hemibox with fences, they could presumably form a room that way. On the other hand, I dunno what would happen if you erroneously continued to classify it as the same room. Presumably, nothing would happen and the situation would resolve itself in-game when the player rips the box open and redraws it.

The real problem remains the profusion of off-lot controllers: Only lots in a specific state of saveiture could even have such a thing attempted, probably by simply vaporizing all "offworld" objects, as global controllers normally respawn. The consequences of such a thing are not entirely known. Also, stopping points, portals, and other "edge" objects would have to be reconciled.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Site Helper
Original Poster
#7 Old 3rd May 2009 at 7:58 PM Last edited by Mootilda : 3rd May 2009 at 8:19 PM.
Quote: Originally posted by J. M. Pescado
Heh, if that.
I already finished ConvertiWall and the GridAdjuster.

The LevelAdder is coming along nicely and I'm hoping to have a version ready for release fairly soon. I haven't decided whether to try another project after that, or whether to enhance existing programs instead.

Quote: Originally posted by J. M. Pescado
Walls-at-the-edge-of-the-lot are a major problem, though: While normal WALLS cannot normally do this and this represents an illegal case, fences CAN, and fences cause room boundaries, so if someone were to draw a hemibox with fences, they could presumably form a room that way.
I take it you haven't seen all of the pseudo-townhouses available for download?

Quote: Originally posted by J. M. Pescado
On the other hand, I dunno what would happen if you erroneously continued to classify it as the same room.
I don't know, either. Needs more research. Previous testing says that the game is likely to crash with incorrect info in the WGRA, but I haven't fooled around with the room ids very much.

One other thing that I haven't said before, but is probably worth stating:
I prefer to write programs which make impossible things possible (such as expanding or shrinking a lot, or adding or removing a level) or make very difficult things easier (such as creating elevations under 4 clicks, or negative elevations). If something is already fairly easy to do in-game or in SimPE, then there's less likelihood that I'll write a program to do it.
Fat Obstreperous Jerk
#8 Old 5th May 2009 at 5:38 AM
Quote: Originally posted by Mootilda
I take it you haven't seen all of the pseudo-townhouses available for download?
The task gets considerably less feasible if you're going to allow people to do illegal things to the lot that normally cannot be done, then allow them to merge mangled lots. Don't lots horribly crash when you do that? I seem to remember nasty crashiness resulting from drawing walls all the way to the edge.

Quote: Originally posted by Mootilda
One other thing that I haven't said before, but is probably worth stating:
I prefer to write programs which make impossible things possible (such as expanding or shrinking a lot, or adding or removing a level) or make very difficult things easier (such as creating elevations under 4 clicks, or negative elevations). If something is already fairly easy to do in-game or in SimPE, then there's less likelihood that I'll write a program to do it.
That seems logical. Why bother doing something that can already be done?

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Site Helper
Original Poster
#9 Old 5th May 2009 at 6:24 AM
Quote: Originally posted by J. M. Pescado
The task gets considerably less feasible if you're going to allow people to do illegal things to the lot that normally cannot be done, then allow them to merge mangled lots. Don't lots horribly crash when you do that? I seem to remember nasty crashiness resulting from drawing walls all the way to the edge.
There was an early test version of the shrinking code which crashed. People wanted the feature so badly that they downloaded it anyway. Since people ignored the warnings, I finally had to hide it away until I had the feature working.
Mad Poster
#10 Old 2nd Jun 2009 at 6:19 AM Last edited by niol : 3rd Jun 2009 at 7:51 AM.
I understand that people can have different view points and preferences for various aspects, so let's be open-minded to nicely accept these facts.
Hopefully, our discussions may lead to more fruitful understandings.


Quote: Originally posted by Mootilda
- Copy the appropriate records to the new lot, making sure to adjust the location. Code to do the adjustment already exists in the LotAdjuster.

What Mootilda meant may be to copy the architectural data and probably some objects rather than objects like common objects in most if not all lots to the new lots.
those common lot objects have to be found out and enlisted for checks for whatever purpose in this potential app or others.

Quote: Originally posted by J. M. Pescado
Well, it's trivial to do so for multiple lots, just add an arbitrary offset: No rule seems to stipulate that room IDs must be contiguous.


Unexamined Room ID reasignment may not work out due to different properties of various room types and their involved wall types.
For example, attic room has different properties and flags from a screendeck room.
May check out arrays (2A51171B) Instances ID 0x09, 0x0A, or 0x0B
http://www.sims2wiki.info/wiki.php?title=3ARY
For another instance,
May check out arrays WGRA files
http://www.sims2wiki.info/wiki.php?title=WGRA
Presently, the standard wall and the foundation block wall can be interchanged practically, and that is based on the crashless results of such earlier experiments and the "apparently same" data pattern analysis on WGRA files during the development since the mid (not early)2008.
Yet, some wall types like attic walls and swim-pool walls have different data patterns and values in WGRA files, and it's been shown that swap between these wall types with others can lead to crashes during lot loading.

I believe, that is still the reason why ConvertiWall can only do the interchange for the standard wall and the foundation block wall so far simply because the data pattern differences have not been all sorted out and analysed. Here, I deserve some slaps coz I got busy on some other RL things without accomplishing the analysis.

Quote: Originally posted by J. M. Pescado
Walls-at-the-edge-of-the-lot are a major problem, though: While normal WALLS cannot normally do this and this represents an illegal case, fences CAN, and fences cause room boundaries, so if someone were to draw a hemibox with fences, they could presumably form a room that way. On the other hand, I dunno what would happen if you erroneously continued to classify it as the same room. Presumably, nothing would happen and the situation would resolve itself in-game when the player rips the box open and redraws it.


What I see it so far:
1. In terms of observed stability, wall segment can extend stably to the lot edge grid point but not on the lot verge. It may also mean closed-room isn't allowed to be at any lot brink.
2. Certain features or ranges were not enabled not because of incompatibility but probably because of the limitted time, poor inter-coordinations, under-estimation on customers, profit-impunity, etc.
3. Fence-based partitions have far more differences of properties and structures from wall-based partitions. Say, the scenegraphical structures, the game-ethic properties. They can surely share the same boundary-properties. Nevertheless, budding fences cannot block sims access. Glasshouse-fence can act in-between fences and walls, such "support"/"if not requirement" for upper grid formation is necessary. Fence-arch has even further building properties.
modding - Fence-arch: infos-sharing, ideas-mingling, etc...
http://www.modthesims2.com/showthread.php?t=222081

Therefore, what all these can mean is that there are even several partition types, with various properties and data, named/categorised in the name of "fence" or "wall", and that can lead to a general confusion that partition is of 1 whole own kind without derived and distinct data and/or properties.

Fences can be so different from walls in game-ethics and data structures.
1. Fenced areas are never considered a closed room for sims but closed regions or barriers for sims routing.
2. Fenced areas are not weather-proofed.
3. Fences data patterns in WGRA files is of its own kind.
4. Fence-arches data patterns in WGRA files is of its own kind.

It's been speculated that different WGRA files may represent different partition properties.
Well, as least, Mootilda and I had thought so.
Now, I insert that wall.txt definition may affect data patterns in WGRA files and yield partitions with different data patterns.
1. wall.txt-based unleashed foundation walls have data pattern different from that of the foundation-block-walls.
2. certain custom walls can have different data patterns.


Quote: Originally posted by J. M. Pescado
Why bother doing something that can already be done?


May read my remarks in
CopyLot - Copy a lot into another neighborhood
Site Helper
Original Poster
#11 Old 9th Jan 2010 at 4:38 PM
I just got a request for this tool today.

Ah, if only it were as easy to clone people as it is to clone sims.
Test Subject
#12 Old 25th Apr 2020 at 1:16 AM
Wait, so is there any way to combine lots? or add a house to a pre-existing lot?
 
Back to top