JsonAsAsset / JsonAsAsset

Unreal Engine plugin to allow conversion between JSON to Unreal Engine.
MIT License
135 stars 24 forks source link

[BUG] Crashes upon import in 5.2 #29

Closed Kein closed 9 months ago

Kein commented 1 year ago

Using Robocop: Rogue City demo as a base and current master branch

  1. I've dumped and compiled SDK successfully.
  2. JsonAsAsset setup successfully
  3. Attempt to import DT with bunch of references crashes editor.

Crash log:

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Legendary\Games\UE_5.2\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 752] Array index out of bounds: 0 from an array of size 0

UnrealEditor_JsonAsAsset!FAssetUtilities::ConstructAsset<UObject>() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Utilities\AssetUtilities.cpp:220]
UnrealEditor_JsonAsAsset!IImporter::DownloadWrapper<UObject>() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Importers\Importer.cpp:76]
UnrealEditor_JsonAsAsset!IImporter::LoadObject<UObject>() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Importers\Importer.cpp:160]
UnrealEditor_JsonAsAsset!UPropertySerializer::DeserializePropertyValueInner() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Utilities\PropertyUtilities.cpp:210]
UnrealEditor_JsonAsAsset!UPropertySerializer::DeserializePropertyValue() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Utilities\PropertyUtilities.cpp:121]
UnrealEditor_JsonAsAsset!FFallbackStructSerializer::Deserialize() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Utilities\PropertyUtilities.cpp:69]
UnrealEditor_JsonAsAsset!UPropertySerializer::DeserializeStruct() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Utilities\PropertyUtilities.cpp:493]
UnrealEditor_JsonAsAsset!UDataTableImporter::ImportData() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Importers\DataTableImporter.cpp:43]
UnrealEditor_JsonAsAsset!IImporter::HandleExports() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Importers\Importer.cpp:318]
UnrealEditor_JsonAsAsset!IImporter::ImportReference() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\Importers\Importer.cpp:218]
UnrealEditor_JsonAsAsset!FJsonAsAssetModule::PluginButtonClicked() [D:\Unreal\5.2\Game\Plugins\JsonAsAsset\Source\JsonAsAsset\Private\JsonAsAsset.cpp:268]
UnrealEditor_JsonAsAsset!TBaseRawMethodDelegateInstance<0,FJsonAsAssetModule,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\Legendary\Games\UE_5.2\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:424]
UnrealEditor_Slate

JASAPI log:

[CORE] Initializing globals, and provider..
[Provider] Found config folder: D:\Unreal\5.2\Game\Config
[UserSettings] Mappings: D:/Unreal/_Mappings_/RoboCop-Win64-Shipping.usmap
[UserSettings] Archive Directory: D:/Steam/steamapps/common/Robocop Rogue City Demo/Game/Content/Paks
[UserSettings] Unreal Versioning: GAME_UE5_2
[CORE] Initialized provider successfully
[CORE] Running API...
[CREDITS] Created by Tector and GMatrix, thank you for using! :)
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:1500
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: D:\Legendary\Games\UE_5.2\Engine\Binaries\Win64\
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:1500/api/v1/export?raw=true&path=/Game/Blueprints/Abstract/Curves/HUDShootSmall_Curve.HUDShootSmall_Curve - 0
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'JsonAsAssetAPI.Controllers.JsonAsAssetController.Get (JsonAsAssetAPI)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
      Route matched with {action = "Get", controller = "JsonAsAsset"}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Get(Boolean, System.String) on controller JsonAsAssetAPI.Controllers.JsonAsAssetController (JsonAsAssetAPI).
info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1]
      Executing ConflictObjectResult, writing value of type '<>f__AnonymousType3`2[[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
      Executed action JsonAsAssetAPI.Controllers.JsonAsAssetController.Get (JsonAsAssetAPI) in 264.8247ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'JsonAsAssetAPI.Controllers.JsonAsAssetController.Get (JsonAsAssetAPI)'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET http://localhost:1500/api/v1/export?raw=true&path=/Game/Blueprints/Abstract/Curves/HUDShootSmall_Curve.HUDShootSmall_Curve - 0 - 409 - application/json;+charset=utf-8 306.8027ms
OngAnker commented 11 months ago

this only works on Fortnite.

Kein commented 11 months ago

Haha what

OngAnker commented 11 months ago

JsonAsAsset only works on Fortnite. It will not work on RoboCop you idiot.

Kein commented 11 months ago

JsonAsAsset only works on Fortnite.

"LOL", said scorpion, "LMAO even".

GMatrixGames commented 11 months ago

JsonAsAsset only works on Fortnite. It will not work on RoboCop you idiot.

It's a data table you idiot. Only materials and material functions are exclusive to Fortnite

Tectors commented 11 months ago

Have you setup the Data Table class in C++? What is the name? Can we see it? Provide more context and description and a sample of the file, we can't help you otherwise.

Kein commented 11 months ago

Have you setup the Data Table class in C++?

It is mentioned in my opening post.

Name of what would you like? And what sample file do you need? You want me to upload DT asset and share on GH? You sure this is a good idea for the repo well-being given the publisher name?

I can share JSON data itself, probably? DT_FPPRifleSettings.json

Tectors commented 11 months ago

Have you setup the Data Table class in C++?

It is mentioned in my opening post.

Name of what would you like? And what sample file do you need? You want me to upload DT asset and share on GH? You sure this is a good idea for the repo well-being given the publisher name?

I can share JSON data itself, probably? DT_FPPRifleSettings.json

Man, I'm trying to help you, not trying to start a stupid fight. I was simply asking just to clarify some details.

I'll take a look at the JSON file once I get home to see what could be causing issues, so don't worry.

Tectors commented 11 months ago

Have you setup the Data Table class in C++?

It is mentioned in my opening post.

Name of what would you like? And what sample file do you need? You want me to upload DT asset and share on GH? You sure this is a good idea for the repo well-being given the publisher name?

I can share JSON data itself, probably? DT_FPPRifleSettings.json

Looking at the code it seems to be that your Local Fetch API seems to be not responding to plugin, recheck your settings and try again.

Kein commented 11 months ago

it seems to be that your Local Fetch API seems to be not responding to plugin,

Elaborate what does that mean, it clearly sent and received response and crashed on that reponse.

Tectors commented 11 months ago

If you take a look at the line of code it crashed on, it gets "jsonOutput" from the response of the api, which it crashes while doing so. Leading to the conclusion that the API responded a invalid request.

Kein commented 11 months ago

Okay and how I'm supposed to fix it? I see in the TCP trace that there is an exchange:

image

Kein commented 11 months ago

Here are the settings for posterity:

[/Script/JsonAsAsset.JsonAsAssetSettings]
ExportDirectory=(Path="D:/Programs/Fmodel/Output/Exports")
bAllowPackageSaving=True
bSkipResultNodeConnection=True
bEnableLocalFetch=True
UnrealVersion=GAME_UE5_2
MappingFilePath=(FilePath="D:/Unreal/_Mappings_/RoboCop-Win64-Shipping.usmap")
ArchiveDirectory=(Path="e:/Steam/steamapps/common/Robocop/Game/Content/Paks")
bChangeURL=True
Url="http://127.0.0.1:1500"

I also can send and receive response from 127.0.0.1:1500 when it is being listened to.

Kein commented 9 months ago

In what way it is fixed?

GMatrixGames commented 9 months ago

There has been no usable information provided to work towards a fix. So it has been closed until such info is provided.

Kein commented 9 months ago

What information do you possibly need? I gave you name of the game, all the configuration data and described the issue. Am *I* supposed to know what is missing when the tool does not work as described?

GMatrixGames commented 9 months ago

I don't appreciate you being rude. Considering it's an isolated issue as it has been reported by no-one else, and it's unreproducible by either me or Tector, you would need to debug it yourself to find where exactly the issue lies. Considering you have said that the API functions properly separately, it leads me to believe it's related to your local firewall, but I've never seen it cause a disconnect between programs.

Kein commented 9 months ago

Windows Firewall never blocks locahost connections, nor outgoing, nor ingoing. This kind of rule has to be explicitly added and it is non-trivial. Taking into account the fact all other tools and apps that use localhost work just fine - this is not an issue of the firewall.

More than that, in the screenshot of the TCP trace above you clearly can see UnrealEditor.exe and JsonAsAsset.exe exchanged 213-262 bytes of data successfully. So the connection worked.

GMatrixGames commented 9 months ago

So again, you need to debug it yourself to find exactly where the issue lies, as you said yourself there is a connection made. If you could provide an updated crash log with the latest plugin, I'll take a final look over.

Kein commented 6 months ago

I've tested latest version on 5.3.0 - STILL the same issue is observed (on a simple CurveTable)