In response to Zagros5000
Mate you know how it goes, you need to make 32x32 blocks and put them together I know I know it will take you few months to make a whole map like that instead of few days but yeaaaaaaah good job. :V
Well also if you want larger dynamic objects you have a problem with this bug, its not only about maps
Okay, I have engineered something of a fix for static objects.

This really should not be used with objects that are going to move. This hack does do the trick... I think. It does break clicking, verbs, and a hell of a lot more. But for simple background objects, this should at least prevent the flicker.

It's also really, really unoptimized, because reasons.

Without my system:



With my system:



Here's a link to a demo showing an implementation of it.

http://files.byondhome.com/Ter13/bigicontest_src.zip

In order to use it, you need to set big_icon_fix to 1 on the static scenery object. Then, you also need to set the fix_width and fix_height to the number of tiles that the icon takes up on each axis. You can calculate this by: ceil(icon_width/TILE_WIDTH), ceil(icon_height/TILE_HEIGHT).

Ceil means round up, by the way.

Fair warning, it's probably unwise to use this. It's a serious hack.
In response to Ter13
I actually love you


it basically uses 0 cpu too what more would you optimize?
it basically uses 0 cpu too what more would you optimize?

The more big objects clustered in an area, and the more clients in the world, the worse performance will be.

There are likely ways to ensure that updates don't have to happen as often that they do. Currently, it has to loop through all "fixed" objects every time the client moves.

There are also likely major problems with it and corner cases where it's going to break shit... I really just wanted to prove the concept.
damn, looks like it does use too much CPU for a multiplayer game

edit: for the way it is atm at least
damn, looks like it does use too much CPU for a multiplayer game

Yep. Not much hope except for Lummox to fix it.
I think this is the most important bug in the entire engine. Once this is fixed I really don't see any other major problems with using DM(other than some rendering issues). Hopefully it'll happen soon, I've been waiting for this to start releasing small demos of Transcendence.
Ter that's brilliant that you've managed to solve that issue (to the best ability that we can in softcode), But are you aware that a for each in DM is faster than an iteration and then accessing the index of the list with that iteration?

for example:

for(var/a in list)
//is faster than:
for(var/i in 1 to list.len)
list[i]
//and both are faster than:
for(var/i = 1, i<=list.len, i++)
list[i]

(Not sure why DM's in+to+step operators are faster than an i++ loop, they just are, I know you have more knowledge of Byond's insides that I do and if you have any hints or ideas about it I'd love to hear them!)

Anyways a structure like this:

            var/list/chunks = o.chunk_locs
var/len = chunks ? chunks.len : 0
var/map_chunk/c
for(var/count in 1 to len)
c = chunks[count]
c.AtomLost(o)

Appears a lot in your demo, to the point where the performance differences here may be enough to have an impact

For example, a profile of 1000 loops of a list of len 1000



Loops from the above demo:
(All that's missing is a len print verb and a for(var/i in 1 to fillamt) loop for populating the list)

/mob/verb/testI()

. = 0
for(var/j in 1 to 1000)
for(var/i in 1 to testlist.len)
. += testlist[i]
world << .


/mob/verb/testEach()

. = 0
for(var/j in 1 to 1000)
for(var/a in testlist)
. += a
world << .


Another optimisation that can be applied on top of the above is something that I've taken to calling an "istypeless-forloop", as you know specifying a type in a for header

for(var/a/type/path/P in list)


allows byond to filter by that type, but if the list only contains that type (or prototypes of the type that has the var you need to access) then the filtering byond does is costly and needless. Of course this optimisation is VERY situational, requiring the list be of specific types


And with all the above optimisations, your above structure looks like this:

var/list/chunks = o.chunk_locs
for(var/c in chunks)
var/map_chunk/C = c
C.AtomLost(o)


tl;dr Great demo, just take a look at the above optimisations and see if it alleviates some of the cost, as part of my work maintaining and optimising /tg/station SS13, these tricks have been VERY helpful.

Ter that's brilliant that you've managed to solve that issue (to the best ability that we can in softcode), But are you aware that a for each in DM is faster than an iteration and then accessing the index of the list with that iteration?

That's interesting, because The last person from /tg/ that talked to me about for..in told me it is actually slower than the for..in..to.. pattern. =/

Thanks for that, though. I'd swapped to a for in to step pattern because the /tg/ guys told me it was faster in every case. ...I guess I'll be swapping back.
In response to Ter13
Ter13 wrote:
Ter that's brilliant that you've managed to solve that issue (to the best ability that we can in softcode), But are you aware that a for each in DM is faster than an iteration and then accessing the index of the list with that iteration?

That's interesting, because The last person from /tg/ that talked to me about for..in told me it is actually slower than the for..in..to.. pattern. =/

Who were they? I'll bap them on the noggin :P

for(var/i in 1 to X)

is faster than:
for(var/i = 1, i <= X, i++)

But DM isn't the best at indexed list access, so the for each wins out over these two when dealing with lists specifically
I ain't no snitch.

But seriously, thanks. Overall, I'd advise against using this softcode fix...


A quick note. Lummox could probably very seriously eke out a LOT of performance improvements from DM as an engine and fix a lot of standing bugs with the implementation by switching to quadtree/chunkmap solutions just about anywhere that he iterates through the raw map data.
Surprisingly, "for = to" is faster than "for in to". (operators are interchangeable in terms of using the to operator)

I believe the in operator may be doing type checking for the value that follows it, thus making the "for in" slightly faster than "for in to". However, the case for the looping through indexes is so you can edit the list as you go, while the for each loop makes a copy of the list.
Whats the progress on this? -_-
In response to Zasif
Exactly what I said it was: Not forgotten, but in limbo while I work on other important priorities. It is not a trivial thing to fix.
In response to Lummox JR
How is this not a trivial thing to fix? a bug thats been around for at least 5 years, are you joking me? This bug makes things alot harder for developers that use large icons to actually work on those projects. Not trivial my hot butty!
In response to Zasif
Zasif wrote:
How is this not a trivial thing to fix? a bug thats been around for at least 5 years, are you joking me? This bug makes things alot harder for developers that use large icons to actually work on those projects. Not trivial my hot butty!

"Non-trivial" does not mean "non-important". This bug is very important to me, and frankly I think it's going to end up being a much higher priority as large lighting objects and parallax backgrounds start to make their way into more games.

No, "non-trivial" means it's darned difficult to fix. Not impossible, just difficult. I have a rough idea of how to approach it, but it's going to take time to flesh that out, and in particular it will take dedicated time to work on it.
I remeber this not been an issue in the more early versions of byond like 504-505, maybe you want to take a look back and see what has been changed to 506-507 that made the bug show up.
In response to Zasif
Zasif wrote:
I remeber this not been an issue in the more early versions of byond like 504-505, maybe you want to take a look back and see what has been changed to 506-507 that made the bug show up.

No, it's always been an issue. The code governing this hasn't changed.

I hate this so much -_-!

Tests: Alright from my tests that I've done it seem after awhile and after .dyn.rsc, dyn.rsc.lk, .int, .lk, .rsc.lk fill up with few kbs the background no longer vanishes, if I delete all of them the problem shows up again.

EDIT: Nevermind its back again lel. Seems to be happening almost randomly when it wants to!
Page: 1 2 3 4 5 6 7