"Memory leak"? Rotating unit issue?

Hi,
I am working on a module which requires unit facings. I have all the units and markers in the module and started a playtest. As my opponent was setting up his forces, he proceeded to begin rotating them to face them in the proper direction. He reports that as he got more and more pieces on the board and began rotating them, he sometimes had to wait 6 seconds or more for the piece to rotate one hexside. He was able to finish his setup and sent it to me both as a log and as a saved game file.

When I open the log and start viewing it goes smoothly until he gets several pieces on the board and then it starts to slow down (using 50% of my CPU resources). It reaches one point where he has 12 or so units which he highlights and rotates all at once… it takes close to a full minute before they actually rotate one hexside. After that, I have sat as long as 5 minutes with no further rotation occurring in the playback and my CPU usage for Vassal sitting at 50%.

When I open the saved game file instead, it takes a couple minutes for the saved game file to load into Vassal and then, as soon as I try to do anything (pan around the map being a good example), the map turns white and Vassal freezes (again, CPU sits at 50%) – meaning I can sit for 5 minutes or more and nothing further happens or can be done in-game, except I can click to close Vassal and, after 90+ seconds, the module shuts down.

I can only speculate it has something to do with the graphics and rendering images as rotated… But the typical counter is only 30kb, so it wouldn’t seem a horrible strain on the CPU.

I suspect I will have to send the mod and the log and save files to a developer. Where should I send them? The mod is 8MB.

Thanks,
Kevin

What are the machine specs?
What is the heap settings for the mod? Have you tried adjusting these?
Have you tried with high quality scaling checked on/off?
How big is the map? Have you tried memory mapped files for large images?

these preference settings are there to help alleviate strains on computers having a hard time.
Give these a shot and see if it helps first

From: MadSeason messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Tuesday, February 10, 2009 8:51:59 AM
Subject: [Technical Support & Bugs]“Memory leak”? Rotating unit issue?

Hi,
I am working on a module which requires unit facings. I have all the units and markers in the module and started a playtest. As my opponent was setting up his forces, he proceeded to begin rotating them to face them in the proper direction. He reports that as he got more and more pieces on the board and began rotating them, he sometimes had to wait 6 seconds or more for the piece to rotate one hexside. He was able to finish his setup and sent it to me both as a log and as a saved game file.

When I open the log and start viewing it goes smoothly until he gets several pieces on the board and then it starts to slow down (using 50% of my CPU resources). It reaches one point where he has 12 or so units which he highlights and rotates all at once… it takes close to a full minute before they actually rotate one hexside. After that, I have sat as long as 5 minutes with no further rotation occurring in the playback and my CPU usage for Vassal sitting at 50%.

When I open the saved game file instead, it takes a couple minutes for the saved game file to load into Vassal and then, as soon as I try to do anything (pan around the map being a good example), the map turns white and Vassal freezes (again, CPU sits at 50%) – meaning I can sit for 5 minutes or more and nothing further happens or can be done in-game, except I can click to close Vassal and, after 90+ seconds, the module shuts down.

I can only speculate it has something to do with the graphics and rendering images as rotated… But the typical counter is only 30kb, so it wouldn’t seem a horrible strain on the CPU.

I suspect I will have to send the mod and the log and save files to a developer. Where should I send them? The mod is 8MB.

Thanks,
Kevin


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

Kevin, what version of VASSAL are you guys using?

  • M.

2009/2/10 MadSeason <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

We are using Beta8.

My specs:
Pentium D 3.0 ghz, 2GB RAM, Radeon X300 gc (128mb)

I turned off High Quality Scaling and the speed and usage has increased considerably. I was able to run through the setup log file and was also able to load the saved game file without any difficulty. Thank you! Although I don’t know why I have never encountered this before with any Vassal mod… It suggests there is something wrong with the module I have made.

However, there is still a serious problem. Although the speed is no longer an issue, another problem occurs now. When a piece is rotated, it turns large parts of the map black. And it stays black. I have attached an image showing the blackness. This image was taken after running through the log file. I loaded the saved game file and it appears exactly the same. (it is also covering some of the units and if I ferret around in the dark and manage to select a unit hidden by the black area, the unit appears but some of the other units north and west of it are now covered by this unit’s black shadow).

Thoughts?

Thus spake “MadSeason”:

I’d like to see these. Can you put them somewhere that I can download
them?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Update: When i rotate the images back to their original orientation, the big black areas disappear. :open_mouth:

I’d like to see these. Can you put them somewhere that I can download
them?


J.
[/quote]

I’ll send you a PM when I have it uploaded somewhere.

thanks,
Kevin

Okay, I sent you a PM with the link. Let me know if you didn’t get it.

Thanks again,
K

Thus spake “MadSeason”:

I believe your problem is that the Can Rotate trait is the outermost trait
in your Unit prototype, when it should be the innermost. The area being
rotated is determined by what traits are ‘inner’ with respect to the Can
Rotate trait, and so if you have some traits which increase a piece’s
bounding box deeper than a Can Rotate trait, you can end up with a very
large (mostly transparent) area being rotated. Generally, only traits which
need rotation applied to them should be inside a Can Rotate trait, as that
will minimize the area to be rotated, and hence give you the best performance.

If you make this change, you should be able to return to using high quality
scaling. (But keep in mind that changes to the prototype won’t affect pieces
which are already on the map.)


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Huh. Okay, I will try that. I was thinking of where I wanted it in the unit menu instead of how it might affect performance.

Thank you!

UPDATE: This issue described here has apparently disappeared completely. :open_mouth:

That helped immensely. Cleared up all the previous problems and even at High Quality scaling it seems to be working without slowdown.

Of course something else crept in. :confused:

When I pick up units, the image colors go wonky. See below. It is all units, not just rotated units.

You can control the menu using the submenu trait as an override. The order you place commands in the submenu trait is the way they will always show up on the piece, regardless of their order in the stack

From: MadSeason messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Tuesday, February 10, 2009 10:53:28 AM
Subject: [Technical Support & Bugs]Re: “Memory leak”? Rotating unit issue?

Huh. Okay, I will try that. I was thinking of where I wanted it in the unit menu instead of how it might affect performance.

Thank you!


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks, Tim. I have seen that in a couple modules and it is on my list of things that I should teach myself how to do. But I keep forgetting about it. Now that I am seriously building modules, maybe I should get cracking! :slight_smile:

Thus spake “MadSeason”:

I suspect that you’re running Windows and have a faulty video driver.

Do the following, and after each step start VASSAL, load your module, and
check whether you see any improvement:

  1. Make sure that you have the current version of Java, which is 1.6.0-12.
    (If you don’t have it, you can get it here: java.com.)

  2. Make sure that you have the current version of your video drivers.

  3. Go to Preferences in VASSAL and check “Disable DirectX D3D pipeline”.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “MadSeason”:

Does anyone else think it would be useful for module development if you could
see all of the trait bounding boxes in the editor, say by hitting a toggle
button? That would make problems like this easy to spot, as you’d be able to
see the unnecessarily huge bounding box you get after rotation…


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)