How to get the most out of 40 events

0 favourites
  • 7 posts
From the Asset Store
40 high-quality characters. This asset is perfect for a side scrolling game, or even a turn based RPG type game.
  • I'm a bit obsessive about refactoring (which is not always a good thing). In this case though, there are certain obvious tangible benefits to compacting your event sheet. So I thought I'd like to share some tips that may or may not already be common knowledge regarding this matter. Note that some of these go against traditional refactoring objectives in terms of losing readability and making things more complicated, but the goal here is to minimize event usage.

    1. Verify your e-mail address on your profile. You now have 10 more events! Easiest way to get a 25% event limit increase.

    2. Avoid using global/local variables to store and manipulate data. Use instance variables instead. Or data objects like arrays and dictionaries. Or instance variables in array and dictionary objects. Bonus (in C2 at least) - you get boolean variables for toggling! It may take an action to reset a variable after using it if you're using it in place of a local variable, but actions are free anyways.

    3. Focus on minimizing and grouping your conditions rather than actions. Conditions are the real limit, as you can have as many actions per event as you please. Avoid functions - again, actions are free, so just copy and paste them where needed rather than have multiple events call one function. Unless your functions have a lot of sub-events going on. In that case, utilize functions!

    4. Use conditional operators. Instead of having a set of If/Then events, you can often condense them into one action/expression. Note that you can use conditional operators in conditional operators. I would normally never recommend this due to the readability being crap, but it can save a ton of events in certain situations! Common use case - looping/repeating counters (cooldowns, ammo, score...).

    5. Alternative compact toggles - Use inverse math to swap any two numbers. Simple - Set x to 1-x will swap between 0 and 1. Advanced - Set x to 15-x where X is anything between 0 and 15 will swap between that number and its inverse. Can be used for animation frame shenanigans.

    6. Loops and loopindexes are your friend, especially for positioning objects dynamically. Note uneccessary use of sub events.

    7. Don't position objects dynamically if you can avoid it, as that takes events. Do as much as you can in the layout editor.

    I'm sure there are more but that's about it off the top of my head for now. I'm sure others can add to this list

  • Fun list. I haven't spent a whole lot of time with C3 yet, but I like your ideas to push the limits. I especially like the conditionals idea, it makes me wonder how deluxe a game could be made with one event. Anyways in the spirit of the topic here are a few more ideas:

    8. Utilize behavior's as much as possible instead of events. A behavior won't always fit with what you want to do but it sure is nice when it does or even is just close enough.

    9. Make a simple scripting language to control your game. Admittedly it may be pretty tricky to cram that in 25 or 40 events but if successful you'd be able to have a lot more logic. Being able to type multi line text for text properties in c3 is useful for this.

    I'm drawing a blank for any other general ideas, no doubt there others.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 10, Simplify your game idea. Even if you want to do as much as possible in 40 events don't try to squeeze in so much that your code/events will be overly complex and hard to maintain, or introduces a lot of bugs. From a performance perspective I tend to follow this rule. "The most performant code is no code at all", or Less is More.

  • 11. A lesser known trick I first learned of in an example template (it isn't mentioned in the manual, or I missed it) -

    If you have the same number of instances with two objects, expressions automatically pick the relevant instance from an object when acting on another object. This can save a lot of picking through conditions and events when used creatively.

  • Some handy tips, but part of the reason I've gone over is having a few layers.

    I'm using layers for a lightning system, so one layer is dark, one is not and a sprite object cuts away at the dark (acts like a torch). Based on their simple lighting example. I'm wondering if there's a better way to do it.

  • Layers are definitely a hard limitation, luckily they are usually not essential to the core of a game.

    In your case it does seem like it is though. I can only suggest blending modes as an alternative. It won't be as pretty, but should be able to represent lighting in terms of game mechanics.

    Also with two layers you should still be able to utilize the techniques in the lighting example. At least the free version isn't limited to just one layer

    On the topic of layers, good ways to utilize additional layers are parallax layers, hud layers, and lighting layers. The first two can be simulated with events and viewport expressions. I haven't experimented much with lighting myself, sorry.

  • 12. Verify your account. I'm pretty sure I read somewhere that you get additional 10 events when your email is verified, but this hasn't been activated yet.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)