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

Experimental multithread mode for single player #1200

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

MortonPL
Copy link
Contributor

@MortonPL MortonPL commented Feb 10, 2024

  • It is now possible to use experimental multithreading support for single player modes (campaign and skirmish) to improve game performance.
  • This feature must be enabled using with MultiThreadSinglePlayer=true.

In rulesmd.ini:

[General]
MultiThreadSinglePlayer=true    ; boolean

No multiplayer. Multiplayer never. I tried and I gave up and I tried again and I gave up twofold. I have robbed myself of hours for nothing. For some reason, all ztyping problems return in PvP, as if to mock me. Or is this a lesson? Punishment for hubris? Mockery of youthful ignorance, repetition of Icarian bravery. If "it" has agency, then it is against me. If "it" has form, then it is alien to my senses. When it first became apparent to me, idealism coming from dreams of progress gave way to pride and spite. Yet, anger only ever burns inside and the heavens do not believe in tears. And so I have arrived at the last act of grief, a timeless tragic play with one actor and no audience. I throw in the towel, wave the white flag, bend the knee, and kiss the pinky ring. There are men made for great things, but just because we walk among them doesn't make us equals.

Summary by CodeRabbit

  • New Features
    • Introduced multithreading support for single player modes to enhance game performance.
  • Documentation
    • Updated documentation to include instructions on enabling experimental multithreading in single player modes.
  • Configuration
    • Added a new setting to enable or disable multithreading in single player modes.

Copy link

coderabbitai bot commented Feb 10, 2024

Walkthrough

The project has introduced multithreading support for single player modes, aiming to enhance game performance. This significant update includes the addition of a new configuration option, updates to project files, and detailed documentation to guide users through enabling and understanding this experimental feature.

Changes

Files Change Summary
CREDITS.md Added multithreading support for single player modes.
Phobos.vcxproj Added Hooks.Multithread.cpp to compilation list.
docs/Miscellanous.md, docs/Whats-New.md Added documentation for enabling experimental multithreading in single player modes.
src/.../Hooks.Multithread.cpp, src/Phobos.INI.cpp, src/Phobos.h Introduced multithreading functionality and configuration in the codebase.

Poem

🏈🐰 In the land of code and bytes, under the digital moonlight,
A rabbit hopped with glee, for a game as grand as can be.
Chiefs and Niners, in a dance, a spirited Super Bowl stance.
Through fields of green and screens of glow,
The rabbit cheered, "Let the good code flow!"
🎉🏆 Amidst tackles and cheers, no room for fears,
For in the heart of the game, every byte claims fame.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@Metadorius
Copy link
Member

you ztyping wot

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 193223e and 94e4a0b.
Files selected for processing (7)
  • CREDITS.md (1 hunks)
  • Phobos.vcxproj (1 hunks)
  • docs/Miscellanous.md (1 hunks)
  • docs/Whats-New.md (1 hunks)
  • src/Misc/Hooks.Multithread.cpp (1 hunks)
  • src/Phobos.INI.cpp (2 hunks)
  • src/Phobos.h (1 hunks)
Additional comments: 7
src/Phobos.h (1)
  • 79-79: LGTM!
src/Phobos.INI.cpp (1)
  • 43-43: LGTM!
src/Misc/Hooks.Multithread.cpp (1)
  • 18-267: The implementation of the multithreading feature is comprehensive, covering thread management, rendering in a separate thread, and synchronization mechanisms. Ensure thorough testing, especially around thread safety and game state consistency across different game scenarios.
docs/Miscellanous.md (1)
  • 166-175: The documentation update accurately describes how to enable the experimental multithreading feature for single-player modes. Clear and concise instructions are provided.
CREDITS.md (1)
  • 239-239: The update to the CREDITS.md file appropriately acknowledges contributions related to the development of the multithreading support for single-player modes.
Phobos.vcxproj (1)
  • 172-172: The addition of src\Misc\Hooks.Multithread.cpp to the compilation list is correctly formatted and follows the project's conventions for file inclusion.
docs/Whats-New.md (1)
  • 358-358: LGTM!

Copy link

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.

@Starkku
Copy link
Contributor

Starkku commented Feb 11, 2024

cooked

FPS goes up by a lot but there's something funny with rendering (especially when scrolling) I can't quite put in words, almost as if it is more choppy / skipping frames or something, even at relatively 'low' framerates like 100+ compared to before. Capped to like 60 it is more or less fine though.

@mbnq
Copy link

mbnq commented Feb 12, 2024

All info about my setup will be on the very bottom of this post.

1.) Game is freezing preety randomly, no matter debug on or off it doesn't generate any logs after all.
Sometimes it freezes and doesn't close (rare), while most of the time process exits to the desktop witout any error dialogs or anything

I will try to get memory dump and post it.

2.) gfx glitches that occured to me:

  • phobos bounty score is displaying very fast, like 4 times more fps than game render
  • when you move cursor over a building or unit it doesn't get highlighted with this cubic borders (sorry for my potato english)
  • sometimes i need to move my screen away from something and go back to see it updated, like for example shrouds removal by spawning (chronoing) units

I think thats all I can recall for now

3.) also fps cap on 30, why? Or I did something wrong?

4.) Oh just one more thing, but this might be just a placebo feeling, I feel like AI is doing everything quicker, from building, creating units and executings scripts. Like few % faster, but I'm not 100% sure about that.

Notice: My mod with Phobos 38 build and latest Ares works perfectly stable with fps ~50, I was even making 12+ hours tests with all slots occupied by AIs.

edit: video


My mod I'm working on: github
My hardware: steam
Windows 11 latest build up to date, all drivers up to date.

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.

None yet

4 participants