Skip to content

Separate AI naval vehicle production from regular vehicle production#817

Merged
Metadorius merged 8 commits intoPhobos-developers:developfrom
Starkku:feature/ai-naval-production-fix
May 24, 2023
Merged

Separate AI naval vehicle production from regular vehicle production#817
Metadorius merged 8 commits intoPhobos-developers:developfrom
Starkku:feature/ai-naval-production-fix

Conversation

@Starkku
Copy link
Copy Markdown
Contributor

@Starkku Starkku commented Dec 30, 2022

By default, while game has separate FactoryClass instances and queues for regular and naval vehicles, game still keeps track of which VehicleType to build and which one was last built using only one reference each in HouseClass. This PR decouples this for ground and naval vehicles, allowing AI to produce both simultaneously.

Because Ares reimplements the HouseClass unit production update function (0x4FEA60) and this feature/fix is impossible to implement without touching that function, it has been reimplemented here again using Ares 0.A version of the function as a reference. However as it stands, I have no reliable way of telling if it has been altered to any significant degree in time since that and 3.0. It is possible that this PR uses less optimized code, or in worst-case, faulty or partial. I would appreciate help of a more experienced reverse-engineer with this.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 30, 2022

Nightly build for this pull request:

@Starkku Starkku force-pushed the feature/ai-naval-production-fix branch from 66ddb19 to 3fa2d71 Compare December 30, 2022 20:34
@FS-21
Copy link
Copy Markdown
Contributor

FS-21 commented Dec 31, 2022

I tested it and works as expected.

It respects the Ares tag "[GlobalControls] -> AllowParallelAIQueues"

@Starkku Starkku force-pushed the feature/ai-naval-production-fix branch 2 times, most recently from ff59549 to d2f48ce Compare January 5, 2023 13:00
@Starkku
Copy link
Copy Markdown
Contributor Author

Starkku commented Jan 5, 2023

There is an issue of yet undetermined cause that sometimes crashes the game due to a seemingly corrupt FactoryClass pointer. This crash has EIP 0x4CA0F8.

@Starkku
Copy link
Copy Markdown
Contributor Author

Starkku commented Jan 17, 2023

The crash mentioned in my previous comment should now be fixed.

@Starkku Starkku force-pushed the feature/ai-naval-production-fix branch from d595b16 to f7f7386 Compare February 4, 2023 21:17
@DOOMGUY2K
Copy link
Copy Markdown
Contributor

I would like to test this but it appears the link has expired.

@Starkku Starkku force-pushed the feature/ai-naval-production-fix branch from 5819c42 to b0628bf Compare May 11, 2023 15:09
@Starkku Starkku force-pushed the feature/ai-naval-production-fix branch from b0628bf to 3f4c6b2 Compare May 11, 2023 15:13
@Starkku
Copy link
Copy Markdown
Contributor Author

Starkku commented May 11, 2023

I would like to test this but it appears the link has expired.

The service that provides the links seems to work slowly or not at all right now, can still get the download manually from the commit's action summary.

Step 1
image
Step 2
image
Step 3
image

https://github.com/Phobos-developers/Phobos/suites/12832730234/artifacts/691258980

Copy link
Copy Markdown
Contributor

@DOOMGUY2K DOOMGUY2K left a comment

Choose a reason for hiding this comment

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

I can confirm this is working as intended.

I checked the previous notes

Tested on

Vanilla 1.001
Ares 3.01p
And KratosDP

And combined inside my own Mod.
817

@Metadorius Metadorius merged commit 826d32d into Phobos-developers:develop May 24, 2023
@Starkku Starkku deleted the feature/ai-naval-production-fix branch May 26, 2023 09:41
Metadorius added a commit to Metadorius/Phobos that referenced this pull request Mar 30, 2025
…hobos-developers#817)

* Separate AI naval vehicle production from regular vehicle production

* Fixup

* Adjust a hook

* Fix a broken hook return address causing a crash

* Split the vehicle production update code

* Fix minor style issues

* shut 🦆👌

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants