pandabear7413's Forum Posts

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since posting this I realized I can use Event Groups for this, and enable/disable groups based on the situation. E.g., I can have a Player Attack group with all the keyboard events I use for attacks, and disable this when interacting with a menu. This is a lot cleaner than the individual conditionals I've been using for every keyboard event. I'm looking forward to seeing how this will work.

    Any other 'best practices' folks have been using?

  • In my game, the 'z' keyboard key serves many functions. Depending on the situation, it can be used to kick, shoot, reload, talk to an NPC, continue a conversation, end a conversation, or select items in a menu.

    I've been using a combinations of conditions to determine what code should be executed when 'z' is pressed. They check for player 'state' (instance variable) values, object visibility, overlap with other objects, layer visibility, or a combination of these. It works but is getting messy, and when I add new features or make changes to the game, my logic is prone to break. It's basically spaghetti logic. I'm pretty early in my game so I have to think there's a better way to implement this, and that this is a common challenge with some proven solutions.

    Is there a 'best practice' on how to implement and manage overloaded key events? Maybe use of a data structure or dictionary opens up some cleaner options?

  • "Add Sprite.pickedcount to killCount" -- That's good stuff right there!

    My understanding of picked logic was: iterate through every step in the action block X times, where X = picked count

    But it sounds like you're saying: iterate through every step THAT REFERECES THE PICKED OBJECT(s) in the action block X times, where X = picked count. For all other steps, execute those once

    Is my new understanding correct?

    Thanks

  • Here's my code. I have a 11 sprite objects with health = 1. Pressing space subtracts 1 from their health, so all will have health set to 0.

    The code properly destroys all 11 sprites, but it only increments killCount once (the highlighted action). Why does it not increment killCount once for each sprite that meets the health <=0 condition?

    The commented "for each" section does what I want, but I'm trying to understand why I need this. I obviously don't understand object picking as much as I thought.

    Thanks

  • Agreed. I have thousands of values (my array is 500+ rows and 140+ columns) and I do a select all (ctrl+a) and copy (ctrl+c) in excel, then paste that into the top left cell in the C3 array editor. Works great.

  • My game is similar to KiwiStory, where I'm creating multiple platform levels in a single layout (pic below). In my game, the enemies move towards the player based on Line of Sight behavior (LOS). They start with a smaller LOS range, but once they "see" the player or are hit their range is increased to the Layout width, so they always have LOS to the player on that level.

    The player can move to different levels in the layout, similar to how the doors work in KiwiStory. The problem is, once the player moves to another level, the enemies on the original level may still have LOS to the player, so they try to move towards the player. I want to keep them from 'seeing' the player unless they're on the same level.

    I see a few ways of implementing this. E.g., a global currentLevel variable that's set when entering the doors, and only enemies with that value can see the player. Or I can compare an enemy's Y coordinate to the Player's Y to determine if they're on the same level. Or I can wrap each level in "obstacle" sprites which can block LOS. Each has its pros and cons, so I wanted to see if there are any strong recommendations for one, or if there's an even better one I'm not thinking of?

    Thanks

  • I want to place several enemies on my layout using the Layout view in the C3 editor, some of which are facing right (normal) or left (mirrored). Is there a way to do set the Mirrored property using the Layout editor? I see a setting for 'angle', but setting it to 180 rotates the sprite upside down.

    If not, my thought is to set an instance variable called mirroredAtStartup, and programmatically mirror the sprite on layout start based on that value. Or is there a better solution?

  • I'd like to be able to change an external file (.csv) at runtime and load it into my game. I'm able to use FileChooser to do this, works great.

    However, I want to be able to change the same file and reload it multiple times during a game, and would rather not have to use the FileChooser "file picker" dialog every time since the filename/location doesn't change, just the file contents. Is there a way to use the FileChooser "file picker" dialog just for the first file selection/load, and then "reload" the file after it's been modified without having to use the FileChooser "file picker" dialog each time? Hope this makes sense.

    FYI this is just for game dev/debugging purposes, and I don't plan to ship the game with this file loading feature.

  • Will give it a shot, thanks!

  • Finally getting back to this. I'm performing the following steps:

    - add the plugin via the Addon manager

    - create a new project

    - add a CSVToArray object to the project

    - preview the project (or layout)

    Here's the issue: The project window pops up but just shows "Please wait, loading..."

    I'm guessing the plugin is no longer compatible with the latest C3 release? Would be great if someone can confirm if they're seeing the same thing on their end. I'm running R276.2 fyi.

    Thanks

  • Can someone please provide a simple c3p showing how to use Rex's csv to array plugin

    (https://www.construct.net/en/make-games/addons/234/csv-array-c3-runtime)? I'd like a programmatic way to load a .csv into an array, vs what I currently do (copy and paste excel data into the C3 array editor.

    Thanks!

  • Can someone please provide a simple c3p showing how to use Rex's csv to array plugin? I'd like a programmatic way to load a .csv into an array, vs what I currently do (copy and paste excel data into the C3 array editor.

    Thanks!