Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

Ulib

Discussion in 'Assets and Asset Store' started by McRain, Mar 17, 2011.

  1. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    ULIB - Unity library includes PHP-gateway, Binary serializer, other tools.


    For fast communication between your game and your PHP server or local drive.
    Transfer your objects directly in own class from the game to the server or from a server to the game. For tables, lists, settings and any. Save / Load your game data (position, number of items, health).
    Send data on a server or get from only a single line of code!
    All data is transmitted in binary, take a little traffic.
    And you can use it to load / save data to local files in your game (in standalone) for save your data directly in the game format: the whole conversion takes place automatically.


    Serializer : For a binary serialization of data (for save/load local files or send/recived from php).
    Gateway : For fast data transfer between the server and Unity3D games.
    LanguageManager :Tools to add support for multiple languages in the Unity3D game. Runtime loaded.
    MenuManager : For a dynamic-runtime load menu.
    MenuEditor : For easy editing of the menu with exports to ULIB, XML, JSON, SQL.
    CommandManager:For execute commands given in the game, loaded locally or from a server.
    And other tools …

    AssetStore link

    Documentation link

    Example link










    Video showing examples of start work with ULIB.



    Other video:
    Create your own script from MonoBehaviour, add it on the server, set reference to material, send to client.


    SOURCE
     
    Last edited: Jul 1, 2020
  2. Frank Oz

    Frank Oz

    Joined:
    Oct 13, 2010
    Posts:
    1,561
    Looks very promising, nice one!
     
  3. alph

    alph

    Joined:
    Jul 20, 2010
    Posts:
    89
    Very nice and helpful tool! :)
     
  4. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thanks to all who are interested or using ULIB :)
     
    Last edited: Mar 30, 2011
  5. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    ULIB 3.3.0 Sended to AssetStore.

    Important! The protocol was changed. May be partially incompatible with the protocol < 3.3.0
    Please – read the documentation before upgrading!
     
    Last edited: Mar 31, 2011
  6. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    If you have error
    Code (csharp):
    1. TypeLoadException: Could not load type 'LanguageManager' from assembly 'ebf61af393d15604b82e5793e0068b20'
    . - Your directory "Plugins" has two files *.dll - ULIB.dll and ULIBi.dll - delete one of them. If you are using. Net 3.5 - remove ULIBi.dll (this file for compatibility with iPhone-development). or delete ULIB.dll if you used .Net2.0.
     
    Last edited: Apr 3, 2011
  7. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    first, very great tool!!
    second, a few questions:

    1: can a client device save and load a REMOTE gameobject, including mesh, colliders, and perhaps most importantly a CUSTOM USER-CREATED SCRIPT(c# in this case)?

    2: does the above process work properly with an iOS device?

    3: does the above process work properly with an Android device?

    4: can Ulib be directed to upload and download specific files, in specific directories on the user's iOS/Android device?
     
  8. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thanks.
    1 - GameObject (including mesh collider, projectors and a few other components) can be pre-saved in the file and download later from the server.
    You can also serialize gameObject or mesh on one client and transmit via the RPC to another client.
    Dynamically created on the server GameObject in PHP can be in theory, but not implemented yet.
    Dynamically load scripts and compile runtime not possible in ULIB. But you can do it - Internet have many examples.
    I now make it possible to serialize any (or many) unity3d component (particles, lighting, cameras, terrain, etc.), with the ability to group it on the server dynamically - most of the work goes in this way.

    2-3-4 )) I know little about the development in iOS / Android and I can not answer precisely. But some people use ULIB in their iOS games. Theoretically, the gateway performs the task of data transmission between server and client and serializes the data into a byte array (and from). If the iOS / Android has the ability to store an array of bytes - then it will work)

    With some of the questions may be can help "Howto"
     
    Last edited: Jun 8, 2011
  9. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Or you can use for this UCommand from CommandManager. As well as used in MenuManager - you can define a set of commands that are available to call in game client and create and download set of UCommand from server (from database, file , etc). This can be used for writing your own routines, quest, dialogs and many other.
     
  10. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    are you planning on creating/posting additional youtube tutorial videos?

    can this script be used to serialize load a file from a user's desktop cpu file-system, from a Unity game built for the desktop(osx or windows)?
     
  11. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Yes, after updating the library and gateway, I will add additional examples and a few videos on youtube.
    And yes, now you can serialize the data (in the editor or standalone-runtime), and save to a file as byte array. This file can be read (in the editor or standalone-runtime) and deserialize to data.
    Additionally ( if, for example, this is mesh or gameObject's ) the same file can be download from the server to the web-player and deserialize to data.
     
  12. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    Thank you for your assistance, our team is planning on purchasing a solution for serialization and data transfer via php.

    Which version of PHP is required for this solution to function properly(v4, v5, etc)?

    To build on my question in the previous post: Can I designate a SPECIFIC file, in a specific directory on the user's Hard Disk to serialize and send to the server via the gateway?
     
  13. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    I use PHP 5.3.5 but it will work on many previous versions.

    ULIB not read the files. The files you're reading in the game self. If your game can read the contents from the file - you can (using ULIB) encode content and send to server.
    2 example:
    1 - if you have saved data
    OR any file ( example with text file)
    If will be questions about the library - you can always ask via this forum or send mail or send a question via the form on the website.
    Thank you.
     
    Last edited: Jun 8, 2011
  14. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    thank you for answering my questions, and offering great support. Looking forward to picking up this very useful tool, after you release the next update on the asset store. Please post on this thread the URLs to the video tutorials/walkthroughs you create.

    EDIT: Is there a checksum verification, or a file verification feature included in Ulib? That would help with a file that doesn't fully download, or gets corrupted somehow during the download/upload to server process.
     
    Last edited: Jun 8, 2011
  15. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    No, ULIB no crc checks or other validation of file reading. You can use other libraries for crc32 in the file in read time.

    Data recived on the server completely deserialized. If the data is incorrect - deserialization will fail and your function on the server does not receive data. In this case, the your game will not receive a response from the server.
     
  16. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    The new updates are GREAT, I'll be able to purchase ULIB soon. Excellent work:

    /*
    Added support for many Unity3D classes: Camera, Light (all types), Projector, Material, Texture2D, PhysicMaterial, Transform, Rigidbody, Collider (including MeshCollider, CapsuleCollider, SphereCollider, BoxCollider, WheelCollider), ParticleEmitter (base class);

    Added support for serialization your own components (MonoBehaviour)

    Added support for serialization Enum

    A single instance of object: when the deserialization is now present as many copies of objects as they were before the serialization (for example, if two or more MeshRenderer.sharedMaterials contain the same material – after deserialize MeshRenderer.sharedMaterials will contain a one copy of the material ). This allows you to save a large number of copies of objects in a scene with little increase in file size ;

    Recovery of references to objects from scripts : if the script contains field and set to GameObject link or other object – after deserialization, this link will be restored;
    Added the ability to encrypt stored files;
    */
     
  17. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    does the new ability to serialize your own components (MonoBehaviour), c# scripts in this case, allow for recovery of references to other scripts?
     
  18. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Yes, if the class of your script will be found in the game. Soon I will prepare a video to better show.
     
  19. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    A small announcement features new versions of gateway Unity3D – PHP:

    • Decrease time serialization / deserialization on the client side and on the server (more than 3-5 times)
    • Added full server-build objects (GameObject) including a hierarchy of components and others : Mesh (vertices, uv, triangles,), Camera, Light (all types), Projector, Material, Texture2D, PhysicMaterial, Transform, Rigidbody, Collider (including MeshCollider, CapsuleCollider, SphereCollider, BoxCollider, WheelCollider), ParticleEmitter (base class), MeshRenderer, MeshFilter , etc. For example it looks like this:

      PHP:
      $go = new GameObject();
      $go->components[Components::TRANSFORM]->localPosition = new Vector3(142.7287498.00685);
      $mesh = new Mesh();
      $mesh->CreatePrimitive('cube');
      $mf = new MeshFilter($mesh);
      $go->components[Components::MESHFILTER] = $mf;
      $mr = new MeshRenderer();
      $mat = new Material();
      $mat->shader 'Self-Illumin/Specular';//'Transparent/Diffuse';
      $mat->parameters['_Color'] = new UnityColor(0100.5);
      $mr->sharedMaterials->Add($mat);
      $go->components[Components::MESHRENDERER] = $mr;
      $collider = new MeshCollider(null);
      $collider->sharedMaterial = new PhysicMaterial();
      $go->components[Components::COLLIDER] = $collider;
      $cam = new Camera();
      $go->components[Components::CAMERA] = $cam;
      $pro = new Projector();
      $go->components[Components::PROJECTOR] = $pro;
      $light = new Light(new UnityColor(1101));
      $go->components[Components::LIGHT] = $light;
      $go->components[Components::RIGIDBODY] = new Rigidbody();
      $child = new GameObject();
      $go->childrens[] = $child;
    • Downloadable Mesh, GameObject of previously saved files are also supported.
    • Added support for own server-side components for send to client.
    • Single instance copies – if the object on server (eg arrays) has multiple objects contain the same object – after deserialization in the client, these arrays will contain the same object (the object in one instance).
    • Added support for the restoration of links reference: links defined on the server are restored to the client after the transfer.
    • Gateway can be used with UWEB – a simple system which simplifies the publishing and management Web-games Unity3D.
    • Added the ability to plugin an additional your own serializer
    • Improved configuration file.

    New Gateway Unity3D-PHP will soon be available on AssetStore.
     
  20. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    that recent set of updates was just was we were looking for. We just purchased Ulib in the Asset store, thanks for your focus on updating and upgrading this necessary PHP(gateway) serialization tool.

    As long as there aren't any glitches/issues, we'll happily give this tool the great rating in the asset store that it deserves(for such necessary functionality).

    PLEASE keep the updates coming!

    and PLEASE PLEASE create more video walkthroughs/tutorials
     
    Last edited: Jun 19, 2011
  21. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thank you for your purchase.
    Please note: These updates will be available in next version. It will take approximately 5-7 days to prepare the samples and documentation.
    In the new version changed the structure of data - files stored in the old version will not be available in the new version.
    Those who bought the previous version and has a file (Mesh, GameObject) can load files to the scene Editor and save as the new version.
    I'll try to make the converter for convert files from the old version in a new one.

    If you have any questions on the use of ULIB - write in this thread or email me . (as you wish)
     
  22. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Update first post - add new video.
     
  23. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    very useful, thank you for creating a new video tutorial/walkthrough. Videos are a big selling point for many devs looking to get into tools like Ulib!
     
  24. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
  25. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    yes, thank you very much, answered my question perfectly. ULib is a GREAT tool!
     
  26. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    New version ULIB sended to AssetStore.
    - Decrease time serialization / deserialization on the client side and on the server (more than 3-5 times)
    - Added full server-build objects (GameObject) including a hierarchy of components and others : Mesh (vertices, uv, triangles,), Camera, Light (all types), Projector, Material, Texture2D, PhysicMaterial, Transform, Rigidbody, Collider (including MeshCollider, CapsuleCollider, SphereCollider, BoxCollider, WheelCollider), ParticleEmitter (base class), MeshRenderer, MeshFilter , etc.
    - Added support for own server-side components
    - Single instance copies – if the object on server (eg arrays) has multiple objects contain the same object – after deserialization in the client, these arrays will contain the same object (the object in one instance).
    - Added support for the restoration of links reference: links defined on the server are restored to the client after the transfer.
    - Added crypt for local files

    Thank you for your comments and suggestions.
    - Improved configuration file.
     
    Last edited: Jun 27, 2011
  27. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    great news! Thank you for the new update :)
     
  28. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    444
    Can you save whole GameObjects to file and reload them later on?
     
  29. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Yes. Most components/gameobjects/objects can be save/load by ULIB to file. For example:

    Code (csharp):
    1. if (GUILayout.Button("SaveToFile"))
    2. {
    3.     var lenght = FileManager.SaveObject(sourceTransform.name + ".unp",sourceTransform.gameObject);
    4.     Debug.Log("GameObject save to file: " + sourceTransform.name + ".unp " + lenght+" bytes.");
    5. }
    6. if (GUILayout.Button("LoadFromFile"))
    7. {
    8.     var destTransform = (GameObject) FileManager.LoadObject(sourceTransform.name + ".unp");
    9.     destTransform.transform.Translate(new Vector3(-2.5f, 0, 0), Space.World);
    10.     Debug.Log("GameObject load from file");
    11. }
    You can save/load GameObject with childrens, Mesh (vertices, uv, triangles,), Camera, Light (all types), Projector, Material, Texture2D, PhysicMaterial, Transform, Rigidbody, Collider (including MeshCollider, CapsuleCollider, SphereCollider, BoxCollider), ParticleEmitter (base class), MeshRenderer, MeshFilter , etc. You can save/load gameObject with your own components (subclass of MonoBehaviour or subclass of System.Object).

    But not all property of Component can set runtime ( Ellipsoid Particle Emitter, for example, has property Elipsoid ).Read this: http://feedback.unity3d.com/forums/15792-unity/suggestions/163600-scripting-expose-more-classes-properties-to-scrip?ref=title. As soon as the Unity will make these properties available - they will be added to ULIB.
     
    Last edited: Jun 28, 2011
  30. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    great update to a very useful tool, thank you!
     
  31. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thank you.
    In the near future ULIB will be updated .
    Will be added support new classes, add managers, and will be available complete documentation.
    I will be happy to hear suggestions and comments on functionality ULIB.
     
  32. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    is there any word on how much additional memory the .net classes occupy in system memory, to allow for Ulib to operate. I'm only asking because we're working on using Ulib mostly on mobile devices.
     
  33. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    It is best to look in the "Profiler" in the Unity editor or look in the statistics window (click "Stats").
    I do not believe that ". Net" classes take up more memory than any other. Most likely on a mobile device is not running clean .net code. This is the Unity3D team will be able to say , but I think - unity compiles all classes in own code.
     
  34. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    thanks for the help, and the quick response! :)
     
  35. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    The new version LangaugeManager adds the ability to localize not only text but sound and texture. All the resources you can load from local files (png, jpg - graphics formats or ulib-format with compression and encryption). It is also available to download resources from the server. Through the use of a ResourceManager, the download occurs only once.
    It's very simple. You specify the source files (local or remote), a download of the available languages​​, the result as a OnGUI. Other everything for you do ULIB.
    Available translation by key, translation with the replacement tag, texture for the current language and other features LanguageManager, such as partial loading of the translation for the current module / scenes, etc.

     
  36. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    Looking forward to using ULIB for developers but at the moment having troubles downloading this
     
  37. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Maybe some problems on AssetStore.
    And I also have to delay the release of updates - I need to make changes to ULIB for support new updates from Unity 3.4.
     
  38. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    I too have recently had problems re-downloading form the asset store, it just hangs while showing the text "downloading". perhaps sending a minor update will cure this?
     
  39. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thanks for the advice. I re-uploaded the package to AssetStore.
    If this does not help - please let me know.

    Maybe I can send the packet directly to the mail for who have problems with the updating of AssetStore - please contact support@reneos.com
     
  40. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    ULIB / PHP - version 4.3b available for download from AssetStore:
    • added built-in support for serialization and dynamic creation of the server a few new components Unity3D.
    • manager added (test): ResourceManager – for loading and caching resources runtime, from local files or server;
    • manager added (test): UserManager – for authorization users in your unity3d games;
    • manager added (test): ShopManager – for get items from database, create shop in game
    • manager added (test): MessageManager – for messages and dialogs in the game
    • LanguageManager : Load localization text, sound, images for each language. Resources can be downloaded as a runtime from local files or a server-gateway
    • Available managers for test ( CommandManager, CompareManager, MenuManager, OptionsManager, QualityManager )
    • Added GUITools – expands the functional of GUI;
    • UTools – a useful set of functions
    • Added download ogg files through php-gateway

    Many other changes.
     
    Last edited: Jul 30, 2011
  41. brandonferr

    brandonferr

    Joined:
    May 10, 2010
    Posts:
    2
    I just want to check before I buy that Ulib can save a player's data and map data to a local file. For example, could I create an instance of a custom class and save that class? Also will this work with iOS and Android?

    class SaveData {
    playerStats (numerous int)
    playerInventory (array[int])
    mapData (array[int][int])
    }
     
  42. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Yes, you can use custom class. I was a little doubt about the multi-dimensional arrays (tomorrow I will try create example) "(array [int] [int])", but I think no problems.
    About iOS/Android - tomorrow I get to Android smartphone for tests - and I can say for sure. As far as I know, ULIB used with iOS.
     
  43. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    I can report that I dont have any issues thus far with iOS and ULIB.


    ULIB / PHP - version 4.3b has a bunch of much needed great features! Thank you McRain
    The UserManager, ShopManager, MessageManager, ResourceManager, and LanguageManager are VERY handy tools. thanks!

    if you're not using ULIB yet, and need any of its core functionalities, you're missing out on a ton of time saving features for any Dev creating a project destined to work over any type of network.
     
    Last edited: Aug 16, 2011
  44. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thanks, zhx!
     
  45. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Hi.
    Last update can not be loaded due to errors in AssetStore.
    I updated the package and you can try to download it.
    Please let me know if there will be problems again.
     
  46. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    the new update loaded properly for me. Thank you for the fix :)
     
  47. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    not you're fault but ULib Tools Dev stuck at 20%

    :rolleyes:
     
  48. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    I just stripped ulib from a project and attempted to reDownload reImport, and also stuck at 20%. This is a Unity issue, not your fault, looks like its happening in other assets on the store too :-(. Hope UNITY STAFF can fix this ASAP!
     
  49. caitlyn

    caitlyn

    Joined:
    Jun 20, 2008
    Posts:
    402
    Hey guys!

    Sorry about that 20% glitch, we've fixed the problem (on our server) so you should be good to go with ULib, which btw is one of the most useful packages on the store (imo). ;)

    Cheers

    Caitlyn
     
  50. McRain

    McRain

    Joined:
    Mar 26, 2009
    Posts:
    138
    Thanks Caitlyn and AssetStore team
     
unityunity