Thursday, May 4, 2023

Construct 2 vs. Stencyl: A Comprehensive Comparison

If you're a game developer, you know that choosing the right game engine is critical to the success of your project. Two of the most popular game engines on the market today are Construct 2 and Stencyl. In this article, we'll compare and contrast the two to help you make an informed decision about which one is right for your needs.



Construct 2 Overview

Construct 2 is now retired. Get construct 3 here.

Construct 2 is a game engine that's ideal for beginners who want to create 2D games. It has a drag-and-drop interface that makes it easy to create games without having to write a single line of code. Construct 2 is known for its simplicity, and it's an excellent choice for creating games quickly.

Construct 2 is a browser-based game engine, which means that you don't need to download any software to use it. You can access it from anywhere, which is great if you're working on a team or want to work on your game from different locations.



Stencyl Overview

Stencyl is another game engine that's great for beginners. Like Construct 2, it has a drag-and-drop interface that makes it easy to create games without having to write any code. However, it's more powerful than Construct 2 and can create more complex games.

Stencyl is a downloadable game engine, which means that you need to download and install it on your computer to use it. This can be an advantage if you're working on a project that requires a lot of resources, as Stencyl is more powerful than Construct 2.


Construct 2 VS Stencyl Comparison

Game Engine Pros Cons
Stencyl
  • Visual coding interface is easy to use and beginner-friendly
  • Includes built-in physics engine
  • Can export to multiple platforms, including iOS, Android, and HTML5
  • Active community with lots of user-generated resources and tutorials
  • Limited control over individual assets
  • Free version has limited functionality and includes Stencyl branding
  • Can be slow to compile and load large projects
  • Debugging can be difficult and time-consuming
Construct 2
  • Drag-and-drop interface is easy to use and beginner-friendly
  • Includes built-in physics engine
  • Exports to multiple platforms, including iOS, Android, and HTML5
  • Active community with lots of user-generated resources and tutorials
  • Limited control over individual assets
  • Free version has limited functionality and includes Construct 2 branding
  • Can be slow to compile and load large projects
  • Debugging can be difficult and time-consuming

Both Construct 2 and Stencyl are excellent game engines, but they have some key differences. Here are a few of the main differences between the two:

Ease of Use: Construct 2 is generally considered easier to use than Stencyl. Its drag-and-drop interface is very intuitive, and it's easy to create simple games quickly. Stencyl has a steeper learning curve, but it's more powerful and can create more complex games.

Features: Stencyl has more features than Construct 2. It has more advanced physics, more powerful animation tools, and more options for creating complex game mechanics. However, Construct 2 has a wider range of templates and assets, which can be helpful for beginners.

Platforms: Both Construct 2 and Stencyl can export games to a variety of platforms, including Windows, Mac, iOS, and Android. However, Stencyl can also export games to HTML5, which is useful if you want to create games that can be played in a web browser.

Price: Construct 2 is generally cheaper than Stencyl. It has a free version that's great for beginners, and a paid version that's more powerful. Stencyl has a free version, but it's more limited than the paid version, which can be expensive.



Add-Ons and Plugins for Construct 2 and Stencyl: Enhancing Your Game Development Experience

Construct 2 and Stencyl are two popular game engines that are great for beginners and experienced developers alike. Both engines offer a range of features that make it easy to create games without having to write any code. However, one of the main advantages of these engines is their flexibility when it comes to add-ons and plugins. In this article, we'll take a closer look at some of the best add-ons and plugins for both Construct 2 and Stencyl.


Construct 2 Add-Ons and Plugins

Construct 2 has a range of add-ons and plugins that can be used to enhance your game development experience. Here are a few of the most popular options:

1. SpriteFont+: This plugin allows you to use custom fonts in your game. It's easy to use and includes a range of options for customizing your font.

2. Array: This add-on makes it easy to create arrays in Construct 2. It includes a range of features for sorting, searching, and filtering arrays.

3. LiteTween: This plugin adds tweening capabilities to Construct 2. It makes it easy to create animations and transitions in your game.

4. Web Storage: This add-on allows you to store data on the user's computer. This can be useful for saving game progress or storing user preferences.

5. iFrame: This plugin allows you to embed external websites within your game. This can be useful for creating in-game ads or for providing additional information to the user.


Stencyl Add-Ons and Plugins

Stencyl also has a range of add-ons and plugins that can be used to enhance your game development experience. Here are a few of the most popular options:

1. Admob: This plugin allows you to display ads in your game. It supports a range of ad formats and includes options for customizing ad placement and frequency.

2. Box2D: This add-on adds Box2D physics to your game. It includes a range of features for creating realistic physics simulations.

3. Tiled: This plugin allows you to use Tiled maps in your game. It supports a range of map formats and includes options for customizing map layers and properties.

4. In-App Purchases: This add-on allows you to add in-app purchases to your game. It supports a range of purchase types and includes options for customizing pricing and availability.

5. Spine: This plugin allows you to use Spine animations in your game. It includes a range of features for creating complex animations and transitions.

Add-ons and plugins can be a great way to enhance your game development experience with Construct 2 or Stencyl. Whether you're looking to add new functionality to your game or simplify your development process, there are plenty of options available. By exploring the add-ons and plugins available for both engines, you can find the ones that work best for your needs and take your game development skills to the next level.

Construct 2 and Stencyl: Case Studies of Successful Games

Construct 2 and Stencyl are two popular game engines that offer users the ability to create games with ease. They are both widely used and have a number of successful games created with them. In this article, we will explore some of the most popular games created with Construct 2 and Stencyl, and analyze their success.


Construct 2 Case Studies

1. Crossy Road: Crossy Road is a popular game that was created with Construct 2. It's a simple game that involves crossing roads and dodging obstacles. It has a colorful design and is easy to play. Crossy Road was a huge success, with over 100 million downloads worldwide. The game's success was largely attributed to its simple yet addictive gameplay, and its accessibility to players of all ages.

2. Super Ubie Island: Super Ubie Island is another popular game created with Construct 2. It's a 2D platformer game that involves collecting coins and defeating enemies. The game's success was largely attributed to its colorful and fun design, as well as its challenging gameplay. Super Ubie Island received critical acclaim and was featured in numerous gaming publications.

3. Zombidle: Zombidle is a popular game that was created with Construct 2. It's a simple game that involves destroying buildings and collecting resources. The game's success was largely attributed to its humorous design and addictive gameplay. Zombidle has been downloaded millions of times and has a strong following among gamers.


Stencyl Case Studies

1. AdVenture Capitalist: AdVenture Capitalist is a popular game that was created with Stencyl. It's a simple game that involves managing a business and making money. The game's success was largely attributed to its humorous design and addictive gameplay. AdVenture Capitalist has been downloaded millions of times and has a strong following among gamers.

2. Burrito Bison: Burrito Bison is another popular game created with Stencyl. It's a 2D platformer game that involves launching a character and seeing how far they can go. The game's success was largely attributed to its humorous design and addictive gameplay. Burrito Bison received critical acclaim and was featured in numerous gaming publications.

3. Badland: Badland is a popular game that was created with Stencyl. It's a side-scrolling game that involves navigating through a dark forest. The game's success was largely attributed to its stunning visuals and immersive gameplay. Badland was critically acclaimed and won numerous awards.

Both Construct 2 and Stencyl have been used to create numerous successful games. The case studies highlighted in this article demonstrate the versatility and potential of both engines. The success of these games can be attributed to a variety of factors, including engaging gameplay, immersive design, and accessibility. By exploring these case studies, game developers can gain insight into what makes a successful game and how to achieve it with Construct 2 or Stencyl.


Conclusion

Both Construct 2 and Stencyl are excellent game engines, but they have different strengths and weaknesses. If you're a beginner who wants to create simple 2D games quickly and easily, then Construct 2 is a great choice. However, if you want to create more complex games with advanced physics and animation tools, then Stencyl is the better option.

Ultimately, the choice between Construct 2 and Stencyl depends on your needs and preferences. Take some time to explore both engines and see which one works best for you. With the right game engine, you can create amazing games that players will love.

Frequently Asked Questions about Construct 2 vs. Stencyl

What is Construct 2?

Construct 2 is a game engine that allows users to create 2D games using a drag-and-drop interface.

What is Stencyl?

Stencyl is a game engine that allows users to create 2D games using a visual coding interface.

Which game engine is better?

There is no definitive answer to this question, as both Construct 2 and Stencyl have their own strengths and weaknesses. It ultimately depends on the specific needs and preferences of the user.

Can I export games created with Construct 2 or Stencyl to multiple platforms?

Yes, both Construct 2 and Stencyl allow users to export games to multiple platforms, including iOS, Android, and HTML5.

Is there a free version of Construct 2 and Stencyl?

Yes, both Construct 2 and Stencyl offer free versions of their software, although the free versions have limited functionality and include branding for the respective game engines.

Wednesday, May 3, 2023

How to keep Your Actors From Going Off Screen

A common question that I run in to all of the time on different Stencyl related forums and blogs is, "How do I keep my character from leaving the screen?".

We all need this feature for different reasons, at different times. Some may need to stop the player actor from leaving just the sides of the screen. This works for side to side shooters like Galaga, where the player is fixed into a single Y position and can only move on the X axis. Then there are others who may need to set boundaries for left, top, and right, but leave the bottom alone, for pitfall style games where you want your player to be able to fall in to traps or large holes.

My instance was a little more complicated than this. I am making a game that scrolls vertically. The player sprite starts at the bottom of the scene, and moves to the top of the screen. The scene is about ten times bigger in height than the standard 15 tile layout. This entails some challenges and obstacles to overcome.

First off, the default screen position is X=0 and Y=0. That would mean that the default screen position is aligned with the top left corner of the scene. Well, this doesn't do us any good, because our players roughly 5,000 pixels further down in the scene! This simple problem can be solved with the addition of a camera.

Blocks for creating a moving camera in stencylHow I solved this problem was to create a "Dummy Actor" that the camera would stay centered on. Placing the Dummy on the very bottom layer of the scene, under the background, makes him invisible to the player, but the camera will still follow him through the scene. I simply drew the dummy actor down at the bottom of the scene, right in what would be the dead center of the screen in a normal sized scene. I then drew the player actor about five tiles down, but two layers up, above the background image. Now, using a few blocks of code, we can make the dummy actor move through the scene and the camera will follow him the whole way. Since all this Dummy Actor will do is move through the scene at a set pace while the camera follows, for ease of use, I just attached these blocks in the actors events opposed to creating a separate behavior.

Now, we have our camera. If you were to test your scene at this point you would see that the camera does in fact scroll northward to the top of the scene at the pace that you set the dummy actor to move. The problem with this is that with the camera moving rapidly, but the player actor being stationary without input, it is very easy for the actor to fall off the bottom of the screen and become in active.

In order to fix this little dilemma of ours we need to incorporate some screen boundaries to stop our player actor from exiting the screen. If you followed the crash course tutorials on stencylpedia, then you should know how to set boundaries for the X position, but I will include the code anyways for those slackers out there who didn't follow those specific tuts.

Setting the Y boundaries can be a little tricky depending on the type of game that your creating. I know when I first started using stencyl, figuring out this whole boundary thing after adding a camera to the mix was a migraine headache in the making. But, with a little persistence I was able to come up with this:

How to stop your character from going off screen in stencyl

There's a few very important things to note about these blocks. One is that when you get to the Y coordinates, you don't want to use Y(on screen). You want to just use Y. The reason for this is that you will be using the Y coordinate of the camera as a starting point. The scene is 150 tiles at 32 pixels per tile. That's 4800 pixels for the height of our scene. What we did here, is we used Y of the camera to find the top boundary. That one's easy. Next, we used Y of the top corner of the camera + the screen height to find the bottom border.
Screenshot of Aero Fighter for SNES
Voila! We now have boundaries that our player character can not exceed! This method works well for Y scrolling games, like Aero Fighter, but the same might not be true for other types of games. In the next tutorial, I will show you how to modify this script to fit other game types. Until then, Cheers!

Monday, May 1, 2023

Character Building 101: How to Build a Level Up System in Stencyl

What is Character Building?


Character building is the backbone of every great RPG game ever made.It's not only for RPG's, though. Over the past decade we are seeing more and more games of different genre's dip into the realm of character building. Even first person shooters are beginning to adopt character building principles (think Borderlands).

To be concise, when I say character building, I mean that the particular game in question has a built in system where your character accumulates experience. That experience usually translates into higher attack power, higher defense, new magical abilities etc. This style of character building is more commonly known as role playing (RPG  - role playing game).

Another type of character building would be acquiring experience in one form or another, and then using that to purchase upgraded abilities (Dante's Inferno).  We will cover building a skill tree of that nature in another tutorial here in a few days.

Today, we are going to go in depth on the first idea I stated, a classic RPG style level up system. The system is pretty simple overall. We are basically going to create a character behavior to attach to our main actor, or playable character. This behavior will watch for one variable ($experience) to become greater than, or equal to, another variable ($NextLevel). Once the experience surpasses the quota for the next level, it will increment our level up one. It will then increment all of our other character attributes, like attack, defense, and max health. Once all of our character specs have been incremented, it will create a new $NextLevel value, so that the behavior can once again begin to watch for a new level up instance.

The Difference Between Getters/Setters and Game Attributes


Before we get started putting our blocks together, we need to discuss the difference between getter/setters, and game attributes. Getters and setters in stencyl are the equivalent of a variable with local scope in an actual programming language. For those of you who know a bit of programming, you already know where this is heading. For those that don't know, a variable with local scope will only function within the confines of where it's created. Sometimes this means one page of a website, or it could mean one particular function of a whole program. These types of variables are used for things that we don't need to pass on to the rest of the program.

A good example of when to use local scope in a game would be the boss battles in the old Mario games. Instead of coding a health bar and doing math to take damage, in a game like this, you could create a code block that checked how many times the boss has been hit, every time he gets hit. The code block increments the HitCount by 1. It then checks to see if the HitCount is greater than, or equal to, three. If this is the case, Bowser dies (sorry Bowser). All of this would be done locally as we don't need it to carry on to any other part of the game.
An example of how to increment damage for simpler games.

When coding a level up system, we have no use for local scope variables. They won't do us any good if they can't follow us around for the entirety of the game, no matter where the game takes us. But don't you worry your pretty little head. Like a good neighbor... global scope is there!

That's right. With a global scope, a variable and it's contents and be manipulated and called on from anywhere in the game. The stencyl equivalent of global scope is Game Attributes. To access these, while in the coding screen, click on the attribute category of blocks, and then in the sub-categories click on Game Attributes.

If we create all of our characters statistics with game attributes, we are now able to create a very simple code block that allows the game to constantly check to see if our experience is sufficient to level up. If we have enough experience to do so, that same code block will increment all of our character traits, increment the amount of experience needed to level up again, and then just for fun, it will also refill our health and energy meters to our new max health and max energy levels.



Implementation


Code blocks depicting how to create a level up system in stencyl.Now we have our very basic level up system. Our game now knows that once we accrue a certain amount of experience, to let us know that we are a little bit smarter than we were a few seconds ago (and stronger, too). Now, how do we start collecting all that experience?:Easy...peasy...Mrs. pacmans sleazy.

All we need to do is add a little bit of code to all of our enemies to define the amount of experience that they will give us if we completely and utterly destroy them (isn't that nice of them to do that?). Simply create another game attribute with a unique name, that can easily be identified as being the experience given for killing this particular enemy.


An example of how to retrieve experience from enemies in stencyl





Optionally, if you were building a much larger game where you may face the same enemies down the road, but they will be much stronger, you could increment the experience similarly to how I did in our level up blocks. You could also use this method to increment the traits of the enemy it's self, instead of creating a whole new actor with the same graphics.





What's Next?


My next few tutorials are going to walk you through the advanced mechanics of character building. Here are just a few of the topics that we are going to discuss:

  1. HUD's, or Heads Up Displays. I am going to show you how to implement health bars, energy bars, magic bars, etc.
  2.  I am going to get a little more in depth with the math behind  this level up system.
  3. Leveling up for RPG style games where you control more than one character, I.E. leveling up several playable characters separately (Final Fantasy Series).
  4. Skill Tree's ( I told ya so)
  5. Status Effects (poison, sleep, etc.)
  6. Stat boosting based on equipped items (think Diablo).
  7. Xbox style achievements
  8. And a whole lot more...

How to Keep Your Actors From Going Off Screen - Part ll: Customizing Boundaries

In the first tutorial, I showed you how I kept my player actor locked in to the camera on a vertical auto-scrolling scene. Now, as useful as that is, it doesn't really cover the whole topic of how to keep your actors from going off screen. When you break it down, there are a ton of reasons why keeping your actors on screen is useful, but what is even more useful is being able to customize that feature to fit any type of game play or scenario.

In part two of how to keep your actors from going off screen, I will teach you how to customize the blocks I gave you in the first tutorial to fit other types of game play, such as a platformer where you want your character to be able to fall through the bottom. I will also show you how to customize this even further to add Mario style effects for fall through's, etc.

Let's get started:

Platform Games

In a typical platform game, you want to be able to move left or right freely, except in the case of the far left and right borders of the scene. Most likely, you also want your actor to not shoot in to space, but you do want them to be able to fall into holes and traps.

To accomplish this, we would first set blocks of code in place that prevent our player actor from moving beyond zero pixels to the left, and greater than our highest pixel to the right on the X axis (horizontal).

Note: The exact numbers in this block of code may not be right for you. As this is just an example script I am using a standard scene size of 20 x 15 at 32 pixels per tile. You may need to adjust your numbers slightly to get the right performance for your game.







This prevents us from running backwards through the screen at the beginning of the level, as well as running straight through the end of the scene at the end of the level. Now, all we need to do is set a Y parameter for the top of the screen, and a death event that will occur when he falls off of a platform into the abyss.

This block of code prevents us from moving above the scene boundaries at the top of the screen. Quick tip: Optionally, if you wanted to create a scenario where you could move above the screen, like in the instance of Super Mario with his trusty Flying P, you could create the scene a tile or two larger on the Y axis, and then set your boundaries at the actual scene height. Now, if you use a camera actor like in my last tutorial, you will see that the screen is exactly the same but there is added space above the cameras view point that you can use to set up secret areas, etc.

Now, we move on to the death event. In just about 100%  of classic platform games, if you fall off the platforms into an empty space in the scene, you die. This is how I would accomplish this:

One thing to note about the above block, is that it is very basic, and not aesthetically please. Basically, in a nut shell, all this does is, if you player actor falls into a hole, it deletes him from memory. Spruce yours up with a little eye candy. When your character falls, make your block change to a special animation just for falling deaths. Also add a sound effect to it that you would use for any other kind of death event for your player actor. Now, make your block of code fade out of the scene and return to a start screen, or even better, a "Try Again?" screen.

Other Game Types

In just about any game type you will find reasons for some level of customization of the screens boundaries at some point or another. In general, if you want to be able to leave the screen on one side, just don't set a boundary for that side. Or, for instance, say you want to have one scene run into another. Simply set the boundary of the scene to move you to the corresponding X or Y position on the next scene.

There are a lot you can do with screen boundaries to enhance the flow of game play over just about any and every genre of game that there is. Play around with your code blocks a little and see what you can come up with. And, as always, if you have any questions feel free to drop a comment here, and I assure you, I will respond as promptly as possible. Until next time, Cheers!