Need some libPlasma tools

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Need some libPlasma tools

Postby Chacal » Mon Jun 15, 2009 4:41 pm

I'm writing an automated distribution system for "manual" changes in Uru files.

A good example of such a change is "Snow fall in your Age" by Andy Legate or my own "Opening up new places in A'egura". As you can see, adding those changes involves a lot of manual operations, which is time-consuming and fraught with peril for the casual user, and cannot be rolled back easily.

This system lets a user install and remove a change by double-clicking an icon.
The system lets a developer "package" his change in a standard format that the installer script understands.

In order to better implement this system I desperately need three utilities (but I'm too stupid to write utilities using libPlasma and I don't have a C++ compiler):

Tool 1- a more granular prdcd which would export a specific object instead of the whole prp.
Something like "prcdc [options] filename [plKey Name] [plKey Type]"
Example:
To export the plSceneObject named "Lamp2" from file tutorial01_District_mainRoom.prp:
Code: Select all
prcdc -o D:\Uru\project1\Lamp2.prc D:\Uru\dat\tutorial01_District_mainRoom.prp Lamp2 plSceneObject


Tool 2- an object importer (similar to the import function in PrpExplorer).
Something like "prcimport [options] prpfilename prcfilename"
Example:
To import the object from Lamp2.prc into tutorial01_District_mainRoom.prp:
Code: Select all
prcimport D:\Uru\dat\tutorial01_District_mainRoom.prp D:\Uru\project1\Lamp2.prc

Ideally, this would also add the object to the plSceneNode when needed.

Tool 3- an object remover (similar to the delete function in PrpExplorer). This could be a stand-alone utility, or a command-line option for another utility such as prcimport.

Something like "prpdel filename [plKey Name] [plKey Type]"
Example:
To delete the plSceneObject named "Lamp2" from file tutorial01_District_mainRoom.prp:
Code: Select all
prpdel D:\Uru\dat\tutorial01_District_mainRoom.prp Lamp2 plSceneObject

Ideally, this would also delete the object from the plSceneNode when needed.

Currently I do these operations using the convoluted process of:
- Unpacking the whole prp into .po files using PrpPack;
- Decompiling some objects using PrcDc;
- Adding, removing and modifying those objects;
- Recompiling those objects using Prcc;
- Packing the whole prp again from the .po files using PrpPack.

There are four problems with this process:
1- It is very CPU and I/O intensive, so it can get very long, especially on a slow computer. While the delay is acceptable for the enthusiast user, it is not for the casual user who just wants to try a distributed change. It doesn't seem logical to have the CPU work for 10 minutes just for inserting a small object into a prp.
2- It generates lots of temporary files that must be cleaned up, and uses up large amounts of disk space, which can bring problems if the disk is near full.
3- It is risky. What if something goes wrong during the long process of repacking? To alleviate this risk I have to add a rollback system, which means making a backup of the user's prp file, which brings us back to problem 2.
4- It is lossy, or so I'm told. Unpacking and repacking loss-compressed textures leads to more degradation. Nothing I can do for that.

I would like to ask the current libPlasma gurus (Zrax, Paradox, Nadnerb, Lonthav, or any other) if you would be interested in developing those utilities and adding them to the current libPlasma tools. It seems to me those tools would also be helpful to all Uru hackers such as GPNMilano, diafero, Race, etc, for their current activities.

Anyone interested?
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2508
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Re: Need some libPlasma tools

Postby Zrax » Mon Jun 15, 2009 5:53 pm

It seems to me that the three tools you propose would make more sense as a single tool with multiple operations, specifically for modifying the contents of a PRP file from the command line. I have no problem creating such a tool, and doing so shouldn't be too hard; however, at the moment my server is dead, and I'll have to fix it before I can do much work on this (as the server is where the libPlasma repository is located).

EDIT: Server is up again... See the post in PyPRP for details
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Need some libPlasma tools

Postby Chacal » Mon Jun 15, 2009 7:53 pm

Hi Zrax, welcome back to you (and you server...).
You are quite right, those could all be combined in a "PrpModify" tool, with options such as import, export, delete, etc.
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2508
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Re: Need some libPlasma tools

Postby D'Lanor » Mon Jun 15, 2009 9:24 pm

Chacal wrote:4- It is lossy, or so I'm told. Unpacking and repacking loss-compressed textures leads to more degradation. Nothing I can do for that.

:shock: I should hope that only the decompiling and recompiling of textures is lossy. Unpacking and repacking should leave the raw prp objects intact.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Need some libPlasma tools

Postby Zrax » Tue Jun 16, 2009 12:18 am

Yes, the actual unpacking and repacking is lossless... It's only when you recompile (or modify, e.g. in PageEditor) a DrawableSpans or texture object that you risk losing accuracy.
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Need some libPlasma tools

Postby diafero » Tue Jun 16, 2009 3:56 am

However, speaking of PageEditor, it does also seem to do that recompiling of DrawableSpans when I edit a completely different object.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Need some libPlasma tools

Postby Zrax » Mon Jun 22, 2009 1:26 pm

diafero wrote:However, speaking of PageEditor, it does also seem to do that recompiling of DrawableSpans when I edit a completely different object.


Hmm, yes it does... The way that PageEditor (and most libPlasma tools, for that matter, excluding PrpPack) works is to let the ResManager do all the work, and rebuild the entire PRP when you save it. I'll have to change the way the GBufferGroup deals with compressed verts, so it can avoid recompressing the buffer if it hasn't been modified, and that should fix this recompression issue.

On the original topic, I've added a "prpmod" tool now, which supports 3 actions: add, del, extract which work on both PRC and raw objects (see --help for details). I also added the single-object extraction support to prpdc, which uses the same syntax as prpmod extract, so either can be used for this purpose now. The tool is available both in the Linux source and the Windows distribution on the release thread now. Enjoy :)
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Need some libPlasma tools

Postby Chacal » Mon Jun 22, 2009 11:12 pm

Awesome!
I'll be all over it when I get back home on Thursday.
Thanks Zrax!
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2508
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Re: Need some libPlasma tools

Postby diafero » Tue Jun 23, 2009 4:21 am

Wow, and I just discovered you added a "prp-fuse"... so that I can actually mount a prp file as file system :o :shock: . If I see it correctly it is currently just a listing and all files are empty, but it is a neat idea anyway :D
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Need some libPlasma tools

Postby Zrax » Tue Jun 23, 2009 11:41 am

diafero wrote:Wow, and I just discovered you added a "prp-fuse"... so that I can actually mount a prp file as file system :o :shock: . If I see it correctly it is currently just a listing and all files are empty, but it is a neat idea anyway :D


The functions to read/write the files aren't implemented yet... This was just a sort of toy project, but since you're the second person to appear interested in it, I'm pretty sure I'll see it to completion ;)
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Next

Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron