Best way of implementing player houses

In a game I’m working on right now, I’m looking to implement a feature where players can create their own houses. These houses can be created on demand by the player, and different layouts can be selected on creation. Then, the player can decorate the interior with their own furniture, wallpaper, and so on. The player can also set extra controls, such as who can enter, the max player count, and who has build rights.

The way I’m currently looking to implement this uses the Create Place API:

  • When a player creates a house, a template place will be copied using CreatePlace, and the house data (layout, furniture, build rights etc.) will be saved into a DataStore.

  • The template place needs to fetch the latest version of scripts and stuff when it’s started. I’m thinking of using the new (and currently not available) auto updating packages feature for this, since packages can contain more than just scripts, which would be highly useful!

  • After the template place is copied, the player’s place will get a reserved server which is used to limit the number of instances to a single instance. This is used when teleporting the player to their place.

  • When the player’s place starts (after all the stuff is fetched), it will read the house data from the DataStore and build the house’s layout and furniture, so everything looks as the player left it previously.

  • As the player tweaks the settings for the house (changes who has build rights or changes the max player count), or changes the furniture, this gets pushed to the DataStore.

  • Players will be able to delete their houses too. I have no idea how to do this, except for removing the DataStore info. Help appreciated!

  • Other players will be able to browse through a list of popular houses, or search for houses. This list should ideally show the number of players currently in each house, prevent people from joining houses with the max number of players in, and let them search houses by name. Again, no idea how to do this! It might have something to do with OrderedDataStores?

Is this a good use of CreatePlace? What would you do differently?

3 Likes

When is this saved?

If this is everytime the user changes something read below;

Instead of saving the info on the Data store each time the assets are changed, why don’t you just do it on player removing? This way, it will save ALL the changes made to the house, and you are not calling the datastore and it’s functions as much. This is what I’m getting from this, but if I’m mistaken, please correct me.

1 Like

The new settings should be available as soon as possible, otherwise the house browsing UI would get outdated information about things like the max player count for a house. I’ll use some form of throttling system in the settings UI, where you can only change the settings once per minute or something similar.

1 Like

I feel like you should have a check using player removing just as a final “filter”, and to make sure that all the assets are saved.

No, the houses exist in isolation, rather than as part of a larger game world. Think along the lines of Habbo Hotel or similar games.

You could have players work on the same server, but then all they can see is their own loaded plate (client-side building)…

And then, if they type the name of your user id, they can load your base onto their client.

Removing data is equivalent to “removing the house”. This itself should be sufficient.

Make sure your using RemoveAsync to do this.

1 Like

Instead of relying on packages to update scripts, you could have them require a module that you update. (Just as a temporary thing)

I know how to delete the DataStore information already. I’m more concerned about deleting the created place and reserved server, if that is at all possible.

I could do this, and I might end up doing it anyway, but also if auto updating packages get released it would make working on the game much more convenient! :smiley:

1 Like

Yeah, it’d just be a temporary solution so that you don’t have to wait to release your game if packages take a while.

1 Like

I don’t think there is an option or method to remove created places.

It seems to be a problem in the past as well, and I am certain there does not seem to be a workaround.

The only thing you can do is leave the place alone.

1 Like
  1. Of course it’s up to you what you want to do, but you don’t have to create a new place just for a house. This could be implemented in the original place if you wanted.
  2. That seems like a good idea. Or at least saving data marking it as removed if you want it to be recoverable or archived.
  3. If you want to quickly search/sort integers, then yes.
2 Likes