Skip to content

Conversation

@MistakeNot4892
Copy link
Contributor

@MistakeNot4892 MistakeNot4892 commented Jul 28, 2024

Description of changes

  • Reworks beehive frames into a general frame type that is filled with reagents, rather than a bespoke item subtype.
  • Removes the existing beehive machinery and replaces it with /obj/structure/apiary, which is crafted directly from planks rather than using a bespoke parts item.
  • Implements /datum/extension/insect_hive and /decl/insect_species to allow for nests to go on any structure, and contain a variety of insects with a variety of products.
  • Implements bees using the above. Beehives will generate swarms, which will gather pollen (not currently modeled via reagent, just a counter) from nearby flowers, then return the pollen to the hive, where it will be used to fill a frame or create a comb.
  • Swarms will need to be smoked before harvesting frames to avoid agitating the hive and getting stung.

TODO

  • Rewrite beehive/implement apiary.
  • Implement and test frame filling/creating behavior.
  • Implement and test swarm behavior.
  • Add wasp and bee hives to dead trees.
  • Balance swarm growth and honey generation time.
  • Balance stinging.
  • Reimplement smoking.
  • Implement wasps venom and wasp stinging.

Ants and silkworms can come in another PR, this one needs to get finished.

Why and what will this PR improve

Generalizes beekeeping in a way that allows for an expansion into other species (ants and wasps) and allows hives to be placed on arbitrary structures like dead trees or old closets.

Authorship

Myself.

Changelog

🆑
add: Beekeeping has been rewritten almost entirely, please refer to the Beewrite PR on the GitHub repo for details.
/:cl:

@MistakeNot4892 MistakeNot4892 added the work in progress This PR is under development and shouldn't be merged. label Jul 28, 2024
@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 9 times, most recently from 53feb86 to 4e88808 Compare July 30, 2024 02:00
@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 2 times, most recently from 8e1e7f4 to 3a4f6ed Compare February 9, 2025 03:59
@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 4 times, most recently from 50ca772 to 81d82ae Compare February 9, 2025 07:32
@MistakeNot4892 MistakeNot4892 added the has dependencies This PR should not be merged prior to any PRs linked in body or comments. label Feb 9, 2025
@MistakeNot4892
Copy link
Contributor Author

MistakeNot4892 commented Feb 9, 2025

Depends on #4855 and #4846

@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 5 times, most recently from 4f36cba to 9bd9647 Compare February 13, 2025 22:28
@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 3 times, most recently from 0b5fbd2 to 6957289 Compare February 17, 2025 01:22
@MistakeNot4892
Copy link
Contributor Author

This is probably as good as it'll get for now. Swarm splitting would be nice to get working but this is a functional replacement for old bee mechanics.

@MistakeNot4892 MistakeNot4892 marked this pull request as ready for review September 22, 2025 11:24
@MistakeNot4892 MistakeNot4892 added ready for review This PR is ready for review and merge. and removed work in progress This PR is under development and shouldn't be merged. labels Sep 22, 2025
@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 2 times, most recently from dca8cf0 to 8fa573b Compare September 29, 2025 02:02
var/sampled = FALSE
var/datum/seed/plant
var/harvestable
var/harvestable = 0
Copy link
Member

@out-of-phaze out-of-phaze Oct 9, 2025

Choose a reason for hiding this comment

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

comment explaining that this is the number of harvests rather than a legacy bool (e.g. hasn't been changed to use FALSE instead of 0) would be nice but isnt mandatory

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'll add a comment.

/obj/structure/flora/plant/Process()
if(plant?.produces_pollen <= 0)
return PROCESS_KILL
if(pollen < 10)
Copy link
Member

Choose a reason for hiding this comment

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

not a huge fan of bare constants like this, would prefer making it a member var or a local const like var/const/max_pollen = 10 at the top of the proc. sometimes code like this gets copied around (e.g. someone wants to copy pollen behavior to their new custom type) and the original constant gets misused/misinterpreted. not mandatory though

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'll add a define alongside the other pollen constants.


/obj/structure/flora/plant/random_flower/proc/get_flower_variants()
var/static/list/flower_variants
if(isnull(flower_variants))
Copy link
Member

Choose a reason for hiding this comment

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

noting that this will only ever contain roundstart plants, but that's probably desirable even if not explicitly made clear in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'll add a comment to make it clear.

skill_link = "<td>[skill_link]</td>"

if(!user.skillset.skills_transferable)
if(!user.skillset?.skills_transferable)
Copy link
Member

Choose a reason for hiding this comment

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

no longer necessary because of #5150

@@ -0,0 +1,358 @@
/obj/effect/insect_swarm
Copy link
Member

Choose a reason for hiding this comment

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

a little curious why this is an effect and not a simple_animal. too much boilerplate you'd have to work around, i assume?parrots already do a similar species/type thing, so i figured it wouldn't be impossible, and mobs-as-effects has historically been a pain (see spiderlings for an example)

edit: oh it might be the merging? mob gc churn would be more annoying than doing the same with effects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The merging and also general health and processing behavior - I don't want you to be able to beat up a swarm with a baseball bat or inject it with a syringe like you can with mobs in general. That said, it would be nice to be able to put someone in control of a swarm of bees, and maybe swarm intensity could be handled via health or something, but... yeah.

for(var/mob/living/victim in view(7, src))
if(!victim.simulated || victim.stat || victim.current_posture?.prone)
continue
if(victim.isSynthetic())
Copy link
Member

Choose a reason for hiding this comment

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

another one for the list of 'isSynthetic uses to remove someday'. though i might as well ask: what is this meant to represent? is it "swarms won't target someone that isn't alive (because they don't exhale, aren't warm, aren't made of meat materials-wise, etc)" or "swarms can't sting someone if their stinger isn't strong enough to break the skin (e.g. if the skin is made of metal, stone, whatever)"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both, I was thinking a bee swarm wouldn't identify a machine as alive and can't sting it. The sting proc does check can_inject so this could probably be relaxed.

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 removed, not sure why it's not showing up as out of date.

/obj/effect/insect_swarm/stop_automove()
SHOULD_CALL_PARENT(FALSE)
move_target = null
//. = ..() // TODO work out why they're not automoving
Copy link
Member

Choose a reason for hiding this comment

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

noting this todo here, is it still the case?

/obj/effect/insect_swarm/start_automove(target, movement_type, datum/automove_metadata/metadata)
SHOULD_CALL_PARENT(FALSE)
move_target = target
//. = ..() // TODO work out why they're not automoving
Copy link
Member

Choose a reason for hiding this comment

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

ditto, is this TODO still current? was under the impression the PR has been ready to review for a bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is fixed, I just missed those. That actually explains why the automove isn't very snappy.

Comment on lines 352 to 353
// TODO: update icon (twitching on ground?)
// TODO: lower agitation
Copy link
Member

Choose a reason for hiding this comment

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

are these work for a future PR or for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed this one, I'll hack out some sleepy states.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

icon_state = "beepack"
material = /decl/material/solid/organic/plastic
var/full = 1
// TODO: consume reagents or charges? Unnecessary complexity?
Copy link
Member

Choose a reason for hiding this comment

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

There are many options for beehive smoker fuel including cotton, bailing twine, pine needles, and wood chips. For best results, use fuel that produces cool, white smoke and avoid harsh smoke that can irritate bees.

seems pretty simple irl, just any flammable waste matter. i think the only thing that wouldnt work is lamp oil. actually it seems a useful thing irl for this is cardboard pellets/scraps which would work perfectly on a space map, probably?

Copy link
Contributor Author

@MistakeNot4892 MistakeNot4892 Oct 12, 2025

Choose a reason for hiding this comment

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

I guess I could use that general proc for burning materials and returning waste products, and make the smoker a container that can hold a stack. My concern is mostly that it will mean anyone who wants to do beekeeping now needs to source smoker fuel.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but 'cardboard cubes/pellets/etc comes in the beekeeping kit in cargo' would be an okay solution to that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had a poke but I think I want to call this out of scope. We don't have a pellets stack and I don't really want to add one, add recipes, etc. As well as redoing the smoker to handle refuelling and such.

@out-of-phaze out-of-phaze added awaiting author This PR is awaiting action from the author before it can be merged. and removed ready for review This PR is ready for review and merge. labels Oct 12, 2025
@MistakeNot4892 MistakeNot4892 added the work in progress This PR is under development and shouldn't be merged. label Oct 12, 2025
@out-of-phaze out-of-phaze removed the awaiting author This PR is awaiting action from the author before it can be merged. label Oct 13, 2025
@MistakeNot4892
Copy link
Contributor Author

MistakeNot4892 commented Oct 18, 2025

  • Automove is not working.
  • Pollen generation is wrong, it's adding 0.000003 per SSplants run instead of 0.2. I thought it generating 12 per run was an error but nope SSplants is just on a massive wait.

@MistakeNot4892 MistakeNot4892 force-pushed the feature/beewrite branch 2 times, most recently from b17230d to d6027b2 Compare October 19, 2025 02:54
default_pixel_z = 8
layer = ABOVE_HUMAN_LAYER
pass_flags = PASS_FLAG_TABLE
movement_handlers = list(/datum/movement_handler/delay/insect_swarm)
Copy link
Member

Choose a reason for hiding this comment

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

/datum/movement_handler/delay/New(var/host, var/delay)
	..()
	src.delay = max(1, delay)

it's gonna get its delay set wrong bc of this inheritance, maybe /delay needs an isnull to avoid setting it if we pass null. that or just do list(/datum/movement_handler/delay = 1 SECOND)

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 did do the latter already.

Comment on lines 210 to 215
SHOULD_CALL_PARENT(FALSE)
move_target = null
. = ..()

/obj/effect/insect_swarm/can_do_automated_move(variant_move_delay)
return !is_smoked()

/obj/effect/insect_swarm/start_automove(target, movement_type, datum/automove_metadata/metadata)
SHOULD_CALL_PARENT(FALSE)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
SHOULD_CALL_PARENT(FALSE)
move_target = null
. = ..()
/obj/effect/insect_swarm/can_do_automated_move(variant_move_delay)
return !is_smoked()
/obj/effect/insect_swarm/start_automove(target, movement_type, datum/automove_metadata/metadata)
SHOULD_CALL_PARENT(FALSE)
move_target = null
. = ..()
/obj/effect/insect_swarm/can_do_automated_move(variant_move_delay)
return !is_smoked()
/obj/effect/insect_swarm/start_automove(target, movement_type, datum/automove_metadata/metadata)

anchored = TRUE
is_spawnable_type = FALSE
movement_handlers = list(/datum/movement_handler/delay/chameleon_projector)
movement_handlers = list(/datum/movement_handler/delay/chameleon_projector = list(2.5 SECONDS))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
movement_handlers = list(/datum/movement_handler/delay/chameleon_projector = list(2.5 SECONDS))
movement_handlers = list(/datum/movement_handler/delay = list(2.5 SECONDS))

subtype no longer needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Subtype needed for MayMove/DoMove.

default_pixel_z = 8
layer = ABOVE_HUMAN_LAYER
pass_flags = PASS_FLAG_TABLE
movement_handlers = list(/datum/movement_handler/delay/insect_swarm = list(1 SECOND))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
movement_handlers = list(/datum/movement_handler/delay/insect_swarm = list(1 SECOND))
movement_handlers = list(/datum/movement_handler/delay = list(1 SECOND))

subtype no longer necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Subtype is needed for DoMove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work in progress This PR is under development and shouldn't be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants