Would you like to react to this message? Create an account in a few clicks or log in to continue.

Official Community Forums
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  The Wiki  Website  github Project  

 

 world instancing

Go down 
2 posters
AuthorMessage
tichfuie
Super Contributor
Super Contributor
tichfuie


Posts : 257
Join date : 2013-02-07
Location : NA

world instancing Empty
PostSubject: world instancing   world instancing EmptyFri 5 Apr - 17:09

any1 knows if there is a current flag that can be set to clamp the max players that can enter a world instance?


lets say you want to use the same world and make instances of it as player population grows.
ie:
world max player capacity is reached then server create new instance, once capacity reached, another is created
and so on.....

but at the same time when a particular world instance is empty the server will destroy it.

is all these already implemented?
Back to top Go down
Delurin
Head of Platform Development
avatar


Posts : 424
Join date : 2011-08-03

world instancing Empty
PostSubject: Re: world instancing   world instancing EmptySat 6 Apr - 2:29

It is not directly implemented but they had it in mind and I dont think it would be all that hard to implement.
In rough detail you would need to modify the instance entry to check the number in the instance and then spawn a new instance. and when some one leaves check to see how many people are in the instance and if there are none delete the instance.

Here are some code segments to help.... let me know if you get something working.

Code:

    public static void CloseInstance(Long instanceOid){
      InstanceClient.deleteInstance(instanceOid);
   }
   
   public static Long CreateInstance(String instanceName){
      //create new instance for players
      Template override = new Template();
                /Overrides the template instance's name so they are not identical
      override.put(Namespace.INSTANCE, InstanceClient.TEMPL_INSTANCE_NAME, instanceName + Engine.getOIDManager().getNextOid());
   
      Long instanceOid = InstanceClient.createInstance(instanceName, override);
      if (instanceOid == null || instanceOid.compareTo(0L) == 0){
         Log.error("Instance was not created");
         return null;
      }
      Log.debug("Instance was created");
      return instanceOid;
   }


You would need to add a way to look up all of the instance with that template I was using this code to create a private instance for a group of players so it just sent the ones entering the appropriate instanceOid.
Back to top Go down
tichfuie
Super Contributor
Super Contributor
tichfuie


Posts : 257
Join date : 2013-02-07
Location : NA

world instancing Empty
PostSubject: Re: world instancing   world instancing EmptySat 6 Apr - 12:26

is this on the C# client?
or the server java?
Back to top Go down
Delurin
Head of Platform Development
avatar


Posts : 424
Join date : 2011-08-03

world instancing Empty
PostSubject: Re: world instancing   world instancing EmptySat 6 Apr - 12:55

Server java
Back to top Go down
Sponsored content





world instancing Empty
PostSubject: Re: world instancing   world instancing Empty

Back to top Go down
 
world instancing
Back to top 
Page 1 of 1
 Similar topics
-
» The Real World as a Base Game World
» "Hello MV World!"
» Hello, world!
» How do I create a new world?
» The Demo World Is Unavailable

Permissions in this forum:You cannot reply to topics in this forum
 :: Development :: Getting Started-
Jump to: