Skip to content

Conversation

@Tonguechaude
Copy link
Contributor

No description provided.

@Tonguechaude Tonguechaude force-pushed the poc-entity branch 2 times, most recently from 4a938f6 to 151be16 Compare November 3, 2025 06:29
@Tonguechaude Tonguechaude changed the title feat : enable to spawn an entity with /spawnpig Poc : entity Nov 3, 2025
@Tonguechaude Tonguechaude force-pushed the poc-entity branch 2 times, most recently from f516222 to 4a2fe09 Compare November 3, 2025 07:17
Copy link
Collaborator

@ReCore-sys ReCore-sys left a comment

Choose a reason for hiding this comment

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

Pretty solid work! Only other thing I'd request as a general thing is to not just include the entire bevy prelude with use bevy_ecs::prelude::*;, instead would you be able to just import the modules you need? You don't have to go through and do it for the entire PR, just for future reference.

@ReCore-sys
Copy link
Collaborator

So far looks good, only other thing I'd ask is that you have a look at how much indirection you got going on for the spawning process. Spawn queues, ECS entities, creating bundles, etc. Can any of these be combined to reduce confusion on the "correct" way to spawn in an entity?

@Tonguechaude Tonguechaude force-pushed the poc-entity branch 3 times, most recently from 890ae6d to ed26497 Compare November 6, 2025 18:45
@Tonguechaude
Copy link
Contributor Author

Tonguechaude commented Nov 6, 2025

actual flow to spawn a pig :

  1. /spawnpig command → request_spawn()
  2. Push to SegQueue
  3. spawn_command_processor_system pops queue
  4. Lookup player position in ECS
  5. Write SpawnEntityEvent to Bevy event system
  6. entity_spawner_system reads event
  7. Generate entity ID with AtomicI64
  8. Call EntityType::Pig.spawn()
  9. Match on EntityType enum
  10. Create PigBundle::new()
  11. commands.spawn() buffers entity creation
  12. Commands applied at end of frame

I understand your purpose but honestly I don't know how I can optimize this

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.

3 participants