Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

CTFAK crashes when the game is too bloaty and has too many objects #102

Open
Utoog opened this issue May 24, 2024 · 5 comments
Open

CTFAK crashes when the game is too bloaty and has too many objects #102

Utoog opened this issue May 24, 2024 · 5 comments

Comments

@Utoog
Copy link

Utoog commented May 24, 2024

One of the games has a really poor optimization choices and has TOO MANY objects. (there are thousands of backdrops in single frame)
Here's the log
Selected tool: Export as MFA. Executing
[00:55:57:00] Reading Fonts
[00:55:57:01] Reading Sounds
[00:55:57:01] Reading Music
[00:55:57:01] Reading Icons
[00:55:57:08] Reading Images
[00:55:57:09] Reading MFA Chunk 33 (Frame Virtual Rect)
[00:55:57:09] Reading MFA Chunk 37 (Layer Shader Settings)
[00:55:57:09] Reading MFA Chunk 40 (Frame Shader Settings)
[00:55:57:10] Reading MFA Chunk 39 (Frame Movement Timer)
[00:55:57:19] No icon found for DirectShow
[00:55:57:20] No icon found for Platform
[00:55:57:20] No icon found for Platform
[00:55:57:24] Preparing to translate 10 frames
[00:55:57:25] Translating frame [censored] - 0
[00:55:57:25] Translating frame [censored] - 1
[00:55:57:25] Translating frame [censored] - 2
[00:55:57:25] Translating frame [censored] - 3
[00:55:57:25] Translating frame [censored] - 4
[00:55:57:25] Translating frame [censored] - 5
[00:55:57:25] Translating frame [censored] - 6
[00:55:57:25] Translating frame [censored] - 7
[00:55:57:25] Translating frame [censored] - 8
[00:55:57:26] Translating frame [censored] - 9
[00:55:57:39] System.AggregateException: One or more errors occurred. (Index was outside the bounds of the array.)
---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at CTFAK.Core.Utils.ImageTranslator.AndroidMode3ToRGBA(Byte[] imageData, Int32 width, Int32 height, Boolean alpha) in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\Utils\ImageTranslator.cs:line 286
at CTFAK.Core.CCN.Chunks.Banks.ImageBank.FusionImage.PrepareForMfa() in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\CCN\Chunks\Banks\ImageBank\FusionImage.cs:line 415
at CTFAK.Core.CCN.Chunks.Banks.ImageBank.FusionImage.WriteNew(ByteWriter writer) in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\CCN\Chunks\Banks\ImageBank\FusionImage.cs:line 362
at CTFAK.MMFParser.MFA.Loaders.AGMIBank.<>c__DisplayClass11_0.b__0() in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\MFA\AGMIBank.cs:line 62
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at CTFAK.MMFParser.MFA.Loaders.AGMIBank.Write(ByteWriter writer) in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\MFA\AGMIBank.cs:line 69
at CTFAK.MFA.MFAData.Write(ByteWriter Writer) in D:\a\CTFAK2.0\CTFAK2.0\Core\CTFAK.Core\MFA\MFAData.cs:line 189
at CTFAK.Tools.FTDecompile.Execute(IFileReader reader) in D:\a\CTFAK2.0\CTFAK2.0\Plugins\CTFAK.Decompiler\FTDecompile.cs:line 608
at Program.Main(String[] args) in D:\a\CTFAK2.0\CTFAK2.0\Interface\CTFAK.Cli\Program.cs:line 233

@Utoog
Copy link
Author

Utoog commented May 24, 2024

not sure why the program chooses to use android mode 3 graphic mode even though its a windows executable

@Utoog
Copy link
Author

Utoog commented May 24, 2024

i found original project and there was a frame which contained 9k copies of the same active object and when i deleted all of them, it decompiled succesfuly. also theres a problem with 256 color (maybe not only 256) exported EXEs: they are assumed to be 16 million and their color palette screws up.

@1987kostya
Copy link
Contributor

indexed color modes are not supported. Color mode 3 is used for both indexed colors on windows and 15 bit colors on android. not sure how i never noticed that before. try using NebulaFD instead, it might have support for that color mode

@AITYunivers
Copy link
Member

Nebula does, yeah. Added it when I started adding KNP support.

@Utoog
Copy link
Author

Utoog commented May 25, 2024

Nebula did it, thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants