x


texture in networked game

I've a background texture that keeps changing based on what a person selects. User also uses Drawing object to add changes on the texture.

I've put NetworkView on this object that contains the texture but all I can track over other networked players are its position and rotation. How can I stream this texture over the network. Note that I'm using Unity's built-in networking.

more ▼

asked Nov 10 '10 at 04:25 PM

Tarun gravatar image

Tarun
71 3 3 8

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

You can send over the byte[] of the texture. That's pretty "low level" though; more efficient would be to just send a number of the desired texture if everyone has the texture anyway. Or even the players selections (and then do the texture changing accordingly).

more ▼

answered Nov 18 '10 at 01:54 PM

Leepo 1 gravatar image

Leepo 1
283 8 10 21

see my comment above.

Jul 12 '11 at 10:00 PM Chris D
(comments are locked)
10|3000 characters needed characters left

I agree with @Leepo in networked games, the easiest way of customization is to give everyone every piece of texture and then only share the combination/customization over network to minimize traffic.

BUT - if you really have the need to transfer the texture btween players, I see three ways possible:

1) as @Leepo writes, transfer it low-level, bytewise, but consider when to do the "updating". I've played a lot of FPS where the customization loads all the time... generating annoying lags for everyone. So perhaps you should only transfer parts of the texture from time to time or schedule how much updating is possible this way.

2) another approach would be to share the "drawing commands" so that every client will replicate in memory how the owner made the customization. This would requiere the basic textures + some kinda command structure like: "drawLine", "drawCircle" or whatever possibilities you have provided your user with.

3) a last approach I think I would use myself, would be to let the user customize before getting online and the upload the textures to a central server, eg. a webserver - because you can easily make WWWload of textures from a webserver + you can control the data on the webserver with SQL/XML database structures, so its quite easy to remember who has what customization. Then when you get "close to another player" then you just use this players ID to request the texture for the player. I dont know what limits you have for amount of co-players, but remember to think of texturememory in graphiccards + OS platform (smartphone, browser, standalone etc)

If you use the "paint on texture" for blood/gore etc. then you can "fake" this custom drawing by making a lot of different "patterns/pieces" and the combination of these would be the custom textures.

more ▼

answered Jan 03 '11 at 11:53 PM

BerggreenDK gravatar image

BerggreenDK
2.4k 54 62 75

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2196
x708
x681
x28

asked: Nov 10 '10 at 04:25 PM

Seen: 1127 times

Last Updated: Jul 12 '11 at 10:00 PM