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

Photos expansion #30672

Merged
merged 23 commits into from
Jun 19, 2019
Merged

Photos expansion #30672

merged 23 commits into from
Jun 19, 2019

Conversation

egorzaderiy
Copy link
Contributor

@egorzaderiy egorzaderiy commented May 19, 2019

Summary

SUMMARY: Features "More features in photos. Allows centered on any tile, captures all creatures."

Purpose of change

Include more features in photos, like furniture, vehicles, weather, etc, for roleplaying purposes. Later this can be used to fill cameras/tablets with pregenerated photos that lead to treasure, for example.

Describe the solution

Monsters, npc and player use unified extended_photo_def format. Still saving monsters to monster memory. Old saves will load fine, as it saves photos to new section, while still reading old sections.

  • It takes photo of any point and checks points in radius=2.
  • If it founds creature, it scans tiles around (R=1). Any objects found are appended as "Nearby you can see ...". These tiles marked as processed and not scanned again.
  • Then all remaining not marked tiles are processed, and objects found are appended as paragraphs showed as categories.

Describe alternatives you've considered

First alternative is create 2d submap of selected part of map, and then draw it when user wants to see photo. Like snapshot of mini-part of map. But thats probably too hard.
Second alternative is creating photo like in first person view, with pseudographics. This is even harder.

Additional context

I want to add:

  • weather
  • overmap name
  • inside/outside
  • bionics this one should be added in character description, and will not be part of this PR
  • field effects (fire, smoke, blood/acid on floor, ..)
  • creature effects (sleeping, on fire, pain, ...)
  • graffiti, some other landmarks (???)
  • other NPC/monsters
  • photos centered on any tile
  • allow viewing of photos on e-ink tablet pc
  • make all creatures in photo blinded
  • save all monsters in photo to memory
Screenshots (openable)

Selfie at forest trail:

Скриншот 2019-05-28 05 05 24

Selfie in military bunker:

Скриншот 2019-05-28 05 07 48

Selfie in campground tent:

Скриншот 2019-05-28 05 06 38

Can't see robot and two items behind wall. Also monster is hallucination, so it is not captured in photo.

Скриншот 2019-05-28 04 40 58

Blinding all monsters in photo when aim point is nearby, but only if player is not in photo (selfie). Reason is player not using a flash when making selfie, to not blind himself.

Скриншот 2019-05-28 04 45 23

When downloading from camera to memory card, it also saves photos, which can be later viewed on e-ink, using new menu entry.
Скриншот 2019-05-28 04 49 57

Скриншот 2019-05-27 04 07 31
Скриншот 2019-05-27 04 02 45
Скриншот 2019-05-27 04 01 59

ledges:
Скриншот 2019-05-27 04 20 05

from here all photos below do not include weather, location and time of day.

interaction of field effects with various objects. Note that there is more advanced affix now, like covered in, under, on, in %s cloud, illuminated by.

Скриншот 2019-05-26 21 22 14
Скриншот 2019-05-22 04 49 02
Скриншот 2019-05-26 04 43 16

not correct focus example:

Скриншот 2019-05-26 04 33 29

npc/player statuses and field effects:

Скриншот 2019-05-26 04 32 29
Скриншот 2019-05-26 04 22 30

traps example:

Скриншот 2019-05-26 04 46 58

items with volume < 0.5 are not captured, unless they are in aim point.

Скриншот 2019-05-26 04 53 05

@egorzaderiy egorzaderiy changed the title [WIP]Photos expansion [WIP][CR]Photos expansion May 19, 2019
@ifreund ifreund added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact labels May 21, 2019
@egorzaderiy egorzaderiy changed the title [WIP][CR]Photos expansion Photos expansion May 27, 2019
@egorzaderiy
Copy link
Contributor Author

i have

enum field_id : int {}
static const std::unordered_set<field_id> covered_in_affix_ids = {};

and travis gives me error .../hashtable_policy.h:85:11: error: implicit instantiation of undefined template 'std::hash<field_id>'
But why, isn't field_id = int anyway? What to do with it, should i clearly indicate hash for set?
https://travis-ci.org/CleverRaven/Cataclysm-DDA/jobs/537982901

src/iuse.cpp Outdated
@@ -6485,22 +6498,23 @@ const auto trap_name_at = []( const tripoint &point )

std::string get_field_description_at( const tripoint &point )
{
static const std::unordered_set<field_id> covered_in_affix_ids = {
typedef std::unordered_set<field_id, std::hash<int>> Field_id_set;
static const Field_id_set covered_in_affix_ids = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is that i have found related to error: https://stackoverflow.com/a/29618545

@AMurkin
Copy link
Contributor

AMurkin commented May 29, 2019

I guess I shouldn't see contents of the closed constructions on the photos. Such as lockers, vats or kegs.

@egorzaderiy
Copy link
Contributor Author

I guess I shouldn't see contents of the closed constructions on the photos. Such as lockers, vats or kegs.

Well, you are right.

@egorzaderiy egorzaderiy mentioned this pull request May 29, 2019
@ZhilkinSerg ZhilkinSerg self-assigned this Jun 4, 2019
Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

Well this is a pretty epic PR

I've been fairly picky with my review as I haven't noticed any issues with the larger structure/goals of this PR.

@egorzaderiy
Copy link
Contributor Author

Wow, thats a lot of changes! :D Thanks for review!

@ZhilkinSerg ZhilkinSerg removed their assignment Jun 7, 2019
@ifreund
Copy link
Contributor

ifreund commented Jun 7, 2019

Wow, thats a lot of changes! :D Thanks for review!

No problem, sorry that it's taken so long for someone to get around to this PR. It is a little large after all.

Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

Bunch of little grammar fixes this time. Don't think it's possible to make the wording perfect in every case without making the code super complex, but this should be pretty good.

Aside from that I'd say this is ready to merge.

@egorzaderiy
Copy link
Contributor Author

egorzaderiy commented Jun 11, 2019

Bunch of little grammar fixes this time.

I'm not native speaker, so these suggestions are always appreciated, thanks!

Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

This looks good to me.

There may be a few rough edges on the wording in some combinations of circumstances that I haven't thought of/noticed, but nothing that should prevent merging imo.

@egorzaderiy
Copy link
Contributor Author

Oh well, since fields refactor #31310, #31311, #31362 is partially merged, it now fails to build :(

@ZhilkinSerg
Copy link
Contributor

ZhilkinSerg commented Jun 14, 2019

That's unfortunate. I will look into required changes when I have time after #31362 is merged.

@ZhilkinSerg ZhilkinSerg self-assigned this Jun 14, 2019
@egorzaderiy
Copy link
Contributor Author

@ZhilkinSerg I have renamed some method names that have been changed, but i fear after #31362 there will be a lot required changes.

src/iuse.cpp Outdated
};
static const auto format_object_pair_article = []( const std::pair<std::string, int> &pair )
{
return format_object_pair( pair, "a " );
Copy link
Contributor

Choose a reason for hiding this comment

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

String is not translated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can see only one way it can be translated properly:

return format_object_pair( pair, pgettext( "Article 'a', replace it with empty "
                               "string if it is not used in language", "a " ) );

egorzaderiy and others added 23 commits June 19, 2019 04:00
… name. Refactor long effects_description_for_creature method.
…to blinded, save all monsters in photo to memory
…earby object, for cases when no creature in photo area.
@Night-Pryanik
Copy link
Contributor

Night-Pryanik commented Jun 19, 2019

My best photo so far:

Filthy cargo pants covered in blood splatter are mentioned twice. Do we really need that?

@ZhilkinSerg ZhilkinSerg merged commit 0c5171c into CleverRaven:master Jun 19, 2019
@ZhilkinSerg ZhilkinSerg removed their assignment Jun 19, 2019
@egorzaderiy
Copy link
Contributor Author

@Night-Pryanik its not mentioned twice, its cargo pants and cargo shorts

@Night-Pryanik
Copy link
Contributor

@egorzaderiy it's cargo pants.
изображение

@egorzaderiy
Copy link
Contributor Author

well, yes, it shows description of item at the aim point. If player have chosen it as main focus of photo, then it is significant, thats why i decided to put in more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants