HoodReplace 2.3: Replace Neighborhood Terrain (Updated Jan 24, 2010)
Flag Download
Hide Thanks Posts for this thread (Show only feedback)
Posts: 241
Thanks: 31354 in 31 Posts
Can anyone confirm for me that HoodReplace works for FreeTime? The last time that I installed FreeTime on my machine, it immediately uninstalled Bon Voyage - so FreeTime is no longer on my machine. If necessary, I'll reinstall FT to test this, but I was hoping that someone had already tried it. |
I have all expansions and stuff packs installed, I just tried the program and it worked perfectly. Many thanks for making the task easier and super fast, it took about 1 second to work, I had to double check to make sure it really did it!:D
Posts: 14,061
Thanks: 38360 in 178 Posts
I have all expansions and stuff packs installed, I just tried the program and it worked perfectly. Many thanks for making the task easier and super fast, it took about 1 second to work, I had to double check to make sure it really did it!:D |
Posts: 14,061
Thanks: 38360 in 178 Posts
[ Extracting an SC4 file from a TS2 neighborhood package ] would be worth *trying* in any case, I think =) |
I must admit that I was surprised. The basic file structures of the SimCity SC4 files and the Sims 2 package files appear to be identical, and SimPE (and therefore HoodReplace) are able to read, uncompress, and parse the records correctly. However, just loading and saving the SC4 file without any changes at all, using either SimPE or HoodReplace, makes the file unrecognizable to SimCity 4. Seems to point to a problem with the compression algorithm, but there doesn't seem to be any option to turn off compression.
I'll fool around with this a bit more, but I'm no longer hopeful that this is an easy feature to implement. If I can't get anything working today, I'll leave the code in-place, but disable the ability to choose SC4 files as either the source or destination.
While working on this, I've been mulling over ways to add roads to an existing neighborhood directly. This may turn out to be a more fruitful avenue of research.
Posts: 11,006
Thanks: 422956 in 1121 Posts
Thanks for the info, Mootilda!
Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.
In the kingdom of the blind, do as the Romans do.
Posts: 5,358
Thanks: 111957 in 267 Posts
Well, I tried it. Unfortunately, it looks like the SimPE DLLs do not save the SC4 file correctly, so SimCity 4 refuses to recognize them as cities. I must admit that I was surprised. The basic file structures of the SimCity SC4 files and the Sims 2 package files appear to be identical, and SimPE (and therefore HoodReplace) are able to read, uncompress, and parse the records correctly. However, just loading and saving the SC4 file without any changes at all, using either SimPE or HoodReplace, makes the file unrecognizable to SimCity 4. Seems to point to a problem with the compression algorithm, but there doesn't seem to be any option to turn off compression. |
I would submit a bug report about this and let Quaxi or Numenor fix the SimPE dll's. Maybe in the short term they could just give us the option of disabling compression? There's lots of neat stuff that could be done if we could easily import / export SC4 files correctly. (not dissing SimPE, SimPE is lovely, all bow before Quaxi and Numenor)
Posts: 14,061
Thanks: 38360 in 178 Posts
Anyway, I appreciate your point and will see about submitting a ... feature request: to be able to write SC4 files. With any luck, it won't be too much work. Update: request submitted.
So, I'm curious: what other neat stuff would you do with exported SC4 files?
Posts: 5,358
Thanks: 111957 in 267 Posts
Anyway, I appreciate your point and will see about submitting a ... feature request: to be able to write SC4 files. With any luck, it won't be too much work. Update: request submitted. So, I'm curious: what other neat stuff would you do with exported SC4 files? |
You're right, feature request is much more accurate.
One thing I would like to do but can't because Sims2 won't let me is change the elevation at lot boundaries. (maybe there's a cheat and I just don't know it?) For example, if I make a river or stream on a lot in Sims2, I want the streambed to have correct low elevation at lot boundaries. Especially if I have two neighboring lots and the stream is supposed to flow through both. If the exported SC4 file captures enough detail, I might be able to lower the elevation at lot edges? Unless Sims2 specifically forbids that or would "auto-correct" it or something? I know I could put in riverbeds in SC4 before I play the neighborhood, but I don't always know what I'll build ahead of time or where, and whether I want rivers there or not, so it would be nice to be able to add rivers later. Maybe my sims decided to dig the Panama canal, you know? Or maybe they dammed a river and now there's a big reservoir lake?
I may want to level mountains as my neighborhood changes over time. Maybe the community has grown and they want to build a highway or strip mine? (naughty eco-destroying sims!) I like how Sims2 families grow and change over time, and would like the terrain and neighborhood to do the same.
Same goes for roads. Larger sim population -> new roads. Or maybe a giant robot has rampaged through the city and destroyed some roads? SC4 has some fun natural and unnatural disasters I may want to inflict on my poor unsuspecting sims in Sims2, and many of those destroy roads.
I would like to be able to export some of the premade neighborhoods and/or subneighborhoods from S2 and play them as cities in SC4. Zone them residential or business/commercial to reflect my home / community lots, and see if I can make a viable SC4 city. Don't know if most folks would think that's neat, but I'd enjoy it.
I don't have FT installed because it is beyond buggy and the FT patch borks it even more, based on what I read in the Sims2 forums. So SC4 <--> Sims2 is the only way I could modify neighborhood elevation.
Posts: 14,061
Thanks: 38360 in 178 Posts
One thing I would like to do but can't because Sims2 won't let me is change the elevation at lot boundaries. (maybe there's a cheat and I just don't know it?) For example, if I make a river or stream on a lot in Sims2, I want the streambed to have correct low elevation at lot boundaries. Especially if I have two neighboring lots and the stream is supposed to flow through both. If the exported SC4 file captures enough detail, I might be able to lower the elevation at lot edges? Unless Sims2 specifically forbids that or would "auto-correct" it or something? |
This particular item (changing the elevation at lot boundaries) won't be fixed by changing the neighborhood terrain. The TS2 rule is that the neighborhood is changed temporarily to match the lot boundaries. (Although the roads seem to be changed permanently, thus the issue with terracing.) Very annoying. It seems especially silly given that the game forbids building on the outer 2 tiles of a lot: why disallow building on the edges if the edges can never change?
However, one of the things that I have on the back burner for the LotExpander is the ability to get the expanded lot terrain from the neighborhood terrain. With the work that I've been doing on HoodReplace, and the work that I've already done on the LotExpander, I might be able to come up with a quick utility which will fix the lot boundaries by setting them to the current (permanent) neighborhood terrain levels. Let me see what I can do.
Posts: 14,061
Thanks: 38360 in 178 Posts
Definitely not seen as a "bug", since SimPE is not seen as a tool for reading and writing SC4 files. Although it would be nice, I suspect that this isn't going to be "fixed". That doesn't mean that HoodReplace can't write out SC4 files, it just means that either:
1) I have to find SC4-specific tools for modifying an SC4 file. It's possible that I can use the DLLs from DataGen. Or, ...
2) I have to rewrite some part of the SimPE DLL functionality. Looks like I can get the uncompressed data for each record, so this might just come down to writing: header, index table, hole record, etc. Or, ...
3) I have to fix the SimPE source code myself... I believe that this is open source and available to be modded.
Not a completely intimidating list, just more work than I was hoping for.
I also asked about the ability to write uncompressed files and am waiting for an answer.
Posts: 628
Thanks: 1264 in 7 Posts
About custom neighborhood ID, in order to get first my custom neighborhoods, I use C010 instead of N004, it seems the game support it but your program doesn't see it like SimPE, so I select the neighborhood package but no suburbs are listed just the main is shown.
Can you do something please ?
Posts: 14,061
Thanks: 38360 in 178 Posts
If you want to open SC4 files, you need to use DatGen because the package contents are different of the TS2 ones |
The file formats are identical between SC4 and TS2; Maxis seems to use this file format for all of their games. SimPE has no problems reading an SC4 file, parsing the individual records, and decompressing the data, which means that opening the SC4 files with SimPE isn't a problem. Since HoodReplace doesn't use SimPE to determine the internal format of the individual records, it doesn't matter that SimPE doesn't actually know the internal formats for any of the SC4 record types.
However, when the files are saved, it seems likely that SimPE is updating something to a newer version which The Sims 2 uses, but SimCity 4 doesn't recognize: either the compression algorithm or the contents of some portion of the file, like the header information or the index table.
I agree that changing HoodReplace to use the DLLs from DataGen to do the mid-level file access for SC4 files may be an option.
About custom neighborhood ID, in order to get first my custom neighborhoods, I use C010 instead of N004, it seems the game support it but your program doesn't see it like SimPE, so I select the neighborhood package but no suburbs are listed just the main is shown. Can you do something please ? |
Posts: 628
Thanks: 1264 in 7 Posts
Thanks for the pointer to DataGen. Do you have the pointer to the download page, where it lists the requirements, etc? |
Sadly the official Datgen site was shutdown but the archive of the site is there
http://web.archive.org/web/20060510...ww.datgen.info/
Yes, I just noticed yesterday that the subneighborhoods weren't included; this will be fixed in the next version. Until then, just use the Browse button to find your neighborhood. |
Ok, thanks !
Posts: 14,061
Thanks: 38360 in 178 Posts
Sadly the official Datgen site was shutdown but the archive of the site is there http://web.archive.org/web/20060510...ww.datgen.info/ |
I don't suppose that you've got a link to the source code? Was it open source?
Posts: 14,061
Thanks: 38360 in 178 Posts
Changing Lot Boundaries:
- I was wrong about the neighborhood terrain being changed temporarily by moving a lot - looks like it changes permanently. This means that it won't be possible to change a lot boundary to match the neighborhood terrain unless the lot is moved or resized or unless the neighborhood terrain is changed.
Fixing Elevation of Structures to Match Terrain:
- Added code to change the elevation of trees so that they match the new terrain. No obvious problems.
- Added code to change the elevation of roads so that they match the new terrain. There's an obvious problem with disconnects at the edge of each segment of road. It appears that the road should flatten the neighborhood terrain from one side of the road to the other, although roads can slope in the direction of travel. Still needs work; although the problem can sometimes be fixed in game by moving lots around.
- Added code to change the elevation of bridges so that they match the new terrain. Along with the road slope problem above, there are additional problems:
- Bridges will not be in the correct location for a different terrain. So, should the bridges stay where they are, or should bridges just be considered an extension of the normal roads and created / deleted as appropriate to allow a road to cross water? Does TS2 have different types of bridges?
. - Need an algorithm to determine the "correct" height of a bridge. For example, the bridge in Pleasantview is quite high.
- DataGen requires .Net 1.1. It doesn't seem reasonable for HoodReplace to require both .Net 1.1 and .Net 2.0, so I'm still exploring options.
Still to be done:
- Fix the issues with road and bridge elevation.
- Add code to change the elevation of decorations and lots so that they match the new terrain.
- Adjust the lot boundaries so that they match the new terrain.
- Explore strategies for extracting SC4 files.
Interesting Tidbit:
- When a road is floating in the air, the cars drive on the ground underneath it.
- When a road tunnels through a hill, the cars drive on the hill above the road.
Posts: 5,358
Thanks: 111957 in 267 Posts
Does that mean if I package a lot, remove the lot, then put the lot back, the lot boundaries will match the terrain? Thank you so much for investigating this, I appreciate it.
tunnel roads
This could actually be useful "feature". If I *delibaretaly* make the roads run underground, and paint the terrain above to look like dirt roads, I could have dirt roads without using a global road appearance mod. I think this means I could also have BOTH regular roads and "dirt roads" in the same neighborhood. That would be rather neat! My "town" sims could have paved roads and the sims that live in the "county" could have dirt roads, all in the same neighborhood. If anyone tries this, post your pictures please!
Posts: 14,061
Thanks: 38360 in 178 Posts
changing lot boundaries Does that mean if I package a lot, remove the lot, then put the lot back, the lot boundaries will match the terrain? |
tunnel roads This could actually be useful "feature". If I *delibaretaly* make the roads run underground, and paint the terrain above to look like dirt roads, I could have dirt roads without using a global road appearance mod. I think this means I could also have BOTH regular roads and "dirt roads" in the same neighborhood. |
Posts: 5,358
Thanks: 111957 in 267 Posts
But, what will happen to the lots that are no longer associated with the underground road (because of the difference in elevation)? |
I didn't know the lots would no longer be associated with the road. I figured if the cars knew the road was there, the lots would too. Ah well, would have been neat. Thanks for letting me know before I messed up my neighborhood!
Posts: 628
Thanks: 1264 in 7 Posts
Extracting SC4 file: - DataGen requires .Net 1.1. It doesn't seem reasonable for HoodReplace to require both .Net 1.1 and .Net 2.0, so I'm still exploring options. |
You can see if you find something at Simtropolis.com forum but sadly the programs are all old.
Posts: 14,061
Thanks: 38360 in 178 Posts
I didn't know the lots would no longer be associated with the road. I figured if the cars knew the road was there, the lots would too. Ah well, would have been neat. Thanks for letting me know before I messed up my neighborhood! |
Posts: 6,238
It took about 3 changes for it to happen, but it worked like a dream, and now the neighborhood terrain is larger, there are fewer trees and more room for expansion for more houses(thanks to another new map).
Thank you for this-although I had to go and find the houses (they were "buried) after using it, it was everything I needed and then some. It's a great addition to the modding community and it is definitely something that needed to be done. Great work!
Posts: 14,061
Thanks: 38360 in 178 Posts
On another note: I just thought that the following conversation at MATY might be interesting to people here:
http://www.moreawesomethanyou.com/s....html#msg330170
Quote from: J. M. Pescado on Today at 07:22:27 Does something supremely bad happen if you replace terrain without the roads, like roads tunnelling into the dirt or floating in the air? |
Yes, right now the various neighborhood elements maintain their assigned elevation. If you mix and match from two different terrains, you can get elements which float over the terrain, or which are under the ground. However, it hasn't been my experience that this is "supremely bad"... the game just doesn't seem to care.
For now, the selective replacement ability of HoodReplace is really meant for people who are fixing up an existing terrain, such as adding roads to Strangetown, rather than for people who are replacing the entire terrain with something very different.
If you want to replace the entire terrain with something different, then you should probably replace all of the terrain elements at the same time: roads, bridges, tree, and decorations... Still, your lots may appear to be floating in the air, or underground, just as they would when using SimPE to replace the neighborhood terrain. Not a problem, just pick them up and move them back where they belong.
I am currently enhancing HoodReplace to change the elevation of all of these elements, including the lots, so that they will match the new neighborhood terrain, even if it has changed dramatically.
Posts: 13
Thanks so much for this utility! It makes it so much more fun to be able to resculpt a neighbourhood when necessary, and it works so quickly and simply!
Posts: 82
[SIZE=3]
~Ferris Bueller's Day Off, 1986
Posts: 14,061
Thanks: 38360 in 178 Posts
Posts: 82
I attached Melly_Sim's Pleasantville terrain to the original post. Try this and let me know what happens. |
[SIZE=3]
~Ferris Bueller's Day Off, 1986
Page 2 of 8
|