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

Enemy module pt1 #566

Merged
merged 27 commits into from
Feb 24, 2019
Merged

Enemy module pt1 #566

merged 27 commits into from
Feb 24, 2019

Conversation

Wyqer
Copy link
Member

@Wyqer Wyqer commented Feb 24, 2019

Q A
Bug fix? no
New feature? yes
Needs wipe? no
Fixed issues #529

Description:

As stated in the issue itself, this provides the first part of the enemy module to provide a basic foundation for the future iterations. The currently implemented functions to transfer garrisons can be tested via the debug console.
Example for transfering units from the Feres Outpost military base to Feres:

["KPLIB_eden_base", "KPLIB_eden_city_1", 20, ["O_MRAP_02_gmg_F","O_LSV_02_AT_F"]] call KPLIB_fnc_enemy_reinforceGarrison;

There is still some rare occurances of "vehicle spawn explosion", even if there is always a "is something already there" check. My assumption is, that it's caused by the fact that we keep calling the spawning, so it maybe can't recognize it sometimes, that there is a vehicle spawned directly before the current one. Would be interesting to test this in the next sprint and maybe find a way to have it running in a capsuled scheduled environment. Reason for this assumption is, that the spawning in general is handled like in the old framework. The only real difference is the (un-)scheduled environment where the spawning happen.

Furthermore this PR contains smaller tweaks outside of the module and a example module structure as template for creating new modules.

Content:

  • Values for the enemy capabilities concerning strength and awareness
  • Functions to alter these values
  • Placeholder event handler functions for sector activation/capturing/deactivaten
  • Transfer garrison units from one sector to another
  • Create new enemy units at military bases and use them as reinforcements
  • Small tweaks in several places
  • One example module structure

Successfully tested on:

  • Local MP Vanilla
  • Dedicated MP Vanilla

Compatibility checked with:

  • None

@Wyqer Wyqer added this to the Sprint 10 milestone Feb 24, 2019
// Handle requested infantry
if !(_troops > (_garrison select 2)) then {
// Define one infantry squad for transport
private _squadComp = [
Copy link
Contributor

Choose a reason for hiding this comment

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

We should provide some more immersive groups in a later stage.

Leader
Medic
AA/AT
MG
...

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just for moving amount of infantry from A to B.
For "battlegroups" or similar it'll be dynamic like in the old framework.

// Check via config for enough transport seats and return resulting array
private _validVeh = [];
{
if ((getNumber (configfile >> "CfgVehicles" >> _x >> "transportSoldier")) >= _amount) then {
Copy link
Member

Choose a reason for hiding this comment

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

Config lookups are performance costly, it could be saved in some namespace, take a look at KPLIB_fnc_common_getIcon

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll have a speed check for pt2 and adjust it, if it's a huge improvement. 👍

Copy link
Contributor

@Dubjunk Dubjunk left a comment

Choose a reason for hiding this comment

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

Nice work, hope it'll work as intended :)

Copy link
Member

@veteran29 veteran29 left a comment

Choose a reason for hiding this comment

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

Config caching thing is minor issue.

LGTM

@Wyqer Wyqer merged commit baa587e into v0.97S10 Feb 24, 2019
@Wyqer Wyqer deleted the v0.97S10-529 branch February 24, 2019 19:31
@Wyqer Wyqer added done and removed review/QA labels Feb 24, 2019
@Wyqer Wyqer mentioned this pull request Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants