-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add Treetops #70643
Add Treetops #70643
Conversation
* update_toys.json Added the plushies!! * Update toy.json * Update data/json/items/toy.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update toy.json * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * Update data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> * YlUpdate data/json/items/toy.json Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>
* Update robofac_gun.json * Update locations_commercial.json * Update music.json
* Remove gutter alias * Readd the alias until mods are done in separate PR * Corrections * Linted * Update mall_second_floor.json * Update mall_second_floor.json * Remove NoHope mall variants They're really outdated and make minor changes and I don't fancy combing the -655 +514 line difference to update it correctly while keeping said minor changes. * Realised I can just separate NoHope palettes for now * Xedra tweak * Final check
Prevents segfault that previously happened when pouring liquid to ground from AIM using "examine" menu. Previous segfault being fixed: ``` #0 __gnu_cxx::__atomic_add_dispatch () at /usr/include/c++/13/ext/atomicity.h:111 #1 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy () at /usr/include/c++/13/bits/shared_ptr_base.h:152 #2 0x00005652b2df5540 in std::shared_ptr<item_location::impl>::shared_ptr () at /usr/include/c++/13/bits/shared_ptr.h:204 #3 item_location::item_location () at src/item_location.h:30 #4 item_location::impl::item_in_container::item_in_container () at src/item_location.cpp:612 #5 item_location::item_location () at src/item_location.cpp:767 #6 0x00005652b27fa6b1 in unload_activity_actor::unload () at src/activity_actor.cpp:3232 #7 0x00005652b32eed69 in player_activity::do_turn () at src/player_activity.cpp:383 #8 0x00005652b2b553e7 in do_turn () at src/do_turn.cpp:487 #9 0x00005652b25ea589 in main () at src/main.cpp:798 ``` The problem before was that the reference to `target` in `unload_activity_actor::unload` was an invalid reference. This was caused by: 1. `unload_activity_actor::finish` calls `act.set_to_null()`. 2. That sets the player activity to `null` type (=no current activity) 3. `unload_activity_actor::unload` is `static`, and takes `target` as a reference. 4. `::unload` calls `Character::add_or_drop_with_msg` which leads to call chain: `liquid_handler::consume_liquid` -> `get_liquid_target` -> `choose_adjacent` -> `choose_direction` -> `temp_hide_advanced_inv` -> `advanced_inventory::temp_hide` -> `advanced_inventory::do_return_entry` 5. `advanced_inventory::do_return_entry` assigns a new `ACT_ADV_INVENTORY` activity. This invalidates the previous `unload_activity_actor` because of pt 2 above. 6. When static method `unload_activity_actor::unload` resumes after its call to `add_or_drop_with_msg`, the reference to `target` is invalid because of pt 5. This commit attempt to fix the issue with invalidated `target` reference by copying its value before invalidating the activity.
When you read a map, we now keep track of what overmap tiles the map revealed to you, so that we can blink them in the map view. I’ve changed it from a vector of coordinates to an unordered_set, so that membership testing is O(1), greatly improving performance. fixes #70540
Fixes an issue where only the charges from one nearby smoking rack would be counted to the crafting inventory, even if there were other smoking racks nearby that had sufficient charges to perform a selected crafting recipe. The issue before was: 1. Part of building crafting inventory calls `inventory::form_from_map` 2. `inventory::form_from_map` has the following checks for pseudo tools from furniture: ``` const furn_t &f = m.furn( p ).obj(); if( item *furn_item = provide_pseudo_item( f.crafting_pseudo_item ) ) { const itype *ammo = f.crafting_ammo_item_type(); ``` 3. `inventory::provide_pseudo_item` returns `nullptr` if the crafting inventory already has a tool of the same type: 4. So `inventory::form_from_map` would only get a pseudo tool back in `furn_item` for the first furniture that was examined. 5. The ammo amount being calculated in `inventory::form_from_map` would therefore only be for that furniture. This commit instead changes `inventory::provide_pseudo_item` so that if a pseudo tool is provided more than once, the second call will return the pseudo tool from the first call, instead of `nullptr` as before. This makes it possible for `inventory::form_from_map` to keep adding ammo (charcoal charges) to the same pseudo smoking rack as it builds up the crafting inventory. In effect, if there are two smoking racks with charges nearby, the crafting inventory will now still contain only one pseudo tool for smoking rack, but its ammo will be the sum of all nearby smoking racks' charges.
* Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update data/json/items/book/spiritual.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update data/json/items/book/spiritual.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update spiritual.json * Update stashes.json * Update books.json * Update books.json * Update books.json * Update spiritual.json --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update character.cpp * monsters too * betterfix * Update monmove.cpp * Update character.cpp * Update monmove.cpp * fixes * blaaargh * fixes * Update src/character.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/character.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/character.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/character.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/character.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update vehicle_parts.json --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Initial (and probably final) commit * ellipsis
* Everything but Speech.json Third times the charm * Update speech.json Keeping speech.json to its own commit. Less crowded this time. * Spelling fixes Correct typos and add terms to dictionary * Update dictionary.txt One more dictionary entry * Update speech.json Add more generic sounds for wailing treefrogs * Update speech.json Adjusting overcrowded speech entries
* Npc retreat2 (#29) * Expose NPC AI consts to options I will probably need a little help with this * Restore 'regroup on player' Now it won't kick in if the NPC is already close to you * Remove unnecessary messages * Npc retreat2 (#30) * Expose NPC AI consts to options I will probably need a little help with this * Restore 'regroup on player' Now it won't kick in if the NPC is already close to you * Remove unnecessary messages * Update data/core/game_balance.json * Update modinfo.json * Update modinfo.json * delete dirty commits from my master I hate the web interface
…type.h`. Initialize them on game load.
* Initial commit * Dodgeability changes * Add effects * Effects is an array
more drops, more tools, pocket trash, custom hard hats, and other things
* fix early returns and dead code * Update character.cpp * Update character.cpp * Update character.cpp
* Line breaks to markdown * Add powers * Update nether attunement values * Spelling * Remove missed learn_spells fields * re-add learning EoC for hobby
…70239) * initial commit. Add ibuprofen/acetaminophen and introduce aspirin bleeding. * initial commit. Add ibuprofen/acetaminophen and introduce aspirin bleeding. * in-progress json effects * It works now! Cleaned up and added reasonable values. * It works now! Cleaned up and added reasonable values. * conjunction * added drugs to loot lists * added some spawns I missed * minor fixes * more infrastracture + perspiration --> respiration (lol) * woops * astyle * minor fix * Update npc.cpp sorting * Update inventory.cpp * Update character_body.cpp * Update character.h * metaprolol first draft. * made metaprolol go through stomach for 30 min delay * minor comment and astyle * updated new meds to use new vit system * forgot to add naproxen to new system * compiler and test fixes. * astyle :( * minor balancing * fix * implemented venera's suggestion to make aspirin make bleeding last longer, with the associated json infrastructure. * Very minor fixes * woops * clang tidy * fixed percentages. Thanks fungamer2-2 * also json comment fix * fixed mod decay logic. * Updated documentation. * vomiting removes digesting drugs now * vomit code deduplication * further documentation * documentation fix * forgot one pkill! * removed foreign code from PR. * Update data/json/items/comestibles/med.json Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com> * Update data/json/effects.json Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com> * Update data/json/itemgroups/Clothing_Gear/clothing.json Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com> * erk's suggestions + renamed item groups to otc painkillers * Update data/json/items/comestibles/med.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/character.cpp Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com> * Update inventory.cpp * increased pill-based pkill duration based on Erk's suggestions --------- Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Somehow you have LOTS of commits here, I suspect something went wrong with git |
It did, and I fixed it. As you can see this PR only changes 10 files and then only with relatively minor updates. |
Maybe good idea to add some new animal spawn here (squirrels, birds, maybe spiders and so on) too as well for some loot like bird nests? |
Not a bad idea, but I'm gonna call it out of scope for now. That's a big project. |
I am worried about balance concerns. This means that as long as you can climb a tree, you can practically dodge any zombie horde in a forest (due to the poor Z handling we have). Can you check to make sure this PR doesn't trivialize that part of the game? |
The only major issue I see with this is that you can use a reach weapon, just going up to "escape" doesn't do much for you bc they'll still be able to see you and just chill waiting for you to come down no? I personally feel like reach weapons shouldn't work across z-levels given the difference in height we typically associate with 1 z level compared to the distance of 1 tile across. Doing any serious damage to a zed from the roof of a bungalow with even a really long spear seems pretty difficult. Obviously you could also shoot the zed but that would aggro more stuff so I don't see that as big of a deal. |
There aren't zombie hordes in forests, and after the beginning of the game they can reach up and pull you down, or destroy your tree with you in it. And in the beginning of the game, ferals are throwing rocks at you or stabbing you with spears. The only thing it's going to get you is surrounded by zombies with no escape route. If you try to hide from them in a tree you're going to die. You can already easily climb on top of any house in town, where the zombies are, and that hasn't caused any issues even though the fact that it can block LOS and doesn't cut off escape routes is way more advantageous than a one tile tree. UNSTABLE making you fall would be fine, as would zombies stealing your spear if you're poking down below with it. Neither are in scope here. |
Also you may not be aware of this, but climbing requires a free hand and there's a roll involved. You can also fall down and injure or kill yourself doing it. Speaking as someone who makes a living playing this game (I hate to bring that up to win an argument, but it's relevant here) I don't see a balance issue here outside of the one that already exists for reach weapons. |
> you can practically dodge any zombie horde in a forest Grabber zombies had an ability to grab enemy on another z-level - it was lost when grabs were reworked, but i think we can return it as one of multiple counters to roof chill |
I think this is good enough to make climbing a balanced action that can save you in a tight spot but implies some innate risk, especially when you're scared/exhausted/overloaded/sick/whatever. |
Would some of the treetops provide shelter from the rain or sun (if albino) if standing under them, or would that be for a future PR? |
Will there be treehouses in the future? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fairyarmadillo note this has pretty much nothing to do with your code work, it is a project infrastructure block.
Heads up to mergers, I think we should probably set this as a 'branch' (hehe) point between the H-stable candidate and I-experimental. We should not be merging this into the stable candidate. Normally we'd be tagging it feature freeze but since we're going to try not to do that this time, I'm just setting this up to be blocked until we have the stable candidate.
I'll see about making a PR tag for this once I am sure I understand how that's going to work fully
It's showing that changes are requested but I don't see anything in conversations. Is there anything I need to do on my end?
I don't see why not in the future, but both of these will probably require multi-tile trees, and we're not there yet. |
It's just to ensure this PR won't be merged accidentally, this would be merged after the 0.H would be released |
No action needed, I managed to get H branch out before it was relevant |
Please note that there are still a bunch of commits listed that are not actually part of your PR. I assume this will cause some issues or side effects when it gets merged. |
I will probably need to make a new PR then. |
Continued in #70669 |
Summary
Features "Adds treetops and makes trees climbable"
Purpose of change
Our trees are big enough to block all movement through their tile, but weren't climbable.
Describe the solution
Describe alternatives you've considered
Out of scope for now, but it probably wouldn't be too hard to make trees have variable heights. Then you'd scale them with something like the WALL_CLING ability that would be available to anyone, so z+1 would be you clinging to the side of the trunk, and at z+2 you'd be on the treetop, etc.
Making it so that some types of trees aren't climbable, or are only climbable with special equipment or mutation flags would also be easy.
There are only 4 forms of treetops right now, and they're all identical except their colors. The base kind is for all deciduous trees, evergreen, dead, and mega_fern are obviously for trees fitting those descriptions. I'm assuming this will be enough for spriters. If not, it's trivial to add more types of treetops in future PRs.
Testing
Additional context