MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
297 stars 287 forks source link

Map Editor not saving buildings or bridges #1209

Closed Dervishx5 closed 4 years ago

Dervishx5 commented 5 years ago

Environment

Megamek version: 0.45.1 OS: Windows 10 Java version 1.8.0_191

Description

So I'm making maps again and I like the UI changes. But when I try to save large maps the buildings and bridges are not saving properly. This map is 80x80 and I do know Megamek struggles with saving everything sometimes.

Files

Attached the map I'm creating, please take a look at all the North/South bound bridges and the buildings on the right side of the map.

Unity City 5.zip megameklog.txt

SJuliez commented 4 years ago

Almost all the problems can be resolved by text-editor by replacing bridge:0 with bridge:1 With the new MapEditor GUI this is less likely to happen but the terrain validity checks are still incomplete concerning buildings and bridges and such. A bridge:0 should me marked as invalid when creating a map so this does not happen.

A more difficult problem happens in hex 6439 (line 3105). This hex will have its "building" terrain removed upon loading the board even though line 3105 is a correct building. When hex 6540 is emptied, hex 6439 loads correctly. Changing 6439 from building:2 to building:3 resolves the issue. Changing 6540 from building:3 to building:2 makes both invalid. Needs further investigation.

Windchild292 commented 4 years ago

@SJuliez The issue appears to be that the building is illegal, because of how the exits are done, so it doesn't save properly. Changing around the exits fixes these issues.

Also, this is the same as #1583. (just as a note)

SJuliez commented 4 years ago

@Windchild292 Yes I've seen the other issue. I just played around with it and I can mess up building exits (creating nonsensical buildings) without any errors. But in a perfectly formed building if I replace one medium building hex with a heavy building (building:3) then, when reloading, four(!) hexes are invalid with terrains missing.

If building types shouldnt be mixed then the MapEditor (or the hex display) should say so.

Windchild292 commented 4 years ago

I agree, and I found that it sometimes lets you save illegal buildings and sometimes it doesn't.

SJuliez commented 4 years ago

This is indeed the same problem as #1583 Therefore closing this issue and keeping the newer one open.