Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Deceased
Original Poster
#1 Old 14th Dec 2014 at 7:23 PM Last edited by scumbumbo : 28th Dec 2014 at 7:37 AM.
Default Family Tree Add-On Testing BETA (Updated Dec 28)
So far at least, it appears that it would be impossible or at least extremely difficult to make a family tree mod in the UI. So I thought, why not approach it as an add-on executable?

I've written a fairly rough-and-ready family tree add-on using Visual Basic and before making it widely available would like comments, suggestions and most importantly testing. In addition, if anyone is a great VB coder especially with graphics please let me know and we can get the source code for the executable shared and make it better.

The approach I've taken uses a script mod to dump the genealogy data for all households into a temporary data file. The executable file then takes that data and merges it into a permanent database so that the data for pruned sims continues to be available to the program. The genealogy data is dumped every sim night at 3:00 AM by default.

Several commands are added to the cheat console:

familytree - Launches the Family Tree Add-On executable, which must be in the Family Tree Support Files sub-folder of The Sims 4 mods folder. This sub-folder is also where the temporary data file is written. If TS4 is played full-screen, it should minimize when the executable is launched.

familytree.save - Forces the save of the temporary family tree data file (FamilyTree.dat) without waiting for the alarm timer.

familytree.setalarm # - Clears and sets a new alarm for the famly tree dump to occur (for testing purposes only). The number should be the 24-based hour the dump should occur, e.g. "familytree.setalarm 14" to set the alarm for 2:00PM. No error checking is performed!

The database itself is placed in the "TS4 FamilyTree" subfolder of My Documents. This folder and the XML database are created automatically.

Using the executable is fairly straight-forward. The FamilyTree.dat file should be found automatically, but can be browsed for if not found. Click the Read Data button to merge the FamilyTree.dat file into the permanent database. By default, any sims in the existing database that have been pruned since the last run will be marked as dead and the FamliyTree.dat file will be deleted after a successful database merge.

Select a sim from the drop-down selection in the Sim Database Browser and click the Draw Tree button to draw the family tree. I've attached a screenshot of the main executable and a sample of a family tree image.
Screenshots
Attached files:
File Type: rar  Family Tree Add-On BETA v0.9.2.rar (32.5 KB, 496 downloads) - View custom content
Description: BETA version 0.9.2 of Family Tree Add-On, Updated Dec 28
Advertisement
Test Subject
#2 Old 15th Dec 2014 at 9:59 AM
hey ive been giving this a test run , Im assuming this will only work with newly created legacies ? i currently have 3 generations however they dont show up as related to one another on the tree? although if i click on the 3rd generation (ie gilbert scott - youngest in generation ) it will show his tree but only to paternal grandfather ?
Deceased
Original Poster
#3 Old 15th Dec 2014 at 4:07 PM
Quote: Originally posted by kiwisims_4
hey ive been giving this a test run , Im assuming this will only work with newly created legacies ? i currently have 3 generations however they dont show up as related to one another on the tree? although if i click on the 3rd generation (ie gilbert scott - youngest in generation ) it will show his tree but only to paternal grandfather ?


Yeah, it can only pick up on what sims currently exist, which is the reason for the persistent database (stored as an XML file in your My Documents\TS4 FamilyTree folder) and also why I have the script portion schedule to take a snapshot of all households every sim night at 3am. Once a sim is pruned, there is no way (that I can see) to get their name, gender and their ancestors. If a sim has a father with ID "X" who has been pruned, unless sim "X" is in the persistent database already, the tree ends there and that missing link will show up in the tree as "Pruned Sim" because we can't even get the unfortunate sim's name anymore.

However, the tree itself should go as far into the ancestry as exists in the persistent database resizing the graphic to fit everybody in. I actually made the "Adison" family in the screenshot by hand by editing the persistent database, as my own game didn't have a long enough dynasty for serious testing.

Finally, as the persistent database is built by the executable, the temporary snapshot data taken by the script can build up (it appends, rather than overwriting so nothing can get lost once the add-on gets installed). It doesn't get very big very quick, but I considered if someone didn't use the executable for a month or so it might get large, so the script checks the file size at every dump and if it exceeds some value (I think I used 5 or 10 MB, don't recall precisely, the script source is included of course) it launches the executable automatically with a command line option to show a message saying it's time to merge that data in.

I'd like to try to think of everything that needs to be put into this effort in order to make this worthwhile in the long run for people, so I appreciate your testing this out and questions and comments. I already have a few ideas for enhancements that I've thought of, but my time will be pretty limited in the next few weeks, between Christmas and work, to actually sit down and code.
Pettifogging Legalist!
retired moderator
#4 Old 15th Dec 2014 at 5:57 PM Last edited by plasticbox : 15th Dec 2014 at 8:54 PM. Reason: So many typos .. o.O
Very cool that you're tackling this =)

One thing that immediately struck (stroke? striked?) me as a little counterintuitive is that if I'm reading that screenshot correctly, the current generation is on the right and the ancestors on the left .. at least for people in the Western hemisphere, that looks kind of backwards since usually time is projected in the reading direction (i.e. granddad -> mum -> daughter). Is there a technical reason for this? I'd think a top-down listing with the current generation at the bottom would most likely work for everyone, but it would soon lead to sideways scrolling which a lot of people dislike ..

(OTOH I seem to recall that the ancestry trees of racing horses that I recently looked at (don't ask =P) were also that way around -- current horse at the left, ancestors to the right. Maybe that's a more widespread convention than I'm aware of .. ?)


But if this is plain XML one could make all kinds of interfaces for it =) they would also be independent of any changes in the tool, I take it(?), as long as you don't change any existing tags.

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.
Test Subject
#5 Old 15th Dec 2014 at 8:41 PM
Quote: Originally posted by plasticbox
Very cool that you're tackling this =)

One thing that immediately struck (stroke? striked?) me as a little counterintuitive is that if I'm reading that screenshot correctly, the current generation is on the right and the ancestors on the left .. at least for people in the Western hemisphere, that looks kind of backwards since usually time is projected in the reading direction (i.e. granddad -> mum -> daughter). Is there a technical reason for this? I'd think a top-down listing with the current generation at the bottom would most likely work for everyone, but if would soon lead to sideways scrolling which a lot of people dislike ..

(OTOH I seem to recall that the ancesty trees of racing horses that I recently looked at (don't ask =P) were also that way around. Maybe it's a more widespread convention than I'm aware of .. )


But if this plain XML one could make all kinds of interfaces for it =) they would also be independent of any changes in the tool, I take it(?), as long as you don't change any existing tags.


I agree with plastic box on the original ancestors on the top and everyone following below them
Instructor
#6 Old 15th Dec 2014 at 11:12 PM
I have a family with 4 generations. All 4 showed up perfectly when I chose the youngest one as the starting point. I would definitely agree with the above statements though about making the tree either read oldest on the left to newest on the right or even more preferably oldest on top going downwards to youngest.

ETA: I just thought of a question. Every time this is saved it just overrides the same file correct? If you have multiple saves won't this mess up the file for us. Like you'll play one save game and it will dump into that file. Then the next time you play it will dump into that same file again and now you'll have to go back to that other save if you need that tree again. Could there possibly just be a command to stop the automatic dumping to the file and then we could just run the familytree.save command manually when needed? Obviously going back to the other save and running it again isn't an issue my concern is just with sims that die/get removed/etc. that you might end up losing their data if it gets overwritten. Or is that not going to be an issue?
Pettifogging Legalist!
retired moderator
#7 Old 16th Dec 2014 at 12:02 AM
Wow, good question, about the multiple save games. Particularly since Maxis have this completely messed-up concept of save slots and so on (so people end up with multiple saves with the same name .. just great )

If it weren't for that, the obvious solution would be multiple database files with the same names as the saves I guess .. that would not be hard to understand I would hope. But so?

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.
Deceased
Original Poster
#8 Old 16th Dec 2014 at 2:01 AM
Quote: Originally posted by plasticbox
One thing that immediately struck (stroke? striked?) me as a little counterintuitive is that if I'm reading that screenshot correctly, the current generation is on the right and the ancestors on the left ..


I just copied the format from an image I found online. I considered several different designs, including vertical with the ancestors at the top, but the horizontal view comes out much more compact. To me the view is equally easy to read.

Quote: Originally posted by plasticbox
But if this is plain XML one could make all kinds of interfaces for it =) they would also be independent of any changes in the tool, I take it(?), as long as you don't change any existing tags.


Multiple designs could be done as separate programs, or options in the same program. Swapping the directions to have ancestors on the left would be pretty easy, a vertical view only slightly less easy.

The persistent database is plain XML, yes, and it is quite straightforward:


The XML database is created in the Visual Basic rather than in the Python scripting to try to keep the actual "mod" portion of the program as simple as possible rather than some kind of overkill script. It's a lot easier to prompt the user that the database has been corrupted and possibly fix it, or needs to be upgraded to a new version format, outside of the game environment.
Deceased
Original Poster
#9 Old 16th Dec 2014 at 2:27 AM
Quote: Originally posted by melbrewer367
I have a family with 4 generations. All 4 showed up perfectly when I chose the youngest one as the starting point. I would definitely agree with the above statements though about making the tree either read oldest on the left to newest on the right or even more preferably oldest on top going downwards to youngest.


Glad that's working for you. I can work on the possibility of a different tree design, probably after the holiday season.

Quote: Originally posted by melbrewer367
Every time this is saved it just overrides the same file correct? If you have multiple saves won't this mess up the file for us. Like you'll play one save game and it will dump into that file.... Could there possibly just be a command to stop the automatic dumping to the file and then we could just run the familytree.save command manually when needed? ... Or is that not going to be an issue?


Good question, and one that I had not considered due to my playing style. I use multiple saves just as backups, so I don't go back to old saves unless the current save is corrupted, something that luckily hasn't happened to me yet. So I really only have one "world" of sims.

I'm not sure it is a problem, but some method of keeping them apart in the database might be good. Right now all the worlds would end up in the same database, but the families wouldn't intersect or anything - unless by some miracle two different sims in two different save games end up with the same sim ID. Or if a player has a family that started out the same, and then they "split off" the game into two saves and developed that family differenlty in two separate save games. To me that's just strange, but it's certainly probable that some people play that way and it isn't strange to them.

There may be no easy answer to that one, but I'm open to ideas.
Deceased
Original Poster
#10 Old 16th Dec 2014 at 2:31 AM
Quote: Originally posted by plasticbox
Wow, good question, about the multiple save games. Particularly since Maxis have this completely messed-up concept of save slots and so on (so people end up with multiple saves with the same name .. just great )

If it weren't for that, the obvious solution would be multiple database files with the same names as the saves I guess .. that would not be hard to understand I would hope. But so?


I think it would be best for the player themselves to manage the sim merge process manually into different databases. They could name the databases themselves. We can't use the save game name, as that could very easily be changed. We can't use the save game slot number as they may delete a game, then save a new branch which ends up in that slot and then it gets merged with data from the old game.

Too bad we can't save the database right into the save game and avoid that whole mess!
Pettifogging Legalist!
retired moderator
#11 Old 16th Dec 2014 at 3:27 AM
Quote: Originally posted by scumbumbo
Or if a player has a family that started out the same, and then they "split off" the game into two saves and developed that family differenlty in two separate save games. To me that's just strange, but it's certainly probable that some people play that way and it isn't strange to them.


I totally play that way, at least at the moment =) I keep re-starting with the same handful of sims using always the same empty save to start from, where those sims are already in the bin .. so I'd think they have the same ID in all saves. Also, what about the pre-made sims? Wouldn't they also have the same ID every time? All those people who say "my sim" .. I think they probably play with one sim/household they make themselves and large parts of the rest would be always the same Maxis sims.

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.
Instructor
#12 Old 16th Dec 2014 at 11:41 AM
Hi!
On my quick test the data file is always corrupt.
Open on np++ shows zoe Patel only. This was a newly created game save.

Advise please.

Tanks for your efforts and keep up the good work.
Test Subject
#13 Old 17th Dec 2014 at 5:14 AM
Thanks for the mod! I've been keeping track of this with just some spreadsheets. So inelegant.

This looks good with my game, but I am curious about whether additional options are feasible.

Ideally, I would like to run this in reverse, i.e. to trace the descendents of a particular sim. I'm playing a legacy game where Sim A is the mother of Sim B, and Sim B had kids with a couple of different partners, Sims X, Y, and Z. If I select Sim A, would there be a way to show her descendant tree, including all of her grandkids from B-X, B-Y, and B-Z, while also identifying whether X, Y, or Z was the other parent in each case?

Additionally, is it possible to make the family tree display interactive, so that you can click on a sim's name and it would redraw the family tree for that person? I suppose that is only relevant if the tree draws both ancestors and descendents though, because clicking on your parent, if it only shows ancestors, would just show an abbreviated version of what's already displayed.
Deceased
Original Poster
#14 Old 17th Dec 2014 at 6:16 AM
Quote: Originally posted by anya11
Ideally, I would like to run this in reverse, i.e. to trace the descendents of a particular sim. I'm playing a legacy game where Sim A is the mother of Sim B, and Sim B had kids with a couple of different partners, Sims X, Y, and Z. If I select Sim A, would there be a way to show her descendant tree, including all of her grandkids from B-X, B-Y, and B-Z, while also identifying whether X, Y, or Z was the other parent in each case?


Yes, I've thought of this and how best to address it. I've knocked about some ideas in my head and the dificulties in graphing both easily and in a user-friendly manner considering the possibility of multiple branches of children with multiple partners, and I think I've come up with some ideas on how to best handle it.

Quote: Originally posted by anya11
Additionally, is it possible to make the family tree display interactive, so that you can click on a sim's name and it would redraw the family tree for that person?


Yes, interactive clickability is something that will be addressed, possibly in the next beta version - though even that is likely to be a few weeks in the future due to the upcoming holiday and major pressures at work.

Thanks for testing and for your ideas!

EDIT: and thanks for distracting me from updating mods for the latest patch! I needed a break.
Pettifogging Legalist!
retired moderator
#15 Old 17th Dec 2014 at 7:23 AM
Regarding graphing, I believe the TS2 approach was quite intelligent -- they'd only show parents and children for each sim (siblings I don't remember) and then a three dots icon for everyone who had more relatives, so you'd click on that and get a new graph. That avoids a lot of spaghetti with those "several kids with several people" scenarios I would think.

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.
Test Subject
#16 Old 24th Dec 2014 at 2:51 PM
I am not a programmer. But would you need any help with the UI design? Im a great graphic designer.
Deceased
Original Poster
#17 Old 28th Dec 2014 at 6:31 AM
Quote: Originally posted by acek7
I am not a programmer. But would you need any help with the UI design? Im a great graphic designer.


Thanks for the offer, I will keep you in mind. Plasticbox has also offered to help with graphics design, so when the time comes to worry about such things hopefully one of you will have some free time. Right now, just trying to address the programming and design issues.
Deceased
Original Poster
#18 Old 28th Dec 2014 at 6:33 AM
Quote: Originally posted by plasticbox
Regarding graphing, I believe the TS2 approach was quite intelligent -- they'd only show parents and children for each sim (siblings I don't remember) and then a three dots icon for everyone who had more relatives, so you'd click on that and get a new graph. That avoids a lot of spaghetti with those "several kids with several people" scenarios I would think.


I seem to remember I liked the family tree in TS2 as well. If anyone can dig up a screenshot (or two or three) that would be helpful, I no longer have TS2 (in a box somewhere probably).
Deceased
Original Poster
#19 Old 28th Dec 2014 at 6:35 AM
Quote: Originally posted by azoresman
Hi!
On my quick test the data file is always corrupt.
Open on np++ shows zoe Patel only. This was a newly created game save.

Advise please.


Thanks for the testing. Possibly there is an issue with the datafile creation on a new game save, not sure. I'll have to give that a try sometime. If you happen to have a copy of the collection file that got generated please PM it to me.
Deceased
Original Poster
#20 Old 28th Dec 2014 at 7:01 AM
Got a chance to do a little bit of programming before Christmas and a bit more tonight. Updated the download to version 0.9.2. The following changes and additions have been made:
  • The script now sends most output notices to the in-game notification window. As far as I know, this is a first for any script mod! Should be a useful technique as it allows notifications even if the cheat window is not open, so feel free to "steal" the code from the script -- appropriate credit is always appreciated (and honest).
  • The script will default to the "FamilyTree" database, however, this can be changed using an option to the familytree.save command. E.g. familytree.save save game 2 will save using the filenames "Save_Game_2.dat" and "Save_Game_2.xml"
  • The current database name is sent to the executable to use as the default loaded database.
  • The XML database(s) are now stored in the Family Tree Support Files folder within the Mods folder instead of in a subfolder of the user's Documents folder. The database format has not changed, so you can copy your test database to the Family Tree Support Files folder. (The .dat file format has not changed either)
  • The tree view can now be zoomed in and out using the mouse wheel.
  • Clicking on a sim in the tree view will open a new tree view starting from that sim.
  • Added a combobox to the tree viewer to select a style. Currently the only style that exists is the same as before, ancestors to the right side of the tree.
  • Note: I realize (too late) I made the test for too long a collection file too short (10k) during testing and didn't make it larger again, so you'll get a notification the file is getting too big. This should only happen once per game. I need to update the script to send the notification again if the database name gets changed.... duh.
Screenshots
Scholar
#21 Old 1st Jan 2015 at 8:24 AM
There is a "standard" file format for family records called GEDCOM. In TS3 Twallan made a command in Master Controller that generated such a file. By using that standard you can use any geneology program to view the family tree in any way you like it. I used Family Tree Builder from MyHeritage, a stand alone free software. In that way you can concentrate to create the file than to invent the wheel once again.
Deceased
Original Poster
#22 Old 1st Jan 2015 at 8:30 AM
Quote: Originally posted by Morphar
There is a "standard" file format for family records called GEDCOM. In TS3 Twallan made a command in Master Controller that generated such a file. By using that standard you can use any geneology program to view the family tree in any way you like it. I used Family Tree Builder from MyHeritage, a stand alone free software. In that way you can concentrate to create the file than to invent the wheel once again.


I will definitely look into this! Thanks!
Trainee Moderator
staff: trainee moderator
#23 Old 5th Jan 2015 at 7:08 PM
This does not work for me. The game crashes if I enter the cheat 'familytree'.

Catalogue of Custom Neighborhoods for TS2
All Hood Building Group neighborhoods are available here
Want to get rid of EA's sims in neighborhoods? Check out my Clean and Empty Steatlh Hoods and Clean and Empty Neighborhood Templates
My Simblr
Deceased
Original Poster
#24 Old 6th Jan 2015 at 5:24 AM
Quote: Originally posted by Jawusa
This does not work for me. The game crashes if I enter the cheat 'familytree'.


Try running the executable file from Windows Explorer rather than from the cheat console. Does the executable launch properly? If not... well, that still shouldn't cause the game to crash.

Check your main game data folder (one folder up from the Mods folder) and look for a file called lastException.txt. If I can get a copy of the contents of that file it may help track down your issue. You may need to make it crash again to regenerate that file anew if you've played since the crash. You can send me the file in a PM or just put it in this thread and put a spoiler tag around it if it's long.

Thanks!
Instructor
#25 Old 7th Jan 2015 at 1:06 AM Last edited by azoresman : 21st Jan 2015 at 12:11 AM.
Quote: Originally posted by scumbumbo
Thanks for the testing. Possibly there is an issue with the datafile creation on a new game save, not sure. I'll have to give that a try sometime. If you happen to have a copy of the collection file that got generated please PM it to me.


Hi @scumbumbo
Sorry for late response but I had internet problems.
I had to change your code (hope you don't mind) because due to a very big mod of mine (over 3000 files) and Net connection, I'm still on pre Ghosts patch.
So after checking your code, I changed <Is_Ghost> to <IS_Dead>.

I Will now try your update and see how it goes.

If I can give an idea, it would be nice if when selecting the founder father, it showed the descendants and if possible child's of different marriages (or affairs)
On my outdated game version step-family is not yet implemented, but the traits exists and I can assign them. I'm sure it is for a near future expansion (Generations).......
This looks very promising.

Keep up the good work.

Happy 2015.

Edit***

Hi again.
On the pre ghost patch, works as it should.
Now fully patched, going to test very hard on my very large and spread families .
Page 1 of 3
Back to top