Menu

DTI does not exist in the correct context?

Anonymous
2013-06-04
2014-10-28
  • Anonymous

    Anonymous - 2013-06-04

    Downloaded the latest git repo and getting the following compile errors in the Detonation.cs file

    Assets/DISUnity/PDU/Warfare/Detonation.cs(317,21): error CS0103: The name DTI' does not exist in the current context Assets/DISUnity/PDU/Warfare/Detonation.cs(334,38): error CS0103: The nameExpendableDescriptor' does not exist in the current context
    Assets/DISUnity/PDU/Warfare/Detonation.cs(337,42): error CS0246: The type or namespace name `ExpendableDescriptor' could not be found. Are you missing a using directive or an assembly reference?

     
  • Anonymous

    Anonymous - 2013-06-04

    Hi,

    You need to define DIS_VERSION_7 in the build settings.
    Click the menu option: "DISUnity/DIS Protocol Version/DIS 7" to have it done for you.

    Regards

    Karl

    I have just pushed a git update that will also fix the issue, its caused by not having a DIS version set.

     

    Last edit: Anonymous 2013-06-04
  • Anonymous

    Anonymous - 2013-06-04

    The latest git now shows the following errors:

    "NotImplementedException:The requested feature is not implemented.
    System.Net.NetworkInformation.LinuxUnicastIPAddressInformation.get_IPv4Mask()

    ArgumentException: Getting control 5's position in a group with only 5 controls when doing Repaint
    Aborting

     
  • donu35

    donu35 - 2013-06-05

    also anything I type for the broadcast address I get a triangle saying "Invalid Broadcast Address"

     
  • Karl  Jones

    Karl Jones - 2013-06-05

    Hi,

    What OS are you developing on and what is your build target?

    It looks like this is an issue with Mono, I am using Windows so the MS .Net libraries have some features Mono does not, subnet masks seems to be one of them:
    https://bugzilla.xamarin.com/show_bug.cgi?id=2033

    I will look for a workaround, for now the latest patch should fix your issues(it works on windows and mac for me) although you will still get the error about it being an invalid broadcasts address but you can ignore this for now.

    Karl

     
  • donu35

    donu35 - 2013-06-05

    Karl-

    I am using Unity 4.1.3f3 on OSX 10.8.3

    I dont see any compile errors in Mono but the errors I previously posted show on the Unity console.

    Is there a open source DIS player I can use to test Unity? I was looking for a DIS flight simulator but failed to find one.

    I ran accross MAK Technologies, they have a VR-Link product for Unity that allows for HLA/DIS interoperability. They also make a DIS player/recorder. Licensing costs are high for that product.

     
  • Karl  Jones

    Karl Jones - 2013-06-05

    Hi,

    DIS Map is good for showing entity locations:
    https://sourceforge.net/projects/dismap/

    My other library KDIS is good for checking the contents of PDU's, its a lot more mature than DISUnity. https://sourceforge.net/projects/kdis/

    Delta3d has some DIS elements, its been some time since I checked what they do though...
    http://www.delta3d.org/

    I have been using MAK products for several years, they are good solid products but they are quite costly when you compare them to Unity, they also have a per seat licencing model which can be quite tricky if your planning on deploying your app to a lot of users, the cost soon shoots up.

    Does the error always occur or only at certains times, e.g when you try to edit a particular object in the inspector or when you click play etc?

    If you try to clear the error in the console does it go?

    If you play does the connection class work, can you see entities appearing?

    K

     
  • donu35

    donu35 - 2013-06-05

    Before hitting play I clear the log, then hit play and the two errors that come up on the console are:

    NotImplementedException: The requested feature is not implemented.
    System.Net.NetworkInformation.LinuxUnicastIPAddressInformation.get_IPv4Mask ()
    DISUnity.Network.Connection.IsValidBroadcastAddress (System.String address) (at Assets/DISUnity/Network/Connection.cs:535)
    DISUnity.UI.ConnectionEditor.DrawWindowContents (Int32 id) (at Assets/DISUnity/UI/ConnectionEditor.cs:157)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

    and

    ArgumentException: Getting control 1's position in a group with only 1 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext ()
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options)
    DISUnity.UI.ConnectionEditor.DrawWindowContents (Int32 id) (at Assets/DISUnity/UI/ConnectionEditor.cs:154)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

    I do see the globe with the DIS connection settings window, the broadcast address is red

     
  • Karl  Jones

    Karl Jones - 2013-06-05

    Ah, I didn't test when playing.

    Ok I have pushed a fix. It will now say the address is valid if it gets a NotImplementedException. This will at least get rid of the annoying messages, you will just have to make sure you use a valid address. I will look for a more permanent solution in the future.

    Karl

     
  • donu35

    donu35 - 2013-06-05

    So when I run the scene on my OSX Unity 3D I do not see the list of Available Multicast addresses but when I tried on my Windows Unity 3D, I was able to see the list of multicast addresses 224.0.0.1, 224.0.0.252, 225.0.0.222, 232.44.44.233

     
  • Anonymous

    Anonymous - 2013-06-05

    Looks like it could be the same problem, mono libraries vs MS .Net.

    I dont have access to a mac at the moment but will tomorrow so I will try it then.

    I use this to get the Multicast addresses:
    foreach( NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces() )
    {
    foreach( MulticastIPAddressInformation mctIPAddressInformation in adapter.GetIPProperties().MulticastAddresses )
    {

    So it could be that your mac does not have any multicast addresses(unlikely) or the mono libs dont have this feature working. You should still be able to use multicast it just means that you wont be able to detect the possible addresses. I will add a field in so you can manually type multicast addresses as well as select from the list.

    k

     
  • donu35

    donu35 - 2013-06-05

    How can I temporarily add a multicast address?

     
  • Anonymous

    Anonymous - 2013-06-05

    NullReferenceException: Object reference not set to an instance of an object
    DISUnity.Network.Connection.IsValidBroadcastAddress (System.String address) (at Assets/DISUnity/Network/Connection.cs:537)
    DISUnity.UI.ConnectionEditor.DrawWindowContents (Int32 id) (at Assets/DISUnity/UI/ConnectionEditor.cs:157)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:1283)

    ArgumentException: Getting control 1's position in a group with only 1 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:511)
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:206)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUILayout.cs:233)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUILayout.cs:225)
    DISUnity.UI.ConnectionEditor.DrawWindowContents (Int32 id) (at Assets/DISUnity/UI/ConnectionEditor.cs:154)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:1283)

     
  • Karl  Jones

    Karl Jones - 2013-06-05

    You will need to add the multicast address in code.

    Get a reference to the connection class and do:

    myConnection.AddMulticastAddress( "address goes here" );

    To get rid of the exceptions change line 542 of Connection.cs from

    catch( NotImplementedException )

    to

    catch( Exception )

    This will get rid of errors for the moment.

    K

     
  • donu35

    donu35 - 2013-06-05

    Can't move the globe still, but i'm making progress, i'm seeing the following logs:
    Discovered new entity: Name -
    UnityEngine.Debug:Log(Object)
    DISUnity.Simulation.Managers.EntityManager:OnEntityState(EntityState) (at Assets/DISUnity/Simulation/Managers/EntityManager.cs:302)
    DISUnity.Events.EventMessenger`1:Broadcast(EventType, EntityState) (at Assets/DISUnity/Events/EventMessenger.cs:164)
    DISUnity.Network.DecodeFactory:Decode(Byte[]) (at Assets/DISUnity/Network/DecodeFactory.cs:98)
    DISUnity.Network.Connection:CheckForData() (at Assets/DISUnity/Network/Connection.cs:357)

     
  • Karl  Jones

    Karl Jones - 2013-06-06

    That's good, the scene doesn't have a camera controller in it at the moment so you cant move the globe. The orbit camera unity comes with is a pretty good one to use.
    Are you planning on using the globe or do you have your own terrain?

    The globe texture is stretched at the poles at the moment, I need to fix this.

    Karl

     
  • donu35

    donu35 - 2013-06-06

    I was able to see grey sphere entities on both the Windows and OSX version of Unity.

     
  • Karl  Jones

    Karl Jones - 2013-06-07

    Yeah it looks like all the errors are just for the GUI elements where I try to validate addresses, the actual sending and receiving data is fine :)

    K

     
  • donu35

    donu35 - 2013-06-24

    Karl-
    What would be the fastest way to automate populating the Entity Manager if you have a text file that lists for each entity the DIS enumeration as well as the directory for the collada model? Should I create a phython script?

     
  • Karl  Jones

    Karl Jones - 2013-06-24

    Hi Donu,

    Python in Unity? You can add your mappings in code, the EntityTypeMap is still very loosely developed at the moment so it may change in the future, I recently commented out 2 important functions. The Load and ReadFromXML functions read the SISO XML Enum document to create the initial map, although if you are populating it from a list then this is not really an issue for you.

    If you want to add a mapping in code you would do something like this:

    EntityTypeMap ourMap;//Get reference or create a new one.
    
    int[] types = new int[] { ( int )typ.Kind, 
                              ( int )typ.Domain,
                              ( int )typ.Country, 
                              typ.Category, 
                              typ.SubCategory,
                              typ.Specific, 
                              typ.Extra };
    
    Node current = ourMap.Root;
    foreach( int val in types )
    {
        // See if a node already exists
        Node n = current.Children.Find( o => o.Value == val ); 
    
        if( n == null )
        {
            // Create a new one for this value
            n = new Node
            current.Children.add( n );
        }   
        current = n;    
    }
    
    GameObject ourEntity = new GameObject(); // You could add a monobehaviour here that has the file path stored in it
    current.Obj = ourEntity;
    

    This should give you what you need.
    I will try to add a function to do it for you in the future.

    Regards

    Karl

     

    Last edit: Karl Jones 2013-06-24

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.