Author Topic: tno.uid and persistance?  (Read 4362 times)

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
tno.uid and persistance?
« on: May 08, 2014, 03:08:26 PM »
Hi, brief question if I may:

We have a situation where we need to save relationships between objects and need to do so using our own save framework (we cannot rely on TNet). Therefor we need control over the uids we hand objects, and we need to rely on them being the same each time the saved game is started.

Are there any drawbacks to assigning tno ids by hand? An alternative is to separate the save ids and network ideas, but that would leave us with two ids for each object which is not ideal.

Thanks in advance!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: tno.uid and persistance?
« Reply #1 on: May 09, 2014, 06:31:28 AM »
The drawback is that there is going to be a discrepancy between the client and the server. Dynamically instantiated objects get marked as such on the server. The server keeps track of all objects. You can't simply set UIDs on the client side, you'd need to somehow set them on the server as well.

I wouldn't do it this way. I would attach a script to each object you want saved with my own identifier on them. I would be saving using this identifier instead of TNO ID. TNO ID should be left for TNet to manage.