Author Topic: [SOURCEMOD] Brutal-OXCE 7.12.1  (Read 74561 times)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #285 on: August 23, 2023, 11:01:58 am »
Uhhh..
https://github.com/Xilmi/OpenXcom/pull/4


Ah, I see it now. And I also see that someone else did another pull-request some time ago, which I also ignored. I thought Github Desktop would show these like the ones directed at Meridian's branch.

I'll take a look at both of these in the afternoon.

Offline Abyss

  • Colonel
  • ****
  • Posts: 327
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.5.1
« Reply #286 on: August 23, 2023, 01:15:26 pm »
The value could be changed on every pass a unit goes through and also tied to certain conditions. My idea of realizing the random aggressiveness was to roll for it at the beginning of the first turn. But it could also happen every turn. But that's probably a bit too random.
Well, this worth collective consideration to give max profit for the gameplay.
- the most frustrating thing is that AI-controlled units are most likely scattered around the map.
- the second thing is that with BAI level 2, most battles are ending within 5-10 turns, except the grand maps like bases, mansions and story missions (more exposure and pressure than DAI).
 
Occasionally, the way it can work is between-turn switching from pre-rolled aggressiveness to aggressiveness level 2 and back. Say, BAI randomizes ninja to 2.5, then, in random turn to 2, and again.
Also, a switch between 1 and 2.5 may seem intriguing.

Balanced twist scenarios are always welcome.
That can be also referred to as aggressiveness waves. Sounds cool.
« Last Edit: August 23, 2023, 01:17:06 pm by Abyss »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #287 on: August 23, 2023, 05:00:19 pm »
Uhhh..
https://github.com/Xilmi/OpenXcom/pull/4
I'm getting linker-errors while trying to build.

Edit: I think I found the issue. You either don't use Visual-Studio or forgot to include the modifier vcxproj-file to your commit.

Edit2: Now it compiles but crashes when I click the Soldiers-Button in the Basescape.
The crash seems to be correlated to this line:

_btnAI->onKeyboardPress((ActionHandler)&SoldiersState::btnAIClick, Options::keyAIList);

in SoldiersState::SoldiersState

Sorry, but this is getting a bit too much of a hassle for me. So I'll revert the inclusion of your code for now.
« Last Edit: August 23, 2023, 06:08:02 pm by Xilmi »

Offline DeltaEpsilon

  • Captain
  • ***
  • Posts: 86
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.5.1
« Reply #288 on: August 23, 2023, 07:55:20 pm »
Not my code. Out of curiosity, have you never used GitHub?
You should write found issues in pull request comments: you can point at problematic lines there as well.


Offline GumChewer

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #289 on: August 24, 2023, 08:35:20 am »
I'm getting linker-errors while trying to build.

Edit: I think I found the issue. You either don't use Visual-Studio or forgot to include the modifier vcxproj-file to your commit.

Edit2: Now it compiles but crashes when I click the Soldiers-Button in the Basescape.
The crash seems to be correlated to this line:

_btnAI->onKeyboardPress((ActionHandler)&SoldiersState::btnAIClick, Options::keyAIList);

in SoldiersState::SoldiersState

Sorry, but this is getting a bit too much of a hassle for me. So I'll revert the inclusion of your code for now.

Right, sorry! I messed up the export to github.
I double checked and opened a new pull request.
Please check too, as I do not use Visual Studio.


I think it is better to not merge into your main branch unless you are sure the code is good.
Please see my last commit message, my hooking into the AI needs improvement.
It would be easier if I could do a pull request into a new branch, but I do not see support on Github for that.
In case you do not want to merge and revert, you'd have to add a new branch or get the code from my repository. You can download a zip via the green code button from the website too:
https://github.com/GumChewer1980/BrutalAI/tree/autocombat-options
In case you want to commit something first before merging, you should be able to do so in my repo to.

Otherwise just let me know.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.5.1
« Reply #290 on: August 24, 2023, 12:03:13 pm »
Not my code. Out of curiosity, have you never used GitHub?
You should write found issues in pull request comments: you can point at problematic lines there as well.
I've been using GitHub for years but I'm still not proficient in using it. Especially when it comes to things I've never done. These were the first two Pull-Requests I've gotten, so I didn't know what the proper way of doing it was.

I also thought I need to first merge it before I can try it out and then maybe report what I found.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #291 on: August 24, 2023, 12:18:26 pm »
Right, sorry! I messed up the export to github.
I double checked and opened a new pull request.
Please check too, as I do not use Visual Studio.


I think it is better to not merge into your main branch unless you are sure the code is good.
Please see my last commit message, my hooking into the AI needs improvement.
It would be easier if I could do a pull request into a new branch, but I do not see support on Github for that.
In case you do not want to merge and revert, you'd have to add a new branch or get the code from my repository. You can download a zip via the green code button from the website too:
https://github.com/GumChewer1980/BrutalAI/tree/autocombat-options
In case you want to commit something first before merging, you should be able to do so in my repo to.

Otherwise just let me know.
Now that I know where to add the files so they get compiled by VS, this isn't a problem anymore. It's was only difficult because I had to find out what to do. Now it's just 2 clicks or so.
Since I can always simply revert merges, I don't see much of an issue trying stuff on the main-branch.
I can look at the hooking again. I think I will change it a little-bit. But I didn't get so far due to the crashes.
There's a better way than downloading the zip:

On the git-console I can do:
Once: git add gum <URL to your Repo>
Every time: git fetch gum

("gum" in this case is a name I can freely pick as identifier how it will be shown for me)

And then I'll see your repo with all directories directly in GitHub-Desktop right under Meridian's oxce-plus-repo and can merge from there.

My gist about github is: There's a lot of ways of doing things with it. The intended one is usually the best. But if you don't know the intended way but some other way that also works, it's fine too.

With the method described above, I don't even need pull-requests. Just the URLs of people's repos. Which I can even find myself by just looking at who forked from me.

I definitely didn't want to deter contributors, so bear with me, when I appear a little incompetent about this stuff. I may have a clue about AI but when it comes to the whole code-management-stuff, I feel a lot less confident and have a lot to learn.

Offline Nalca

  • Captain
  • ***
  • Posts: 70
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.5.1
« Reply #292 on: August 24, 2023, 02:42:28 pm »
I've been using GitHub for years but I'm still not proficient in using it. Especially when it comes to things I've never done. These were the first two Pull-Requests I've gotten, so I didn't know what the proper way of doing it was.

I also thought I need to first merge it before I can try it out and then maybe report what I found.

You can checkout the branch of the pull request, that way you don't need to merge on master.
Github will tell you if the branch require a modification before merging.

And, I don't know if it is available on the public part of github, but you can propose a modification directly on github / add comments on the pull request.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #293 on: August 24, 2023, 04:25:51 pm »
Please see my last commit message, my hooking into the AI needs improvement.
Okay, the new PR doesn't crash and I could set up half my team as automated while leaving the other half controllable. I'm now trying to fix the issues caused by mixing AI-controlled and not AI-controlled soldiers in the same group.
Suppodely caused by the mechanism that skips to the next unit not being aware which units it is allowed to select.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #294 on: August 24, 2023, 11:32:36 pm »
Otherwise just let me know.
Could you update your side with my latest changes and test the stuff a little if it works as you intended?
I did a bunch of testing, found a bunch of issues, hopefully fixed them now but there's a lot of new possibilities. It feels kinda odd to play with half units controlled by AI and other half not. Basically when you click one of the AI controlled ones, it acts. And if you click it after it acted, it immediately auto-picks the next unit and if you cycled with no reselect they will also end the turn on your behalf.

So while it feels weird, I also can't really think of a way to do it better that doesn't require a lot of changes and testing.

Offline GumChewer

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #295 on: August 25, 2023, 07:51:16 pm »
I definitely didn't want to deter contributors, so bear with me, when I appear a little incompetent about this stuff. I may have a clue about AI but when it comes to the whole code-management-stuff, I feel a lot less confident and have a lot to learn.

I did not intend to complain or similar. Btw. DeltaEpsilon might be competent in these thing, but I just appear so at best.
I even messed up the default values for the new options a second time...

Offline GumChewer

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.5.1
« Reply #296 on: August 25, 2023, 07:58:08 pm »
And, I don't know if it is available on the public part of github, but you can propose a modification directly on github
The one thing I have seen is selecting a file and then something similar to hitting edit / the pencil and then some button like "save as new pull request".

add comments on the pull request.
Definitely, right after clicking the pull request. I've seen at least Xilmi already found that too.

Offline GumChewer

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #297 on: August 25, 2023, 08:03:01 pm »
Could you update your side with my latest changes and test the stuff a little if it works as you intended?
I did a bunch of testing, found a bunch of issues, hopefully fixed them now but there's a lot of new possibilities. It feels kinda odd to play with half units controlled by AI and other half not. Basically when you click one of the AI controlled ones, it acts. And if you click it after it acted, it immediately auto-picks the next unit and if you cycled with no reselect they will also end the turn on your behalf.
Thanks! I will definitely do, but you have to bear my slowness. It might take some days.

So while it feels weird, I also can't really think of a way to do it better that doesn't require a lot of changes and testing.
If it does not satisfy you, you can always choose between
- Not adding it (least work, least distraction from programming a strong enemy AI)
- Keep it and declare it an unsupported feature (maybe hidden behind a compile time constant too)
- Try to implement "Basically you press a hotkey for each soldier when it's selected and it will handle stuff with AI immediately but only for that soldier." (sounds good, but most work)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #298 on: August 28, 2023, 11:10:36 am »
- Keep it and declare it an unsupported feature (maybe hidden behind a compile time constant too)
I would just not enable it by default and this way the details about the implementation are not that important.
Also: Someone made a very, very related feature-request on discord:
Specifically it was about enabling it for the robotic-units you have.
Since those do not appear in the soldier's menu, I guess I'll just add it as a separate option. But other than that the framework is already there.

Offline GumChewer

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.3.1
« Reply #299 on: August 28, 2023, 09:30:18 pm »
Could you update your side with my latest changes and test the stuff a little if it works as you intended?

I did extensive tests and it works as you described. Thanks!

HWP and similar are excluded from the autocombat option, if control per unit is enabled. I fixed that, please see the first commit of my repo on Github.