Known Issues and Workarounds - MegaMek/megamek GitHub Wiki

Increasing Memory (Can help with the bot)

If you've edited your ini files previously to increase memory to the programs you can keep the value in the Xmx comment. As a general rule try not to allocate more than 25% of system memory to MegaMek (Java) this way. Realistically 4 gigs of memory provides the memory required to improve performance in MegaMek and MekHQ.

The ini files that can be edited are:

  • Megamek - MegaMek.l4j.ini
  • MegaMekLab - MegaMekLab.l4j.ini
  • MekHQ - MekHQ.l4j.ini

image

For systems with 16 Gig

-Xmx4096m -Dsun.java2d.d3d=false

-or-

-Xmx4096m -Dsun.java2d.opengl=true


Systems with 32 gig of memory should safely be able to go to

-Xmx8192m -Dsun.java2d.d3d=false

-or-

-Xmx8192m -Dsun.java2d.opengl=true


Weird artifacts/Screen Distortions

You can try one of these solutions. Adding the following flags in the Megamek.l4j.ini and Mekhq.l4j.ini file.

-Xmx2048m -Dsun.java2d.d3d=false

-or-

-Xmx2048m -Dsun.java2d.opengl=true

For MegaMekLab issues add the following to the MegaMekLab.l4j.ini

-Xmx1024m -Dsun.java2d.d3d=false

-or-

-Xmx1024m -Dsun.java2d.opengl=true

If you still have issues with UI Scaling some players have reported success adding

-Dsun.java2d.uiScale=1

Exporting PDFs in MegaMekLab

Modern fonts contain characters that MML's PDF exporting system cannot handle (up to 0.47.16). You will notice this problem as being able to select the font in MML but exporting the record sheet as a PDF results in a font like Times New Roman or Arial being used in the PDF. Updating the PDF exporting system to support modern fonts is expected in the 0.49 development line.

Clearing the Font Cache

If you run into an issue with fonts when exporting PDFs, you can try deleting the font cache folder used by Apache FOP:

  • Windows: %USERHOME%\.fop
  • Linux: ~/.fop
  • MacOS: ~/.fop

Running under Java 9+ before 0.45.2

Java 9 includes a new way to split libraries ("JAR" files) into modules. This means that some Java classes, which were until Java 8 part of the normal Java installation, aren't automatically found. Adding the following to the command line or the *.l4j.ini files (Windows package) or the value for DEFAULT_JVM_OPTS in the startup scripts (generic package) fixes it for now.

--add-modules java.se.ee