Search code examples
actionscript-3flash3dairunreal-engine4

Passing variables to UnrealEngine from an .swf (and vice versa)


I'm working on a project along with 3D developers. I'm an Actionscript developer doing the front end (2D) controls for a 3D game.

  • The 3D game is on one screen and the 2D controls are on another
  • Both the 3D game and the 2D controls are running locally on the same machine
  • The 2D controls are in an Air application on a touch screen while the 3D game is in Unreal Engine on a bigger, non-touch screen

The 3D developers are working on the game itself in UE4's blueprint 'visual coding' thing.

How can I pass variables back and forth between the .swf and the Unreal game?

Thanks in advance.


Solution

  • There're several possibilities.

    • FileStream. You simply write to the file while UE reads this file and vice versa.
    • NativeProcess. In this case you can read and write to standart input/output.
    • ServerSocket. This is the most preferable way. Your AIR application will act as a server while a game will connect to it. You simply pass TCP messages back and forth. You can use JSON or Protobuf for messages encoding.