Jump to content

Recommended Posts

I'm posting this question in the mods section because I have a feeling a solution, if one exists, will be in the form of a mod.


 


In regular Don't Starve, when you use the ShowArea(int, int, int, int) method, it reveals map terrain and the entities in the radius. In DST, the same method only reveals terrain without entities, even if the host is the one doing the revealing. I suspect this is because in DST, the server (dedicated or not) is the arbiter on what entities clients can see.


 


Having said that, I am also suspicious that this may actually be an issue with the minimap system rather than not having data loaded, because modifying clients' FOV to something ludicrously high and having them run around at high speeds has entities being loaded up already with no apparent lag spikes.


 


My question: Is there a way to force a DST server to send the necessary data to clients so that they can view entities in areas they haven't explored yet, or is this a case of the minimap inner-workings still being buried in native code that the Lua API can't interact with?


Easily, no. Even if your client knew about the icon I'm pretty sure it wouldn't be drawing it. The icons you see in the distance are cached icons on the mini map. It would be possible but would require a lot of work and it wouldn't be done very cleanly. (Creating dummy objects for a second to cache the icon on the minimap)

Edited by Sarcen

Easily, no. Even if your client knew about the icon I'm pretty sure it wouldn't be drawing it. The icons you see in the distance are cached icons on the mini map. It would be possible but would require a lot of work and it wouldn't be done very cleanly. (Creating dummy objects for a second to cache the icon on the minimap)

 

Thank you for the speedy response! I figured it would be ugly, one way or another.

 

One clarification - when I said that entities were loaded up during the FOV test, I meant that they were visible during the normal game view. As in, the client clearly had the entity data available as entities weren't suddenly popping in when I was zipping around the map at very high speeds, as you might expect them to if entities were sent entirely via the network. I tested this over the net on two computers very close geographically though, so it might just be that our ISP was behaving very well.

 

I'm interested in your suggestion about creating dummy objects. Are you suggesting that the client creates dummy objects in the reveal area based on data it already has, or are you suggesting the server do the same and then send the data? Or am I way off the mark?

Entities are only loaded in a large circle around you, you can see it my changing your camera distance as client (TheCamera.maxdist = 200 or so in console). Also, You can't zip around the map without the server putting you there, with that I mean is that the server is already actively sending all those entities around you, even if going at fast speeds...

 

With dummy objects I mean simple prefabs spawned on the client side that only contain an icon for the specified prefab. The location and prefab would be specified by the server in a global (no transform) networked entity.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...