ID:265324
 
Umm well I made a testing world and tested some stuff for my game. What I did was make a world full of turfs 40K to be exact. And then had them change their dir all to east at once. This took on average 2 seconds. Then I added 30K objects to the map and changed their dir which gave me another second so a total of 3 seconds to handale 40k turf and 30k objects.

Well kinda disappointed I thought that byond could handle pre defined icons faster than that oh well. So I tryed to start thinking how I could push this to a second on average. Why so many turfs and object changes? I plan on chaning a lot of my icons in game and was just wounder what the (time-amount) would compair.

So I came up with changing only those obj/turf dirs in view. Then just change the dir of the other obj/turf around me before I moved. This produced an under a second change for all those in view. And from my test if they are accurate it took under a second to change the ones when I moved. So that seemed pretty good.

Then I decided to test the changing of icon_states instead of just dir's. So I made a state SOUTH, and EAST and edited my code a little so it would change all the icon_states in the world. To my dismay it took on average 5 seconds to change the icon_states of all the obj/turf in the world

Why does it take longer for icon_states than dirs?

I also tested the icon_states with the inview and then change on movement and they only took on average a seconds time to do like dirs.

Umm does this speed of changing icons also relly on the speed of you computer? So if I had a faster computer it would process the dir/icon_state changes faster?

Im guessing the obj/turf and other types do not dither on the changing of dir/icon_state. They are all changed at the same speed right?

Also I could just use many small maps and link them to one another to reduce the lag between dir/icon_state changes right?
Green Lime wrote:
Umm well I made a testing world and tested some stuff for my game. What I did was make a world full of turfs 40K to be exact. And then had them change their dir all to east at once. This took on average 2 seconds. Then I added 30K objects to the map and changed their dir which gave me another second so a total of 3 seconds to handale 40k turf and 30k objects.

Well kinda disappointed I thought that byond could handle pre defined icons faster than that oh well. So I tryed to start thinking how I could push this to a second on average. Why so many turfs and object changes? I plan on chaning a lot of my icons in game and was just wounder what the (time-amount) would compair.

70,000 changes in 3 seconds is very fast. Try loading up a modern PC game. Those games load only around 10,000 objects at a time (including terrain geometry), and loading times can often range from 5 seconds to 30 seconds.

People often overestimate the power of modern computers. =)
In response to Spuzzum
Spuzzum wrote:
Green Lime wrote:
Umm well I made a testing world and tested some stuff for my game. What I did was make a world full of turfs 40K to be exact. And then had them change their dir all to east at once. This took on average 2 seconds. Then I added 30K objects to the map and changed their dir which gave me another second so a total of 3 seconds to handale 40k turf and 30k objects.

Well kinda disappointed I thought that byond could handle pre defined icons faster than that oh well. So I tryed to start thinking how I could push this to a second on average. Why so many turfs and object changes? I plan on chaning a lot of my icons in game and was just wounder what the (time-amount) would compair.

70,000 changes in 3 seconds is very fast. Try loading up a modern PC game. Those games load only around 10,000 objects at a time (including terrain geometry), and loading times can often range from 5 seconds to 30 seconds.

People often overestimate the power of modern computers. =)

Yikes! Well I just tried to use the image object but it froze from all the lagginess. I'm not sure if its my coding or the actual lag image objects cause.

mob/var/list/ImageCopy = new/list()

:Inside Verb:
del(ImageCopy)
ImageCopy = new/list()
var/turf/grass/G
for(G in world)
var/image/I = image(G.icon,G.loc,G.icon_state,G.layer,TDIR)
usr << I
ImageCopy.Add(I)
//G.dir = TDIR


Thats the basic gist of it. I have in a verb when I click it deletes any all ready made ImageCopy list. Im thinking that deletes the image objects that are stored in the list too. Im not too sure on that though. Then I make a new null list ImageCopy too place my up coming image objects in. Then I go into a for loop for the whole world getting all the turfs which are G. Then I make my image object and assign its propertise with the image() proc. Then display it to the usr and add it too the list.

The last part is just apart of the other code that I commented out.

So is there a coding problem or are image objects super laggy?
In response to Green Lime
Um... you're creating 40,000 objects at once and you're expecting that to be FAST?

That's a *lot* of memory being allocated and manipulated behind the scenes there. Object creation is complicated.