UDP server vs .NET for python for Unity - c#

Does anyone have an idea of the performance difference between .NET for python and just setting up a UDP server for communication between python and Unity? I've tried ironPython but it only supports python2 which is dead now. I need to run python functions for each agent I instantiate in Unity and grab their states as they update to animate in real time.

Related

How to use LibVLCSharp to stream in game footage from Unity?

I would like to implement an application that is composed by a server application (built with Unity for Windows), where the actual simulation is running, and a client application (built with Unity for Android) to which the rendered game view is streamed to; in other words I want to do remote rendering in Unity and both ends are implemented with Unity.
I have found, among others, LibVLCSharp, which looks quite promising.
My questions are:
- Is it actually possible to achieve the indicated functionality with LibVLCSharp and Unity?
- Does someone know sources where a potentially similar project has been documented?
Unity implementation is currently actively being worked on. It hasn't been open sourced yet and doesn't work quite well for now.
Expect communications on LibVLCSharp if we manage to make it work !
First question: no.
Second question: there can't be any.
"Unity is not officially supported yet, this was a closed beta test. Unity will be supported in LibVLCSharp 4.0" source

Strategy for Appium in C#

I’ve done some projects with Selenium in C#. But now we are looking what the best strategy is for mobile testning.
Can you give me some advice? I’ve red some tutorials but I really don’t know where to start.
Install Appium server on Mac and point all iOS test to that server? How about the Android tests? Do they also point to the Appium server on Mac?
So you can hear, I need some advice or a really good tutorial in this matter.
Thanks in advance.
What you require is Selenium Grid: https://www.seleniumhq.org/docs/07_selenium_grid.jsp
Read up on this thoroughly, as I guarantee it is what you are looking for. I wrote an automation framework in the Unity game engine to load a game executable onto iOS devices and Android devices.
I physically connected the testable devices to the Macbook that was being used as a server, and Jenkins build agent.
You will want to download the Selenium Grid jar, which is a hub that proxies commands to multiple Appium processes all running on the same machine (each process communicating with a separate device). This server will help Appium to segregate functionality so that multiple Appium processes can run at once, and communicate over WiFi or physical cable connections with attached devices.
Once you are ready, I suggest reading my tutorial on setting up Jenkins with an Appium/Selenium Grid integrated solution. This tutorial is specific to setting up a framework I developed called Trilleon, within the Unity game engine, but the vast majority of this tutorial will not differ at all when you are setting up testing for a regular native application in Appium with Selenium Grid.
https://github.com/disruptorbeam/trilleon/wiki/Setup-Linux-Mac
https://github.com/disruptorbeam/trilleon/wiki/Jenkins-Setup
And here are various samples of bin/bash scripts that I developed (also for this framework, but much of it will match what you need).
https://github.com/disruptorbeam/trilleon/blob/master/server/sh/run-tests.sh
The following will create a node in Selenium Grid. Each instance that is running at a time will need to be registered in this way. Use this to determine how you can fill it out and provide the node json to your Selenium Grid
https://github.com/disruptorbeam/trilleon/blob/master/server/sh/CreateUniqueNodeJson.sh
Here are python scripts launched from Jenkins to run the appium. This will be run by several jobs all running in unison in their own workspace.
https://github.com/disruptorbeam/trilleon/tree/master/server/py
The above python scripts will have a bunch of stuff that is completely irrelevant to you, but it will also have everything you need to launch appium on android or ios devices.
As for mobile testing, I suggest that you could take a free trial on WeTest. It support Appium、Espresso、XCTest and custom environment which could help you complete automation test on a wide range of devices. Visit https://www.wetest.net/products/automation/?utm_source=bn&utm_medium=AM-BN-2

How to allow a python script (that is called within a C# app) to access the USB port

Wondering if anyone has insight on the above.
I have a Python script that accesses and sends messages through a USB-to-CAN converter. The script works pretty flawlessly when run from the Windows command line.
I then tried to port calling this script from within a C# app. I can call the script fine. No problem there. When the script goes to connect to the USB-to-CAN converter, it throws an error similar to when the CAN converter is not plugged in to the USB port.
I know this is not a lot to go on, as far as code and seeing my errors. I don't know if I can effectively give enough real code context without making a gigantic post.
So just wondering if anyone has insight on a C# app giving USB access to a Python script called within the app.
Thanks.

Real time C# websockets client to use with Unity3D?

I'm building a Unity3D client in C# for a multiplayer game that I made. The server is written in Node.js, and I wrote a web client in Javascript that works well. But I am running into lag issues with my Unity3D client implementation. I am using the websocket-sharp library, but have been unable to use it in the same way as I did on my Javascript client with the HTML5 Websocket class. I believe the issue lies in the way the websocket-sharp library is made, currently each Send() will cause a lock to _forSend, so the data will transmit like this:
data1:frg1
data1:frg2
data2:frg1
data2:frg2
...
But on my working javascript implementation, it looks like this as it is truly multithreaded:
data1:frg1
data2:frg1
data2:frg2
data1:frg2
Therefore I believe this is the cause of my lag with my C# Unity implementation, because the websockets-sharp library behaves like this. Can anyone confirm that this is an issue with the websockets-sharp library or suggest a library that would work?
you can see my simple SignalR unity client and create simple one for your node.js server, then see if the lag still present or not. https://github.com/Mo-Rahemi/WebGlGameWithSignalRClient
from my experience the lag should happens because of :
if your fps is low then java script calls affects too.as unity is single threaded and Webgl not support C# threads you have to handle incoming update in unity main thread. let say your server send update every 50 ms, so you have 20 java script call per second, so if your fps is under 20 frame per second your game go behind the server.
if your server update rate is too high it would be the problem because of tcp protocol of websocket ... .
interpolation, if your server sends 20 update per second depend on your player move speed you may have jumping issue in game client. so you must first queue them and interpolate between updates smoothly.
as websocket-sharp is a known library i think it shouldn't be problem, perhaps you are using it in bad way but we need see the code sample to help.
I used Socket.IO for Unity in my project and it work. I implement to create notification for my game example when someone aware a gilf ....
https://www.assetstore.unity3d.com/en/#!/content/21721

How to start developing an Sphero-Ball Windows Application in C#?

I have a Sphero 2.0 ball.
What do I need to connect it to Windows 7 and to start developing applications for the ball (preferably in C#).
I tried to connect it via Bluetooth. While "pairing" the ball, it started to blink in red, green, violet. But Windows told me that it couldn`t find the right driver.
It would be great if the developers of Sphero could contribute some developing HowTos.
I don't know if you've solved this problem yet, but I've successfully managed to communicate with the Sphero using .NET in windows 7. I began by reading this post:
http://thomasbladh.com/2013/01/01/balls-out-fun-with-the-sphero/
This is a good place to get started. I then re-implemented it because the receiving of packets back from Sphero wasn't quite right, and it dropped some. Using the above will get you as far as sending and running orbbasic code to the sphero, though.
I am currently developing a "lowlevel" API for Sphero in C++. The only dependency is a working bluetooth stack and a C++ compiler. I am also thinking about making the API C-Style with only POD but at the moment this fits my needs:
https://github.com/PaulFreund/SpheroRAW
It should be easy to use from C# and even add a event based interface.

Categories

Resources