tge-was-taken / amicitia Goto Github PK
View Code? Open in Web Editor NEWEditor for file formats used in Atlus' Persona games
Editor for file formats used in Atlus' Persona games
I'm not a C# developer, but I hacked together a feature that allows to open multiple TMX files at once, and then export them all as PNG
The gist of it is:
private void ExportAllTMXAsPNGToolStripMenuItemClickEventHandler(object sender, EventArgs e)
{
Console.WriteLine("Starting mass export as PNG.");
foreach (TreeNode node in mainTreeView.Nodes)
{
var resWrap = node as IResourceWrapper;
if (resWrap.Resource is ITextureFile)
{
// this is extremely lazy but I forgive you
var path = openToolStripMenuItem.DropDownItems[openToolStripMenuItem.DropDownItems.Count - 1].Text;
var lastSlashPosition = path.LastIndexOf('\\') + 1;
path = path.Substring(0, lastSlashPosition) + node.Text.Replace(".tmx", ".png");
//path = path.Replace(".tmx", ".png");
Console.WriteLine("Writing file {0}", path);
((ITextureFile)resWrap.Resource).GetBitmap().Save(path, ImageFormat.Png);
}
else
{
Console.WriteLine("Skipping a non-texture node: {0}", node.Text);
}
}
Console.WriteLine("Mass export as PNG finished.");
}
Is there any use in submitting a formal PR? I don't have the files committed yet.
Also, the main issue is memory leaking and the fact that amicitialibrary is 32 bit, therefore things start crashing after about 40 4MB TMX files, when the app reaches cca 1.7GB memory usage. I don't know how to fix that myself, I couldn't convert it to .NET 4.7 or newer myself.
Hi, I just found this bug. Amicitia doesn't save correctly this file for some reason. This is the only one that I'm aware of, but maybe there are others. It's from Persona 4, and it's inside the "PACK" folder.
Hello, when I save a modified SPR, the program crashes and show the error "The process didn't have access to the file because are used from another process"
The log
************* Texto de la excepción **************
System.IO.IOException: El proceso no puede obtener acceso al archivo 'C:\Users\Darkmet\Desktop\Build\FISHING.BIN' porque está siendo utilizado en otro proceso.
en System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
en System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
en System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
en AtlusFileSystemLibrary.Common.IO.FileUtils.Create(String path)
en AtlusFileSystemLibrary.FileSystems.PAK.PAKFileSystem.Save(String outPath)
en Amicitia.ResourceWrappers.PAKFileSystemWrapper.<>c.<Initialize>b__3_0(PAKFileSystem res, String path)
en Amicitia.ResourceWrappers.ResourceWrapper`1.Export(String path, SupportedFileType type)
en Amicitia.MainForm.SaveToolStripMenuItemClickEventHandler(Object sender, EventArgs e)
en System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
en System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
en System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
en System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
en System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
en System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
en System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
en System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
en System.Windows.Forms.ToolStrip.WndProc(Message& m)
en System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Ensamblados cargados **************
mscorlib
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3110.0 built by: NET472REL1LAST_C
Código base: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Amicitia
Versión del ensamblado: 1.8.1.0
Versión Win32: 1.8.1.0
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/Amicitia.exe
----------------------------------------
System.Windows.Forms
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3110.0 built by: NET472REL1LAST_C
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
OpenTK.GLControl
Versión del ensamblado: 3.0.0.0
Versión Win32: 3.0.0
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/OpenTK.GLControl.DLL
----------------------------------------
OpenTK
Versión del ensamblado: 3.0.0.0
Versión Win32: 3.0.0
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/OpenTK.DLL
----------------------------------------
System.Windows.Forms.resources
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
mscorlib.resources
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_es_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
AtlusFileSystemLibrary
Versión del ensamblado: 1.0.0.0
Versión Win32: 1.0.0.0
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/AtlusFileSystemLibrary.DLL
----------------------------------------
AmicitiaLibrary
Versión del ensamblado: 1.8.1.0
Versión Win32: 1.8.1.0
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/AmicitiaLibrary.DLL
----------------------------------------
System.Numerics
Versión del ensamblado: 4.0.0.0
Versión Win32: 4.7.3056.0 built by: NET472REL1
Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
AssimpNet
Versión del ensamblado: 3.3.1.0
Versión Win32: 3.3.1
Código base: file:///C:/Users/Darkmet/Desktop/Build/Ami/AssimpNet.DLL
----------------------------------------
************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada
Por ejemplo:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.
But with an older version (1.6 for example) works.
Thanks for all.
I'd like to fix some small problems I've got with P4D mainly the scratch notes being pretty hard to see at times. I thought this could open the SPR4 file I assume the files are contained in but unfortunately this cannot open them.
I'd love to see support for these files being added into this.
Thanks.
Hi,
Thank you for this awesome tool. However it seems that it doesn't support certain TMX and BIN files from PS Vita Persona 4 Golden. Bustup Bins and card TMX for example doesn't work.
Does Amicitia support those files and I'm doing something wrong?
Is there another tool that supports those files?
Thanks for advance.
If you open a PAC and rename the files, when you save the file. It doesnt save the changed filenames, opening it up in a hex editor shows that there were no changes made.
So, I wanted to integrate this new menu for a possible french translation, and this is what the editor shows me
here is the full message :
Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.
************** Texte de l'exception **************
System.IndexOutOfRangeException: L'index se trouve en dehors des limites du tableau.
à AmicitiaLibrary.PS2.Graphics.PS2PixelFormatHelper.WritePSMT4(BinaryWriter writer, Int32 width, Int32 height, Byte[] indicesArray) dans D:\dev\Amicitia\Source\AmicitiaLibrary\PS2\Graphics\PS2PixelFormatHelper.cs:ligne 443
à AmicitiaLibrary.PS2.Graphics.PS2PixelFormatHelper.WritePixelData[T](PS2PixelFormat fmt, BinaryWriter writer, Int32 width, Int32 height, T[] array) dans D:\dev\Amicitia\Source\AmicitiaLibrary\PS2\Graphics\PS2PixelFormatHelper.cs:ligne 471
à AmicitiaLibrary.Graphics.TMX.TmxFile.WritePixels(BinaryWriter writer) dans D:\dev\Amicitia\Source\AmicitiaLibrary\Graphics\TMX\TMXFile.cs:ligne 451
à AmicitiaLibrary.Graphics.TMX.TmxFile.Write(BinaryWriter writer) dans D:\dev\Amicitia\Source\AmicitiaLibrary\Graphics\TMX\TMXFile.cs:ligne 310
à AmicitiaLibrary.Graphics.SPR.SprFile.Write(BinaryWriter writer) dans D:\dev\Amicitia\Source\AmicitiaLibrary\Graphics\SPR\SPRFile.cs:ligne 206
à AmicitiaLibrary.IO.BinaryBase.Save(Stream stream, Boolean leaveOpen) dans D:\dev\Amicitia\Source\AmicitiaLibrary\IO\BinaryBase.cs:ligne 41
à AmicitiaLibrary.IO.BinaryBase.GetMemoryStream() dans D:\dev\Amicitia\Source\AmicitiaLibrary\IO\BinaryBase.cs:ligne 61
à Amicitia.SupportedFileManager.<>c.<.cctor>b__2_23(Object o) dans D:\dev\Amicitia\Source\Amicitia\SupportedFileManager.cs:ligne 62
à Amicitia.SupportedFileInfo.GetStreamWrapper(Func2 getStream, Object obj) dans D:\dev\Amicitia\Source\Amicitia\SupportedFileInfo.cs:ligne 58 à Amicitia.SupportedFileInfo.<>c__DisplayClass7_0.<.ctor>b__0(Object o) dans D:\dev\Amicitia\Source\Amicitia\SupportedFileInfo.cs:ligne 24 à Amicitia.ResourceWrappers.ResourceWrapper
1.GetResourceMemoryStream() dans D:\dev\Amicitia\Source\Amicitia\ResourceWrappers\ResourceWrapper.cs:ligne 162
à Amicitia.ResourceWrappers.PAKFileSystemWrapper.b__3_2(ResourceWrapper1 wrap) dans D:\dev\Amicitia\Source\Amicitia\ResourceWrappers\PAKFileSystemWrapper.cs:ligne 40 à Amicitia.ResourceWrappers.ResourceWrapper
1.RebuildResource() dans D:\dev\Amicitia\Source\Amicitia\ResourceWrappers\ResourceWrapper.cs:ligne 657
à Amicitia.ResourceWrappers.ResourceWrapper`1.Export(String path, SupportedFileType type) dans D:\dev\Amicitia\Source\Amicitia\ResourceWrappers\ResourceWrapper.cs:ligne 286
à Amicitia.MainForm.SaveToolStripMenuItemClickEventHandler(Object sender, EventArgs e) dans D:\dev\Amicitia\Source\Amicitia\MainForm.cs:ligne 238
à System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
à System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
à System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
à System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
à System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
à System.Windows.Forms.ToolStrip.WndProc(Message& m)
à System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.
Par exemple :
Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
When using Amicitia to mess with the OffsetX, OffsetY, and Coordinate values in spr files found in P4G PC (haven't tested other games spr files), the values don't change after saving. I end up having to manually open it with a hex editor and change the values there.
Please add the .TPC file extension to the list of recognized Atlus Archive Files, as games like Persona Q2 use them quite often, and Amicitia can open these files just fine, but only after the file has been renamed to a .PAC or .BIN file.
.bed files are containers for multiple file types in P4G. Requesting open/export/import functionality
Save and Save As appear to have no effect on any RMD or RMD within a PAC if animation files are added. Was not an issue in earlier (unknown which version in particular) instances of the program
Theres some file containers that have plain .DDS inside them, despite Amicitia's ability to display P5 ui textures in .SPD that are presumed to be .DDS, it cannot display files that outright named with the .DDS extention.
Helps the compiler guess the right format.
Examples:
in Persona 5's tittlle.pak
p5tittlle_01.spd > Textures
Texture 00 [ps3_tittle_01] is viewable in the program
Texture 01 [ps3_tittle_02] is not viewable, but can be exported as DDS and can be viewable in another program (like photoshop)
in Persona 5's ps3.cpk and ps4.cpk
font > chat > chat.pac > chat.spd > Textures
Texture 00 [chat] does not display the full texture. When exported as PNG, what you see is what is exported, however exporting as DDS reveals there is actually more to the file than there is viewable in Amicitia.
Currently, P4G materials are manually edited via text in the mds for models post-conversion. If they could instead be extracted directly from the original gmo, then imported to the new, we could edit the texture it is calling and be 100% sure that the material we are editing is one the game will read correctly. Dont know if it is possible to view this data within model_data
Some possible conversions:
TMX -> PNG
RMD -> DAE
PAK/PAC/BIN -> extract files
title, sprites won't preview or export properly when looking through ps4 files.
Importing a PNG file directly to replace a TMX file results in artifacting on the edges of certain transparent parts of a texture.
As an example, I decided to export c_help02
in data00004\init_free.bin
from P4G. This file contains the textures for the Xbox user interface.
I then immediately imported the exported PNG and had it replace the TMX it was just exported from. Despite making zero edits myself, once this had been compiled in game there was heavy artifacting on the edges of the textures:
The only alternative I can find to this is exporting the PNG as a TGA, manually converting that to a TMX file using BE0605.exe,and then importing the file into Amicitia, and even that is an imperfect process.
Method ScaleFullRangeAlphaToHalfRange
is not used when replacing TMX.
I added the patch disable exist.tbl check to my patch.yml file and whenever I try to patch the eboot it says "Error: Invalid patch YAML.
Exception message:
(Line: 258, Col: 29, Idx: 10499) - (Line: 258, Col: 46, Idx: 10516): While scanning an anchor or alias, did not find expected alphabetic or numeric character" I cant take off this patch as it fixes a softlock issue on ps3 hardware. I uploaded my patch.yml as a txt if its needed.
patch.yml.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.