[Question] - Virtual Worlds?

References:
(1) - http://wiki.sa-mp.com/wiki/SetPlayerVirtualWorld
(2) - http://gtaforums.com/topic/548238-virtual-world/

I’ll start by saying my lua knowledge is very very limited so this question is essentially: “Do you know if what I’m describing is possible to accomplish thru GTAV?”

Back in the days of San Andreas multiplayer they had a function for setting a player’s ‘virtual world’ (see reference 1). What this did was prevent someone in virtual world #1 from seeing/interacting with any players or vehicles from other virtual world (such as the default world #0, or for example #145).

This would allow two players standing in the exact same coordinates to ‘technically’ be in two different places.

To me… this seems to be exactly what Rockstar does in GTA:Online with apartments. Two players can own the same apartment unit, but when they each enter their apartment interiors they are identical but they do not see each other inside.

Does anyone know how to go about doing this? Reference (2) seemed to think it was not.

4 Likes

i want to know this too :stuck_out_tongue:

You mean different dimensions. I remember MTA SA had over 1000. very good for housing script. And for sending Knoobs to XD (Hey Knoob pick any number from 1-1000. What every number you pick that’s where your going XD

I’m guessing no one has any ideas then?

Too wanna know. Subscribed to this topic.

if that’s what I’m thinking, there’s an ESX-Org mod that does this

Hm, thanks.
This is helpful :wink:

Do we have a non esx version of this at all? Can’t seem to find one and I need one for my server. I will try and make on without esx but would be surprised if I can convert it

apparently the only function of ESX in the code are the notifications, remove the dependencies and change the notifications that should work

1 Like

Have looked at that code but what it “only” seems to do is set players invisible to each other and turn off each others collisions when in different “instances”.

However this isn’t a true instance unfortunately, will still cause issues when wanting to use it for garages for example, or when you would like to use objects in a home (when they are synced for example)

2 Likes

What? You are aware any entity can be set as locally-unusable, right?

‘True’ instances are generally unwanted, even R* doesn’t use them.

Yes I am, but in this thread it clearly asks about the same instance use as with SA-MP in and for which I have developed many years, and there it did had the effect of a ‘true virtual instance’ (for the scripters) as to which the linked function doesn’t do.

The linked function only sets the players invisible but does not handle vehicles or other object at all.

There it was as simple as “SetVehicleVirtualWorld(vehicle, Vworld);” and same for player’s.

And since that was (for scripters atleast) considered a ‘true virtual world’ since that’s all they needed to do (and it worked very well).

This function to where is linked only makes the player invisible and attempts to set the collision to false (where the latter doesn’t seem to work well). From there on players would still need to make sure that:

  • Vehicles that might be in the same ‘virtual instance’ are not ‘cross visible’
  • make sure objects are handled in the correct ‘virtual instance’
  • and make sure that other scripts (like playername labels for example) will recognize the script so it won’t start showing ‘invisible players’ by preventing floating texts.

Nevertheless I’m already working to see if i can re-produce what was made for SA-MP back then in GTA V, only have to find some more effective ways instead of calling a crapload of natives (to set every object, vehicle and player in it’s ‘correct world’).

Didn’t started that long ago with FiveM so not familair with all the (important) natives from the top of my mind yet, but will definitely look moor into this :slight_smile:

EDIT:
To add to the problems i’m referring to, if we just take a look at the issues section on github of that project:
" Whats also really funny about this. Is if your in your IPL and someone comes into the same one & even tho you can’t see them you can pull out a gun and kill them. Or fight them."

These things will be need to overcome by something better than just setting certain players invincible, also a “fix” suggested there to change voice channels to prevent others from hearing footsteps of other players isn’t a good solution.

Another problem which I referred to (the objects) is the doors moving (when an instanced player is in the same IPL/interior and moves through a door, other players will actually see that door movie due to a ‘ghost’.

Will work on it if i can find other solutions or perhaps re-create the SA-MP VirtualWorld’s system, although this might take (quite) a while since I’ll have to do it all by myself and have limited time at the moment.

1 Like

I am using instancing for interiors for a motel system im making for my framework. But I am considering just making it create another version of the interior and put them into that. I have seen this done before I think and will update this with an example because it may be what someone looking through this thread is looking for.

I guess i know what you mean, i’m thinking to do about the same for garages (duplicating them as separate IPL’s and loading them only per player, although before i’m going to do that i want to work on some other more ‘solid’ solution instead of the problems the current solution offers (the ESX version link here)

I have given it a try (since that’s only fair to do so), but indeed it does not come anywhere near the instances or virtual worlds of SA-MP, players can indeed just kill each other, explosions caused by player A are still seen by Player B, if it’s near Peds (normal game peds’s) and Player B would kill the ped then player A suddenly sees a ped ‘randomly dying’, when making sounds like footsteps they are still heard and often collision ‘just returns’ or doesn’t get disabled enough without making resource intensive loops.

Therefor it’s for me definitely not usable this way, and will try to see if i can manage to ‘re-invent’ the methods we’ve used for SA-MP back in the old days, but would first need to do some research on the natives and which are stable, synced and not to intensively (as in needed to do on each frame) and when i’ve found which natives would work best i could also see if there would be an possibly useful implementation or not :slight_smile:

2 Likes

i agree with you . it just sets the player invisible and its very annoying . im trying to duplicate interiors as well . do u have any good tutorial on how to do so . i tried doing it with CodeWalker once i saved the ymap it didn’t stream the walls just props . again i would be very thankful if u can link me to a tutorial on how to duplicate interiors .

Currently I haven’t looked decently enough into duplicating the entire interior (“IPL Clone effect”), due to the fact i first still want to try and work out ‘the way it should be done’ with ‘virtual worlds’. But due to family circumstances i’m having a setback in spare time at the moment and next to that i was working on a wiki for more elabortate information to setup a server + database (for people not wanting to use ESX, vRP etc but make their own framework/server properly).

When i get more time again (which should be soon) i will resume on investigating and trying at full speed again (i HAVE found some functions and calls which KIND OF might work in certain conditions but do want to be 100% certain of stability and that it’s working properly) :slight_smile:

NOTE: This isn’t at the level of the same virtual worlds as sa-mp yet though! But seems like a start.

2 Likes

great , i actually gave up on setting a player into a different instance as i thought it was impossible to be done . anyways thanks for your reply . if i come across anything i ll let you know .good luck

Any updates on this topic?

however, “virtual world” is useful and mostly needed for Role Play server, R* does have “virtual world” in GTA:O.

You can find the same feature in GTA:O, just get in your own apartment/house, find another player teleport in their own apartment/flat with exactly the same location/entries you’re in.(they need to own the same property for sure), then you’ll find out the “virtual world” feature, you’re not able to see/hear/attack them in the same transform

imagine having 500 properties with 20(even less) ipls, invisible and no collision isn’t the right way to implements this feature.(creating a thread(virtual) to sets entity’s props every loop is also bad for performance.)

There aren’t true instances. These are just some more advanced natives of the likes of the usual hiding players.