Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Garden Water and Harvest All Rework

Forum Index > Core > Suggestions >

Citrisfur's AvatarCitrisfur
Citrisfur's Avatar
grandmaster.pnge.png
Currently it seems the garden's Water All and Harvest All functions mostly operate clientside. Correct me if I'm wrong here; when the user clicks either button, it loops through each planted berry, checks if the request is valid (plant can be watered or harvested), then sends an AJAX request to the server for each one. At a fully upgraded field, a user can send up to a potential 32 requests synchronously, meaning each request has to resolve before the next begins. If each request takes ~500 ms (about average), that's 16 seconds the user has to wait until they can play again. And that's also assuming all requests start immediately after the other, which doesn't seem to be the current case, and there aren't any further delays. Two improvement reworks I can think of: 1. Have the requests resolve asynchronously (and rate limit if needed). This means ALL berries will attempt to water/harvest at the same time. The amount of time it would take to water/harvest a full garden now would be dependent on your internet connection and the time it takes the server end to process them and return all requests. 2. My preference: have the server end process the watering/harvesting. Modify the Water All / Harverst All button to only check if at least one plant is valid, then send only one AJAX request to the server, which will then check all the user's plants and act accordingly. 2a. Alternatively, have the Water All / Harvest All buttons provide a list of plot IDs for berries that need action, and the server can act on those without needing to check the plants itself. This would drastically speed up the wait time, as the player would only have to wait for one request to complete. The time the server would take to process on its end should be negligible.
Creator of PokeFarm Pokemon IVs;
a userscript that reports your best owned Pokemon.


PM if you're interested in or are an IV breeder and you'd like to join our group!
Citrisfur's AvatarCitrisfur
Citrisfur's Avatar
grandmaster.pnge.png
Bump
Citrisfur's AvatarCitrisfur
Citrisfur's Avatar
grandmaster.pnge.png
Bump

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page