Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Deozaan

Pages: [1]
NGUI 3 Support / OutOfMemoryException: Out of Memory NGUI 3.7.1
« on: August 30, 2014, 12:10:04 PM »
I'm getting the following error from NGUI:

OutOfMemoryException: Out of memory
BetterList`1[UnityEngine.Vector2].AllocateMore () (at Assets/NGUI/Scripts/Internal/BetterList.cs:178)
BetterList`1[UnityEngine.Vector2].Add (Vector2 item) (at Assets/NGUI/Scripts/Internal/BetterList.cs:220)
UIBasicSprite.TiledFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/Internal/UIBasicSprite.cs:529)
UIBasicSprite.Fill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols, Rect outer, Rect inner) (at Assets/NGUI/Scripts/Internal/UIBasicSprite.cs:329)
UISprite.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UISprite.cs:422)
UIWidget.UpdateGeometry (Int32 frame) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:1459)
UIPanel.UpdateWidgets () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1522)
UIPanel.UpdateSelf () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1185)
UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1144)

I saw a similar problem mentioned in this previous topic which seems to indicate that it was fixed as of 3.5.1, but I'm using 3.7.1 and am encountering this issue.

I think it may have something to do with the fact that I'm using Space for Unity which uses some pretty large meshes and another camera to things look very big and far away. The reason I suspect this is because my problems didn't start occurring until some time after I imported that into my project, and it only seems to happen in scenes where I have both NGUI and Space for Unity.

NGUI doesn't like something about it and I get lots of errors. It also slows down the editor to a crawl and has crashed it a couple of times. Please help me figure out how to resolve this!

TNet 3 Support / Target.All vs Target.Others
« on: August 02, 2014, 10:37:29 AM »

I'm curious about when to use Target.All vs using Target.Others, and what the delay is (if any) when sending an RFC to yourself.

For example, in my player input script, I don't want remote players controlling my character. So I perform the logic that converts input to movement, and use a tno.Send to tell the remote players how my character should be moving.

The question is: Is Target.All smart enough to instantly run the RFC on my local machine so there is no lag (waiting for the command to go to the server, then come back to me) before my character moves? Or do I need to just use Target.Others and then also update my movement locally?

In other words, which of the following is necessary for there to be no delay between input and movement on the local machine?

  1. void Update() {
  2.         // perform some logic determining dMov and other things first
  3.         // and then. . .
  4.         // send out the changes
  5.         tno.Send("SyncMovement", Target.All, dMov); // <-- does this get executed immediately on my own machine?
  6. }
  8. [RFC]
  9. void SyncMovement(Vector3 deltaMovement) {
  10.         _char.deltaMovement = deltaMovement;
  11. }

  1. void Update() {
  2.         // perform some logic determining dMov and other things first
  3.         // and then. . .
  4.         // send out the changes to other players
  5.         tno.Send("SyncMovement", Target.Others, dMov);
  6.         // make the changes locally
  7.         _char.deltaMovement = dMov;
  8. }
  10. [RFC]
  11. void SyncMovement(Vector3 deltaMovement) {
  12.         _char.deltaMovement = deltaMovement;
  13. }

Note that in these examples, I'm not syncing position, I'm syncing movement/input (which direction the character should be moving continuously). In case that makes any difference.

And a follow up question: Can I call an RFC without actually making an RFC? e.g., can I do something like:

  1. tno.Send(myRFC, Target.Others, arg);
  2. myRFC(arg); // <-- will this execute locally?

Is this message normal? Will it cause any problems?

TNet 3 Support / RFCs unique to what?
« on: July 21, 2014, 10:31:52 PM »
In the past I've resorted to making an enum to make it easy for me to remember which byte belongs to which RFC, since they need to be unique.

But I vaguely recall reading some time ago that RFCs bytes can in some instances be re-used. Under what circumstances to bytes for RFCs have to be unique?

Is it on a per-class level (all RFCs in a class need unique byte IDs, but different classes can use the same byte IDs)?
Or do all RFCs across the entire project need to have unique IDs?

The documentation could really use some expansion with little things like this.

The latest version of TNet can't compile when the platform is set to "Web Player" because of the following errors:

Assets/TNet/Common/TNTools.cs(509,28): error CS0161: `TNet.Tools.WriteFile(string, byte[])': not all code paths return a value
Assets/TNet/Common/TNTools.cs(552,28): error CS0161: `TNet.Tools.DeleteFile(string)': not all code paths return a value

You need the return falses to go after the #endifs to fix these errors.

I also get some warnings about variables which are defined but never used. It would be nice if these messages didn't show up in the console.

I like to put all third-party assets/packages into a directory to help keep my project uncluttered. But NGUI's Font Maker requires FreeType.dll to be in the Assets/NGUI/Editor directory. Why is that? The dll is still in my project folder, and it's still in the same location relative to the other NGUI files, but the entire NGUI folder is now a subdirectory of another folder and that breaks things.

Am I wrong in thinking that this shouldn't break things?

Hi folks,

Over the past couple of days I've been looking over the NGUI documentation, forum threads, video tutorials, and more trying to figure this out. I've come to the conclusion that I just need to ask because I can't find the answer anywhere else. (I'm not saying the answer isn't out there, just that I seem to be unable to find it!)

I would like to dynamically instantiate an unknown number of buttons at runtime that each correspond to an action or skill, depending on the character.

For example, if my Fighter class has 5 actions and my Mage class has 8 actions, then if I select a fighter character I'll want to instantiate 5 buttons, each one mapped to a different action. If I select a Mage character, then I'll want to instantiate 8 buttons, each one mapped to a different action.

The part I'm having trouble figuring out (though I'll gladly accept hints/tips/help with any of it) is how would I dynamically change the function that is called when the button is clicked? I mean, how do I dynamically map a button to a different skill/action?

Or am I thinking about this the wrong way?

TNet 3 Support / How much does TNManager.noDelay affect?
« on: March 09, 2013, 03:47:10 AM »

I was curious how much is affected when I set TNManager.noDelay to true. Does that affect the entire server (and thus, all clients that are connected, making Send requests) or just the current channel?


TNet 3 Support / Gateway: None found
« on: March 06, 2013, 11:17:18 PM »
Is it a problem that the gateway is never found? I can't seem to get UPnP to work with the built-in TNServer.exe. My teammate and I have tried this on multiple machines, on multiple networks. We get an error:

ERROR: (UPnP) A connection attempt failed because the connected party did not pr
operly respond after a period of time, or established connection failed because
connected host has failed to respond
Gateway:  None found

Is this bad, or will it work with this error?

I don't know if this is related or not, but we have two lines of code, the SendQuickly doesn't work, but Send does:

  1. //tno.Send("setPos", Target.OthersSaved, transform.position, transform.eulerAngles);  // this sends over tcp and works
  2. tno.SendQuickly("setPos", Target.OthersSaved, transform.position, transform.eulerAngles); // this sends over udp and doesn't work

There are no errors. SendQuickly just doesn't update the position, but using Send, the position is updated.

TNet 3 Support / RFC Not Being Called
« on: February 18, 2013, 08:05:26 PM »
The following RFC is never called. The log message "Color should be changed" never appears. What am I doing wrong? I know that SetUpPlayer is being called because the log message is appearing from in there. But SetColor is never called.

  1. [RequireComponent(typeof(TNObject))]
  2. public class PlayerCapsule : TNBehaviour {
  4.         void Awake() {
  5.                 if (TNManager.isThisMyObject) {
  6.                         gameObject.AddComponent<Controls>();
  7.                         SetUpPlayer();
  8.                 }
  9.         }
  11.         void SetUpPlayer() {
  12.                 ColorHSV col = new ColorHSV(Random.Range(0f, 1f), 0.5f, 0.5f);
  13.                 Debug.Log("Color is setup as " + col.ToString());
  14.                 tno.Send("SetColor", Target.AllSaved, col.ToColor());
  15.         }
  17.         [RFC]
  18.         void SetColor(Color col) {
  19.                 renderer.material.color = col;
  20.                 Debug.Log("Color should be changed.");
  21.         }
  22. }

I'm really stumped. I don't know why this isn't working. The even stranger thing is that this did work properly, before I added the object to the TNManager Object List. . .

TNet 3 Support / [SOLVED] 1.5.0 Example Menu doesn't show LAN Servers List
« on: February 18, 2013, 04:26:44 PM »
I have to admit that I'm finding it very difficult to figure out TNet. Mostly because while there is some documentation on what TNet is, there is almost no documentation with instructions on how to use it. But I suppose that's besides the point.

This thread is to inform you that I've also noticed that some things worked in v1.3.1 but in v1.5.0 are having problems.

For example, the Example Menu will no longer display the server list. It just sort of bounces slightly as if its going to move over for the server list, but then it bounces back into place and the server I just started never shows up on the right hand side like it used to. Apparently the Known Servers keeps jumping back and forth from 0 to 1, but spends most of its time as 0, so it never shows the LAN server list.

I modified the Example Script so that it always shows the LAN server list, but the server itself keeps blipping in and out of existence too quickly to click, every couple of seconds.

Pages: [1]