mrabear's Forum Posts

  • 13 posts
  • As soon as I started experimenting with sound, things started to perform poorly and stutter quite a bit. I've seen this from many HTML5 games so I am not entirely sure if construct can do anything about that. Add that to the fact that I actually want to manipulate the sound (open it up, inspect the waveform etc) before syncing it up with the game play. I got the feeling that I'd spend a chunk of time wrestling with attaching custom code only to have it perform inconsistently in each platform/browser because of spotty HTML5 implementations.

    Again, this isn't really a problem with construct, so I'm not sure if my experience can really be constructive for you. I can say that short of needing to use rex_function, construct surprised me for how far I was actually able to take it out of the box. Coming from a development background, I had not taken the idea of a programming free development environment too seriously (I put it in the 'toy' category). You can't be all things to all people though, and I can say that you won me over for being a fantastic prototyping environment. I was able to find a way to accomplish just about any piece of logic I wanted, and it was always easy to try ideas out without making major investments up front.

    The sound issues I was having was certainly the fault of HTML5. I'm sure there are ways to work around this and improve things, but that isn't where I want to spend my time. I'm just a hobbyist, so it's easier to move to a more established platform and let the HTML5 issues get sorted out by more invested parties.

  • I'm definitely not abandoning the idea, if anything, I wanted to take the idea further and just didn't want to start down that road unless I was comfortable on the platform. I have to say though, between your comments and reading Finish your Games, I'm getting tempted to just downsize my expectations and put a wrapper on it in construct, even if it isn't the end product I wanted and even if I don't think it is much of a challenge in it's current form.

    Food for thought, I guess. Corona was on the short list already, so I will certainly check it out.

  • Thanks for the feedback. It was when I needed to go from randomly building ideas to actually crafting a game experience that I felt the biggest drawbacks of construct on HTML5. The more specific I wanted to be with design elements, the more the engine fought with me. When it became apparent that I'd have to wrestle with JavaScript underneath the covers to optimize performance (especially for mobile), it just seemed easier to find an engine that would let me roll my own code from the beginning. This is just a hobby for me, so I'm perfectly content riding down the technology stack until I find a place that feels right. I don't think I want to go back to writing C++ on directx, but I'm sure there is a happy middle ground between completely declarative platforms like construct and completely native application code like C++.

    Speaking of which, does anyone know of any good platforms to try out? I still want to make small 2d games (potentially on mobile), I just need a bit more flexibility in the design process and a more reliable game experience than HTML5 delivers at the moment.

  • This is the testbed project I worked on for the past few weeks to test if I wanted to fully commit to working with construct 2 as a platform. I'm sadly moving back toward just coding everything myself although I may use construct for prototyping, I decided to not take my current project any further.

    With that said, I figure I'd share what I put together so far in case it provides some useful reference for anyone else out there. There is no working game per se, but the level editor and game mechanics are all there and functioning.

    The game itself was intended to be a hybrid puzzle/tower defense concept that gave you the power to direct the flow of minions while having to solve color based puzzles. The first map that loads gives a pretty good indication of what the various components do.

    Game Example

    .capx project file

    Level Editor:

    To place new items on the grid, hold down a button and left click:

    A - places a flow redirector (redirects the stream, right click to rotate)

    Q - places a stream generator (produces a colored stream, click on it and push 1-3 to adjust the color)

    Z - Barrier (blocks streams)

    V - Laser (kills minions, right click to rotate)

    X - Painter (recolors minions)

    C - Lens (recolors stream)

    E - Prism (splits streams)

    W - Exit (unlocks when the correct stream color hits it, select and push 1-6 to change the color)

    Guess that's about as far as I'll go with explanation. I'll check back in to answer specific questions, but in case this is my last post, thank you for jump starting my long dormant passion for building games.

    EDIT: Forgot to mention that you'll need two plugins:

    REX_FUNCTION

    Chrome Debug Console

  • GRID MOVEMENT

    I'm doing something similar, except I have a few different size grids that the player can drag and drop items from (inventory grid vs game grid). When the object passes from one grid to another, I have to adjust the various x,y coordinates.

    floor( (coordinate-offset) / scale ) * scale + round( ( scale / 2 ) ) + offset

    coordinate - is the X or Y coordinate to snap

    scale      - the size of a grid square

    offset     - if your grid doesn't start at (0,0) this would be set to the x or y value at the grids top left spot (you'd use the X offset of you're calculating the X value and the Y offset for Y)

    In my particular example, I want to drop items in the center of the grid square, hence adding scale/2.

    I plugged all of this into two functions.

    fnGetGridCoordinate( x, y ) - takes layout x,y values and returns grid compatible coordinates. This function figures out which grid the point lies on and calls the snap function with the appropriate scale and offset values. Returns grid snapped X and grid snapped Y values.

    fnSnapGridCoordinate( layoutCoord, scale, offset ) - takes a single coordinate, scale, and offset to calculate a compatible grid coordinate.

    These two combined can give me any arbitrary grid coordinate for any arbitrary scaled number of grids on my screen. The beauty part here, at least from an efficiency perspective, is that all of the redundant checks to see what kind of grid, what kind of scale, etc. are all done centrally, freeing up my object movement code and inventory management to not have to worry about it.

    EDIT: I didn't know if it was interesting to anyone else, but since my two different grids have two entirely different scales (the inventory is 30x30 while the game is 40x40), I resize the objects as you drag and drop between them.

    When moving from the game grid to the inventory:

    Width = round( sprite.Width * inventoryScale / gridScale )

    Height = round( sprite.Height * inventoryScale / gridScale )

    When moving from the inventory to the game grid:

    Width = round( sprite.Width * gridScale /inventoryScale )

    Height = round( sprite.Height * gridScale / inventoryScale )

    RANDOM GRID CREATION

    Since you are using a grid, I assume that you will be using some sort of tile approach to populate your world. I don't know if this helps, but when I thought about doing this myself, I thought of assigning a number to each type of tile you would place (ground, water, path, etc) and then randomly populate a 2d array with values.

    This would cover the basics and setting various thresholds of probability would give some structure to it. Your most common tiles that are non-blocking (grass, for example) could have a larger probability of being selected over blocking or other types of special items (like rocks or trees).

    If you wanted to have specific complex formations of tiles, like a connected series of road tiles that winds through your map, you could have a second pass go through your world array and overwrite those elements on top of whatever was randomly put there. Your road loop could choose to create a random number of roads at a random length and then randomly build them by walking one tile at a time and randomly choosing the location of the next tile (perhaps limiting it to the four tiles sitting in the cardinal directions).

    All of these loops could be enriched with various checks to make sure that the map feels playable (don't add rocks if it will block off a section of the map, stop adding water if you hit the max amount of water on the map). You could even include a further refinement that takes prefabricated complex structures (boss room, special castle) and drops them wholesale into your randomly generated world. This would let you blend in traditional level design elements with randomly generated ones.

    At this point, any map element that you can come up with is just a variation on these themes. I'm sure you could get some really dynamic game worlds with this approach. All it would take it some tweaking and tuning of the probability models.

  • lol taking back what I said, as I am obviously unaware how else works <img src="smileys/smiley19.gif" border="0" align="middle" />

    I accidentally, the whole manual.

  • Did some further analysis and figured out that Construct will only fire the OR block when BOTH overlap events are true (as opposed to either event).

    Don't know if you're already on the case, but that might be what this person was running into as well:

    http://www.scirra.com/forum/or-doesnt-work_topic51262.html

    EDIT:

    Hrm, now that I look at it, this might be another manifestation of a previous bug that I reported as well. It's tough to know for sure without seeing the implementation underneath, but something is causing these blocks to be evaluated as traditional AND blocks rather than OR. I apologize in advance if I sent you down redundant rat holes.

    http://www.scirra.com/forum/r87-or-doesnt-work-with-on-key-press-events_topic51319.html

  • Another quirky bit of behavior from the 'OR' blocks...

    'OR' blocks fail to fire when they have both an overlap and NOT overlap condition.

    Example:

    Jesus is NOT overlapping the straight and narrow path (inverse overlap)

    OR

    Jesus is overlapping a Krull blade (ouch)

    ACTION

    Destroy Jesus

    In this case I'd want Jesus to eat it if he is matching either one of those conditions. In r87, the block fails to fire for either event.

    The attached capx demonstrates this bug and also validates that this logic works just fine when the 'OR' block is separated out into individual events.

    Exmample .capx file

  • I don't know why this isn't standard functionality, but your plugin literally revolutionized the way I approached designing games with C2. Your plugins really are amazing for productivity, but your function plugin is the crown jewel of that fine collection.

  • Just wanted to reply and say that this little plugin really streamlined my debugging. Once I wired all of my events into the console, I was able to start diagnosing very complex interactions between game events that I had been putting off for quite some time. Nice work!

  • The OR blocks don't seem to work with two 'on key press' events. I tried a few different key events and can validate that it is working for things like 'any key pressed' and 'on key down', just not 'on key press'.

    OR Bug Example

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In r87 whenever a family and folder have the same name, clicking on the family in the object viewer opens the folder rather than opening up the actions available to that family.

    You can work around this by renaming either the Folder or the Family.

    UPDATE: Just found another small bug with the folder view. When are selecting objects as part of an expression, it still uses the old style layout without the folders.

  • Here is the example:

    http://dl.dropbox.com/u/73352718/whileloopbug.capx

    The while loop that relies on the Jesus' opacity directly works just fine and he fades in as expected.

    The while loop that relies on a local variable to do the same job fails to iterate even once, and the Krull Blade stays hidden.

    I'm tempted to say that it's Jesus just kicking ass and making his loop work, but it's more likely a bug <img src="smileys/smiley2.gif" border="0" align="middle">

  • 13 posts