-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
[Highly Customized] Optimize aircrafts actions #1366
[Highly Customized] Optimize aircrafts actions #1366
Conversation
suggest to make these guard behaviors compatible with |
Only the attack move action will use the weapon's range to reduce the range that search the valid target. |
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
TechnoClass FootClass TechnoClass_vtbl vt_entry_3B4 -> bool InAuxiliarySearchRange(AbstractClass* pTarget) |
I modified the above content and merged the branch #1449. |
To do that you have to create a branch in YRpp, then you can push it and submit a pull request to YRpp repository. When you cloned Phobos recursively - you also cloned YRpp as a submodule. Basically submodules are just nested repositories. You can open it like any other repository, so the changes can be synchronized to Phobos and you don't need to rename stuff by hand. What I suggest to do is: in Visual Studio (regular or Code) rename fields and functions using
At this point you have to create a branch in YRpp repository (create a fork of it if you didn't yet), commit and push the changes and submit it as a pull request. After pushing it you have two options in Phobos repository:
After the YRpp pull request gets accepted you will need to switch to the latest commit that was merged (you do that in the submodule), verify that it compiles like normal, and then commit and push it to your Phobos branch that you made for the pull request. |
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 all looks good to me except one thing. I also took the liberty of helping you out with documentation. Please review the changes and the question and let's get this merged.
It seems I am not able to push to this branch. Could you please enable "Allow edits by maintainers" on your pull requests so we can submit improvements without creating additional pull requests? I will push my doc/spelling improvements then. |
It seems that |
I think there's some configuration that prevents me from directly pushing. I have submitted a PR: CrimRecya#2 |
Doc and spelling/style improvements
Thank you for your correction. I have merged it. |
Excuse me for being unable to test when it was a PR, but it seems an aircraft still has some trouble proceeding to the next planning waypoint. For example it will try to contact the airport first. Is this intended? |
No, judging from the mission of the aircraft, there will be 1-2 frames trying to contact the airport before entering the next planning waypoint, but this should not prevent it from continuing to the next waypoint. Is this the problem caused by the aircraft ammunition upper limit is greater than (not equal to) 2 and its ammo is not 0 but less than (not equal to) half of the upper limit? |
I don't have much clue either. I once tried avoiding it via flyloco methods such as 4CFA70, but it no longer works with your code here. |
if (distance > std::max((pType->SlowdownDistance >> 1), (2048 / pType->ROT))) | ||
return (R->Origin() == 0x4168C7 ? ContinueMoving1 : ContinueMoving2); | ||
|
||
pThis->EnterIdleMode(false, true); |
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.
For example an easy but nasty way to "avoid" this is to add remaining waypoints check before enteridlemode. But it's probably not correct.
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.
Normally bool __thiscall EnterIdleMode(TechnoClass *this, bool construction, bool nextPlanningPath)
should have handled the next waypoint, but I don't understand why it didn't take effect. I'll check it carefully.
At present, the return purpose of one or two frames is not a big problem, at least they will continue to the next waypoint. One more thing, ww hard coded that the aircraft cannot move directly to the water surface, which is also a problem. But anyway, I will try to solve these two problems and submit a new fix later. |
I fixed these two problems in #1484. Please check them in your own time. |
1. Fix aircrafts planning waypoint problem - At the end of each task, all units with planning waypoints will generate an mega event to the next planning waypoint and respond after 1 frame. This is really no problem for most units, but for aircrafts, they will always return to the airport after each task. So they will try to return to the airport in the frame before it respond to event. There will be looked like a "shaking", if the `Speed` and `ROT` of the aircraft are fast. To solve this problem, I check the waypoints of aircrafts and let them wait before returning. 2. Fix a vanilla issue - Now aircrafts can fly towards the water surface normally. --------- Co-authored-by: Kerbiter <crabiter@vivaldi.net>
stop
command (S) is issued to an aircraft, the aircraft will immediately return to the airport. When aguard
command (G) is issued, the aircraft will search for targets around the current location and return immediately when target is not found, target is destroyed or ammos are depleted (Note that if the target is destroyed but ammos are not depleted yet, it will also return because the aircraft's command is one-time). When aattack move
command (Ctrl+Shift) is issued, the aircraft will move towards the destination and search for nearby targets on the route for attack. Once ammos are depleted or the destination is reached, it will return (Note that if the automatically selected target is destroyed but ammos are not depleted yet during the process, the aircraft will continue to go to the destination).In
rulesmd.ini
: