bscarl88's Forum Posts

  • If i understand it right, i would try making an array for each player and then when it comes time to play or make a new game with the player just have a function to call for when a specific character is chosen and then populate the array based on that so that you would be dealing with 4 array instead of ten array and having to erase them every time.

    And then for the rest If i remember right there are some value that should be stored in array and then in dictionary. Not sure what is best used. Im working on a system myself but its just for one character atm. as for persist you can just set the array to global. Saving the game is one area i have no explored yet.

    thanks! That's what I'll do then! I'll do a player 1-4 array. And assign the player's variables on each start of the screen based off of the global array.

  • I'm creating a local co-op RPG game, up to 4 players can choose from up to 10 characters (each with their own move sets) I need to store/persist player variables like:

    -Level

    -Character Name

    -XP

    -Money

    -Base Health

    -Base Damage

    -Ability 1 Level

    -Ability 1 upgrades

    -Ability 2 level

    -Ability 2 upgrades

    -Ability 3 level

    -Ability 3 upgrades

    -Ability 4 level

    -Ability 4 upgrades

    -Armor Piece 1

    -Armor Piece 2

    -Armor Piece 3

    -Armor Piece 4

    -Armor Piece 5

    and probably more that I cant think of. Should I make 1 array to store all this information for all 4 players, 1 array per player, or 1 array per character? I need them to persist through layouts, and I might possibly need them to save between play sessions as well.

  • Centra hmmm not sure! I tried to optimize early on. Plus most of those objects are just background/scene art. So there's no thing to them except for holding their place on the map. Do your objects have a lot of complex code associated to them? I did what Colludium told me to do and disabled a lot of my enemies if they weren't on screen. This greatly reduced

  • It says webgl, but it's an older onboard processor GPU. It's the intel HD4400 GPU that comes with the i5 4200U processor. It's an ultrabook processor, so i think it's probably my worst case scenerio machine (good to test on)

  • Colludium

    Draw calls is ~ 3%-4% with 1,130 objects on screen. Doesn't seem like that is very much against draw calls, even though 1130 objects seems like a lot? (most of the objects have their collisions disabled.

    Engine is 25-35%

    My My "GameSheet" is my main, and my Level1LSheet is my level specific sheet. Level1Sheet is very expensive at 50%-60%, but even when I disable all events in it, it's still at a high % rate. I am including a few sheets in my Level1Layout, are those making it appear as though Level1LAyout sheet is taking their CPU% load? I don't think my draw calls or engine % is too crazy.

    Thanks for the help on this already btw

  • When I say disable enemies I mean disable their behaviors - so they don't move, shoot, path-find, platform, or whatever else you have them do. The engine uses collision cells so there's no need to turn off collisions for enemies with your player.

    Created "IsActive" boolean for each enemy. When they first come on screen, it is active and then starts to run through their code. This reduced CPU usage by about 30-40%! But my FPS didnt' change on my slower ultrabook... how can that be?!

  • It sounds like you need to disable the enemies who are way off screen. That should drastically reduce your collision checking (providing they are moving and somehow checking for overlaps/collisions).

    Yup, I was thinking on doing that by putting an event with each collision to only check collisions if that enemy is On Screen first, would that limit the collision checks to only what's on screen? How do you disable an enemy? If I disable the group code, that would disable it for all of my enemies.

    Also, if there are no Object A on screen, but I have a collision check for OBject A and Object B, does it still check for that collision? OR does it only check collisions for pairs if both objects exist?

  • Im getting about 80-90% CPU usage, with 1,120 objects on my gaming PC with GTX970 and my ultrabook with integrated chip. I'm getting anywhere from 400k-800k collision checks. My level layout is pretty huge at 14000, 6000. And I have around 150-200 enemies throughout the layout, which it's obviously checking collisions against bullets and hitboxes for each one. It seems like all the strain is on my CPU and not my graphics card, which makes me feel like it's the collisions (since collisions are handled by the CPU correct?) I'm going through and trying to replace <On collision> with <is overlapping: Trigger once> because I heard there are performance gains, but I cant do if for all event cases.

    In order to reduce collisions, I was thinking on making the collision check start with an <Enemy Is On Screen>. Would that effectively reduce it to only check collisions of who's on screen? There are 3 different enemy objects that use the same code (all the enemy code is coded to the family). I'd have tested this first, as I usually do instead of resorting to the forums, but this would require a massive code redo that I'd rather go for an answer first.

    Thanks!

  • Any ideas on how I can accomplish this with 4 players running around on a screen? Right now it's only taking the distance of 2 players. Would you have to compare the X and Y distance of every player, then choose the max ones?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • has this been done yet? I used to code double jump manually before, but never had to since they implemented it. But This feature has always come across my mind as a requirement. That along with allowing more jumps

  • I may be one of the very few that splits up like that but there are quite a few games I have played like this. Hammerwatch, Binding of Isaac, Nuclear Throne, Mercenary Kings and Full Mojo Rampage are a few that come to mind.

    PHEW - Quite the overhaul, but I did it. Now you can toggle at the character select if you want player 1 controlled by keyboard or controller. If you select Co-op, and you have 1 controller, it will default player 1 to keyboard, and player 2 to controller. You can dynamically change it, and it will adjust what players the controllers control. So now you can do local co-op with 1 controller and 1 keyboard!

  • Hopefully you have the autosave and backups setup, because there is nothing that can be done with this file unfortunately.

    If you unzip, you will see that the Files, Animations and Textures folders are missing. There is nothing anyone can do to bring them back.

    Check the folder where you had this project for .backup and .autosave files. If found, just remove the suffix to leave .capx.

    Can this not happen to backup or .autosave files? Has anyone found a solution/reason for this issue? That's very scary, I lost days on projects before due to this. I do have the backups, but they never opened for me. Thanks for the last tidbit of information on how to open them.

  • Problem Description

    I have a file that seems to have corrupted while working on it. If I click "Run Layout", I get an error. If I open on a new computer, or existing, it fails to open the project.

    Referencing the error images below:

    -When I use my computer that already has the file open try to Run any layout, I get the first error message.

    -If I attempt to open the file on any computer, I get the 2nd message. It has retroactively messed up my last 3 saves and can't open any of them.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/104143348/ErrorTest1.capx

    Description of Capx

    Seems to be attempting to go to a temporary folder for assets (specifically font30b), doesn't seem safe that something is stored there. I haven't touched the asset or the folder that it is stored in. My project ran last night, I woke up int he morning and it stopped running.

    Steps to Reproduce Bug

    • Step 1 - open file - Error message should pop up
    • Step 2 - IF step 1 is successful (but it shouldn't be), click run layout
    • Step 3 - Error message should pop up

    Observed Result

    Error popups of not being able to access required files

    Expected Result

    Error popups of not being able to access required files

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10 build 10240

    Construct 2 Version ID

    212.2

  • bump

    Right now my laout is 7000x2000, I'm using 32x32 tiles. Im not sure if I should make one big tile map that stretches the whole layout, or multiple small ones

  • Yes most local co-op games that use keyboard+gamepad would let you set first player as the keyboard and 2nd player as controller 1. You could make it something you could set in an options menu or something if you cannot auto detect that somehow. The way you have it setup someone would need two game controllers plugged in even if you just wanted to play one player on keyboard and one on gamepad (which is how my wife and I play those games typically).

    Great insight! I apologize, I was under the impression that no one split it up like that, and everyone just used controllers. I'll start working on that. How does this sound....

    I'm trying to think on how best to accomplish that. I went into a few Local Coop games, and they all handle it differently. Rivals of Aether, for example, keep pushing the keyboard controls to the next available player when a controller joins. So if player 1 was controlled by the keyboard, when a controller joins, now player 2 is controlled by the keyboard.

    Risk of Rain, only lets the first person be controlled by the keyboard, the rest have to use controllers. They have an icon above the character select that you can toggle keyboard on and off (this sounds the easiest). But i'll probably have to mimic it where the players have to change the number of participants manually instead of it being dynamic like I currently have it, which was something a few people were looking forward to.