Emthree - Functionality?

I’ve tested it in both your emthree basic version and copying the logic into my game and the results are the same.

In your example of having 1 block, there’s no apparent bugs I came across. The only possible bugs are it won’t fill directly below the blocker and the empty space below a blocker sucks in stationary bricks from the wall instead of flowing down from the top. But those 2 could be design choices?

The problems begin once you add in more blockers. Some bricks treat the blockers like empty spaces and will slide into the blocker position. Once that’s happened that blocker is ignored entirely. In the example it only impacts the blockers either side of the gap but I just tested if that’s the case and it is a bug with all the blockers.

A test with more complicated blocker layout to test flow.

A test with adding a simple check for blockers in the slide function before allowing them to move.

if M.is_blocker(board, tox, toy) then
    print("Can not move. Blocker on: " .. tox .. "," .. toy)
else
    blocks[tox][toy] = block
	blocks[x][y] = nil

	-- slide diagonal
	local to = vmath.vector3((block_size / 2) + (block_size * tox), (block_size / 2) + (block_size * toy), 0)
	go.animate(block.id, "position", go.PLAYBACK_ONCE_FORWARD, to, board.config.slide_easing, duration)
	did_slide = true
end

The blocker check seems to have stopped bricks overlapping the blockers and ignoring them.

Example tests from my project, which I’m showing publicly for the first time. Sorry for quality/size but file size was too big. Board cleared using a debug button for testing.

First test using blockers. 5.5 seconds to fill and stabilize. Way too long.

seathreecomp1

Compared to no blockers. 1 second to fill and stabilize.

seathreecomp2

The blocker version does not have the same fluidity and smoothness to it. It has a very stiff feel and it is slow to fill and stabilize the board.

I hope this post was helpful.

Indeed it was! I will look into the issues you found later today.

1 Like

I’ve pushed new code to the same branch that should work a whole lot better. Please note that there are a few breaking changes:

  • emthree.SLIDE_* is now emthree.COLLAPSE_*
  • Config value slide_duration is now collapse_duration
  • Config value slide_easing is now collapse_easing

There’s also new config values:

  • slide_duration for controlling the slide (diagonal) animation duration
  • slide_easing for controlling the slide easing
  • swap_duration for controlling swap animation duration
  • remove_duration for controlling the pause duration while removing blocks

Check emthree.create_board() for defaults.

I’ve played around with the latest version all day. Below is the only possible bug I have encountered. I’ve seen it occur with the go.animate in trigger_spawners and in collapse.

I’ve only seen it happen around the same time as special blocks exploding so it is highly possibly that is a bug in my code not yours. It’s pretty rare. When I get time to try accurately reproduce it I’ll submit an issue on github if I find/suspect it is your code but at this stage I’d lean more towards my code being the problem.

go.animate(block.id, "position", go.PLAYBACK_ONCE_FORWARD, to, board.config.collapse_easing, duration) -- Error /emthree/emthree.lua:2307: '[main:/board#basic]' does not have any property called 'position'

The latest version works really well for most real world scenarios (ie You’re playing normally and not clearing the whole board and seeing how fast it refills a test board with blockers positioned purposely to slow it down). The only small issues are because it animates 1 block at a time for the diagonal slides it can slow down the refill a lot if it has to use diagonal slides to refill most of an 8x8 board.

I made a workaround for when it’s refilling a large area using diagonal slides by just progressively speeding up the collapse duration so blocks spawn and fill faster and then resetting it on stabilize.

remove_duration is not used anywhere other than create_board

Thank you so much for taking time out of your busy schedule to add that functionality. I really appreciate it. If I find any bugs I’ll submit them on github.

1 Like

Yes, please do.

Ah, yeah, this line should probably be removed actually:

I haven’t tried but it should still remain stable.

Nope, that will break stuff…