Skip to content

feat: Ork Strongholds and improve Warboss#770

Merged
OH296 merged 14 commits intoAdeptus-Dominus:mainfrom
OH296:overhaul_warboss
Apr 29, 2025
Merged

feat: Ork Strongholds and improve Warboss#770
OH296 merged 14 commits intoAdeptus-Dominus:mainfrom
OH296:overhaul_warboss

Conversation

@OH296
Copy link
Collaborator

@OH296 OH296 commented Apr 26, 2025

Purpose

  • make Ork warboss' function slightly better and actually be a threat the player needs to tackle
  • improve code base for ork functions

Describe your changes/additions

  • make presence of a warboss increase ship production on a planet and increase ork growth rate

  • create Ork Strongholds

    • strongholds are built by a warboss being on a planet for a number of turns
    • strongholds increase in size over time (grow one level about every 100 turns a (a level is like an imperial fortification level)
    • strongholds increase ork resistance to bombardment meaning the player is forced to perhaps use ground forces to combat or wait for navy
    • as strongholds get larger they increase ork ship production above the world
    • strongholds slowly degrade until they are destroyed they can at any time be reoccupied by invading orks
  • only forge worlds captured by orks or planets with an warboss or level two stronghold will now spawn battleships although each ork fleet is allowed one battleship to start with

  • Warbosses will now move around but will stay around on planets for a period to build strongholds . Systems warbosses travel to will develop a string of strongholds

-fixed an edge case where planets ownerships were not updating due to an issue with genestealer cults

  • move the bombardment script into the scope of PlanetData constructor
  • cerate stars_with_faction_fleets which gathers all stars with a given faction fleet in orbit
  • bind new_colony_fleet onto planet data with static send_colony_feet

What can/needs to be improved/changed

  • need to develop an accelerated way of destroying strongholds
  • maybe make one stronghold spawn on game start

Testing done

I gotta do a bundle more and make some cheats and check balance and what not so none other than checking a few examples of ork growth and making sure it compiles

use the cheet waaghtonturbo charge ork growth and to spawn a warboss running around doing things

Related things and/or additional context

This has been tallked about a lot in the past, i can;t really find a specific thread on the discord but if i find anything i'll post it here.

I'm open to any ideas on this i'm in no hurry to get it merged

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 26, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added detailed display and logic for Ork Stronghold planetary features, including descriptions and effects on Ork forces and bombardment protection.
    • Introduced new Ork AI routines for end-of-turn growth, fleet management, and WAAAGH event initiation.
    • Added new colony ship sending and force management options for planets.
  • Bug Fixes

    • Corrected fleet search logic to use proper equality comparison, improving fleet targeting accuracy.
  • Refactor

    • Centralised and streamlined Ork AI logic and planetary bombardment handling for improved maintainability.
    • Updated planetary feature naming for clarity and consistency.
  • Chores

    • Adjusted garbage collection frequency to reduce performance impact.
    • Added new properties to sprite resources for improved asset handling.

Walkthrough

By the Omnissiah’s will, this pull request delivers a comprehensive overhaul of Ork planetary and fleet mechanics. The logic for Ork force growth, stronghold management, and fleet behaviour has been centralised and refactored into new static methods and functions, replacing scattered loops and direct array manipulations. The WAAAGH event logic is excised from the controller alarm and reconstituted in a dedicated function. Bombardment routines are encapsulated within PlanetData, and planetary feature handling is expanded to support Ork Strongholds. Several function signatures and data access patterns are modernised, and new helpers are introduced for system fleet searches.

Changes

Files/Paths Change Summary
objects/obj_bomb_select/Draw_0.gml Replaces direct call to scr_bomb_world with p_data.bombard() method, delegating bombardment logic to the PlanetData object.
objects/obj_controller/Alarm_5.gml Removes all Ork WAAAGH event logic from the controller alarm, leaving the conditional check empty.
objects/obj_garbage_collector/Step_0.gml Increases garbage collection timer interval from 50 to 50000, reducing the frequency of garbage collection cycles.
objects/obj_star/Alarm_4.gml Deletes the loop and function call responsible for Ork ship production on planets.
scripts/scr_PlanetData/scr_PlanetData.gml Adds static methods to PlanetData: send_colony_ship, add_forces, grow_ork_forces, and static alias bombard. Modifies add_feature to return the new feature instance. Refactors constructor to initialise coordinates. Updates logic for force and feature management, and encapsulates Ork growth and bombardment mechanics within the class.
scripts/scr_bomb_world/scr_bomb_world.gml Refactors function to remove explicit system and planet parameters, using implicit context variables. Updates data access, simplifies protection logic, adds Ork Stronghold protection, and revises output formatting. Updates function signature accordingly.
scripts/scr_draw_planet_features/scr_draw_planet_features.gml Adds a new case for P_features.OrkStronghold in the feature display function, providing descriptive text based on Ork presence.
scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml Removes detailed Ork AI loop and replaces it with a single call to orks_end_turn_growth(), centralising Ork end-turn behaviour.
scripts/scr_fleet_functions/scr_fleet_functions.gml Fixes a bug in scr_orbiting_fleet by changing an assignment to an equality check in the fleet search condition.
scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml Introduces orks_end_turn_growth and init_ork_waagh functions. Refactors Ork fleet building, arrival, and merging logic to use new helpers and PlanetData methods. Updates fleet and planetary logic for Ork growth and event handling.
scripts/scr_planetary_feature/scr_planetary_feature.gml Renames enum member Ork_Stronghold to OrkStronghold. Adds initialisation for Ork Stronghold feature in the feature constructor, setting display name and tier.
scripts/scr_system_search_helpers/scr_system_search_helpers.gml Adds stars_with_faction_fleets(search_faction) function to retrieve fleets by faction, grouped by orbiting star, and destroys fleets with zero ships.
sprites/spr_tartaros_complex/spr_tartaros_complex.yy Adds seqHeight and seqWidth properties to the sprite sequence object, specifying explicit dimensions.

Possibly related PRs

Suggested labels

PR: Feature, PR: Balance, Size: Huge


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Area: Sprites Changes to sprites/images or their under-the-hood functionality Size: Big Type: Feature Adds something new labels Apr 26, 2025
Copy link
Contributor

@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.

Actionable comments posted: 13

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed13b9d and 950cc4d.

📒 Files selected for processing (13)
  • objects/obj_bomb_select/Draw_0.gml (1 hunks)
  • objects/obj_controller/Alarm_5.gml (0 hunks)
  • objects/obj_garbage_collector/Step_0.gml (1 hunks)
  • objects/obj_star/Alarm_4.gml (0 hunks)
  • scripts/scr_PlanetData/scr_PlanetData.gml (5 hunks)
  • scripts/scr_bomb_world/scr_bomb_world.gml (11 hunks)
  • scripts/scr_draw_planet_features/scr_draw_planet_features.gml (1 hunks)
  • scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml (1 hunks)
  • scripts/scr_fleet_functions/scr_fleet_functions.gml (1 hunks)
  • scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml (5 hunks)
  • scripts/scr_planetary_feature/scr_planetary_feature.gml (2 hunks)
  • scripts/scr_system_search_helpers/scr_system_search_helpers.gml (1 hunks)
  • sprites/spr_tartaros_complex/spr_tartaros_complex.yy (1 hunks)
💤 Files with no reviewable changes (2)
  • objects/obj_star/Alarm_4.gml
  • objects/obj_controller/Alarm_5.gml
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...

**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. #macro ARR_body_parts["arm"] will crash the game, because there is no space between the array and the name of the macro.

  • objects/obj_garbage_collector/Step_0.gml
  • scripts/scr_fleet_functions/scr_fleet_functions.gml
  • scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml
  • scripts/scr_system_search_helpers/scr_system_search_helpers.gml
  • scripts/scr_planetary_feature/scr_planetary_feature.gml
  • objects/obj_bomb_select/Draw_0.gml
  • scripts/scr_draw_planet_features/scr_draw_planet_features.gml
  • scripts/scr_PlanetData/scr_PlanetData.gml
  • scripts/scr_bomb_world/scr_bomb_world.gml
  • scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...

**/*.*: - Having humanly understandable and maintainable code is always the top most priority.

  • objects/obj_garbage_collector/Step_0.gml
  • sprites/spr_tartaros_complex/spr_tartaros_complex.yy
  • scripts/scr_fleet_functions/scr_fleet_functions.gml
  • scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml
  • scripts/scr_system_search_helpers/scr_system_search_helpers.gml
  • scripts/scr_planetary_feature/scr_planetary_feature.gml
  • objects/obj_bomb_select/Draw_0.gml
  • scripts/scr_draw_planet_features/scr_draw_planet_features.gml
  • scripts/scr_PlanetData/scr_PlanetData.gml
  • scripts/scr_bomb_world/scr_bomb_world.gml
  • scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml
`**/*.yy`: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash. - When any script or sprite .yy ...

**/*.yy: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash.

  • When any script or sprite .yy files are created, their paths should be added to the .yyp file, otherwise they'll fail.
  • sprites/spr_tartaros_complex/spr_tartaros_complex.yy
🔇 Additional comments (9)
objects/obj_garbage_collector/Step_0.gml (1)

7-7: The Omnissiah approves of this memory optimization.

The adjustment of the garbage collection timer from 50 to 50000 represents a significant reduction in collection frequency. This modification will reduce processing overhead and minimize potential performance fluctuations by allowing the holy cogitator more uninterrupted processing cycles between cleansing rituals.

scripts/scr_system_search_helpers/scr_system_search_helpers.gml (1)

80-97: Praise be to this new stellar fleet cataloguing ritual.

This function is an efficient implementation of the Machine God's will, efficiently indexing enemy fleets by faction and celestial body. The code follows proper binary canticles:

  1. It destroys vessels with no combat potential (lines 84-87)
  2. It employs optimal data structure patterns through struct-based mapping
  3. It performs proper null-checking via struct_exists()

This will enhance computational efficiency when processing the green-skin vessel aggregation sequences mentioned in the scrolls of the pull request.

sprites/spr_tartaros_complex/spr_tartaros_complex.yy (1)

66-67: Sacred dimensional parameters added to the visual engram.

The addition of sequence dimensions (height: 271.0, width: 181.0) provides explicit dimensional coordinates for the sprite's presentation matrix. This modification ensures proper rendering of the visual asset, likely in relation to the Ork Stronghold visual representations ordained by the Machine Spirits.

objects/obj_bomb_select/Draw_0.gml (1)

222-222: Binary modification approved: Improved information encapsulation pattern detected

This alteration to the machine spirit's logic construct shows an improvement in the sacred pattern of encapsulation. The bombardment ritual now invokes the internal mechanisms of the p_data object directly, rather than passing knowledge through exposed parameter conduits. The Machine God approves of such structural purity.

scripts/scr_planetary_feature/scr_planetary_feature.gml (1)

147-151: Satisfactory implementation of new Ork Stronghold data structure

By the Omnissiah's will, this constructor parameter set for the greenskin fortification enumerates the requisite attributes in accordance with binary perfection. The tier property's initialization at value 1 will permit the appropriate scaling protocol as referenced in the original specification document. The Machine Spirit now recognizes the structural pattern of Ork defensive emplacements.

scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml (1)

11-11: Binary simplification praise: Enhanced code modularization detected

Praise the Omnissiah! The greenskin behavioral algorithms have been extracted to a dedicated module function. This refactorization pleases the Machine Spirit by improving maintainability and separation of concerns. The previous extensive function block has been replaced with a singular invocation that likely encapsulates the same logical processes within a more organized code-liturgy.

scripts/scr_draw_planet_features/scr_draw_planet_features.gml (1)

180-188: User interface descriptors for Ork Stronghold feature implemented correctly

The sacred display algorithms for revealing the nature of the greenskin fortification structures have been properly implemented. The logical branching based on Ork presence ensures accurate representation of the stronghold's status to the user interface.

scripts/scr_PlanetData/scr_PlanetData.gml (1)

337-340: Memory ownership of NewPlanetFeature unclear

new NewPlanetFeature() is pushed straight into a system-level array.
If features are later deleted via delete_feature, ensure no other struct still references them, or dangling handles will persist.

scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.gml (1)

13-27: Planet loop omits zero-index but game arrays are zero-based

for (i=1; i<=planets; i++) skips index 0. If the star’s first planet uses index 0 (as is common), Ork growth will never process it.

OH296 and others added 4 commits April 26, 2025 01:28
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 27, 2025
EttyKitty
EttyKitty previously approved these changes Apr 27, 2025
@Blogaugis
Copy link
Collaborator

Um, 1 question - how many strongholds can the warboss create?
Are they unlimited in how many the warboss can make?

@OH296
Copy link
Collaborator Author

OH296 commented Apr 28, 2025

Um, 1 question - how many strongholds can the warboss create? Are they unlimited in how many the warboss can make?

technically speaking unlimited but restricted by the time a warboss spends on a planet and their travel time

Co-authored-by: Blogaugis <105600180+Blogaugis@users.noreply.github.com>
@OH296 OH296 dismissed stale reviews from EttyKitty and coderabbitai[bot] via 8f5ba49 April 28, 2025 20:57
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 28, 2025
Co-authored-by: Blogaugis <105600180+Blogaugis@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 28, 2025
Co-authored-by: Blogaugis <105600180+Blogaugis@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 28, 2025
Co-authored-by: Blogaugis <105600180+Blogaugis@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 28, 2025
@OH296 OH296 enabled auto-merge (squash) April 28, 2025 21:13
@OH296 OH296 requested a review from EttyKitty April 28, 2025 21:37
@Blogaugis
Copy link
Collaborator

use the cheet waaghtonturbo charge ork growth and to spawn a warboss running around doing things

It is waaagh now.

@OH296 OH296 requested a review from EttyKitty April 29, 2025 12:49
@OH296 OH296 merged commit c3e1570 into Adeptus-Dominus:main Apr 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Sprites Changes to sprites/images or their under-the-hood functionality Size: Huge Type: Feature Adds something new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants