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

Follower / Faction camp summary menu and migrate to overmap #28498

Merged
merged 4 commits into from Mar 14, 2019

Conversation

@davidpwbrown
Copy link
Contributor

commented Mar 4, 2019

Summary

SUMMARY: Features "Follower / Faction camp summary menu and migrate to overmap"

Purpose of change

fixes #24360
Created a menu that uses the # key ( that the old faction menu used )
In this menu, a list of your followers will be on one tab, with a summary of their information.
On another tab, a list of your faction camps and a summary of their info.
On another tab, a list of other factions ( these don't really exist yet )

Describe the solution

There is a new list being tracked for NPC followers.
follower_ids
used with the following functions in game.cpp/h

        void add_npc_follower( const int &id );
        /** Remove follower id from follower list. */
        void remove_npc_follower( const int &id );
        /** Get list of followers. */
        std::vector<int> get_follower_list();
        /** validate list of followers to account for overmap buffers */
        void validate_npc_followers();

Validate is called on load to ensure that existing NPC followers are added to this new list from older saves.
Other NPC functions would determine if NPCs were friendly or were guarding,but only in reality bubble, there was no "master list" of followers you had obtained, even if they were miles away.
This remedies that. ( and opens the door to future remote contact via radio and so on )

For the faction camps - there was some work required to move some of their information to the overmap buffer.
You can now name the camp when creating it.
There is now an overmap_ui label like the city labels, but for camps.
The camp summary will show what is required for the next upgrade and total calories stored.

The validation for older saves with existing camps was tricky, what I've done for the moment is when the menu is opened nearby an existing camp, it adds it to the list straight away.
Players with many existing camps in a save wont see them in the menu until they visit each one and "check in" by opening the menu near them.

Various other things have been done that I hope are self-evident in the code to support the goals of this PR I had to change a lot of little things.

The code is obviously very ugly, and I expect a brutal review, this was a bit of a stretch for me.

Describe alternatives you've considered

This will be improved once #28481 is merged, that will have descriptive map of strings for the mission name.
Will want to improve functionality of this in steps.

Additional context

image
image
( that is just the default name )
image

Show resolved Hide resolved src/basecamp.cpp Outdated
@Night-Pryanik
Copy link
Member

left a comment

om_description_trunc and om_upgrade_description are VERY similar. Consider merging them into one function with overload.

Show resolved Hide resolved src/game.cpp Outdated
@mlangsdorf
Copy link
Contributor

left a comment

It looks like a good start, but you're complicating the tracking of the omt_pos quite a bit and I don't get the two stage tracking of camps in the overmap.

Show resolved Hide resolved src/basecamp.cpp Outdated
Show resolved Hide resolved src/faction.cpp Outdated
Show resolved Hide resolved src/faction_camp.cpp Outdated
Show resolved Hide resolved src/faction_camp.cpp Outdated
Show resolved Hide resolved src/overmapbuffer.h Outdated
Show resolved Hide resolved src/overmapbuffer.h Outdated
Show resolved Hide resolved src/overmapbuffer.h Outdated
Show resolved Hide resolved src/overmapbuffer.cpp Outdated
@AMurkin
Copy link
Contributor

left a comment

No need to include trailing spaces.

Show resolved Hide resolved src/basecamp.cpp Outdated
Show resolved Hide resolved src/basecamp.cpp Outdated
Show resolved Hide resolved src/character.cpp Outdated
@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

Consider adding a [WIP] tag if you're actively working on the PR.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

Consider adding a [WIP] tag if you're actively working on the PR.

Not currently actively adding stuff to it, the recent addition
"removed paramters to get*description in character class" was due to one of the reviewers suggesting that on discord. there will be no more additions to it, only changes due to reviews.

@ifreund ifreund removed the 0.D Freeze label Mar 8, 2019

@davidpwbrown davidpwbrown force-pushed the davidpwbrown:factionmenu branch 2 times, most recently from 83f3a12 to ab85e50 Mar 9, 2019

@davidpwbrown davidpwbrown changed the base branch from development to master Mar 9, 2019

@davidpwbrown davidpwbrown force-pushed the davidpwbrown:factionmenu branch 5 times, most recently from 4740c92 to 9e8572d Mar 9, 2019

@mlangsdorf
Copy link
Contributor

left a comment

Looks pretty good. The only thing I want to change is basecamp::pos should go away. Change it to pos_deprecated, remove it from the savegame_json. Now that camps are going to be tracked via the overmap buffer, they should have an omt_pos and a board_pos.

Show resolved Hide resolved src/basecamp.cpp Outdated
Show resolved Hide resolved src/basecamp.h Outdated
Show resolved Hide resolved src/faction_camp.cpp Outdated

davidpwbrown added some commits Feb 23, 2019

added NPC summary window
added ability to chat to NPC from menu

fixed zero-size vector crash

fixed abs coords checking and NPC in buffer

fixed interactable/visible check and NPC leaving party

changed chat-to from menu to accept an interactable bool

added mission description to NPC list

added camp labels and camp names

moved camps to overmap

removed pointers for now, get camp info works from voermapbuffer now

made the om_camps accept pointers

added mission description to camp menu

removed test code, added validation for existing camps

removed code from the future

removed more code from the future

from reviews

moved add_camp to define_camp

temporary fixing commit

removed om_camp and camp_reference intermediate structs

string formatting

moved naming camp popup to new function

Update src/basecamp.cpp

Co-Authored-By: davidpwbrown <39344466+davidpwbrown@users.noreply.github.com>

Update src/basecamp.cpp

Co-Authored-By: davidpwbrown <39344466+davidpwbrown@users.noreply.github.com>

removed paramters to get*description in character class

removed string initlializing to ""

astyle

fix travis errors v1

travis errors v2

trvis errors fix v3

travis fix error v4

@davidpwbrown davidpwbrown force-pushed the davidpwbrown:factionmenu branch from 5e04721 to 78fd364 Mar 13, 2019

@kevingranade kevingranade merged commit 46e2ec7 into CleverRaven:master Mar 14, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
gorgon-ghprb Build finished.
Details
@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 18, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/new-menu-functionality-for-npcs-and-factions/19282/1

@davidpwbrown davidpwbrown deleted the davidpwbrown:factionmenu branch Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.