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
Implement Carryall edge spawn, harvester delivery by carryall and harvester insurance for D2k #7664
Conversation
6fda2aa
to
bfb0041
Compare
What does the 'insurance' do? An empty description helps no one. |
bfb0041
to
a9e651b
Compare
Added a trait description to |
Did the insurance only apply to worms in the original, or to general harvester death? |
The insurance in the original was only a per-mission feature (a "you may need a new harvester in this mission, just so we don't make the mission too hard" thing) and it didn't care who killed the harvester. Our worms, however, are much more pesky than the ones in the original and our AI is really unequipped to deal with them, so I thought I'd make it permanent. |
would be nice to have "harvester-insurance" as option ... "default = on" of course , for the bots ... |
atreides = Player.GetPlayer("Atreides") | ||
|
||
InsertHarvester() | ||
Media.PlayMusic("score") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also plays the shellmap music.
This seems to work extremely well in-game. |
a9e651b
to
23476c1
Compare
Fixed. |
Media.PlayMusic("score") | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow
23476c1
to
9d909e2
Compare
👍 |
Needs a rebase. |
9d909e2
to
09c0e0c
Compare
Rebased. AppVeyor seems to be failing because of some warnings (not errors!) in the OpenRA.Test project. |
<Compile Include="Traits\Buildings\DamagedWithoutFoundation.cs" /> | ||
<Compile Include="Traits\Buildings\LaysTerrain.cs" /> | ||
<Compile Include="Traits\Carryable.cs" /> | ||
<Compile Include="Traits\Player\HarvesterInsurance.cs" /> | ||
<Compile Include="Traits\Render\WithBuildingPlacedOverlay.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is the real error:
CSC : error CS2001: Source file 'Traits\Render\WithBuildingPlacedOverlay.cs' could not be found
not the warnings in the test project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a rebase problem after #7570 so sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, didn't see that.
09c0e0c
to
8f34775
Compare
Crash fixed. @MicroJOo the insurance can be turned off per-map, but I have no plans for UI integration for the moment. |
@@ -1,4 +1,4 @@ | |||
carryall.scripted: | |||
carryall.reinforce: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably not have TargetableAircraft
. carryall.infantry
neither, come to think of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they should all be targetable. The initial idea of making carryalls untargetable was questionable, because they were targetable in the original. (or was it their cargo that was targetable, I'm not sure now).
Anyway, I'll remove TargetableAircraft
from all carryalls for now, but it probably should be brought back when the proper balancing is being done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentionally creating more work for the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that only the carryall used for the harvester insurance should have TargetableAircraft
removed from it, not all of the carryalls. (Changed my mind about carryall.infantry
, it's better if people can defend against them). Regular Carryalls should of course be targetable.
Edit: my reasoning: if the carryall that performs the harvester insurance function is shot down, it will not trigger another harvester being sent. And the player receiving the harvester cannot even control the carryall or its flight path, so that would be a pretty shoddy gameplay experience. It would also lure rockets troopers away as the spy plane in RA did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See I hadn't considered stances. Having "chase all the way across the map" as the default stance really sucks. We should change the default to Hold position or similar.
Anyway, it was decided not long ago (no idea by who) that we want carryalls untargetable, because they are uncontrollable. I'm fine with it being like this for the moment, until the time comes to do the proper balance. We'll be changing everything there anyway.
This looks fine for the most part, but those two nits (+ typos) need to be fixed. |
8f34775
to
5153302
Compare
Fixed the problems, but I still don't know what's wrong with |
I suggest you leave a |
Agreed. It will be quite a while before anyone may want (if anyone at all) to use this on an isometric map. |
5153302
to
a947f03
Compare
This isn't really acceptable. "I don't know how to fix this" cannot be a free pass to merge incomplete code if we want to keep a maintainable project. This is how we end up with "// HACK" and "this is shit" comments scattered throughout the code. There are two examples on how to use MPos with bounds and borders right before ChooseClosestEdgeCell in Map.cs. Please try to get a feeling for how these work, as this really isn't a hard problem. You need to:
|
Looks like this is going to wait for a decision on #7701. |
[Desc("What the unit should start doing. Warning: If this is not a harvester", "it will break if you use FindResources.")] | ||
public readonly string InitialActivity = null; | ||
[Desc("Offset relative to structure-center in 2D (e.g. 1, 2)")] | ||
|
||
[Desc("Offset relative to structure-center in 2D (e.g. 1, 2).")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually relative to the top-left cell, not the center.
The two testcases break compilation under non-windows, and prevent testing the actual pr contents. |
Fixup Carryable
…reorganize Carryall actor definitions
Fix FreeActorInfo fields descriptions
cdbfb38
to
efee359
Compare
Since #7701 does not seem to be the fault of this PR, I'm going to merge it now. It looks ok code-wise, and works very nicely in-game, too. AI probably benefits the most. 👍 |
Implement Carryall edge spawn, harvester delivery by carryall and harvester insurance for D2k
First off, this got a bit bigger than expected. So sorry, reviewers.
This is more or less a direct successor to #7300.
I spent quite a while organizing the changes into propper self-contained commits, so I strongly suggest reviewing, and even testing, by commits.
Despite the nice commit messages, I'm going to sum this up:
1. Make built carryalls spawn at the closest map edge cell instead of spawning at the High Tech facility
2. Do some refactoring to enable 3. and 4.
3. Enable FreeActors to be delivered from outside the map via transport (use case are the D2k harvesters, transported by carryalls; this might also be useful in some missions (TS?), but that's not important at the moment). This uses the closest map edge cell by default, but can be set to spawn at a specific location in the YAML file.
4. Add harvester insurance by attaching a new
HarvesterInsurance
trait to the player actor and making worms call that if they eat a harvester.Side bonus: the shellmap got a bit more interesting due to the harvester's new harvesting location (the first time you watch it, at least :D ).