Author Topic: Editor Out of Memory  (Read 9680 times)

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Editor Out of Memory
« on: November 15, 2013, 03:12:51 PM »
Soooo I've possibly pushed this editor a bit too hard, and have a fairly large level with tons of new assets - It's to the point now where when I work for 2-5 minutes it crashes due to memory. For future levels I'll try to keep them smaller but this level has a small ways to go to be finished and I'm wondering if there is a way to increase the amount of memory the editor can use or reserve? Or are there any tips to get the editor to crash less?

NekoBaron

  • Posts: 124
  • Scripting Wizard
    • View Profile
Re: Editor Out of Memory
« Reply #1 on: November 15, 2013, 08:06:37 PM »
You could try merging some art assets to one file if your using a separate file for each one.

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #2 on: November 15, 2013, 08:21:58 PM »
With the amount of assets I have in this level that would probably require redoing the entire level :/

I couldnt find a config file anywhere for the editor that might designate more memory or something - as it seems to be a limit of the program itself - my system has plenty of memory to spare.

NekoBaron

  • Posts: 124
  • Scripting Wizard
    • View Profile
Re: Editor Out of Memory
« Reply #3 on: November 16, 2013, 12:38:55 AM »
I put a lot of my art assets into a single file, you can have multiple xmls reference the same image file.

How many xmls and images we talking about? I'm curious what the limits are or if they're just something your hitting,

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #4 on: November 16, 2013, 03:19:50 AM »
Well most of them are in the same image already, it's not referencing different images for each asset - they are mostly part of a large palette. As far as doodads, about half my list of doodads is vanilla hammerwatch and the other half is stuff I've imported - actually a bit less than half. The difference would be in the scaling of the assets - some 16, some 32, some 64, etc. Also the amount of doodads I have placed and such seems to be quite a lot - they are most times smaller and require more of them to fill the same space. Lots of doodads overlapping, etc.

Crashing occurs most when changing doodad layers, copying doodads, and (almost everytime) reloading resources in the editor.

I checked the .xml file size and it is just under 6MB - I thought maybe the file size was some indicator but after looking at the file sizes of the vanilla levels some are bigger.

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #5 on: November 16, 2013, 06:35:01 PM »
After some tinkering and removing over half of the assets placed in this large level - it still seems to crash often...

Could one of the devs comment on what takes up resources the most, or some best practices for conserving memory?

Any plans on increasing the available memory for the editor in the future?

NekoBaron

  • Posts: 124
  • Scripting Wizard
    • View Profile
Re: Editor Out of Memory
« Reply #6 on: November 17, 2013, 01:37:59 AM »
I don't think its the level having too many assets, but that you have a lot of custom assets which are all loaded into the editor even if they're not used.

It might be all the 64 scale images taking up too much for the editor, from what I remember the default general scale is 16 so 32 is 4x as much needed and 64 is 16x as much being used by images.

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Editor Out of Memory
« Reply #7 on: November 17, 2013, 12:04:46 PM »
May I ask, does the level have more assets and are larger than level 9 or 11 in the campaign?

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #8 on: November 17, 2013, 03:30:09 PM »
May I ask, does the level have more assets and are larger than level 9 or 11 in the campaign?

It's just under the size of level 9, but I cut it basically in half to make it two different levels but the crashing still happens. Before cutting in half the assets placed might be a little more than the assets placed in 9 and 11.

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Editor Out of Memory
« Reply #9 on: November 17, 2013, 09:47:38 PM »
If you work a lot with tilemaps, a lot, like I did with level 6, all those small borders, I had crashes all the time because the editor ran out of memory. Myran fixed this by flushing the history data when the memory peaks at 1GB (I think), I can ask him if we can make an option to remove the history states completely, that would probably increase the performance, espec on slower machines.

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #10 on: November 18, 2013, 01:01:31 AM »
I don't actually work with tilemaps that much - at this point its really just grass and a dirt path. In fact, i laid down the tilemap first and mostly didn't touch it very much since. The crashing occurs when i copy a doodad, change the doodad layer (via ctrl+#) and I do notice the history list on the left 'refresh' itself by completely deleting itself - which happens literally every minute.

I should also note that my system isn't very low end, it's kinda a beast. I have a quad 3.6ghz and 8 gigs of ddr3 RAM.

In some cases I have a very large image palette that I only use a small item or two from - but that item is used many times. Would part of the memory issue have something to do with that? I suppose it might be best practice to make those images as small as possible anyways - its just more work for me and I'm lazy :D

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Editor Out of Memory
« Reply #11 on: November 18, 2013, 08:33:55 AM »
Would it be possible for you to share the map to me, either here or via PM, skype or whatever? I can just see how it handles on my computers, this one here at home or the one at work?

The amount of memory doesn't seem to matter when you go above a certain point, I'm sure the editor only uses 1GB anyway. For some reason... I've asked myran about this before, but I remember it being something complicated.

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #12 on: November 18, 2013, 03:09:11 PM »
Yes I can! I'd have to package all of the new assets into a zip too, right? Let me see if I can get it all together correctly and I'll PM it to you.

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Editor Out of Memory
« Reply #13 on: November 20, 2013, 11:42:22 AM »
I tried the level in question, I don't get the lag or any sort of performance issues, not at home and not here at work.

However, there's a lot of different technical errors here, both with tilemaps that shares the same layer and most important, you have textures that dosn't use the power of 2. You should really try and fix the latter issue and see if it fixes your performance.

Also, what kind of graphics card do you have?

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Editor Out of Memory
« Reply #14 on: November 20, 2013, 02:17:08 PM »
It's just crashing of the editor - but after I removed the doubles of the vanilla assets in the hammerwatch/assets folder it kinda stopped crashing overall. I think maybe because there were so many duplicates it was having some kind of problem.

I have radeon 6850 GT

I plan on going through and changing everything to the 'powers of 2' rule, but before I had noticed or even cared about that I already had most assets imported as they are. Hopefully it will work alright long enough for me to work on the levels and such, and I'll add the powers of 2 rule to my list for optimization near the end.

If you notice, the tilemap conflict is saying "shares same level as tilemaps/a_dirt.xml and tilemaps/a_dirt.xml - both of which are YOUR tilemap and I'm not sure how I'm supposed to fix this :/ Is it because I ahve the assets dumped into my editor folder?
« Last Edit: November 20, 2013, 02:39:14 PM by Pwnography »