Console Platform Support

magique

Active member
I decided to give this new version a try on the Wii U console because I still have one project I'd like to publish there. However, when it ran the project on Wii U I got a fault with something like invalid generic parameters. I'll post the specific error later, but I was wondering if anyone else had tried on an AOT platform or mobile?
 
I've tested against WebGL and Android which are AOT. What error are you getting?
 
Unhandled Exception: System.ArgumentException: Invalid generic arguments
Parameter name: method
at (wrapper managed-to-native) System.Type:MakeGenericType (System.Type,System.Type[])
at System.Type.MakeGenericType (System.Type[] typeArguments) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.Preset.Initialize (System.Object obj, MemberVisibility visibility) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.State.Initialize (IStateOwner owner, System.Collections.Generic.Dictionary`2 nameStateMap) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.StateManager.InitializeInternal (UnityEngine.GameObject gameObject, IStateOwner owner, Opsive.UltimateCharacterController.StateSystem.State[] states) [0x00000] in <filename unknown>:0
 
- What API Compatibility Level?
- What version of Unity are you using?
- What is the platform symbol for Wii U? Is it UNITY_WII?

Based on those errors I would expect the presets to be using the standard BaseDelegate rather than the templated BaseDelegate (line 141 in preset.cs instead of 143).
 
API Compatibility Level is WiiU Subset.
Unity version is 5.6.5p3
Platform symbol is UNITY_WIIU
 
Now I'm getting a ton of errors like the following:

ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) <Module>:invoke_Vector2__this__ ()' while running with --aot-only.
at Opsive.UltimateCharacterController.StateSystem.Preset+GenericDelegate`1[UnityEngine.Vector2].UpdateValue () [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.Preset+GenericDelegate`1[UnityEngine.Vector2].Initialize (System.Object obj, System.Reflection.PropertyInfo property, MemberVisibility visibility) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.Preset.Initialize (System.Object obj, MemberVisibility visibility) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.State.Initialize (IStateOwner owner, System.Collections.Generic.Dictionary`2 nameStateMap) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.StateManager.InitializeInternal (UnityEngine.GameObject gameObject, IStateOwner owner, Opsive.UltimateCharacterController.StateSystem.State[] states) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.StateManager.Initialize (UnityEngine.GameObject gameObject, IStateOwner owner, Opsive.UltimateCharacterController.StateSystem.State[] states) [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.StateSystem.StateBehavior.Awake () [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.Input.PlayerInput.Awake () [0x00000] in <filename unknown>:0
at Opsive.UltimateCharacterController.Input.UnityInput.Awake () [0x00000] in <filename unknown>:0
 
I did a search for UNITY_WII and added UNITY_WIIU as you suggested. It definitely included the AOTLinker scripts.
 
That error unfortunately doesn't say too much. Is there a way that I can remotely connect to your machine to debug it?
 
No, that wouldn't be possible. The errors occur when running on Wii U only and that is connected to my dev machine via local network connection only.
 
Can you output more debug info? Does AOTLinker.Linker get executed? This is extremely tough to debug without being able to reproduce it.

As a test you can put a true anywhere there is a UNITY_WII symbol to ensure that code gets run. For example:

Code:
UNITY_WII
to:
Code:
UNITY_WII || true

The errors that you are seeing directly relate to the AOTLinker not generating the delegate.
 
Ugh.. I was hoping that would do it. I'm unsure how to debug it from here without being able to reproduce it - can you get the same errors to occur on any other platform?
 
Unfortunately I don't know what to say - let me know if you are able to debug it. I saw somebody get it working on the Playstation dev kit (though there were some other errors, but at least it would run), and I know that it works on WebGL, Android, and iOS which are AOT so I don't know why WiiU is different.
 
Last edited:
Sounds good - the reason the AOTLinker class exists is to explicitly prevent these JIT errors on AOT platforms. The AOTLinker.Linker method contains delegates each type so the compiler will generate the types ahead of time. The error that you are getting specifically relates to a Vector2 type not being generated... but it should have been generated with the genericVector2Delegate on line 28 of AOTLinker.

It may be worth sending to Unity to see if there are any gotchas with WiiU. If you want I could create a small test scene that reproduces this and I could get in contact with Unity to see if they are able to help .
 
Top