Official Community Forums
 
HomeHome  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  The Wiki  Website  github Project  

Share | 
 

 world instancing

View previous topic View next topic Go down 
AuthorMessage
tichfuie
Super Contributor
Super Contributor
avatar

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

PostSubject: world instancing   Fri 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


Posts : 424
Join date : 2011-08-03

PostSubject: Re: world instancing   Sat 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
avatar

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

PostSubject: Re: world instancing   Sat 6 Apr - 12:26

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


Posts : 424
Join date : 2011-08-03

PostSubject: Re: world instancing   Sat 6 Apr - 12:55

Server java
Back to top Go down
Sponsored content




PostSubject: Re: world instancing   

Back to top Go down
 
world instancing
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Forge World 40 K
» ~FORGE WORLD OPEN DAY~
» Forge World Painting contest
» news forge world
» Forge world nob bikerz

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