How To Restore Basic Objects - SWG-Source/swg-main GitHub Wiki
=============================================================== Original discussion thread text for search result purposes:
SWGSOURCE FORUMS MARK FORUMS READ SEARCH FORUMS SUBSCRIBED FORUMS SUBSCRIBED THREADS NEW THREADS SHOWCASESWG FILESMEMBERSCHAT1 / 10 /
Forums SWG NGE Source Server Development FAQ & Guides How To Restore Basic Objects Discussion in 'FAQ & Guides' started by IrishDarkshadow, Sep 27, 2017.
Subscribe to Thread IrishDarkshadow IrishDarkshadow Well-Known Member Joined:May 18, 2017 Messages:441 Likes Received:131 #1IrishDarkshadow, Sep 27, 2017 As most people are aware it's very difficult to pinpoint and exact point in the life cycle of SWG which matches the point at which our source code currently sits. In a broad sense we know that SWG was shutdown in Dec 2011 and our source code was originally from Apr 2010 leaving us about 18 months short of the final version. This means we are sitting somewhere prior to update 16. However, work has been done to restore objects from within that 18 month gap and so we're not truly at that exact point e.g. Mutated Acklay was added in Nov 2011 yet it's in our current code.
The approach we are currently taking is to restore the tangible objects from that 18 month period first and then do any corresponding server side work. The most basic objects (paintings / furniture items) typically only require two files (tpf = template file) to be added to the server to make them spawnable in game. The technique demonstrated in this thread is one way to recreate the needed tpf files in order to restore those items to the game.
We've been able to run a comparison on the tangible object templates in our server code versus the tangible object templates within the final day SWG client in order to quantify what is actually missing.
The primary count is 877 objects in that final day SWG client that are missing from our server code and those are the current target of our restoration efforts. Some of these objects are more complex than others as they as pieces of a bigger object e.g. ship parts, vehicle parts. It's best to treat those types of object as part of a bigger restoration whereas the simpler objects can be tackled one by one with little worry about additional attachments having to be dealt with. This is the list of missing objects that we are working from (link).
The following posts will provide an overview of the process / technique and then some examples of objects being restored step by step. REPORT BOOKMARKLIKE + QUOTE REPLY IrishDarkshadow IrishDarkshadow Well-Known Member Joined:May 18, 2017 Messages:441 Likes Received:131 #2IrishDarkshadow, Sep 27, 2017 Last edited: Oct 3, 2017 Tools:
Notepad++ [https://notepad-plus-plus.org/download/v7.5.1.html] This is a personal choice situation as you just need a text editor. I find Notepad++ to be superior. SIE 3.7.0.95 [http://www.modthegalaxy.com/forums/thread-sie-3-7?pid=10067] Mod The Galaxy's Sytner has produced this wonderful viewer for SWG files.
Source Code Structure: We need to focus on two specific folders and their compiled counterparts for this process. Objects typically require a server side and a client side file.
The server side file goes into sys.server and the client side file goes into sys.shared. When you run the build script you will see a phase which compiles Java then IFFs then Datatables and finally Object Templates. The files we need for restoring objects are template files (tpf file extension) and when the build script operates on them the output is IFF (interchangeable file format) files.
Those compiled versions are moved to a different folder. The tpf files were added to the dsrc folder then into the appropriate folder hierarchy. If you change the dsrc part of the address to data you will find the compiled versions. That gives us the four locations listed below to deal with:
(1) /dsrc/sku.0/sys.server/compiled/game/object/tangible/ (2) /dsrc/sku.0/sys.shared/compiled/game/object/tangible/
(3) /data/sku.0/sys.server/compiled/game/object/tangible/ (4) /data/sku.0/sys.shared/compiled/game/object/tangible/
Template Files:
sys.server tpf files If we look at a sample object from the source code we can edit the tpf file to see what it contains. We're going to look at this file - /dsrc/sku.0/sys.server/compiled/game/object/tangible/furniture/decorative/cafe_chair.tpf
@base object/tangible/furniture/base/furniture_base.iff @class tangible_object_template 2 @class object_template 3 sharedTemplate = "object/tangible/furniture/decorative/shared_cafe_chair.iff" The key line here is the last one. It points to the compiled version of the client side file. You can tell that by the prefix on the filename (shared_) and the file extension (IFF). For any object we're restoring that final line has to be corrected to point to the client side, compiled version of the object. The thing to work out is what that file is actually called. We can get that filename by using SIE to locate the client side file as the compiled version will be contained within the SWG client structure.
sys.shared tpf files In looking at the matching client side template file you will notice a higher level of complexity. We're going to look at this file - /dsrc/sku.0/sys.shared/compiled/game/object/tangible/furniture/decorative/cafe_chair.tpf
@base object/tangible/furniture/base/shared_furniture_base.iff @class tangible_object_template 6 @class object_template 5 objectName = "frn_n" "cafe_chair" detailedDescription = "frn_d" "cafe_chair" appearanceFilename = "appearance/frn_all_chair_cafe_s02.apt"
The last three lines are where we need to focus our attention. The first two link the object to the name and description it will have when seen in the SWG game client and the final line defines the art asset that will display when the object is spawned into the game.
These values can be found in SIE by editing the file and looking through the nodes as the client side compiled file is already filled out by SOE. This essentially makes the process an exercise in copy and paste.
objectName & detailedDescription have values in two parts. The first part shows the string file being used and the second part shows the entry within that file. You can use the SIE string search to see those files and browse their contents.
This means we can work backwards from this point to actually perform a restoration. Choose the object to restore from the missing items list or the SIE browser Take note of the filename (shared_xyz.iff) Edit the file within SIE Take note of the objectName, detailedDescription and appearanceFilename values Place those values into your blank client side tpf file Edit your server side tpf file to point to the filename of your client side file but ensure the file extension is IFF and not tpf for that entry. Run the build script to compile your files to IFF format Reboot the server Login via the SWG client Spawn the restored object to confirm your work was successful It's actually a relatively easy process to follow and once you've done it a few times it will become like second nature to you. Different object types need different values but the technique is always the same.
Samples For Blank TPFs: Once you know the object you are going to restore you should identify a similar object that was added to the game as near to the end as you can find. This ensures that the values in your template file are the most recent they can be.
SIE can help with this by looking at the tre file in which the object is located and using the numeral in the filename as a starting point e.g. our cafe chair example shows a tre filename of patch_12_00.tre and all the other object of that type in that folder show the same value so it's safe to assume the values inside the file will work for us. In some cases you will find that the IFF file for an object in the final day SWG client will use a specific base object. You need to take that into account when creating the tpf files for those objects. You can read more about that in this guide (link).
Restore Process Recap:
Create a folder structure that mimics that of the source code for the objects you are restoring Make a copy of a similar tpf file for sys.server Edit the tpf to point toward the sys.shared compiled version of the file Use SIE to get the values for the object to be restored Where needed ensure the base object used in the IFF matches your tpf files If the IFF has missing string file entries, use String Search to locate the correct values. Populate the sys.shared tpf file with the values from SIE Put the new tpfs in the appropriate folders Verify using Notepad++ that your EOL (end of line) characters are not Windows format Transfer the folder to your VM Run the build script (building script phase only) Boot up the server Log in with your client In god mode use a spawn command to generate the item you restored REPORT BOOKMARKLIKE + QUOTE REPLY Scytale likes this. IrishDarkshadow IrishDarkshadow Well-Known Member Joined:May 18, 2017 Messages:441 Likes Received:131 #3IrishDarkshadow, Sep 27, 2017 Last edited: Sep 27, 2017 Target: object/tangible/holiday/empire_day/shared_mara_jade_poster.iff
It was added with patch 56. It's a furniture object. object/tangible/painting/shared_painting_pvp_reward_imperial.iff was added in patch 33. We have the server & client side tpf files for that in our source code and can use it as our blank template.
Server side values: @base object/tangible/furniture/base/furniture_base.iff @class tangible_object_template 1 @class object_template 2 sharedTemplate = "object/tangible/painting/shared_painting_pvp_reward_imperial.iff"
Client side values: @base object/tangible/furniture/base/shared_furniture_base.iff @class tangible_object_template 6 @class object_template 5 objectName = "item_n" "painting_pvp_reward_imperial_n" detailedDescription = "item_n" "painting_pvp_reward_imperial_d" appearanceFilename = "appearance/frn_pvp_imperial_painting_s01.apt" Now we need to make copies of these files, rename them and blank out the key lines. The next piece is to get the values we need from SIE. That then gives us this situation.
Server side (object/tangible/holiday/empire_day/mara_jade_poster.tpf): @base object/tangible/furniture/base/furniture_base.iff @class tangible_object_template 1 @class object_template 2 sharedTemplate = "object/tangible/holiday/empire_day/shared_mara_jade_poster.iff"
Client side (object/tangible/holiday/empire_day/shared_mara_jade_poster.tpf): @base object/tangible/furniture/base/shared_furniture_base.iff @class tangible_object_template 6 @class object_template 5 objectName = "item_n" "mara_jade_poster_n" detailedDescription = "item_n" "mara_jade_poster_d" appearanceFilename = "appearance/frn_all_gcw_kiosk_imp_mara_jade_poster.apt" Attached Files: Mara Jade Poster (FIXED).rar File size:1.8 KB Views:2 REPORT BOOKMARKLIKE + QUOTE REPLY Scytale likes this. scubasteve scubasteve Member Joined:Jul 30, 2017 Messages:23 Likes Received:5 #4scubasteve, Sep 30, 2017 Fanfaire 2010 reward hologram "Space Battle" restored screen_Shot0002.jpg Attached Files: dsrc.zip File size:3.5 KB Views:4 REPORT BOOKMARKLIKE + QUOTE REPLY Erusman Erusman Well-Known Member Joined:May 9, 2016 Messages:673 Likes Received:298 #5Erusman, Oct 1, 2017 Ok thanks guys got the mara jade poster and 2010 reward hologram restored to repo. REPORT BOOKMARKLIKE + QUOTE REPLY GreenRegulus GreenRegulus Member Joined:Jun 28, 2017 Messages:14 Likes Received:6 #6GreenRegulus, Oct 2, 2017 Your method is like my initial one but it will give some errors in certain files*(wod paintings). I will upload my guide on the final method on how I've restored all the tpfs today just like I said I would now that I'm back from vacations. REPORT BOOKMARKLIKE + QUOTE REPLY IrishDarkshadow IrishDarkshadow Well-Known Member Joined:May 18, 2017 Messages:441 Likes Received:131 #7IrishDarkshadow, Oct 2, 2017 What sort of errors are you referring to? I used this method to restore two WOD (Witches Of Dathomir) paintings as part of the lesson plan for the restoration training and they both worked absolutely fine with no errors. It is also the foundational method for restoring everything else in the tangible folder...and some things outside of that folder. You are essentially only updating 4 pieces of text to do the tpf restoration on any object of this type, if you are getting errors from that then you are likely copying over incorrect characters from SIE when editing the final day IFF versions of those objects. Watch out for hidden characters and be selective with what you copy / paste from SIE entries as some of them are borked as you can see in the previous examples used in this thread. Those require you to locate the correct string files and value IDs to use for the tpf references to be correct once compiled.
The WOD paintings are no different than an other painting object in the game. The sys.server tpf points to the compiled sys.shared IFF. The sys.shared tof points to the string files for the name and description of the object while the apt file points to the msh which points to the sht which points to dds (the texture for the actual painting. The apt / msh / sht / dds are already present in clientdata on the v3.0 server vm and within the tre files of the v2.9 SWG client. The CRC entries for the objects are also present and matched up in both locations.
Spawn Commands: /object spawn object/tangible/painting/painting_wod_sm_01.iff /object spawn object/tangible/painting/painting_wod_sm_02.iff
The tpfs are attached to this post.
This is what the paintings look like when spawned in game: dR63WmM.jpg 7vmM8v1.jpg
The examine window for each shows you the full detail: JzWqEHw.jpg 4YxFVBs.jpg
If you want me to go over the process with you I can set up a TeamSpeak session for when I'm training up @bandit@bandit and @scubasteve@scubasteve so they can help out with stuff like this going forward in order to ease the pressure on @Erusman@Erusman with end to end restoration efforts. Attached Files: Nightsister Paintings.rar File size:2.4 KB Views:1 REPORT BOOKMARKLIKE + QUOTE REPLY GreenRegulus GreenRegulus Member Joined:Jun 28, 2017 Messages:14 Likes Received:6 #8GreenRegulus, Oct 2, 2017 It's about the item templates. Once I get home in some hours I will make the guide. REPORT BOOKMARKLIKE + QUOTE REPLY IrishDarkshadow IrishDarkshadow Well-Known Member Joined:May 18, 2017 Messages:441 Likes Received:131 #9IrishDarkshadow, Oct 2, 2017 The objects I posted, two of the WOD paintings you referred to, are fully restored here and don't give any errors when compiled, during server load or when spawned.
The template references used in the tpf files are taken from the most recent painting object released by SOE prior to the WOD update. The only painting that operates in a different manner is the Wim Magwit multi-painting and perhaps the stage backdrop collection reward. REPORT BOOKMARKLIKE + QUOTE REPLY GreenRegulus GreenRegulus Member Joined:Jun 28, 2017 Messages:14 Likes Received:6 #10GreenRegulus, Oct 3, 2017 It gave me an error because I choose the same bases as other paintings. Once I used the one that the publish gifts use it worked. REPORT BOOKMARKLIKE + QUOTE REPLY Write your reply...
Write your reply...
Users Who Are Viewing This Thread (Users: 1, Guests: 0) Users Who Have Read This Thread (Total: 0) Share This Page ABOUT US Community for sharing and guides on how to get a SWG Server up and running. Our goal is to allow people to share information freely and publicly and to preserve that information.
QUICK JUMP Home About Forums Downloads USEFUL LINKS Alpha Delta Omega REGULATIONS Forum software by XenForo™ ©2010-2017 XenForo Ltd.
SWGSource Home Help Terms and Rules
===============================================================