Bugs in NeoLemmix VExNF

Started by Nepster, June 13, 2016, 08:37:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nepster

This is a thread for namida and myself to keep track of bugs in the "New Filesystem" version VExNF of NeoLemmix. Everyone else can safely ignore this post.

  • Layered drawing of levels is slow: While the layered system makes for clean, nice and readyble code, the current implementation has performance issues, to the point where even a 1-lemming level of the size of L1-levels doesn't run smoothly on my computer. The problem is, that TRenderBitmaps.CombineTo draws 10-12 level-size layers onto each other. As most of them are (almost) empty, this is (usually) far slower than creating the level image from scratch (as done in V1.43).
    A few things can be done to speed this up:
    - Draw directly on (a copy of) the background layer, instead of calling DrawTo.
    - Have flags telling when a layer is completely empty and does not need to be drawn. We might even have TBooleanMaps (at least for some layers) where one can check faster, whether the current screen position intersects the non-empty part of the layer (see also next point).
    - Only combine the layers at the screen position, instead of the whole level. Clicking on the minimap or scrolling while paused should trigger combining the layers again. To make non-paused scrolling smooth, it probably should not trigger combining the layers again, but instead we should combine a slightly larger part (by about 5 pixels) than the screen.
    However even with all of this, I am not sure it gets as fast as V1.43.
  • Remove some terrain, then go back in time: Internally the terrain gets readded again, but this is not displayed on the screen.
  • Start a level -> use a builder -> exit level -> exit to main menu -> get to preview screen of level again -> start level -> lemmings go up the invisible bridge that was built in the previous attempt (while NOT building it this time!)
  • Sprite position of right-facing diggers is one pixel off to the right.
  • Change background colors: Instead of adding contrast, they currently greatly reduce the contrast.
  • Change color scheme of shadows: They have now more contrast and are lighter than usual terrain, so they are a real eye-catcher. Instead they should be background stuff, that can easily be ignored when casually looking at the screen.

namida

Quote- Only combine the layers at the screen position, instead of the whole level. Clicking on the minimap or scrolling while paused should trigger combining the layers again. To make non-paused scrolling smooth, it probably should not trigger combining the layers again, but instead we should combine a slightly larger part (by about 5 pixels) than the screen.

This is what I was planning to try at some point. However - I will stress again; my priority at the moment is making it work, not making it fast.
When you say "it doesn't run smoothly", are you talking an unstable framerate, or just slower than normal? If the latter, how much so? If it's going to be a major issue, I can look at implementing some kind of "only draw the relevant part of screen" code now, even if for now it might be kludgy, so that it doesn't impact your playing too much.

QuoteRemove some terrain, then go back in time: Internally the terrain gets readded again, but this is not displayed on the screen.
Start a level -> use a builder -> exit level -> exit to main menu -> get to preview screen of level again -> start level -> lemmings go up the invisible bridge that was built in the previous attempt (while NOT building it this time!)

First one, I've encountered before but I had thought I fixed it. Maybe I accidentally un-fixed it again. Second one, I wasn't aware of, but is probably very closely related.

QuoteSprite position of right-facing diggers is one pixel off to the right.

Will look into this.

QuoteChange background colors: Instead of adding contrast, they currently greatly reduce the contrast.
Change color scheme of shadows: They have now more contrast and are lighter than usual terrain, so they are a real eye-catcher. Instead they should be background stuff, that can easily be ignored when casually looking at the screen.

I see these as non-urgent matters. As long as drawing them /works/, we can decide at a much later point what colors should be used for them. But for the shadows, I'm not entirely sure how I feel about them not standing out...
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Nepster

My post above was meant as "Stuff that needs to be remembered and fixed at some time" and not as "Stuff that needs to be fixed right away".

Quote from: namida on June 13, 2016, 07:48:50 PM
Quote- Only combine the layers at the screen position, instead of the whole level. Clicking on the minimap or scrolling while paused should trigger combining the layers again. To make non-paused scrolling smooth, it probably should not trigger combining the layers again, but instead we should combine a slightly larger part (by about 5 pixels) than the screen.

This is what I was planning to try at some point. However - I will stress again; my priority at the moment is making it work, not making it fast.
When you say "it doesn't run smoothly", are you talking an unstable framerate, or just slower than normal? If the latter, how much so? If it's going to be a major issue, I can look at implementing some kind of "only draw the relevant part of screen" code now, even if for now it might be kludgy, so that it doesn't impact your playing too much.
I haven't measured it precisely, but I would guess a L1-level runs constantly at about 15fps. Just slow enough that my eyes realize that the lemmings don't move continuously.
It is bad enough that it definitely needs to be fixed before releasing this version, but not enough that I need some kludgy hack right now and cannot wait until it can be coded properly.

namida

#3
I've:

Entered 1, 2 and 4 into the BitBucket issue tracker.
Fixed 3, as a side effect of fixing an even more significant physics hold-over glitch I found.

5 and 6 I'd like to wait until there's been a chance for people to use a released experimental version to experiment.


Please also note: Dirt graphic set won't work in the latest commit (if you re-convert it yourself or use a copy from an older commit it will work though). It's because I'm using it for some WIP stuff, and haven't written all the code to go with it yet. (EDIT: As of commit da45ef2, it works again.)
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

Try commit b471976 or newer. I wrote some code to improve the speed by not combining the off-screen parts of the layers. There are some side effects; I'm working on fixing these.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)