pandabear7413's Forum Posts

  • I'm seeing some weird behavior with 276.2. The following code works as expected, and in the debugger I can see Player's animation being set to "collapse" in either scenario.

    However, if I combine the conditions into an OR block, like this...

    ...this is what happens:

    - the "set animation to collapse" action executes when either of the conditions is met (expected)

    - Player's animation changes to "collapse" ONLY when the hitCount>= player.hitMax condition is true. In other words, if lifeBar (a Progress Bar) has progress <= 0, the "set animation to collapse" action is still called per the debugger, but the player animation doesn't change.

    I've had the OR block (2nd pic) in my code for many months now, and only recently started seeing an issue with it. I split it into the code shown in the 1st pic and now it works. Is there something about OR blocks or Progress Bar objects that I'm not considering?

  • Thanks - I feel silly for not thinking to do that.

    I created/exported a sample project to test it out. For anyone that's interested, the answer is 'yes'.

  • I'm OCD with the tab order as well. I have 3 rows of tabs in my project and I get pretty stressed if I accidentally close something on the first row. I'd love to have a way to lock the tabs and keep them from accidentally closing. I'd even be happy with tabs that can be properly dragged and dropped across multiple tab rows.

    But I'm in the camp of keeping the tabs, using the project bar every time to select the item to view would be too cumbersome in my opinion.

  • Very excited about these new features!

    I have a request... For operations that have the option "apply to all animations" (e.g., setting image point coordinates), would it be possible to add an option "apply to all animations in folder"? Basically applies the changes only to the animations in the folder/sub folders, but the other animations are untouched.

  • Say I import image A.png into the animation editor as a frame, and then use the 'crop' feature on that frame. If I was to import that same A.png file into another frame/animation, and again used the 'crop' feature on that frame, is C3 deduplication (on export) smart enough to know that these 2 frames are the same image?

    I would think the answer is 'yes' since the crop feature should generate the same pixel data each time... right?

  • Whenever I first preview my layout, or when I change images in certain sprites, "preparing images" shows up and takes a good amount of time (~2 minutes). I have a lot of high-res images that I'm trying to optimize, so I'm sure that will help, but can someone help me understand what "preparing images" is actually doing? Knowing that may help with my optimization.

  • Great idea, I never knew about that! I'll add that action to my printToErrorText function and play around with it.

  • Sometimes the layout editor in C3 stops rendering the layout and instead just shows a sad face in the upper left corner (pic below). When this happens, none of the 10+ layouts in my game will render properly. The only solution I've found is to close the project, restart the browser (chrome), and reload the project. Any idea why this may be happening, and is there anything I can check to track down the underlying cause?

  • For the more experienced programmers in the community: what are some best practices for logging debug-type data in C3?

    I use some simple logging in my code for debugging purposes. Basically I have the simple function below that prints to a text object, which is in a layer called 'debugLayer'. Every layout in my game has a 'debugLayer' layer, and pressing the 'd' key toggles visibility of that layer. I call printToErrorText throughout the code to log what I feel may be helpful or relevant for debugging, but other than calling it once at the beginning of every function (with the function name and parameter values as the str argument) I don't have any consistent rules on when to use it.

    This method has been helpful, but I have to think there are better ways to tackle logging with C3. Would love to hear what's been working for the C3 veterans out there.

  • I have about 10 layouts in my game. I can debug most layouts just fine, but there are a couple that "crash" the debugger. When I select "Debug layout" for those I get what's in the screenshot below. No controls work, and eventually I get the warning window from Chrome. This is happening on simple layouts: the main title layout and the level select layout. Both of these layouts work fine when playing the game, and I can't think of any objects these layouts contain that are not in the layouts that work with the debugger. My capx is too large to share, any suggestions on what to check?

  • Layers and event groups are not reset to their default state. If you deactivated a group, it will stay deactivated after the layout restart.

    All objects are re-created, except global and the ones with Persist behavior.

    Hey Dop thanks for the response. Re: your comment on groups, just want to make sure I'm not misunderstanding something. Per the docs:

    Restart layout:

    Restart the current layout. Note that unlike Go to layout, this action resets all event groups to their initial activation state. Global variables keep their current value - they are not reset. To reset them use the system action Reset global variables.

    ?

  • Thanks everyone, this is very helpful. The 2 articles mentioned provide great detail and I have a strategy now to deal with this. Luckily I'll be able to break up the sprite into a number of smaller ones, and I only need a few per layout. I'll also work to reduce the overall image size and crop the dead-space around the images.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to understand what "system->restart layout" actually resets...

    For example, in the layout editor I set one of the layers to be initially invisible. During the game it's set to visible at one point, but when I call "system->restart layout" it doesn't reset that layer to invisible.

    Does "system->restart layout" ignore the layout properties set in the layout editor? If so, which ones? And what's the best way to truly reset the layout - store all properties in global variables?

  • This is very helpful and I has really hoping both of you would respond! I've started working with the profiler to make sense of the memory usage, and will look to see what can be done to reduce image size and even keep in the power-of-two size.

    Here are some preliminary findings running the profiler (shift+f5) with x number of player_combat sprites on an otherwise blank layout:

    - x=1: profiler shows "Est. image memory = 3700mb", mem usage increase of 0.8 gb (compressed) per Windows task manager

    - x=2: profiler shows "Est. image memory = 3700mb", mem usage increase of 1.2 gb (compressed) per Windows task manager

    - x=3: profiler shows "Est. image memory = 3700mb", mem usage increase of 1.5 gb (compressed) per Windows task manager

    Questions:

    - Why does the profiler show 3700mb image memory if Task Manager is only showing .8gb usage?

    - The images directory of my project is 1.1gb. Why does the profiler show 3700mb for images?

    I'm guessing the answer's the same -- 3700mb image memory is for uncompressed images. But any clarity would be helpful.

    Thanks!

  • In my game, there are a large set of high-res animations for each player/enemy combination. To provide come context, I expect the total size of the animations for my game (after C3 processes them) to be upwards of 1gb.

    I currently have all the animations in a single "player_combat" sprite, that I place when and where a combat occurs. I only have one instance of player_combat that I make invisible when not in use.

    This is convenient because I have all the animations in one place, and can easily copy animations, image points, and collision polygons between different "enemy" folders in the object's animation page. However, C3 is taking a long time (several seconds) to instantiate the object at the beginning of the game, and I believe it's because of the number and size of the animations it contains. My C3 editor is running slower these days as well, especially when opening the animations dialog for any sprite object, and I'm wondering if the size of player_combat and its large animation count is contributing.

    I'm thinking it may be more efficient to separate the "player_combat" sprite into multiple "enemy_combat" sprites, each of which only contain the animations for that enemy. Seems logical that these sprites would take less memory, and even if I have 1 of each instantiated all at the same time, the combined performance hit would be no more than a single player_combat sprite.

    I want to run this by the community before I go down this route, because if it turns out to be a bad idea, going back to a single player_combat sprite would be a lot of work (I'd have to recreate all the collision polygons for each animation since there's no way to transfer those from one sprite to another).

    So my question is: is separating the "player_combat" sprite into multiple "enemy_combat" sprites a good idea for this situation? And are there any other best practices I should keep in mind with large numbers of high-res animations?

    Thanks

    Before