Author Topic: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21  (Read 20067 times)

TS_Hawk

  • Catalyst Demo Team
  • Major
  • *
  • Posts: 6370
Well we all have our own house rules whether we use the ATB rules or not.  But now I understand what you are doing and that will be a good idea. 

Thank you Hikage
Agent 694 N. Idaho

saginatio

  • Private
  • *
  • Posts: 40
@saginatio I tried the newer patch and it runs fine, I can play MM from HQ and resolve normally but I still get errors in the log.

1st is java.lang.NullPointerException which I assume is the NPE you were referring to.
2nd is actually two with the same error java.net.SocketException: Software caused connection abort: socket write error
3rd is java.net.SocketException: Socket closed

At least it works for battle resolution though.

Thanks for testing. I've left those exceptions on purpose to indicate that something bad is happening in MegaMek code (I hate problems swept under the carpet). The important thing is those exceptions have no impact on MHQ - the worst thing that can happen is that some resources are not released. I did not check the code inside MM server, since it is not a priority problem now and I would rather leave it to someone who knows MM communication architecture better. He would decide if it is a bug in MM or a bad usage of MM api in MHQ.

Just an FYI... all I get when using this and your previous patch are...
Java exception occured errors. Retested... after a clean reboot. Whatever the latest Java is and Windows 8.1
Posting in case this becomes an issue and out of a healthy dose of "bug fever" :)
Strange, I've used my patch in a few games and had no problems with it - if you want you can pm me the log ( or attach only exceptions).

pheonixstorm

  • Major
  • *
  • Posts: 5548
Question now is, will ralgith use what works (the last patch) or squash out all the errors on both ends before the next custom build is released.

Now to test out some of the newer items alog with the patch. While my main campaign sticks with ralgiths work + my unused patches, I still like to test the bleeding edge using an alternate campaign.

epic

  • Catalyst Demo Team
  • Lieutenant
  • *
  • Posts: 1137
hmmmm... I can't get to the victory phase.  I assume that's what all the jargon above is about.   NOT using anything ATB related.  even using /victory, while it will show I won in that phase, won't get to the next screen beyond, so I can't generate MULs 

:(
Agent # 703

pheonixstorm

  • Major
  • *
  • Posts: 5548
That would be something different. The patch I was referring to is after the victory in MM when it returns you to HQ and you click on the Yes/No for " Did your side control the battlefield" and it shows all units as a total loss. If you aren't even getting TO HQ then it is another issue and you will need to attach a copy of your log to your next post.

Thomasmarik

  • Private
  • *
  • Posts: 31
A bug I ran into earlier.   I had the ATB rules on in teh default settings.  I was starting a new unit and trying to buy some start up parts.   I tried buying standard armor and it said that that part is not available to my unit.  Armor is level 0 equipment.  The only thing I can think is I wasn't using dragoon rating for the unit.   MAybe that caused an issue?

2ndAcr

  • Captain
  • *
  • Posts: 3165
 No, there is a glitch somewhere. Things seem to be fairly normal as long as you do not use the AGTB rules.

 Except every battle has your stuff as MIA, all pilots MIA and my mechs end the battle completely undamaged. So something is seriously FUBAR with latest builds.

Thomasmarik

  • Private
  • *
  • Posts: 31
I did a practice match earlier.  Using a custom mission/scenario If you manually add in the mul to the megamek game and then save the mul and manually add in the results I was able to continue.

've not tried doing that with the ATB generated scenarios.   I was going to try it but the enemy opfor had a bunch of red invalid unit entries and It was flipping out over that. 

neoancient

  • Warrant Officer
  • *
  • Posts: 507
  • MegaMek team member
A bug I ran into earlier.   I had the ATB rules on in teh default settings.  I was starting a new unit and trying to buy some start up parts.   I tried buying standard armor and it said that that part is not available to my unit.  Armor is level 0 equipment.  The only thing I can think is I wasn't using dragoon rating for the unit.   MAybe that caused an issue?
The parts availability system works a little differently due to the way parts are implemented in MM and MHQ. I still have some adjustments to make. Dragoon rating doesn't affect parts availability unless you're not in a contract, and if you're not using the rating the AtB rules assume a rating of C. If you use IOps Beta, it uses the reputation/10, rounded down (0-9 = F, 10-19 = D, etc).

scJazz

  • Captain
  • *
  • Posts: 1828
You know Ralgith I think one of my favorite features of the 1925 Build is the blue hex background in MM. Finally, I can click on the icons in the Unit list when I'm zoomed out or the map is not very wide. No more trying to guess where clicking was possible on the far right edge of the right hexes!

scJazz

  • Captain
  • *
  • Posts: 1828
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #100 on: 27 July 2014, 12:05:40 »
Any word on the Scenario Resolution bug?

Is the problem related in any way to the fact that MM.exe shrunk by a bit over 4MB from r1739 to r1925? The \lib\MegaMek.jar are both similar in size between both versions. I'm just grasping. Fearful that I am once again going to revert to r1739 which was the last stable and usable version of Dylan's Dev builds.

EDIT: I was just going through EntityStatus.txt with the goal of manually adding units with the correct damage. Even EntityStatus.txt is broken, showing "The following utterly destroyed units are not available for salvage" for units that are still alive and on map.

Then showing a similar section for the units which were ammo critted.
« Last Edit: 27 July 2014, 12:17:19 by scJazz »

Davout73

  • Captain
  • *
  • Posts: 1837
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #101 on: 27 July 2014, 13:43:53 »
Not sure if it's something I did...

But anyhow, I am playing an AtB campaign set in 3015.  In the Megamek options I set the game year as 3025.  Midway through the contract, the Units for the bot and the unit sales started being pulled from later era's.  I have Xotl and the Total War MUL's as my defaults.

Not sure what to attach,

Dav
Kiiro no Torii, a Battletech AU, found here:
http://bg.battletech.com/forums/index.php/topic,7316.0.html
Interview with a Mercenary, found here: http://bg.battletech.com/forums/index.php/topic,319.0.html
Every Man Must Be Tempted, a KNT Universe series: https://bg.battletech.com/forums/fan-fiction/every-man-must-be-tempted
"Violence is the last resort of the incompetent, because the competent use it when it could do some good."

ralgith

  • Captain
  • *
  • Posts: 2251
    • Dylan's BattleTech Emporium
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #102 on: 27 July 2014, 13:44:32 »
Any word on the Scenario Resolution bug?

Is the problem related in any way to the fact that MM.exe shrunk by a bit over 4MB from r1739 to r1925? The \lib\MegaMek.jar are both similar in size between both versions. I'm just grasping. Fearful that I am once again going to revert to r1739 which was the last stable and usable version of Dylan's Dev builds.

EDIT: I was just going through EntityStatus.txt with the goal of manually adding units with the correct damage. Even EntityStatus.txt is broken, showing "The following utterly destroyed units are not available for salvage" for units that are still alive and on map.

Then showing a similar section for the units which were ammo critted.

Yeah well... Arlith FUBARed something somewhere at some point. But he's been very busy. He told me he thinks he might know what happened, but he hasn't been able to look at code.

neoancient

  • Warrant Officer
  • *
  • Posts: 507
  • MegaMek team member
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #103 on: 27 July 2014, 15:27:57 »
Not sure if it's something I did...

But anyhow, I am playing an AtB campaign set in 3015.  In the Megamek options I set the game year as 3025.  Midway through the contract, the Units for the bot and the unit sales started being pulled from later era's.  I have Xotl and the Total War MUL's as my defaults.

Not sure what to attach,

Dav
The Total Warfare RATs are the final fallback when MHQ can't find any other in the list that fits, and it sounds like that is what's happening. It goes through several steps before that, though, and the fact that your campaign is set earlier than the first Xotl chart shouldn't be a problem. In the event that the campaign predates any of the selected RATs, MHQ simply selects the earliest one on the list and disregards the date. In this case it should be using Xotl 3028. It will also run through a list of alternate factions. For most IS factions this is simply a check for a "general" RAT; periphery nations look for a generic periphery table before moving on to the general table, and a few factions search another faction before moving on to general (e.g. St. Ives will check Liao, Andurien looks for Marik, etc.)

At this point I can't think of anything that would cause it to change behavior, but if I knew your employer and enemy I might be able to figure it out. If that doesn't help, I would probably need your campaign file to find the problem.

Edit: Actually if it's doing it on the unit market as well, then employer and enemy don't have anything to do with it unless it's just the employer market.
« Last Edit: 27 July 2014, 15:48:59 by neoancient »

Davout73

  • Captain
  • *
  • Posts: 1837
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #104 on: 27 July 2014, 19:50:17 »
I am away from my laptop for the next couple of days, when I get back I'll see if I can reproduce it.  I'm using your build with the fixed .jar, I will email the files if need be.

Thanks,

Dav
Kiiro no Torii, a Battletech AU, found here:
http://bg.battletech.com/forums/index.php/topic,7316.0.html
Interview with a Mercenary, found here: http://bg.battletech.com/forums/index.php/topic,319.0.html
Every Man Must Be Tempted, a KNT Universe series: https://bg.battletech.com/forums/fan-fiction/every-man-must-be-tempted
"Violence is the last resort of the incompetent, because the competent use it when it could do some good."

neoancient

  • Warrant Officer
  • *
  • Posts: 507
  • MegaMek team member
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #105 on: 27 July 2014, 22:10:26 »
I've been pondering this and I thought of something else that could produce this behavior: changes in the RAT files themselves, specifically to the name (first non-comment line in the file). The system I used to categorize the various tables to search for one that matches a certain set of criteria (source, faction, era, type of unit, force quality) can be broken by changing the names. It makes the system rather fragile, especially since MM doesn't require the names to be constant or consistent as long as they're unique. But after considering three or four different approaches, I decided that this approach was the best least problematic alternative.

Battleclad

  • Warrant Officer
  • *
  • Posts: 413
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #106 on: 28 July 2014, 01:02:58 »
I've been pondering this and I thought of something else that could produce this behavior: changes in the RAT files themselves, specifically to the name (first non-comment line in the file). The system I used to categorize the various tables to search for one that matches a certain set of criteria (source, faction, era, type of unit, force quality) can be broken by changing the names. It makes the system rather fragile, especially since MM doesn't require the names to be constant or consistent as long as they're unique. But after considering three or four different approaches, I decided that this approach was the best least problematic alternative.

You could set it to search for the first unit in the RAT instead of the filename or have some identified added to the first line of the file.

saginatio

  • Private
  • *
  • Posts: 40
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #107 on: 28 July 2014, 01:57:06 »
I've been pondering this and I thought of something else that could produce this behavior: changes in the RAT files themselves, specifically to the name (first non-comment line in the file). The system I used to categorize the various tables to search for one that matches a certain set of criteria (source, faction, era, type of unit, force quality) can be broken by changing the names. It makes the system rather fragile, especially since MM doesn't require the names to be constant or consistent as long as they're unique. But after considering three or four different approaches, I decided that this approach was the best least problematic alternative.

Maybe it's a good moment to add some meta information to rat's. Faction, time period, quality, weight class, unit type. I can add code to MM responsible for reading and interpreting those and we could ask community for help in changing the headers.

Netzilla

  • Warrant Officer
  • *
  • Posts: 590
    • Facebook
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #108 on: 28 July 2014, 08:03:41 »
Another alternative that would save you needing to update every rat file in the game would be to make that an AtB Campaign setting.  Set up a matrix of Eras and Qualities and allow the user to fill in the cells with the appropriate rat.
"Everything starts as someone's daydream." -- Larry Niven

MM Bug & Feature Requests:
https://sourceforge.net/p/megamek/_list/tickets

MHQ Bug & Feature Requests:
https://sourceforge.net/p/mekhq/_list/tickets

neoancient

  • Warrant Officer
  • *
  • Posts: 507
  • MegaMek team member
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #109 on: 28 July 2014, 09:41:20 »
Another alternative that would save you needing to update every rat file in the game would be to make that an AtB Campaign setting.  Set up a matrix of Eras and Qualities and allow the user to fill in the cells with the appropriate rat.
That was the first of the alternatives I considered. It would involve selecting the RATs for the employer and the opfor for each contract and each unit type ('Mechs and vehicles at least, plus any other types the player might be using in the campaign) and for each weight class, which would be at least sixteen. Though it would be quicker overall than doing everything by hand, it is still the type of tedious activity that I'm trying to save the user from having to do. A better solution might be to combine the two approaches and let MHQ fill in the default values, but allow the user to review and change them. It would also give the user more control over some choices that the code makes automatically, such as defaulting to Davion for FedCom forces, and using Steiner when Davion is not available. That's something that I've been planning to revisit anyway.



You could set it to search for the first unit in the RAT instead of the filename or have some identified added to the first line of the file.
The first unit it the RAT would indicate what unit type and weight class is covered, but not the faction, era, or equipment rating, or whether it covers more than one weight class. As for the identifier...

Maybe it's a good moment to add some meta information to rat's. Faction, time period, quality, weight class, unit type. I can add code to MM responsible for reading and interpreting those and we could ask community for help in changing the headers.
This is what would work best for me, but I don't expect MM to change just for the benefit of the AtB code. On the other hand, it might be useful for users to be able to filter the RATs for certain criteria in MM, and in my opinion this would be the best way to do it. If each line for the metadata started with a two-character sequence, the first of which is "#" (such as #@faction:FS), then MM would ignore it as a comment until someone got around to writing the filter code, and newer RAT files would be backward-compatible with older versions of MM.

scJazz

  • Captain
  • *
  • Posts: 1828
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #110 on: 28 July 2014, 10:58:02 »
That was the first of the alternatives I considered. It would involve selecting the RATs for the employer and the opfor for each contract and each unit type ('Mechs and vehicles at least, plus any other types the player might be using in the campaign) and for each weight class, which would be at least sixteen.

Just create the matrix and fill in the default values yourself.

After that we the users can switch things up.

The only thing that would I think become a requirement is that N number of files representing the default be the Master files that all updates for new releases is done on. In other words Davion 3028's file name can never be changed. Contents yes, filename no.

Tedium removed, we get to fuss with things if we wish. You don't have such a miserable time. Everyone happily plays giant stompy robots.

saginatio

  • Private
  • *
  • Posts: 40
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #111 on: 28 July 2014, 12:15:26 »
Another alternative that would save you needing to update every rat file in the game would be to make that an AtB Campaign setting.  Set up a matrix of Eras and Qualities and allow the user to fill in the cells with the appropriate rat.
Btw the matrix would be huge: Faction  x quality x weight x type x (era). That is more or less 15 x 5  x 4 x 2 = 600 only for CI era, mechs and vech considered, that is hell of a matrix to set up.

For the metainfo approach:
 
This is what would work best for me, but I don't expect MM to change just for the benefit of the AtB code. On the other hand, it might be useful for users to be able to filter the RATs for certain criteria in MM, and in my opinion this would be the best way to do it. If each line for the metadata started with a two-character sequence, the first of which is "#" (such as #@faction:FS), then MM would ignore it as a comment until someone got around to writing the filter code, and newer RAT files would be backward-compatible with older versions of MM.
Adding meta fields and appropriate IO to rat class should not be a problem, I could do it relatively fast (I'm guessing - I've not seen its source code yet:) ).

I don't think there is a real need for backward compatibility but the comment approach would work if one is needed.

The only real work would be with modifying existing .rats. But we could write a very simple bash script to do it - most of the meta info is already coded inside pathname so looking for keywords or simple regexp inside pathname would provide enough information to produce meta_info header inside rat.
« Last Edit: 28 July 2014, 12:17:39 by saginatio »

TS_Hawk

  • Catalyst Demo Team
  • Major
  • *
  • Posts: 6370
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #112 on: 28 July 2014, 13:46:43 »
Just out of curiosity Ral when do you think the new build will be out?

Thank you Hikage
Agent 694 N. Idaho

ralgith

  • Captain
  • *
  • Posts: 2251
    • Dylan's BattleTech Emporium
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #113 on: 28 July 2014, 18:32:45 »
Just out of curiosity Ral when do you think the new build will be out?

I was hoping for tomorrow, but that isn't going to happen. So no, I don't have any better idea of when. Sorry.

TS_Hawk

  • Catalyst Demo Team
  • Major
  • *
  • Posts: 6370
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #114 on: 29 July 2014, 00:35:13 »
I was hoping for tomorrow, but that isn't going to happen. So no, I don't have any better idea of when. Sorry.

No problem.

Thank you Hikage
Agent 694 N. Idaho

ralgith

  • Captain
  • *
  • Posts: 2251
    • Dylan's BattleTech Emporium
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #115 on: 29 July 2014, 23:38:24 »
Everyone will be happy to know that the resolution bug is now fixed. Thank Arlith as he did 95% of the work.

pheonixstorm

  • Major
  • *
  • Posts: 5548
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #116 on: 29 July 2014, 23:59:02 »
Was the problem on MM then or on both sides?

scJazz

  • Captain
  • *
  • Posts: 1828
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #117 on: 30 July 2014, 07:52:35 »
Everyone will be happy to know that the resolution bug is now fixed. Thank Arlith as he did 95% of the work.


And the crowd goes wild!

Thank you Arlith! For breaking it and fixing it :)

arlith

  • BattleTech Volunteer
  • Warrant Officer
  • *
  • Posts: 698
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #118 on: 30 July 2014, 08:48:45 »
I don't know precisely what happened.  The way things work roughly is that, MM enters the "victory" phase, which is where you get the report about the status of all the units and whether they're dead or not, and who killed what, etc.  When you click done, the victory phase ends, the game's state is reset, the server sends a packet to the client to clear it's entities, and then it transitions to the lounge phase.  When this lounge phase transition happens, a game event is fired that MekHQ catches.  It checks for a transition from the victory to lounge phase (well, checks for a transition out of the victory phase  but the only transition out of the victory phase is the lounge phase).  Then, MekHQ goes about resolving the scenario.  It gets the list of entities from the client and uses their state to populate the dialog.

If you'll notice, the first thing the server does when ending the victory phase is clear the game's state, which clears the list of entities, and sends a packet to the client to clear the list of entities.  This code has been unchanged for a while.  My guess is that, the time between the client receiving and processing this packet to clear the entities was longer than the time it took MekHQ to ask for the entity list.  The socket communication on the client and server used to be a non-blocking busy-wait loop, that was something like, "wait 100ms, is there any comms?  No, wait another 100ms... any comms?..." etc.  Now it's a separate blocked thread that sits there quietly waiting for their to be comms, a packet is received, gets pushed into a queue and the packet handling thread gets notified that there's a new packet.  So now there's no longer this 100ms delay between checking for packets. 

There are a couple ways you could solve this.  The one we chose was to add a new game event called GameVictoryEvent.  When ending the victory phase, this event gets fired before the game's state is reset.  MekHQ then listens for this event, and resolves the scenario before any game state resets happen. 
Member of the MegaMek Team.

ralgith

  • Captain
  • *
  • Posts: 2251
    • Dylan's BattleTech Emporium
Re: New custom builds of MegaMek, MegaMekLab, and MekHQ - 2014/07/21
« Reply #119 on: 30 July 2014, 09:45:35 »
Aye, it wasn't really a difficult fix... I just suck at Client/Server Comms... hence why I brought Arlith in. :D

 

Register