BattleTech - The Board Game of Armored Combat

Other BattleTech Games => MechWarrior and BattleTech Computer | Console Games => MegaMek Games => Topic started by: PuppyLikesLaserPointers on 21 March 2022, 11:09:21

Title: Make the bots faster?
Post by: PuppyLikesLaserPointers on 21 March 2022, 11:09:21
Well, although my case seems the weird one, but I am struggle to play with princess. Even in the ideal condition it takes few minutes to move one unit in the movement phase, and basically takes 5 to 10min to move one unit. Also it usually stucks and I have to save and reload the game, and it often end up with also run an another instance of MegaMek and decide what to do by myself instead of take it to the bot.

Usually only the movement phase is the problem, but I don't understand why the bot afk for hours while it can ignore all the enemy that needs a 13+ to hit on the weapon phase as well.

My case seems weird, for I have 30+ units right now(thus Princess needs a lots of factor to consider), and I like to burn the ground by Arrow IV Inferno rounds(so the bot may check the hazardous area during the movement phase). Recently I am try to play the game again but it's all the same. Even if I have split the force by many bots, nothing is changed.

Asides, what about playing the opponent by myself? Is it a solution to this? Yes counterplay myself seems not that fun, but if you play with Individual Initiative you don't have to think much either.

Title: Re: Make the bots faster?
Post by: Lanceman on 21 March 2022, 11:25:09
How much memory do you have assigned to MegaMek? It definitely shouldn't be taking minutes for the bot to move.
Title: Re: Make the bots faster?
Post by: PuppyLikesLaserPointers on 21 March 2022, 11:29:16
Right now it's 4096m. I have 8GB memory so its about a half of my memory.

An another thing is... will windows defender or any anti virus program interfere the process of MegaMek? For years windows defender always says that it seems not safe and my anti virus program always try to shut it down and send it to the company when I downloaded the new version of megamek. Although I passed all the warning but will these programs still haunt running megamek?
Title: Re: Make the bots faster?
Post by: monbvol on 21 March 2022, 11:33:32
Then most likely either your Java version is out of date, there is a small typo in the configuration file so it's using default instead, or you're using an older version of MegaMek.
Title: Re: Make the bots faster?
Post by: PuppyLikesLaserPointers on 21 March 2022, 11:44:46
My java version is AdoptOpenJDK 11.0. I didn't updated it since april 2021, though, but I can't see much info other than this (https://github.com/MegaMek/megamek/wiki/Java-and-MegaMek) states that it seems already enough. Is it better to update jdk as well? But even when it was the last release it was all the same.

I am using 0.49.7. In fact, I am almost always use the latest version of megamek.
Title: Re: Make the bots faster?
Post by: Hammer on 21 March 2022, 11:51:12
What type of units are you using? What's the rules turned on? How many bots are you using? Version your playing.

These all factor into how fast she plays. I've you got 28 High speed VTOLs on one bot she will be slow as that is a huge amount of calculations for her. 28 divided among 7 bots each will be faster.

Optional rules like hidden units or double blind (she doesn't support it) can slow her down. Also assigning too much memory to java can be just as bad as not enough as it impacts the processes the computer needs to run.

My case seems weird, for I have 30+ units right now(thus Princess needs a lots of factor to consider), and I like to burn the ground by Arrow IV Inferno rounds(so the bot may check the hazardous area during the movement phase). Recently I am try to play the game again but it's all the same. Even if I have split the force by many bots, nothing is changed.

Consider how much computing power this needs. Say a hundred hexes on fire plus smoke. The program has to calculate every hex worth of fire spread and smoke spread every turn. Princess then needs to figure out how to move to fine line of sight if possible for 30 units. This will take time, I've seen massive amounts of fire and smoke take the fastest computer to slow it to a crawl.

   
Title: Re: Make the bots faster?
Post by: dgorsman on 21 March 2022, 11:56:37
8 GB is pretty small these days, but shouldn't be too bad.  Use the system monitor, see how much is being used, and if it's running out.  For what it's worth, I'm running 32 GB with the 4 GB Java instruction, and have run large battles of that size, with Princess taking under a minute per move (less when it's slow units, more when it's fast ground units).

Do you also have 30+ units?  What size map are you playing with?  Large total number of units and huge maps (once you start having to track individual fires, tree/building CF/etc.) greatly increases the calculations required, and will probably tax that 8 GB RAM.

Stick with individual Princess players, at least you can use individual settings appropriate to each group.

Couple of extra tricks that may help, but may change how you play the game.  Use individual initiative, so that there is no choice to be made about which unit is moving; that applies to your units as well.  Use double-blind and sensor contact rules (highly recommend the unofficial 'inclusive sensor ranges' option is on) so that not everything is visible or detected.  Less targets to track, less work to do.
Title: Re: Make the bots faster?
Post by: Hammer on 21 March 2022, 12:50:40
Use double-blind and sensor contact rules (highly recommend the unofficial 'inclusive sensor ranges' option is on) so that not everything is visible or detected.  Less targets to track, less work to do.
Princess doesn't support Double blind, and if used can result in her milling in a cluster in a section of the map. Then when a unit stumbles in LOS she'll react like a piranha a swarm the unit.

And yes I know there are tricks to reduce this, but officially she doesn't support double blind and players use that their own risk.
Title: Re: Make the bots faster?
Post by: Simon Landmine on 21 March 2022, 15:33:56
Well, although my case seems the weird one, but I am struggle to play with princess. Even in the ideal condition it takes few minutes to move one unit in the movement phase, and basically takes 5 to 10min to move one unit. Also it usually stucks and I have to save and reload the game, and it often end up with also run an another instance of MegaMek and decide what to do by myself instead of take it to the bot.

Usually only the movement phase is the problem, but I don't understand why the bot afk for hours while it can ignore all the enemy that needs a 13+ to hit on the weapon phase as well.

That does seem odd - even on my little laptop with only 4Gb total RAM, so 2GB for MegaMek, it took a while, but not that long. You're not using simultaneous movement or double blind, are you?

Asides, what about playing the opponent by myself? Is it a solution to this? Yes counterplay myself seems not that fun, but if you play with Individual Initiative you don't have to think much either.

Yes, that's pretty easy to do - just start one instance of MegaMek (which will be the server), and then start a second instance, and join the first game - as you would if it were a remote server. That way you can be running 'both' players, just alternating between them as required.
Title: Re: Make the bots faster?
Post by: PuppyLikesLaserPointers on 22 March 2022, 11:15:47
My units are 30+, and the opponent's one is varied for it is playing Against the Bot campaign.

I don't check simultaneous movement(all the other phases are simultaneous, though, but as you know only the movement phase has the meaningful difference) or double blind, and I use Individual Initiative to make it faster.

The problem is, even on round 1 and 2, that you have no flames from an Arrow IV(since you fire it on the turn 1, and it arrives after the movement phase of the round 2), the bots are quite slow.

Also I have seen Princess was stuck with the turn of the prone mechs when all around it is set on flame as well.

An another possible factor is... will the enemy(of the bot) C3 network affects its performance? The most of my units are fitted with a C3 network device, so it may a reason why the bots are so bugging even on the round 1 to 2.
Title: Re: Make the bots faster?
Post by: Hammer on 22 March 2022, 12:43:10
Then we'd need to see a bug report opened with a save game from the end of turn 1.
Title: Re: Make the bots faster?
Post by: ThePW on 29 June 2022, 17:38:39
What type of units are you using? What's the rules turned on? How many bots are you using? Version your playing.

These all factor into how fast she plays. I've you got 28 High speed VTOLs on one bot she will be slow as that is a huge amount of calculations for her. 28 divided among 7 bots each will be faster.

Optional rules like hidden units or double blind (she doesn't support it) can slow her down. Also assigning too much memory to java can be just as bad as not enough as it impacts the processes the computer needs to run.

Consider how much computing power this needs. Say a hundred hexes on fire plus smoke. The program has to calculate every hex worth of fire spread and smoke spread every turn. Princess then needs to figure out how to move to fine line of sight if possible for 30 units. This will take time, I've seen massive amounts of fire and smoke take the fastest computer to slow it to a crawl.

 
I would love to know HOW you optimize Java (more memory but not to the unspoken amount you mention). An Idiot's Guide would be nice, sir. I want to run a larger BV battle but I'm killing Megamek as result (Latest recommended version of java, 0.48.0, a large amount of common advanced rules, etc)
Title: Re: Make the bots faster?
Post by: Hammer on 01 July 2022, 14:25:18
I would love to know HOW you optimize Java (more memory but not to the unspoken amount you mention). An Idiot's Guide would be nice, sir. I want to run a larger BV battle but I'm killing Megamek as result (Latest recommended version of java, 0.48.0, a large amount of common advanced rules, etc)

You can update memory allocations be following this. (https://github.com/MegaMek/megamek/wiki/Known-Issues-and-Workarounds)
Title: Re: Make the bots faster?
Post by: ThePW on 01 July 2022, 16:46:58
That explains the basics... but What is the name of the ini file that needs mods? Where is it? I sorta understand the how, its the where that's the frustration part. Is it a file inside megamek/megamekHQ or in java?
Title: Re: Make the bots faster?
Post by: Hammer on 01 July 2022, 16:57:49
That explains the basics... but What is the name of the ini file that needs mods? Where is it? I sorta understand the how, its the where that's the frustration part. Is it a file inside megamek/megamekHQ or in java?

Recheck the post I've linked I've updated the wiki entry.
Title: Re: Make the bots faster?
Post by: ThePW on 01 July 2022, 17:22:05
Thank YOU....

now just to be clear because I'm old...

this is what i see on each of the 3 ini files...

"

# Launch4j runtime config
# you can add arguments here that will be processed by the JVM at runtime
-Xmx1024m

"

Do i add "-Xmx4096m", or the whole line "-Xmx4096m -Dsun.java2d.d3d=false"?

I'm using Note++ to look at each file. I'm supposing the -Xmx####, the # is the memory allocation. Like i said, i understand the how* to do it but not 100% changing the numbers to something abstract isn't gonna cause megamek to go hostile on me...
Title: Re: Make the bots faster?
Post by: Simon Landmine on 01 July 2022, 18:58:47
Yeah, "-Xmx####m" is the memory allocation part.

The other part is an instruction that can be added to address graphics issues, if you're having them.