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

Multiple Villager Selection #8

Open
InternetNutzer opened this issue Jul 17, 2022 · 5 comments
Open

Multiple Villager Selection #8

InternetNutzer opened this issue Jul 17, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@InternetNutzer
Copy link

It would be a pretty nice feature to be able to select multiple Villager for swapping,
due to the limiting factor of the villager accepting the profession.

I imagine it to be possible to get ~5 Villagers into a hole,
one lectern being swapped and the cooldown to be lowered because of it.

I love the mod, amazing work.

@maxsupermanhd
Copy link
Owner

I thought about this but unfortunately codebase was designed around concept "let's at least make it work first" so making it track multiple villagers and swap multiple stations will not be trivial.

Rambling aside, one major problem that I have no idea how to solve is to select undefined amount of fillagers/blocks, how would you input it? Right now there is constant 1 blocks selection and 1 villager selection and it is easy and intuitive, no idea how to make people select multiple blocks aside of making a coordinate list in gui.

Second major problem is having n stations freely assignable to villagers, with 2 I can imagine one being on the left and one on the right, that would work but 5 and in one hole is probably impossible because one station can be assigned to only one villager. Perhaps it is down to how cooldown is implemented by server...

Good feature? Yes
Can be implemented? Maybe
Will I implement it? Probably not
Will I merge a pull request that implements it? Probably yes

@InternetNutzer
Copy link
Author

InternetNutzer commented Jul 17, 2022

I noticed the problem, after trying to look for suitable solutions...

None of the ideas feel intuitive or suitable for the job.

The idea was to use one lectern and multiple Villagers, to reduce the time spent on the Villager pathfinding to the lectern: https://legende.cc/ss/e8dc140be2.png

An idea to implement this would be to scan a 2-block area for the villagers in use, check which one got the profession, and perform the regular interactions from there.

A small bug that I noticed is, that the villager sometimes doesn't get the job, and doesn't get it from the lectern at all.
This probably happens due to server settings (I am on Purpur (a Paper fork) - 1.19).

A way to fix that would be to add a cooldown in which the Villager could get the Profession.
-> If the Villager didn't get it in let's say 30 seconds, replace the lectern.

I don't quite know how to implement those ideas correctly since I haven't worked with OOP Java - Minecraft yet.

Would appreciate it, if you would add any of those ideas anyways - have a nice day.

@maxsupermanhd
Copy link
Owner

I am playing on a Paper forked server too, there is a configuration that decreases AI ticking if villager in a confined space (1x2x1), try making some room for them (like 3x2x1) and it may help with the process. Entities that are stuck are usually not worth processing so it kinda applies here (even if they are super close to players)...

With even modified server and bunch of AI optimizations I can get consistent 1 - 1.5 rolls per second and it satisfies my needs at least for now. Try lowering cost requirement (by increasing minimum cost) if you can not get what you need for a long time.

@getkirill
Copy link
Contributor

getkirill commented Sep 6, 2022

Rambling aside, one major problem that I have no idea how to solve is to select undefined amount of fillagers/blocks, how would you input it?

Maybe you could sneak to confirm amount after repeatedly selecting villagers and stations?

@maxsupermanhd
Copy link
Owner

Well, one way of doing it can be a sign marker with specified text or specified block or something like that, perhaps down to specific coordinates. I recently seen on one of streams of someone that people making rolling stations in all 4 directions from the player character, I can see how this issue actually triggers people now.

Major problem is that capturing user input and making it a smooth experience is a funny experience. Right now, as I said, everything is centered around one villager because it is easy to implement, if you dig into how rolling exactly works in the addon you will understand why I am so "negative" about it.

There are particular tasks that had to be completed/implemented: selection (you shift or sign or literally enter coordinate boxes), keeping (all positions have to be stored somewhere and be easily accessible), rolling (will had to be made instanced).
Right now whole roller is basically a state machine that literally waits for a packet/input and switches state based on environment, this will had to be either instantiated or changed onto dynamic tasks "per villager stage".

Sneaking approach is one of the best one so far.

@maxsupermanhd maxsupermanhd changed the title Feature Request: Multiple Villager Selection Multiple Villager Selection Aug 26, 2023
@maxsupermanhd maxsupermanhd added the enhancement New feature or request label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants