Simple Lockbox Puzzle (Tech Demo)

acarnivorousocean

  • Posts: 194
http://acarnivorousocean.tumblr.com/post/26111455843/tech-demo-simple-lockbox-i-had-the-concept-for

This video is kind of old, but I didn't really show it off or ever finish the game that featured it.  Maybe one day I can return to this nifty little feature!  Check the blog post for the video and notes regarding its creation. 

Have anything similar to show off, or questions about how this was created? 

gamegirlxl

  • Posts: 716
I'm not sure why, but it wouldn't play on my computer...  But I've played enough room escape games (although there are VERY FEW Stencyl games in this genre) to know what you have from reading the description (unless you lied :P ;D).

What I saw of the graphics looked nice (although that's unimportant since this is a coding example), and you seem to have accounted for many (any features that I've seen beyond this tie into the game more, such as needing to collect the pieces) of the features that typical puzzles of the sort need.

Unfortunately, unless you share the code, it's hard to tell the extent that it can be reused...  If you plan on sharing it, that is...

acarnivorousocean

  • Posts: 194
I'm not sure why, but it wouldn't play on my computer...  But I've played enough room escape games (although there are VERY FEW Stencyl games in this genre) to know what you have from reading the description (unless you lied :P ;D).

What I saw of the graphics looked nice (although that's unimportant since this is a coding example), and you seem to have accounted for many (any features that I've seen beyond this tie into the game more, such as needing to collect the pieces) of the features that typical puzzles of the sort need.

Unfortunately, unless you share the code, it's hard to tell the extent that it can be reused...  If you plan on sharing it, that is...

Oh, that's odd..I wonder why it won't play.  I'm glad someone is showing some interest in what I did here, and maybe I'll just arrange to send you the video personally so you can see what you think.
There are very few good Stencyl games done in this style, and it's certainly something I'm looking at in the future.  It would obviously require great variable planning and making sure the game can't be broken.  No lies here ;) I spent a lot of time trying to tear this puzzle apart lol

And that was something I paid close attention to while testing and programming this lockbox: what are all the ways that players could break it, or otherwise cheat their way into a correct solution?

I might try to turn this box into a kit or something...haven't attempted making a kit before, and I need to make some comments and make it as clear as possible.  Who knows, maybe someone can improve upon it.

gamegirlxl

  • Posts: 716
I responded to the PM you sent me with my personal link (which didn't work either...WHY ME???)


I'll share a link for this project from Scratch that I did FOUR YEARS AGO:http://scratch.mit.edu/projects/1200361/

I'll apologize for the horrific graphics and gameplay (and I thank my past self for leaving a walkthrough because I did NOT remember I had to click on the mouse hole :P ::) :D).  At the end, after getting all the pieces, I tried to do something similar to a lock box, and basically failed.  (Scratch has less features than Stencyl and I was very inexperienced at the time, so I think now I'd do a better job.  Actually, it might be within my abilities to do something like this in a language like C++/OpenGL after I learn how to render graphics from some .PNG's.  But really, in retrospect those graphics are horrible, especially considering what I'm capable of doing now.  I even have experience with vector drawing now, and I'm pretty good.)


Also I might as well provide a link to 2keysgames.com, which has wonderful (yet hard) room escape flash games.


I really wish that there were more people, even outside of Stencyl, that wanted to make room escape games.  Especially good room escape games.

acarnivorousocean

  • Posts: 194
This is pretty cool!  I like how you sometimes had to do a small chain of events to get a new puzzle piece.  The only times it became unclear were usually caused by graphics (colors blending between the pink ball and nearly-pink carpet).  But this game is 4 years old and it's more than I would have been able to program 4 years ago.

I really want to do a good room escape in the future, just working a couple of smaller projects and working my way up, because I know my organization and thought process will really need to be sharp if I wanna do the genre justice.  Currently I am about to release my first game on FGL to seek sponsorship, and I have a number of things brewing in the background that I can't wait to start on ;)

gamegirlxl

  • Posts: 716
This is pretty cool!  I like how you sometimes had to do a small chain of events to get a new puzzle piece.  The only times it became unclear were usually caused by graphics (colors blending between the pink ball and nearly-pink carpet).  But this game is 4 years old and it's more than I would have been able to program 4 years ago.

I really want to do a good room escape in the future, just working a couple of smaller projects and working my way up, because I know my organization and thought process will really need to be sharp if I wanna do the genre justice.  Currently I am about to release my first game on FGL to seek sponsorship, and I have a number of things brewing in the background that I can't wait to start on ;)

I think you're talking about the piece of fluff that goes into the trash can ;D .  I did all the graphics with the built in image editor in Scratch (except I didn't make the image I used for the puzzle).

I remember 4 years ago I tried to publish that game on Kongregate, because flash is used on the Scratch website.  I failed because it's not a .swf (or Unity file extension, as Kongregate supports both).  This was part of the reason why I came to Stencyl, and one of the first things I tried to do was a room escape game.  Of course, due to the differences in how Stencyl operated, I mostly failed, however now I understand better how to do things.


So I decided to spend some time (but not very much time, actually) and I made some sort of "game engine".  It's the basis for a room escape game, built in Stencyl 2.x (I'm not a paid user), although I think that it could port easily.  Actually, aside from the miniscule amount of graphics I have (mostly placeholder text), I could probably rewrite the entire thing in an ACTUAL (meaning something text-based) coding language (there may be several that I know well enough to manage a project like this one).

  I have something, first of all, that regulates which wall you look at.  Left arrow key cycles leftwards, right key cycles rightward through the view of the walls (there's no graphics yet, but I drew text instead).  Although I have only played ONE game where there was more than four walls in a room (it was hexagonal), I have an attribute that can decide how many walls there will be (two walls minimum...but you wouldn't need this for ONE wall).

  I also started something like a limited inventory system (you can only carry x amount of items, which adds a slight bit of difficulty because it throws in inventory management so you can't just grab all the trash lying around in the room).  I haven't done much with it so far, but I made a simple GUI for it and displayed some text.


I actually think that there's a lot less logic(mostly Boolean logic, anyways) to code than with most genres, especially if you use bunches of functions.  Graphics and the puzzles themselves are more important as well.  Now that I think about it, there's a good chance that the same code could be reused between games, with only slight alterations (of course the graphics would need to be changed, although there' still reusable elements there...and I would guess that the same would go for sound effects, although the background track should definitely be changed).

acarnivorousocean

  • Posts: 194
This sounds promising!  I certainly like the idea of being able to scroll through different wall views.  I had written a bunch of notes recently about having an 'escape the house' in which I wanted multiple available views in each room (if applicable).  The idea quickly became much, much larger than I felt I could handle at the time, but it's not off the table yet.  It's a very sequential sort of thinking...'what do I want them to do first, and how can I make sure they do it?'.  Just gotta write a lot and plan it all out.

The inventory system is always something I ponder...whether a click-to-use interface is good enough, or if I'd want to have drag & drop, or even allow item combinations.  I think you are in the right direction with the limited inventory space.  Not only gathering items, but holding the right ones at the right moment.  That's a puzzle in itself. :)

And I agree, you're mostly using static images, a few simple Behaviors, and the meat of your game is going to be Booleans...maybe some timers too.  I am falling in love with time-sensitive material hahaha.

gamegirlxl

  • Posts: 716
This sounds promising!  I certainly like the idea of being able to scroll through different wall views.  I had written a bunch of notes recently about having an 'escape the house' in which I wanted multiple available views in each room (if applicable).  The idea quickly became much, much larger than I felt I could handle at the time, but it's not off the table yet.  It's a very sequential sort of thinking...'what do I want them to do first, and how can I make sure they do it?'.  Just gotta write a lot and plan it all out.

The inventory system is always something I ponder...whether a click-to-use interface is good enough, or if I'd want to have drag & drop, or even allow item combinations.  I think you are in the right direction with the limited inventory space.  Not only gathering items, but holding the right ones at the right moment.  That's a puzzle in itself. :)

And I agree, you're mostly using static images, a few simple Behaviors, and the meat of your game is going to be Booleans...maybe some timers too.  I am falling in love with time-sensitive material hahaha.

I haven't considered the potential of using timers, although the sheets/pillows in my little game was something that added some slight element of reaction speed, because they'd fall back down due to "gravity".  I don't think that timers should force a game over, however, renewable items could disappear after n seconds.  Like an ice cube, although I'm not sure what you'd use that for...

I do agree that items should be interactive with each other.  I like the system 2keysgames uses where you can bring up an interactive enlargement of an inventory item.  In that screen you can interact with that item, or use another item with it.

Also, I think that transitions between rooms should be easy enough to do.  It's similar to zooming in on some specific area inside a room, except for the fact that you need to make sure you face the correct direction after leaving a room.  I use a pretty simple system for deciding which walls to display.  I'm using almost all game attributes, so scene switches shouldn't be an issue.  I just need to add some more Boolean stuff to make sure that you only see the wall for the room you are in.

As for an escape the house thing, I think it might be worth considering breaking it up into rooms.  It might be too long to do in one sitting otherwise.  You can always just permit everyone to go back into previous rooms to grab stuff.  It might be nice to give the user a password after completing a room, if you make it a series of games, so they can start the next chapter with the same inventory that they finished with.

gamegirlxl

  • Posts: 716
I received your PM, and although I actually managed to open your game in Stencyl, Stencyl's entire interface is <Missing String>.  Is the project in 3.0?  I had an almost identical problem before, where a downloaded Stencyl file <Missing String> the interface.  I'm not sure what version the file was in, although I eventually got it into a functioning window.

The graphics definitely are very nice (but it's unsurprising due to the fact that you're basically a professional in Graphic Design and such ;D).  I still haven't PLAYED the game or even seen the code, because of the <Missing String>. :'(  I feel cursed...

acarnivorousocean

  • Posts: 194
OMG we are cursed!  The game file is in 2.2
What can we do about the missing string?  I really want you to play this!

Thanks for your kind words about the graphics!  I am definitely a visuals kinda guy, and I'm glad that Stencyl is here to allow me to code some stuff as well.


gamegirlxl

  • Posts: 716
OMG we are cursed!  The game file is in 2.2
What can we do about the missing string?  I really want you to play this!

Thanks for your kind words about the graphics!  I am definitely a visuals kinda guy, and I'm glad that Stencyl is here to allow me to code some stuff as well.

I congratulate you for including sounds, in that case.  Although I try really hard, I am not very musical.  I keep the sound off 98% of the time on my computers and my iPhone.  The only exception most of the time is for videos, which really need sound.

I might have to close both (I have 2) of the Stencyl windows I have and reopen it.  At least I know that I'm not having issues due to inconsistent versions.  ~Edit:  I have done so, and opened it as the only Stencyl window.  Currently it is compiling 52 of 32 because SOMEBODY clearly can't count~


I was also sort of wondering how you did the graphics, because I first assumed they were vectors.  And although you can do wavy (well, clearly not as straight as plain vectors) brush-like lines in vectors, and import it into Stencyl, Photoshop-like programs would be maybe better optimized for things like that.

« Last Edit: January 30, 2014, 09:32:27 am by gamegirlxl »

acarnivorousocean

  • Posts: 194
Doing the best I can!  We will beat this thing!

For these graphics, I used Photoshop and a Wacom tablet.  It's pressure sensitivity allowed me to create a painterly style.  Vectors are wonderful, but are so perfect most of the time, I didn't think it would have been right for this particular project.

So I was thinking, while you obviously want to fix the string issue, in the meantime I suppose I could just take screenshots of every code block for you.....unless there is some alternative.  Wouldn't take me long, but you have waited a long time to play this and you don't even know if it's any good :P hehe

gamegirlxl

  • Posts: 716
I got it up and working, so don't bother taking pics.

Anyways, I was thinking "Bamboo Tablet"  little bit.  I've seen them used, however, I've never used one.  I wonder if the input from an iPhone is similar enough for an app to work like one.


Also, I'm modifying the code that you have (mostly in the Lock box Puzzle Room) so that it is easier to change and re-use.  It shouldn't impact the game itself (except removing the "always" event may reduce lag...it's going to only be checked after a number is correctly placed).  From the way that you code, I can tell that you haven't been taught any "formal" coding languages (in my C++ class, for example, we are encouraged to put lots of stuff into functions, to allow maximum re-usability).   ;D Although I learned in Stencyl beforehand, I now decide to obsessively use functions.

acarnivorousocean

  • Posts: 194
Yay!  Glad you got it working.

Not too sure about the iPhone input, but the Wacom line usually offers many levels of touch feedback for the pen to simulate the pressure of a human hand while painting.  Might be worth a look though!

I was 99% sure that you'd find a way to improve my blocks :) I'll be interested to see what you've done with it.  I definitely have no formal training, and at this time I felt like I was holding my code together with duct tape :P

gamegirlxl

  • Posts: 716
I think the main reason why I don't get a drawing tablet is the cost (seriously, I feel like I might be younger than you expect...I'm 17 ;D).  They're really expensive, so it might be better if I just struggle with a mouse or something.  I always loved Ctrl+Z...


Anyways, I think that there's a lot of optimizations that could be made in your code.  I was somewhat disappointed that it takes n2 events to make a puzzle with n pieces, which is something that might quickly become impractical.  But, since you are using regions, I might store the mathematical representation of them so I can compare the x and y of a piece to see if it's within the range of the imaginary region.  Maybe as something that could be done on an actor after the mouse was released and "_dragged" was true.  Although this might change the behavior of the pieces slightly(you wouldn't drop the pieces on the region automatically, I think), it's probably worth it to have shorter code.


I'm not sure exactly what half of the actor behaviors you have are attached to...  Camera follow, 8 way movement, explode on death...  I don't see anything that uses them.