stricky's Forum Posts

  • Ashley please comment on this. This is a very basic feature which should have been in place long ago. It's hugely frustrating not being able to see my entire layout in design mode. I can barely see 20% of it at the moment.

    Tokinsom, with good design it's very possible to make large layouts that run at 60 FPS on PC. I can't comment on mobile games. I'm sure there are many other non-coders out there like me who are trying to develop ambitious 2D games on PC using Construct2 - and this is one of those easily fixable annoyances that needs to be addressed before development on Construct 2 comes to a halt.

  • So I would put the block sprite into 2 different families and test for overlap between families? Would I then need to create family instance variables and compare these? Appreciate if you could modify my CAPX to illustrate.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What's the simplest way to compare instance variables for 2 or more instances of the same object?

    In the CAPX below, I want to destroy overlapping blocks only when they are of the same color but at the moment all overlapping blocks are destroyed regardless of color. I have seen some forum posts mention using local variables but I could use a simple example to illustrate this.

    sendspace.com/file/ur8wzd

  • I was hoping to avoid creating separate events for each player's controller actions as there will be a large number of inputs (button combinations etc..). Is there any way I can dynamically support 1 to 4 players without having to create separate events for each controller?

  • See my event sheet below. I'm trying to support 2 or more players (using gamepads).

    [attachment=0:3cevwxj5][/attachment:3cevwxj5]

    Have uploaded an updated CAPX fie for anyone using r192.

    s000.tinyupload.com/?file_id=00649642362768732583

  • I am trying to create a local multiplayer game in which 2 players can provide input via keyboard/gamepads

    The game will eventually be fairly complex and the players will interact with various other sprites and can take a number of different states. The players will be made up of several sprites (using a container). To keep things organised I would like to change the player state based on keyboard input and then have the state changes call functions which trigger actions. These actions may impact certain sprites the players are made up of as well as the sprites the players are interacting with.

    In the simple CAPX below the layout with one player works fine, but the layout with two players is resulting in one player state overriding the other. Any suggestions appreciated.

    s000.tinyupload.com/?file_id=69883725359287767242

  • Ashley, those are the image file sizes, the C2 size for the player animation frames would be 262kb per frame (256px * 256 px * 4). There are approximately 1000 player/enemy animation frames in total which works out to 260Mb if I'm not mistaken.

    If I add in 300 frames for environment objects per layout, say an average size of 512x512 (some larger, most smaller) that adds up to 300Mb, so rounding up I would expect minimum image memory usage of 600Mb (not including space required for tiled backgrounds which are also used).

    The "ImageMemoryUsage" parameter in C2 varies between 600Mb and 1Gb which seems about right, with I assume the other 1.7Gb (of the 2.7Gb total) being taken up by the code/nodewebkit processes. There is a lot of room for improvement in the code, but I'd be surprised if I could claw back another 1Gb. I can't run the game in a browser any more (too big I assume) so I'm not able to use the layout debugger to troubleshoot.

    I don't think there's much I can do to reduce image memory usage unless I reduce sprite sizes and/or reduce the number of frames.

    Example frames for the player and environment in links below. Edit; Don't have the rep to post links yet.

    TiAm, the game is PC only, so I'm aiming for around 2Gb total memory usage, I estimate half of this will be taken up by image memory, but given I have yet to add audio, I will probably struggle to stay within 2Gb.

  • saiyadjin, the frames have transparent edges on the spritesheet but these are trimmed in Construct2. I can rearrange the sprites on the sheets so that so they are (2^n -2), but they will still be very large. Minimal sound in my project so the issues are all image related.

    Aphrodite, the 2.7GB is the "memory use" value in the bottom right of C2. There is a dump layout but it only contains 10% of all sprites. When looking at the memory usage of the nodewebkit executable in task manager it gets close to 2.7GB. Nodewebkit spawns two processes each taking up 1.3GB when the game gets busy. Not sure why this is (using r192).

    Examples of my large spritesheets include cars and furniture (e.g. the same items in different colour schemes). So the large spritesheets are composed of mostly static frames. However, I also have spritesheets for enemy heads (which are pinned to the same body to give enemy variety). Will the whole spritesheet/all frames of animation be loaded into memory for each instance of the sprite?

    Ashley, just to clarify, there are no static frames that are larger than 1024x1024 (max size per frame 200kb), and all frame-by-frame animations are between 2 and 20 frames (max size per frame 50kb). I have looked into Spriter but it can't replicate the look of the complex animations I have hand drawn.

    So my question is, if the sizes of my individual frames are unchanged, is there any reduction in memory usage if I chop up my large spritesheets into smaller sprite sheets and spread the static frames across multiple animations (in one C2 sprite or multiple C2 sprites)?

  • Ashley, yes there are a large number of animations and in some cases, frames per animation. I'm following the techniques described in your article with one exception, and I think this may be my problem. I have around 20 sprite sheets that are larger than 2048x2048 but these contain many frames of animation, (so no single images anywhere near this size). There are some animations with 50+ frames (with each frame being less than 50kb).

    I assumed Construct2 would physically chop up these spritesheets when loading them in as sprite strips in the image editor. If this is not the case, would it help if I broke these large sprite sheets down into smaller sprite sheets? Or do I just have too many frames in my animations?

  • I'm making a top down shooter which runs reasonably on a moderate spec PC but uses excessive memory. Currently 2.7GB and rising. I've read all the performance improvement articles and blog posts from Ashley but am at a loss as to how I can reduce memory usage beyond what I'm already doing.

    There are a large number of animations in my project (and some large sprite sheets which are between 500kb - 4mb in size) but there are no individual sprites which are larger than 50kb (all images are PNG-24 with transparency). The total size of all spritesheets is 90mb. At its busiest, there are approximately 100-150 sprites on screen. There are some large layouts (10k square) but the number of sprites rarely exceeds 1000 in a layout. Some of these sprites are repeated, so the number of unique sprites generally does not exceed 100 in a layout.

    There are no large layout images, I'm using tiled backgrounds wherever possible, I'm not generating large numbers of sprites via actions or doing anything else (as far as I know) that would consume a large amount of memory.

    The project is too large to share (3000+ events) but any suggestions for reducing memory usage would be appreciated.

  • I'm looking to replicate the action "Set position to Mouse.X(0), Mouse.Y(0)" with the xbox 360 gamepad right thumbstick

    So far I have "Set Position to ((Gamepad.Axis(0,2)/100 * WindowWidth/2) + WindowWidth/2 , (Gamepad.Axis(0,3)/100 * WindowHeight/2) + WindowHeight/2) which works with just one layer but if I have multiple layers in my layout it fails.

    Is there any way I can modify this to accommodate multiple layers and are there any improvements I can make to the action to smooth the thumbstick movement? It's running every tick but is still a little jittery and the cursor doesn't quite reach to the four corners of the screen.

  • LittleStain, on an xbox 360 pad the trigger buttons are accessible but they are binary as far as Construct2 is concerned (if I'm not mistaken). Either they are pressed or they are not. What I'm looking for is the degree to which the trigger is being pressed as they are analog buttons. E.g. is the trigger partially down, half way down, all the way down. If for example the triggers detect 10 degrees of pressure I'd like to return a number between 0 and 9 rather than pressed/not pressed.

  • Looking through the gamepad entry in the manual, there doesn't seem to be any way of detecting gamepad trigger button pressure (e.g. to support accelerate/brake in a racing game). Is there any way to implement analog triggers currently in Construct2?

  • robertjs3, you may find the attached CAPX useful. It basically simulates hotline miami style gamepad controls

    https://www.sendspace.com/file/wmb8uh