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

Chaotic zombie movement #13428

Merged

Conversation

kevingranade
Copy link
Member

This patches up a failing I noticed with the zombie stumbling code, namely they weren't considering all the squares that were closer to the target than they were, so they tended to stick to the center line between themselves and the target and as a result they'd bunch up pretty badly.

Better Zombie Stumbling

I'm also looking at ripping out monster::plan, it's not useful, and it seems to be causing some occasional bugs. If this lands first I'll follow up with another PR doing that.

@Rivet-the-Zombie Rivet-the-Zombie self-assigned this Aug 29, 2015
Rivet-the-Zombie added a commit that referenced this pull request Aug 29, 2015
@Rivet-the-Zombie Rivet-the-Zombie merged commit 519e8d3 into CleverRaven:master Aug 29, 2015
@Night-Pryanik
Copy link
Contributor

Well, their movement pattern like "go to the target by the shortest way" seems ok to me. They are brainless zombies after all. Most of them.
Now they move way too chaotic and sometimes not even in my direction.

@ghost
Copy link

ghost commented Aug 30, 2015

It failed to compile on Mac using clang++ compiler.

src/line.cpp:467:20: error: no member named 'abs' in namespace 'std'; did you mean simply 'abs'?
    const int ax = std::abs( dx );
                          ^~~~~~~~
                          abs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdlib.h:129:6: note: 'abs' declared here
    int abs(int) __pure2;
        ^
src/line.cpp:468:20: error: no member named 'abs' in namespace 'std'; did you mean simply 'abs'?
    const int ay = std::abs( dy );
                   ^~~~~~~~
                   abs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdlib.h:129:6: note: 'abs' declared here
    int abs(int) __pure2;
        ^

Which is in a piece of code in std::vector<tripoint> squares_closer_to( const tripoint &from, const tripoint &to):

           const int dx = to.x - from.x;
           const int dy = to.y - from.y;
       467:const int ax = std::abs( dx );
           const int ay = std::abs( dy );

After I removed std::, then the code was compiled successfully.

@kevingranade kevingranade deleted the chaotic-zombie-movement branch April 30, 2018 01:05
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.

None yet

3 participants