Large blocks

Large blocks

Postby Edward_Lii » 07 Jul 2013, 18:20

Hello all,

One thing I don't like about large arrays of blocks is their repetitiveness.
I thought of making a system that would select the right tile depending on the location of the block in a larger block, but since me and my shadow doesn't have a grid this isn't feasible.
So I decided to support bigger blocks instead, which was surprisingly easy.
The collision/movement code already supported arbitrary sized blocks and today I finished the theming part.
All that's left to do is adding support for larger blocks in the leveleditor.

And here's the result :cool:
LargeBlocks.jpg

There are only seven blocks in this image (player start, shadow start, exit and four normal blocks).
The art used: http://opengameart.org/content/gui-windows-constructor
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Large blocks

Postby acme_pjz » 08 Jul 2013, 03:05

Wow, it's amazing :D With arbitrary size pushable blocks, fancy puzzle can be created :)

PS: Does squash code work correctly for large blocks?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Large blocks

Postby Edward_Lii » 08 Jul 2013, 17:46

Hello acme_pjz,

acme_pjz {l Wrote}:PS: Does squash code work correctly for large blocks?

I haven't encountered any bugs with moving blocks and squashing yet.
Since the code doesn't use any hard-coded widths/heights I think there won't be any problems.
Unless a block moves width + player width in one frame, which causes the block to "jump" over the player.
In that cause no collision/squashing will be detected, but I don't think this is a problem. ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Large blocks

Postby MCMic » 09 Jul 2013, 21:41

This is ugly…
I don't really understood which problem you tried to solve with this solution.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Large blocks

Postby Edward_Lii » 10 Jul 2013, 06:32

Hello MCMic,

MCMic {l Wrote}:This is ugly…
I don't really understood which problem you tried to solve with this solution.

The screenshot is just a proof of concept, but might not be the best example.

This technique allows for many cool things.
Conveyor belts could become one long block, so you'll only have to set the speed once.
Theming wise some sort of "sockets" could be placed on either side making them less cut-off.
Different sized pushable blocks can create some interesting puzzles and can be themed to look like one block instead of multiple.
Moving platforms will also become easier to path.

It might be better to still be able to see individual blocks.
In that case the theme could just repeat the block over the surface or repeat it around the edge and have a different inside. ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Large blocks

Postby MCMic » 10 Jul 2013, 09:55

Hum, ok, I see.

I was just surprised by the first explanation «One thing I don't like about large arrays of blocks is their repetitiveness.», which looked like only a graphical problem, and then the result was much uglier than repetitive blocks.

Good luck with the uses of this new feature then.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Large blocks

Postby acme_pjz » 10 Jul 2013, 12:57

Is it possible to change block size at runtime through scripting? :)
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Large blocks

Postby Edward_Lii » 10 Jul 2013, 17:25

Hello all,

acme_pjz {l Wrote}:Is it possible to change block size at runtime through scripting? :)

It is possible now (svn rev. 676) ;)
For setting the location or size there are now two methods (setLocation and moveTo, setSize and growTo).
The reason for this is that the former ones set the new values without worrying about collision/movement.
This means that the player will get "squashed" when a block collides, whereas the other methods will update the correct delta values.

MCMic {l Wrote}:I was just surprised by the first explanation «One thing I don't like about large arrays of blocks is their repetitiveness.», which looked like only a graphical problem, and then the result was much uglier than repetitive blocks.

That was actually the main reason for me to start working on this, but I soon realised that it had a lot more advantages. :)
The result was not meant as a release ready replacement of the current blocks, though.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Large blocks

Postby acme_pjz » 22 Jul 2013, 17:11

Hi Edward_Lii,

I just tried to test if the pushable blocks can be sizable using existing texture :) Here is my attempt:
{l Code}: {l Select All Code}
block(Pushable){
   editorPicture(tiles/tiles.png,0,150,50,50)
   state(default){
      object{
         picture(tiles/tiles.png,0,150,8,11)
      }
      object{
         positioning(left,bottom)
         picture(tiles/tiles.png,0,175,8,25)
      }
      object{
         positioning(left,bottom)
         picture(tiles/tiles.png,0,191,9,9)
      }
      object{
         positioning(right,top)
         picture(tiles/tiles.png,41,150,9,9)
      }
      object{
         positioning(right,bottom)
         picture(tiles/tiles.png,42,189,8,11)
      }
      object{
         positioning(right,bottom)
         picture(tiles/tiles.png,35,191,15,9)
      }
      object{
         positioning(left,repeat)
         offset(0,11,0,25)
         picture(tiles/tiles.png,0,161,8,14)
      }
      object{
         positioning(repeat,top)
         offset(8,0,9,0)
         picture(tiles/tiles.png,8,150,33,8)
      }
      object{
         positioning(right,repeat)
         offset(0,9,0,11)
         picture(tiles/tiles.png,42,159,8,30)
      }
      object{
         positioning(repeat,bottom)
         offset(9,0,15,0)
         picture(tiles/tiles.png,9,191,26,9)
      }
      object{
         positioning(left,repeat)
         offset(8,8,0,9)
         picture(tiles/tiles.png,8,158,5,33)
      }
      object{
         positioning(repeat,repeat)
         offset(13,8,14,9)
         picture(tiles/tiles.png,13,158,23,33)
      }
      object{
         positioning(right,repeat)
         offset(-8,8,0,9)
         picture(tiles/tiles.png,36,158,6,33)
      }
   }
}
Looks like it works ;)

I have some problems: Does sizable button work? And what is its hit-test area? How about showing resize gripper for some type of blocks in level editor?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Large blocks

Postby Edward_Lii » 23 Jul 2013, 11:02

Hello acme_pjz,

acme_pjz {l Wrote}:I just tried to test if the pushable blocks can be sizable using existing texture :) Here is my attempt:

It looks quite good, although there's something strange with the lighting.

acme_pjz {l Wrote}:I have some problems: Does sizable button work? And what is its hit-test area?

The button is activated when the player is on the block, so it works with any width.
Visually however, the block is rendered only once, meaning the button is on the far left of the block.
This can easily be fixed by rendering with a width.

Though I think large buttons aren't really useful anyway.

acme_pjz {l Wrote}:How about showing resize gripper for some type of blocks in level editor?

This is definitely something that should be added.
I'll try and see if I can implement it when I have the time. ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Large blocks

Postby acme_pjz » 25 Jul 2013, 10:19

Unfortunately, your recent changes breaks conveyor belt animation :( Maybe the theme file should be updated :think:

[EDIT] Fixed in latest SVN, but it's an ad-hoc one...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Large blocks

Postby acme_pjz » 09 Jun 2018, 11:46

I have finished the GUI for resizing large blocks in git version. I have provided the Windows nightly build at https://github.com/acmepjz/meandmyshadow or compile from source code.
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Who is online

Users browsing this forum: No registered users and 1 guest