Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

Entity.index changes coming soon!


koonschi
 Share

Recommended Posts

  • Boxelware Team

Entity Index Change to UUIDs

I'd like to inform you beforehand that we'll be changing the Entity.index from a 32bit number to a 128bit uuid. This will most likely not affect you if you're not writing mods, and even then it might not affect you, but I found it important to tell you this.

 

Why's that?

Because it's about damn time! I wanted to do this for a long time but I always thought "later will be a better time". Well, it is later now. We're doing this change because we've always run into problems with the 32bit number. Entity indices have to be changed often, for example whenever changing the sector, leading to issues when turrets (which are their own entities) have to find their parent, which has been an issue that's been popping up recently. With the introduction of the new 128bit number, we can easily assign fixed, server unique IDs to entities, without having to worry about duplicates, even on a server-global scale.

 

When is it coming?

Sooner, rather than later. I'm not sure how and when we'll introduce the change, but we're currently working on this since it will pave the way for other features, fixes, improvements and simpler code. It might come this week, next week or in a month. But it will definitely be part of one of the next patches.

 

Why are you telling us this?

I'm telling you, because I wanted to give you a head's up of a fundamental change that might affect you. If you've been using the Entity.index property as a number, then you'll have to adjust your mod. If you've been using it solely for comparing entities or checking if an entity is there, etc. then you probably won't even see a difference. I'm working on making this transition as painless as possible.

 

But I don't want to adjust my mod, can't you just work around this?

No. We've been working around this problem for a long time and it's lead to more problems than it avoided. It's time that we make this change, even if it might break a few things or if things have to be adjusted. This is the long-term solution and it will make a lot of things a lot easier.

 

I wrote a mod that uses the index, what should I do now?

If you've been using it only for comparing entities or checking if an entity is there, etc. then you probably won't have to do anything. Entities will receive unique IDs upon first loading of a save, and they will keep those ids. If you've saved IDs into files or in other places, then you will have to adjust that.

 

How will the new Ids look like?

They'll be normal UUIDs, meaning they'll have 128 bits and when you print them they'll look like a string of hex numbers, separated by dashes: 6a12a4d5-e9e6-4568-afcc-34c70b24a668

 

I think that's all you have to know for now. I'll let you know if anything else comes up.

Have fun!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...