ID:265740
 
ScreenSize(tile) 8x5
TileSize 32x32

Assuming there is a full screen of objects, would there be any real benefit if the icon data were copied to an another buffer of objects and then copied into the screen list? like an off screen buffer of objects perhaps?

world/maxz=1;
var tmp/bufferData[80]
client/New()
mob=new/mob{}(null);
var i=0;
var atom/movable/obj;
while(i < 80)
obj=new/atom/movable{}()
obj.name = "#[i%40]"
obj.screen_loc="[1+(i&7)],[1+((i>>3)%5)]"
i++
bufferData[i]=obj;
i=0
while(1)
i^=1
screen=bufferData.Copy(i*41,(i^1)*41)
Alter();
sleep(1);
proc/Alter()
var i = (world.time&1);// put an ! @ this line and observe the visual difference.
var tmp = bufferData.Copy(i*41,(i^1)*41)
var gfx = 'dull.dmi'; // black box;
var atom/movable/A
gfx+= rgb(0,rand(240),rand(240));
for(A in tmp)A.icon=gfx;


The above is set up so that the icons are updated while the objects are off screen..or vice versa. *shrug* I observed a slight improvement when doing this, tearing still occurred but a lower frequency. It isn't life threatening obviously, I'd just like to know.
side note: does dream seeker have some sort of hierarchy? Are displayed objects given a 1 up on objects undisplayed? I'm unsure seeing as such an implementation would require constant shuffling of a list.. if someone could answer this question as well, it'd be a real plus.

Regards,
Eloc
What follows is all supposition. I haven't actually tested these assumptions; they're just educated guesswork based on what I think happens. For best results, test it yourself. You could use a packet sniffer like Wireshark to compare how much traffic each method generates.

It probably doesn't matter whether you:

A) create an object off-screen, change its properties, move it on-screen

or

B) create it on-screen and change its properties

Provided that you don't pause (e.g. call sleep()) between creating the object and changing its properties. If you do, then the object will get sent over the network twice in case B, so you'd prefer case A.

However, if you move an object off-screen, then modify it, then move it back on-screen, that's more expensive than just modifying it in-place. So don't do that.


side note: does dream seeker have some sort of hierarchy? Are displayed objects given a 1 up on objects undisplayed? I'm unsure seeing as such an implementation would require constant shuffling of a list.. if someone could answer this question as well, it'd be a real plus.

Not sure what you mean. What kind of hierarchy are you talking about?
In response to Crispy
Not sure what you mean. What kind of hierarchy are you talking about?

I meant if objects within the immediate view window are given a higher priority as far as drawing goes? But now that I think of it... such would be theoretically inefficient seeing as the 'view' window is relative to each client connected, unless dream seeker has some sort of capability which makes light work of such a case.

ps: I doubt I'll be making any network-ready games any time soon, multi-player design isn't something I pride myself on, and seeing as the improvement of using such one method over the other(methods i described) isn't substantial, I doubt this is something worth chasing.

Regards,
Eloc
In response to Angel_Inc
Objects that are not on in a client's view are not even sent to that client. =) (There might be a 1-tile border or something, I'm not sure.)
In response to Crispy
Oh I see. Thanks alot.

Regards,
Eloc