Ysh wrote:
- Code: Select all
boolean inDarkness = true;
for(LightSouce s : sources) {
if(player.getc().dist(s.getc()) <= s.getRadius()) {
inDarkness = false;
break;
}
}
I think this calculation ignoring wall is O(n) with number of light source per player. When you consider that decision on which object to send to player client is already O(n) in number of total object, then I think this one is effectively O(1), since we must look at all object (including light source) anyway. This seem quite cheap to me if we do ignore walls.
MagicManICT wrote:shubla wrote:It does get quite expensive with walls and objects blocking light. Even without them it still sounds like a very expensive calculation to make.
What gets expensive is lighting textures. Testing lights vs vertices and vectors is relatively cheap in the realm of 3D math. It is only a couple of floating point calculations per wall segment. When it's a 2D map, it's really cheap.
Granted that the server probably doesn't have a GPU on it for optimizing this sort of thing, which would then make such calculations so fast as to be a non-issue.
Yorla wrote:Errr, what? What electroplating has to do with light in caves?
Yorla wrote:To the supporters of the idea: You are proposing to punish people with low fps and poor vision who use light hack (not only them, but still) while you can have it your way just without using the hack. Why are you so cruel?
shubla wrote:Ysh wrote:
- Code: Select all
boolean inDarkness = true;
for(LightSouce s : sources) {
if(player.getc().dist(s.getc()) <= s.getRadius()) {
inDarkness = false;
break;
}
}
I think this calculation ignoring wall is O(n) with number of light source per player. When you consider that decision on which object to send to player client is already O(n) in number of total object, then I think this one is effectively O(1), since we must look at all object (including light source) anyway. This seem quite cheap to me if we do ignore walls.
Player moves. It's O(n) being done every server-tick for every player that is in cave, because the state of being in light or not may change as the player or light sources move. I am also pretty sure that the server currently does not iterate through every object that is near the player every server tick.
Kaios wrote:Spice Girls are integral to understanding Ysh's thought process when communicating, duly noted.
Granger wrote:Yorla wrote:To the supporters of the idea: You are proposing to punish people with low fps and poor vision who use light hack (not only them, but still) while you can have it your way just without using the hack. Why are you so cruel?
You might notice that you would still be able to run with a light hack. I also expect that, should darkness enforcement on the server be implemented, the custom clients will, within a few days, have a nice (or not, depending on viewpoint) skynet tactical overlay to mark the dark areas for you.
So no, I'm not being cruel to people with sight issues or shitty computers.
The idea aims at increasing immersion, with the side effects of slowing down early world cave exploration (as you can no longer stroll through a cave with a gearless fresh-spawn), slowing down development of mining operations (for the same reason) and to attach a cost (in the form of an item sink) to living in cave bases (which currently are easier to create and maintain than surface ones).
Ysh wrote:shubla wrote:Ysh wrote:
- Code: Select all
boolean inDarkness = true;
for(LightSouce s : sources) {
if(player.getc().dist(s.getc()) <= s.getRadius()) {
inDarkness = false;
break;
}
}
I think this calculation ignoring wall is O(n) with number of light source per player. When you consider that decision on which object to send to player client is already O(n) in number of total object, then I think this one is effectively O(1), since we must look at all object (including light source) anyway. This seem quite cheap to me if we do ignore walls.
Player moves. It's O(n) being done every server-tick for every player that is in cave, because the state of being in light or not may change as the player or light sources move. I am also pretty sure that the server currently does not iterate through every object that is near the player every server tick.
I do not consider this point. Do you know when or how does server evaluate when to send object? It seem to me that object changed/removed messages are sent at consistent positions, which I think will imply that it is not checking my position on timer, but rather every time I move. If this is the case, then I think my point still stands. I admit that I do not study this game that closely though.
Users browsing this forum: Archipenos, Claude [Bot], Trendiction [Bot], nachtmaerie and 84 guests