World Width Height value settings

Options
thetnswe
thetnswe ✭✭
edited March 2011 in DotNet
Hi,
How can I specify the MMO world's width and height value.. The island demo use 19999x19999 and Unity grid demo use only 100x100 .... I see the horizontal and vertical settigns in the Settings.cs and Grid demo use the following values..

const int BoxesVertical = 10;
const int BoxesHorizontal = 10;
const int EdgeLengthVertical = 20;
const int EdgeLengthHorizontal = 20;

and I changed it to the following values and the MMO world size is not changing..

const int BoxesVertical = 20;
const int BoxesHorizontal = 20;
const int EdgeLengthVertical = 1000;
const int EdgeLengthHorizontal = 1000;


..so how do we know that how much size that my world needs.. How can I calculate the size of the world and create the MMO world with custom size? Does it calculate using Unity Units??

Comments

  • Boris
    Options
    That is indeed a bit confusing.

    Each world has a unique name, and only the first CreateWorld caller will be able to set the dimensions.
    The client grid is initialized from the EnterWorld response parameters, not from the settings.
    You have to either change the world name or restart the server in order to get the size you expect.
    To increase the confusion there is a documentation line above the settings saying the terrain is 2000x2000, but we set the area to 20000x20000 - this is because each coordinate is multiplied times 10 (see MmoEngine.PositionFactorHorizontal + Vertical) before sending it, probably a left over when all coordinates on the server were just integers - so this should not be necessary anymore.

    The current way of setting the world size is also not optimal for every use case because it assumes that your top left corner of the world is always at (1,1).
    Line 110 of class Photon.MmoDemo.Client.GameStrategies.Connected is where the CreateWorld call really happens.
    Operations.CreateWorld(game, game.WorldData.Name, game.WorldData.TopLeftCorner, game.WorldData.BottomRightCorner, game.WorldData.TileDimensions);
    
    and the game.WorldData is set from the settings in class Photon.MmoDemo.Game line 131.
    new WorldData {
       TopLeftCorner = new[] { 1f, 1f }, 
       BottomRightCorner = new float[] { this.settings.GridSize[0], 
                                         this.settings.GridSize[1] }, 
       Name = this.settings.WorldName, 
       TileDimensions = new float[] { this.settings.TileDimensions[0],
                                      this.settings.TileDimensions[1] }
    };
    
    Ideally you would use your real world corners and choose tile dimensions about the size of the minimum view distance you want to support.
  • thetnswe
    Options
    Thanks.. it works for now...

    Any way to calculate the grid size to cover my whole world.. Currently, I have a city level where I am trying to make this level as an MMO . How can I know which grid size is the best for my MMO world.. is the grid size 1 unit the same as Unity's 1 unit??
  • Boris
    Options
    Yes, you just use the coordinates from unity.
  • thetnswe
    Options
    Thanks.. it's solved for now... This demo is working fine for me and doesn't have subscribe/unsubscribe behaviors... I don't know why the island MMO demo is not working for me. :( anyway.. any good news for bootcamp demo?? I am still waiting for this to see how you have done the animation syncing and raise event operations...
  • Tobias
    Options
    It's now in the Asset Store. Simply download through the Unity Editor.