Editor crashing a lot

TosanuTosanu Member, PRO Posts: 388

Is there a hard limit to how large a scene can be or how many actors it can have? I was constructing a platforming level as a mock up test, and for some reason, once i got to about 3 1/2 screens across with just the floor geometry placed out (IPad size) It started choking and crashing almost constantly. I was being a bit inefficient, making the geometry out of single 64 x 64 blocks, so there were probably a large number of those on the scene, but does that choke the editor? The blocks had a spawn actor command that create an invisible actor on top for specific contact needs, but beyond that there werent that many behaviors. The player, enemies, and items were based on the recipe tutorials on Jamie-cross.net, so they had some instructions, but not a massive number yet.

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    How large a number of blocks do you think @Tosanu? Around 200 is pushing it if they have rules in. Are you sure that you don't accidentally spawn more than one invisible actor?

  • TosanuTosanu Member, PRO Posts: 388

    Each block spawns one. And lets see, were looking at definitely over 100. Is there a hard actor limit? That will make making larger levels tricky even with better arranged, properly shaped blocks, and with the invisible actors applied carefully rather than spawned by each block (for a lower number total)

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited April 2014

    It is not so much the number of blocks, but the duplicate code it has to process in each. Is there a way that you could control the spawning from a single actor which reads the level design (spawned actors) from a table?

  • TosanuTosanu Member, PRO Posts: 388

    I think instead I am going to directly attach the surfaces to the level. It'll take a bit more time, but i'll end up using a much smaller number of actors total and both the blocks and the spawned surfaces are zero instructions then. So in platformers, you really want to have as many things spawned at level start rather than being in the level to start?

    Please note, it was crashing in the editing pane, not during a preview. Is that still the same issue?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Well, uhm, yes, editing complex scenes can make the creator a bit wobbly. Saving, closing and loading up helps. I think it keeps too many undo stages in memory.

    Sure it is better to have as much created at the start of the level as possible, but spawning actors is not the great evil it is made out to be if handled sensibly.

    I did a test once, a life sim, of many actors which recursively spawned and destroyed. At 400 it was all good on the device, still at +-24 fps. It only crashed at 2000 actors.

  • TosanuTosanu Member, PRO Posts: 388

    Hmmm, ok. I wonder if I could find a better workaround for the invisible actor. Right now it acts as the Ground surface for the player to land on to change the animation to standing and refresh the jump counter. I couldn't figure out a way to have the ground block work in that function without it reacting if the player hit the sides or bottom of the block too.

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited April 2014

    What you could do is create all the actors off screen at the start of the level, moving them into place and out again as needed. Maybe that can be a solution for you?

  • TosanuTosanu Member, PRO Posts: 388

    I'm afraid I'm unsure as to that. This is meant to be part of the level's static geometry, an actor tagging the top of each block that the player character could land/stand on. Is there really a good way to build and rebuild that in a scene? (the ultimate option, which should be doable, is to split levels into multiple Scenes. it bugs me a bit because of the issues with gameplay flow, but if I end up needing to, that should be ok.)

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Can you sketch something up for me and PM it? Then I will have a look if I have some ideas.

  • TosanuTosanu Member, PRO Posts: 388

    Here is a layout of a sample level. This is extremely preliminary. As noted, the assets are currently borrowed from the excellent platforming tutorials, so those are just placeholders.

    Please excuse the terrible joining of the blocks and the drawn in last parts, I wanted to get a full level layout for this test pattern on screen. As of right now, every 64 pixel block ,even in the long walks and walls, creates a thin invisible actor at the top surface. I'm changing that part, of course. I follow what you mean on spawning objects, and will be able to do that with enemies and collectable items (if i bother to put any in, this is a vertical slice for my proposal). So basically, with the player replaced by a Player Spawn attribute, and the enemies turned into a spawning table, the only materials currently in place will be the surfaces, the blocks attaching them, and the spikes i am toying with (that will have no instructions, as the reaction to them will be in the player's behaviors)

    I've been reconstructing the geometry of the level, and with instructionless blocks with variable sizes rather than a large number of small blocks it seems to be doing somewhat better, although I haven't manually added the invisible Surface actors yet. I'm just wondering if theres any way to push this even further.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    But you intend your levels to be bigger though? Because the depicted size is no problem for GS (except for the editor lagging :P)

    As you said, making long and high block sections into a single actor is definitely sensible.

    If you want to go muuuch bigger then you should look at populating the visible screen portion from a table. A bit complicated but doable. You can easily map out your scene in a spreadsheet and import it into a table via CSV format.

  • TosanuTosanu Member, PRO Posts: 388

    Because I am unhappy with the collisions of the actor with the ground. If i just mark it as "refresh jump count and have standing imagE when collide with ground actor" It will activate every time it hits a block ,whether from a bove, below, or on the sides. Rather than do a location track on every block, i thought instead to create an invisible attached actor to act as Ground Surface and have the rule look for colliding with that instead.

    And I am afraid I do not know how to do that spreadsheet suggestion. Are there any tutorials on the idea?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    No tutorials that I know of. I have the concept of offset-aware actors bound to a table, but not as template. It would be nice and fast though.
    Also unfortunately no time in the next days. Maybe on the weekend.

    To your standing / jumping image issue, search youtube for some "jump through platform" tutorials. The same concept, detecting only if the bottom of the actor touched the block, can be used for that.

  • TosanuTosanu Member, PRO Posts: 388

    Ok, I found a tutorial, but it actually leads back to something you suggested avoiding. The tutorial requires putting the collide tracking rule in the platform rather than the player, so ill have a large number of duplicated behaviors in the scene this way. The one ive created has extra actors, but at least they have no behavior..... Or am I missing a possible way?

  • TosanuTosanu Member, PRO Posts: 388

    Though the level is performing better now that i retooled it with the described elements, its still prone to some crashing. Im starting to think my computer is a bit weak, which may be part of the problem.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    I would take the rules out of the platform actors.

    Make a detector actor and constrain him to the player actor with one pixel overlap at the bottom.

    This detector actor then sets a game level attribute on or off depending on whether it overlaps with the platform.

    The player actor then changes image according to this game level attribute.

  • TosanuTosanu Member, PRO Posts: 388

    Oh wow, that worked GREAT. and it solved a few small bugs I hadn't touched either (proper wall collision to deactivate movement when pushed against a wall).

    Do you have a recommendation for tutorials for using tables to populate a level with enemies and/or items?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Nice!

    Didn't find anything on the quick regarding building levels with tables.

    But how are you set up now? You build the whole layout of your scene don't you?

    Then just place the enemies also, no?

    I am going to be afk for 2 hours again.

  • TosanuTosanu Member, PRO Posts: 388

    I've been trying to make it work with a table for a while now. The plan is to make a table with number of columns = twice the number of types of objects im playing. The first column of each pair is the X coordinate, and the second the Y coordinate. I am trying to get a function to check if the value of the table cell is zero, and if not, spawn at those coordinates, and then move down one row, and repeat. If the value is zero, they then move over two columns, and repeat, until the column track value equals the column total value (both that i have set up before, along with a Row number and a Cell Value function)/. So far, its not working.

  • TosanuTosanu Member, PRO Posts: 388

    To update, since I reread that and it didnt make much sense. I have the RowNumber and ColumnNumber attributes, which are set to 1 manually by the game at the start. There is a rule that says while the ColumnNumber is less than or equal to the ColumnTotal(derived by Tablecolcount in the actor), a timer will trigger every .01 seconds (not great, but its a placeholder) that checks the CellValueX (CellValueX and CellValueY, Column 1 and 2 are filled at the start of the timer as well). As long as its not Zero, i have put in the command Spawn Actor (Object 1) at locations CellValueX and CellValueY, and then increment the row by 1 and repeat. If it IS zero, the columntracker is incremented by 2 (to reach the next pair) and the rowtracker returns to

    As far as i can tell it ought to work, but nothing is happening.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Maybe you did not tick "run to completion" on the timer? Are the values set to 1 before the timer rule gets called?

    Maybe post a screenshot.

  • TosanuTosanu Member, PRO Posts: 388

    I found it. I accidentally inserted some bad text in one of the expresions, which threw the whole thing off.

    Now, I got this working, except for one problem. Unfortunately, since i have it on a timer, there is a bit of a delay in the spawning. I have this even spawning the architecture, so I cant tell if it looks a little bit weird to watch the level be popped into existence around the start point before the player character is created. Is there a way to make a while loop independant of a timer, or at least faster than the Timer Function can create?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Nope, both the loops and timers are bound by the game cycle, roughly every 0.02 seconds.

    What people do is process batches of spawn instructions every cycle.

  • TosanuTosanu Member, PRO Posts: 388

    That was a bit much for me to try all at once, but I did a simpler setup, and now it works. The entire level spawns in less than two seconds. the previewer seems to play just fine, so the main issue must have been the editor's resources only. Really, I want to thank you for all the help in getting this set up.

Sign In or Register to comment.