Tree quality display implementation question

Forum for alternative clients, mods & discussions on the same.

Tree quality display implementation question

Postby twincannon » Fri Mar 15, 2019 8:50 pm

Out of boredom and being tired of mass-inspecting my trees (and being too lazy to write down the information), I was poking around the client code to see how possible it'd be to implement something like "on inspect tree: display persistent quality text sprite over tree"

I looked up how Amber does the growth stage display and that's pretty straightforward, but immediately hit a wall since it doesn't look like the client really handles the "Inspect" command at all - probably just sends it to the server and prints back whatever the server returns.

One idea I had in lieu of that is if we can parse the system log, and if a line displays the "Quality:" text, then check if the client clicked on a tree within the last X milliseconds or whatever, then presume that tree was just inspected and tag it accordingly.

Beyond that, I'm guessing actually making the tags persist across sessions would be a fairly involved ordeal, I'm not sure if objects have unique IDs that persist across sessions or such, but yeah. Maybe store a list of tags and the tile location of them and/or tree type, and clear the tag if tree type doesn't match or tile doesn't have a tree on it (though of course trees don't exist solely in a single tile - but yeah - getting ahead of myself here)

And thinking in a larger scope, this could probably just be expanded to store anything that reports quality so you can know at a glance what the Q of your kilns, ovens, etc is.
twincannon
 
Posts: 83
Joined: Wed Feb 15, 2012 8:33 pm

Re: Tree quality display implementation question

Postby Ysh » Fri Mar 15, 2019 8:59 pm

twincannon wrote:Out of boredom and being tired of mass-inspecting my trees (and being too lazy to write down the information), I was poking around the client code to see how possible it'd be to implement something like "on inspect tree: display persistent quality text sprite over tree"

I looked up how Amber does the growth stage display and that's pretty straightforward, but immediately hit a wall since it doesn't look like the client really handles the "Inspect" command at all - probably just sends it to the server and prints back whatever the server returns.

One idea I had in lieu of that is if we can parse the system log, and if a line displays the "Quality:" text, then check if the client clicked on a tree within the last X milliseconds or whatever, then presume that tree was just inspected and tag it accordingly.

Beyond that, I'm guessing actually making the tags persist across sessions would be a fairly involved ordeal, I'm not sure if objects have unique IDs that persist across sessions or such, but yeah. Maybe store a list of tags and the tile location of them and/or tree type, and clear the tag if tree type doesn't match or tile doesn't have a tree on it (though of course trees don't exist solely in a single tile - but yeah - getting ahead of myself here)

And thinking in a larger scope, this could probably just be expanded to store anything that reports quality so you can know at a glance what the Q of your kilns, ovens, etc is.

I think you will need to store your own database of object type and position. Object id is not persistance across map being unloaded and loaded (by server) I think. Position in client is also based on log in position, so you will need to translate these coordinates to absolute coordinates yourself as well. I think you can do this using minimap tile id, which is consistent across sessions and users (this is how world map ingame and e.g. odditown map is working).

Having these numbers last just for current session is probably not hard, since object id is maybe good enough here. Otherwise this seem to me like lots of work for simple quality of live feature like this.
Kaios wrote:Spice Girls are integral to understanding Ysh's thought process when communicating, duly noted.

I have become victory of very nice Jordan Coles Contest! Enjoy my winning submit here if it pleasures you.
User avatar
Ysh
 
Posts: 5953
Joined: Sun Jan 31, 2010 4:43 am
Location: Chatting some friends on forum

Re: Tree quality display implementation question

Postby Granger » Sat Mar 16, 2019 8:30 am

I agree with Ysh on most, but
Ysh wrote:Having these numbers last just for current session is probably not hard, since object id is maybe good enough here. Otherwise this seem to me like lots of work for simple quality of live feature like this.

as it depends on how many trees you have, how they're organized (nice 'forrest' or industrial style) and if you cut them down instantly or let them be.

Anchoring the lookup on position and tree type within a map tile (if the IDs of the are really stable) looks like a good way.
⁎ Mon Mar 22, 2010 ✝ Thu Jan 23, 2020
User avatar
Granger
 
Posts: 9263
Joined: Mon Mar 22, 2010 2:00 pm


Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 12 guests