Blockski+ , like Klotski but with a board editor.

So you have written that new, must have program. Let us see it here.
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Added another little side game, a bit of Tetris if yr bored :)

Made a number of fixes since adding the multi-select. :-/

Some internal stuff...
I added a String[][] array to the board that's a grid reference to all the blocks, each String is a list of blocks occupying that space.
This speeds thing up slightly as now i am only referencing simple strings not complete block objects.
Checking if a block exists is now all done via the map array.

This allowed for a trick that i have used for the Tetris board. the board paint method can just paint a single block tile if a string exists at any grid part, ignoring blocks on the board.
So after a block has fallen and settled it is removed without removing the reference from the grid map.
so there is only ever one block on the board , the falling one. and when a line is filled i can simply delete the String[][] array line and add a new one to the top. The block on the board match the array.



Well it's been a fun adventure.

I have not used the klotski board editor much but it's getting there slowly with regards to the mess i made when adding multi-selection.
use it carefully, (mostly just don't rely on the undo feature yet)
Attachments
Untitled.jpg
Untitled.jpg (27.32 KiB) Viewed 6949 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
Technopeasant
Posts: 147
Joined: Saturday 13th July 2019 6:50pm
Location: Stony Plain, Alberta, Canada
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by Technopeasant »

Nice work Bruce.
Technical director,
Piga Software
http://icculus.org/piga/
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Technopeasant wrote: Saturday 9th March 2024 2:22am Nice work Bruce.
Thank you kind sir. 😎

It's getting there bit by bit ☺️
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Since the last update i have been trying to iron out some of the bugs, 1 of which I introduced by changing from single selection to multiple selection.
Mostly the problems were caused by 2 things i think...
1. The BlockOverlap(hBlock, X, Y) method was returning the hBlock where it should have only returned other blocks that hBlock overlapped.
2. If the mouse went beyond the board limits something silently went wrong and caused errors in the layout.

So now BlockOverlap is fixed and the mouse can no longer go beyond the board limits during a drag event. (not sure if that'll work on wayland)

Save/ restore was also not working as expected.
It used to just save all the block names and their positions. then on restore it loaded the board and moved all the blocks. this turned out to be buggy. i think maybe some blocks loaded with different names.
So now it saves every blocks complete config (type, shape, size, color, etc) and on restore it clears the board of blocks and then creates new ones for each saved item. This seems to be working fine now. The bad side is previously saved games can no longer be restored. (sorry about that)

Added features in version 1.3.27 ...
* AutoSave in the editor ,set how many seconds to check if the board has changed and auto-save the changes.
* Shape editor now resizes. size can be changed in the shape editor and if an outer row/column is blank the block size is automatically reduced to fit.
* My GF was 2000+ moves into a game when her laptop gave a critical battery warning and before she plugged in the laptop died and she lost her game. so I added a battery checker/warning, you can set the battery percentage to warn at.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Right then ,, this program coding is now winding down to a finish i think.

I found a few issues that were mostly related to blocks going outside the board area causing errors.
So now you cannot move blocks outside the board and you cannot create or paste blocks outside the board (they will be automatically moved within the board)

The swap buttons that swap width and height values now work better, if a block has a shape it is rotated like a tetris block.

the board cannot shrink below any block positions now either by swapping dimensions or manually setting.

The shape editor now can change width and height and will auto-trim any blank edges.

There has been many a tweak/fix.


Current status (known bugs)
Almost finished.

The play board is pretty darn stable and working well.
There is only one bug i know of, a "vanishing wall" can disappear when the prize block is just "next to it" and has not actually crossed it. (i'll get around to fixing that sometime)

The editor possibly has a bug or 2 still. mostly i think with undo/redo feature
but it is very usable now. I'm not sure it needs any more features, for now i will just be keeping an eye out for bugs.

V 1.3.35
https://forum.gambas.one/download/file.php?id=1575
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Some more updates , currently on V 1.3.38

Blocks can now be flipped horizontally or vertically

A new paint mode for Wall blocks PaintErase. if paint mode is set to Erase it does not draw the wall but it erases the map beneath it giving invisible edges.
(see the attached snapshot that has large Erase walls on each corner)

Added some more boards made by my girlfriend who is complaining much less about bugs now ;) lol
Attachments
Untitled.jpg
Untitled.jpg (165.88 KiB) Viewed 6314 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

Just updated to 1.3.46

I discovered it looked terrible if using a system dark theme (see lower picture) :shock:
Untitled.jpg
Untitled.jpg (110.92 KiB) Viewed 1954 times
So i have now fixed that.

Benoit advised that using Picture["filepath"] to load pictures inverts them if using a dark theme and to use Picture.Load("filepath") instead.

had to do it for the block images/ background image/ everything that was not a gambas gui image basically. sigh.
i hope i got them all :)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

new in version 1.4

ScoreShare

When you open the ScoreShare window and hit LogOn it uploads your scores to the webserver and they are visible to other users while you're logged in.
you can see scores from any other users that are currently logged on.

the web server is a simple gambas gb.web cgi tool that uploads your score file when you log in and removes it when you log out. while you are logged in the file is accessible to all.

(EDIT: now default is to not remove your score from the server when logging out but leave them there for 24 hours)

(Ps. logging in does not require account or password, it just uses the name you select (or User.Name) and your host name)

You can merge either a single boards scores or all of their boards.

So if you and your friends/partners/whoever both run the game and log on the the ScoreShare at the same time you will be able to see each others scores and merge them into your own.

Merging is Read only.
Ie. only their scores import to yours, for them to get your scores they must merge yours from their program.

This is currently working on the development branch but i want to do more testing/error handling before adding it to main branch.

git clone https://gitlab.com/bsteers4/blockski.git --branch=development

(see picture)
Attachments
Untitled.png
Untitled.png (524.59 KiB) Viewed 750 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1691
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Blockski+ , like Klotski but with a board editor.

Post by BruceSteers »

The new ScoreShare system is now active in main branch.

Have added a way to add an user icon.
and made it load icons for each board.

So now when it connects/logs on it sends a settings file containing your scores and your icon image (converted to text)

You can import/merge scores from a single board from any user or all their boards at once.

Merging simply joins 2 scoreboards and "Sorts" the scores, omitting any duplicates and then trims the excess.

Let me know if you have any problems with it, thanks :)
Attachments
ScoreShare.png
ScoreShare.png (305.82 KiB) Viewed 417 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
cogier
Site Admin
Posts: 1142
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Blockski+ , like Klotski but with a board editor.

Post by cogier »

I notice the date is always in US format. Is that part of the plan?
Post Reply