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
Artificial Stupidity--changes to AI, possibly improvements #358
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Conflicts: src/Battlescape/Pathfinding.cpp
Conflicts: src/Battlescape/UnitWalkBState.cpp src/Engine/Options.cpp src/OpenXcom.2010.vcxproj
sectoids are scurrying well Conflicts: src/Savegame/BattleUnit.cpp
tile-scoring based on LOS to soldiers works now, apparently BattleUnit badly needs a copy constructor added flags to BattleUnit to try to add some continuity to AI actions probably more? Conflicts: src/Savegame/BattleUnit.cpp
some clean-up in AggroBAIState mean soldier distance calculated in survey function XXX dynamic_cast to AggroBAIState in handleAI() does not work, investigate copy constructor written for BattleUnit for proper operation of survey...() total TU cost of calculated path is available from Pathfinding now Conflicts: src/Savegame/BattleUnit.cpp
so far, meh
changed the valid melee range check to not consider direction when a 2x2 unit is actually in range to attack, just as it ignores direction when looking for a position to run to for an attack
actually consider distance from action target to aggrotarget, at least a little bit, duh
things seem to be running fairly well
aliens know about all soldiers known to any alien when pathfinding; they use their space-walkie-talkies
but did you fix reapers? |
Don't forget to neuter and spay your reapers! I did get them to successfully attack in all directions in the x,y plane. Their problems with z need a look from someone who understands the voxel hit stuff better. |
stick a fork in it maybe?
…tificial_stupidity Conflicts: src/Engine/OpenGL.h
…heir last action. They also use pathfinding when needed to figure out where soldiers might come from. Prepare to get ambushed, suckers! Maybe!
…tificial_stupidity Conflicts: src/Battlescape/UnitWalkBState.cpp
also tweaked colorizer again
Warboy1982
added a commit
that referenced
this pull request
Mar 3, 2013
Artificial Stupidity--changes to AI, possibly improvements what could possibly go wrong?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code for taking cover now evaluates tiles based on multiple factors with different weights assigned to different variables; probably the most important is the amount of soldiers which can see an alien at the given tile (see surveyXComThreatToTile() in TileEngine.cpp). The AI will also try not to stand in fire, smoke, directly next to soldiers, or next to windows. It should also prefer to stand somewhat close to other aliens but not close enough to make a really tempting grenade target.
The AI also tries to keep its state around for multiple actions for a bit more continuity. This was part of an effort to make reapers stop being bad and might be unnecessary.
There's a change to validMeleeRange() which was done to allow reapers to attack targets properly. When looking for a spot from which to bite humans, the could would test the attack in all directions. After approaching the target however, the reaper would face the target and the code would check the attack only in that direction. Sometimes it would fail. This change only made it so the code checks in all directions when it comes time to actually attack. A closer look at the code is needed, I guess.
There is still a problem with melee attacks between units at different heights, especially on mountain hills!
In a final effort to make reapers less bad, I gave all melee units more actions. They should be scary and to be effectively frightening they need to be able to spend all their TUs on attacking when possible. There's no point in preserving TUs for reaction fire in the case of melee units, after all.
There is also an AI option, "sneakyAI," which causes the pahtfinding code to avoid visible tiles. Turn it on if you want the ailens to cheat like crazy, I guess. Note that it doesn't work well for 2x2 units yet.
I added a change to the pathfinding code so that aliens can share the locations of X-Com soldiers (over their space-walkie-talkies) for purposes of path planning. See method SavedBattleGame::eyesOnTarget(), it's handy.
Aliens will also now turn to face the nearest insolent X-Com upstart at the end of their last hide action. If they actually hid well and nobody's visible from their hiding spot, they'll use pathfinding to face in the direction of their aggro target's likely approach.
In short, this is a lot of stuff for one pull request.