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 - David

Pages: [1]
1
TNet 3 Support / Set channel data at channel creation ?
« on: November 28, 2013, 02:16:57 PM »
Is there a way to set channel data at channel creation ? I wanted to set a channel name when creating a new channel and wanted to store the name in the channelData, but didn't find a way to do it.

2
TNet 3 Support / Best pratices for lot of bullets/laser/shots handling
« on: November 21, 2013, 03:30:21 PM »
Hi,

I'm currently trying TNet on a small prototype project I'm coding, a small multiplayer space shooter game. As the spaceships in my game can have some quite big shooting rates, I was wondering what's the best way to handle many "laser shots" per second.

I first tried the naive approach with TNManager.create from the player's starship control script, creating a laserShot prefab on the correct position/rotation. This TNObject is then moved locally by each player at a constant speed (so I don't need to sync position after initial creation), I check collisions with a raycast and I only apply damage to an enemy ship (via a RFC on the hit ship) if the laserShot "isMine" so the shot's result is always consistent. I only call RFC on this object when a new player is connecting so he can see the shots created before his arrival at the correct position. This seemed quite "elegant" to me but I have a small problem with this:

It seems that when I have a quite important ping (tried on an amazon ec2 server with 250ms ping) on the server that the TNManager.create is a little laggy and I can see that my ship's firing rate is not constant nor as fast as when I'm playing solo.

I tried to implement some pool system, with each player creating a pool of laserShots when connecting via a RCC call that adds the newly created laserShot in a pool, but it takes quite a long time and it "floods" the server with create calls each time a new player is connecting. And I suppose that having a lot of "pre-created" TNObject isn't that good performance-wise as there will be a lot of calls to OnNetworkPlayerJoin callback each time a new player connect with properties synchronisation (activated or not, position, rotation...).

Do any of you have any tips on how to handle this problem ?

Thanks !!!

3
Hi, I don't know if it's the correct place to write a bug report but here it is :

I bought NGUI some days ago (thanks by the way, it's fantastic :)) ) and I just had a problem when trying to change dynamically the sprite used by a UISprite.

Changing sprite with UISprite.spriteName = ... works but UISprite.sprite = ... doesn't (the sprite image is modified then returns to its last value as soon as update is called).

The problems seems to come from the fact mSpriteName isn't updated in UISprite.sprite's setter, if I add mSpriteName = mSprite.name in UISprite.cs at line 146 it works as expected but I don't know if it has other side effects.

I hope it can be usefull.

Pages: [1]