Custom AOI

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Custom AOI

Postby Mrm83 » 07 Jun 2018, 14:41

I have a problem that I need to solve regarding AOI

by default, the AOI is 10,10,0 (2d game), and this is fine for regular users.

However, if I login as an admin, I would like to see a bigger range of whois within proximity, so maybe 25,25,0.

How can I achieve something like this? advanced-mmo-api page says it not possible to set a larger value than default.. so does that mean my use case is impossible?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom AOI

Postby Lapo » 07 Jun 2018, 15:55

Yes, this is not possible, sorry. At least not with the MMOAPI.
From server side however you have access to every user in the Room, so you can have custom requests for Admin only that can access the Room in a different way compared to a regular user.

To give you and idea, in order to keep track of everyone's AOI the server must create a pretty complex 2D/3D data structure that uses a fixed AOI value.
In order to support multiple AOIs we would need to be able to maintain multiple data structures for multiple users... making it very resource demanding, and complicated to manage.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom AOI

Postby Lapo » 08 Jun 2018, 14:10

Update: thinking about this issue a bit more I realized that there is a way for an Admin to se a larger are of the map compared to regular users. From server side you can query a certain position of the virtual map, for example:

Code: Select all

List<User> clients = getProximityList(Vec3D position, Vec3D aoi);
List<BaseMMOItem> items = getProximityItems(Vec3D pos, Vec3D aoi);


This code allows you query any arbitrary area, provided that the custom AOI is <= Room's AOI. In other words you can query an area smaller or equal to the Room's AOI.

This however can be extended by querying multiple blocks to effectively read a larger portion of the map. If the AOI is (10, 10) in 2D you can query multiple adjacent (10, 10) areas and obtain a larger view of the Room.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: Custom AOI

Postby Mrm83 » 08 Jun 2018, 15:22

Yeah, spent hours rereading many of the posts and pages and I thought of this as well.

are these calls performance heavy though?
List<User> clients = getProximityList(Vec3D position, Vec3D aoi);
List<BaseMMOItem> items = getProximityItems(Vec3D pos, Vec3D aoi);

It is likely that I will be calling this 1000 times every 100ms assuming 1000 users are moving continuously.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom AOI

Postby Lapo » 08 Jun 2018, 17:54

I'd recommend to test it out because, as I mentioned, "performance intensive" doesn't mean very much without a context.
On a small server it might be, on a dedicated multi-core machine it probably won't.

You can write a test Extension and run it to see how it behaves.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 69 guests