Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Black Ice terrain modification #4521

Merged
merged 24 commits into from
Feb 20, 2024

Conversation

pheonixstorm
Copy link
Collaborator

Ice Storm includes Black Ice by default
Optional Black Ice in weather at or below -30

The Ice change per rules is at 5 or 6 on a 1d6, currently for testing it is set at 2-6 so the likelihood of NOT hitting black ice is slim.
This is nearly finished and put up to be picked apart.

Happy skidding!

@pheonixstorm pheonixstorm added (RFE) Enhancement Requests for Enhancement, new features or implementations In Development (Draft) An additional way to mark something as a draft. Make it stand out more. labels Jun 12, 2023
@SJuliez
Copy link
Member

SJuliez commented Jun 12, 2023

Is this a draft? If so, maybe convert the PR to draft for now.

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of requests, including a fundamental one.

// inferno bombs, 4: inferno IV
/** The SMOKE terrain type includes laser-inhibiting smoke and chaff from chaff pods (TO:AUE p111). */
public static final int SMOKE = 20; // 1: light smoke 2: heavy smoke 3:light
public static final int SMOKE = 21; // 1: light smoke 2: heavy smoke 3:light
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's definitely not change these constants, as it'll wreck every map that uses the terrain types whose value was changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The maps themselves do not use this number. The entry in the map itself reads smoke:1 - smoke:4. I did find that the game saves do use 20 rather than smoke:1 etc. This won't wreck maps, but it will a save.

From a test board file I get: hex 0101 0 "smoke:1" ""

From a save game file I get:
<megamek.common.Terrain id="2135">
20
1
false
0
0
</megamek.common.Terrain>

I'm not sure if this should go to the bottom, but that would put it out of place based on the ordering of the constants. Terrain, mods, building etc. Might want to discuss this with the rest of the team as if I place this below smoke there is no telling if this will break other save games while placing it at the bottom of the list means that the constants are longer organized by terrain types. But since you can't play a save from one version to another that renders this entire review point moot. Unless that changed of course.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't particularly care about backwards compatibility for save games. You can always leave it in the same place in the code but have the number be different. Feel free to ask in discord, though, as long as it doesn't break maps I don't mind it either way..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this covered on Discord? Trying to find loop closure on the question. This seems like a change that could have unintended consequences.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pheonixstorm Would you mind actually changing this and placing BLACK_ICE below the other terrains (I think we care the least about the ordering of the terrains) and give it the 55? It is likely that it would only break savegames, so it may be just a matter of principle, but it's certainly good form not to change those constants without any real need. Also, leaving BLACK_ICE where it is and giving it the 55 invites the next terrain accidentally also using 55. I actually found such a thing awhile ago in another class that used the 71 for two different equipments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SJuliez the ordering is based off of the sections in Tac Ops for the terrain types. I don't mind placing it at the bottom of the Terrain Modifications section but not at the very bottom of the list. While I am making that change I can also add in the constants for the missing terrain types and modifications as well, something I had planned on doing when I started the Hazardous Liquid Pools.

As for savegames, they don't carry over between versions so at worst it affects the nightlies. I don't think those are affected moving from one nightly to another.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like if three people call this out as a potential problem, it might be worth taking a different approach.

megamek/src/megamek/server/GameManager.java Outdated Show resolved Hide resolved
@pheonixstorm
Copy link
Collaborator Author

Not to self: Find where the terrain names are stored for the map editor. Will need to add Black Ice entry for it.

@pheonixstorm pheonixstorm marked this pull request as draft June 13, 2023 00:34
@pheonixstorm pheonixstorm removed the In Development (Draft) An additional way to mark something as a draft. Make it stand out more. label Jul 3, 2023
@pheonixstorm pheonixstorm marked this pull request as ready for review July 3, 2023 23:58
@pheonixstorm
Copy link
Collaborator Author

@NickAragua this is ready for another look

megamek/i18n/megamek/common/options/messages.properties Outdated Show resolved Hide resolved
megamek/src/megamek/common/Entity.java Outdated Show resolved Hide resolved
megamek/src/megamek/common/Entity.java Fixed Show resolved Hide resolved
megamek/src/megamek/common/MoveStep.java Outdated Show resolved Hide resolved
// inferno bombs, 4: inferno IV
/** The SMOKE terrain type includes laser-inhibiting smoke and chaff from chaff pods (TO:AUE p111). */
public static final int SMOKE = 20; // 1: light smoke 2: heavy smoke 3:light
public static final int SMOKE = 21; // 1: light smoke 2: heavy smoke 3:light
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this covered on Discord? Trying to find loop closure on the question. This seems like a change that could have unintended consequences.

megamek/src/megamek/server/GameManager.java Outdated Show resolved Hide resolved
megamek/src/megamek/server/GameManager.java Outdated Show resolved Hide resolved
// inferno bombs, 4: inferno IV
/** The SMOKE terrain type includes laser-inhibiting smoke and chaff from chaff pods (TO:AUE p111). */
public static final int SMOKE = 20; // 1: light smoke 2: heavy smoke 3:light
public static final int SMOKE = 21; // 1: light smoke 2: heavy smoke 3:light
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like if three people call this out as a potential problem, it might be worth taking a different approach.

# Conflicts:
#	megamek/src/megamek/common/options/GameOptions.java
#	megamek/src/megamek/server/ServerHelper.java
# Conflicts:
#	megamek/src/megamek/common/options/GameOptions.java
@SJuliez SJuliez added the For New Dev Cycle This PR should be merged at the beginning of a dev cycle label Feb 15, 2024
@SJuliez SJuliez merged commit 1c2925d into MegaMek:master Feb 20, 2024
5 checks passed
@pheonixstorm pheonixstorm deleted the Feature-BlackIce branch April 30, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For New Dev Cycle This PR should be merged at the beginning of a dev cycle (RFE) Enhancement Requests for Enhancement, new features or implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants