Graphical clock for ToME 1.0.1

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#16 Post by nate »

Row wrote:I think it should be just above the icons, and bigger than those. As big as a picture in this thread is good. Or, the size of standard square (such as the PC icon, or a skill icon)
On click, it should behave as it does in the Minimalist UI. It can as well do nothing (just display tooltip on mouse over)
So far there isn't any addon using the unused area above the bottom left mini-icons, so I wouldn't bother. And I think fixed size is fine, there will always be enough room.
It always seems easier to me to decide on an ambitious final goal and plan baby steps toward it, than to expand things built on humble goals.
Okay, I'll maybe get a version of it running for Classic soon. Maybe not the ideal version, but the Classic players can always give me more feedback.
jotwebe wrote:I realize this isn't classic, but here's where I like to put it:
Didn't I put default placement there? If not, it was one of the places I considered. Now I'll have to delete my settings and find out where defaults are :)
I really like the white circle idea by the way. And while doing something similar for the mouse-overed enemy is problematic due to differing speeds, how about:
Heh, that white circle was mostly just because I didn't want somebody to mouseover a target at the wrong time and decide mouseover didn't work :)

I'm concerned about making it more confusing. Different behavior based on distance to mouseover target would probably do that. v1 actually showed more info than v2, but I decided that it was too confusing. You can probably still download v1.01 to see what that was like.

Still, I might make a verbose version (v1.0.0 showed a full clock for you and your mouseover target), with configuration options from the main game menu. It sounds like the info you're after is, "how many actions of type x can the target take during one of my actions?" Is that accurate? Because the marker for time of action doesn't show you how long the enemy takes to act, just when they're going to act. I want to approach that problem in as general a way as possible. Not just for most players, but for future compatibility (new classes, new modules, other addons, etc).

What if I just allowed full display of mouseover target speeds with a configuration option? It would display your clock, make a small offset (ten pixels maybe, scaled to your scale, not much) and then draw a clock for the target on top of your clock. (No extra clock texture, of course.) That way, you'd see the target's move speed the way you see your own, and you could probably just eyeball it: "Well, the wolf's move arc looks less than half as long as my move arc, so I guess I'd best stand and fight." There'd still be some surprises when stuns expired during your action, or similar things happened. Would that give you the kind of information you wanted?
jenx wrote:SyWhat about also adding dynamically symbols or colouring to talent icons, to indicate those that take less than full turn?
I haven't paid much attention to talent cooldowns. Are they cooling down on turn rollover, or relative to when they were triggered? If the latter, I'll certainly add that to the to-do list. (I probably won't alter the icons themselves-- my plan for effects was to add a mouseover marker to indicate cooldown tick, same as I've got for moused over mobs. That's primarily for ease of coding, and keeping everything nicely modular, nicely constrained to one obvious thing the add-on is affecting, but also I'm a little worried about out-of-control growth of the procedural graphics I use in this add-on. In hindsight-- after discovering that there is, indeed, a glRotate()-- those aren't even necessary, but I probably won't ever get around to making the graphics work The Right Way. Even done the right way, we're talking about a lot of trigonometry. I haven't noticed it affect performance on my computer, but it is something I keep in the back of my mind. edit before posting: which made me go read about Lua trig, and it doesn't sound any more expensive than C trig. So my only excuse is laziness :) )
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: Graphical clock for ToME 1.0.0

#17 Post by Noel »

Really nice addon - the display is pretty intuitive, once it's used a bit.

Ran into a bug, though. I was playing a Berserker, and ran into a rare white ooze that rushed and dazed me. When I cleared the daze with a wild infusion, and then tried to Stunning Blow it, the screen went black, and I got this repeating error in the log.

Code: Select all

[LOG]	Baka is dazed!
[LOG]	
[LOG]	#UID:1455:0#Baka hits Lisylaith the white ooze for #DARK_GREEN#16 blight#LAST#, #DARK_GREEN#16 blight#LAST# damage (total 30.26).
[LOG]	#UID:1455:0#Baka hits king cobra for #DARK_GREEN#16 blight#LAST# damage.
[LOG]	#{bold}##UID:1455:0#Baka killed king cobra!#{normal}#
[LOG]	#UID:29296:0#Lisylaith the white ooze hits Baka for #LIGHT_GREEN#2 nature#LAST#, #aaaaaa#4 physical#LAST#, #aaaaaa#2 physical#LAST# damage (total 6.77).
[LOG]	#UID:29124:0#King cobra hits Baka for #aaaaaa#4 physical#LAST# damage.
Loading tile	effects/dazed.png
[LOG]	Baka uses Infusion: Wild.
[LOG]	Baka is not dazed anymore.
[LOG]	Baka is cured!
[LOG]	Baka lessens the pain.
[LOG]	Baka uses Wrath of the Woods.
[LOG]	Baka radiates power.
[LOG]	Baka uses Stunning Blow.
Lua Error: /mod/addons/chrono/superload/mod/natelib/natelib.lua:211: bad argument #1 to 'max' (number expected, got nil)
	At [C]:-1 
	At [C]:-1 max
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:211 getCombatSpeed
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:218 getSpeeds
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:330 drawChronoArcs
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:102 displayChrono
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:57 display
	At /mod/class/Game.lua:1208 
Lua Error: /mod/addons/chrono/superload/mod/natelib/natelib.lua:211: bad argument #1 to 'max' (number expected, got nil)
	At [C]:-1 
	At [C]:-1 max
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:211 getCombatSpeed
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:218 getSpeeds
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:330 drawChronoArcs
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:102 displayChrono
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:57 display
	At /mod/class/Game.lua:1208 

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#18 Post by nate »

Thanks for the report, after checking the code, I'm mildly surprised that didn't happen earlier. Natelib line 211 needs to read

Code: Select all

slowest = math.max(offhand[i].physspeed or 1, slowest)
And I suppose I need to double check offhand weapon computation, maybe dig up a fast offhand and make sure it's registering.

I'll do some coding tomorrow and do my best to get a fix up, with as many new features as I can do in that time.
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

rexorcorum
Graphical God
Posts: 482
Joined: Wed Jan 05, 2011 8:05 am
Location: There and Back again

Re: Graphical clock for ToME 1.0.0

#19 Post by rexorcorum »

Ran into the same lua error as Noel:
Noel wrote:

Code: Select all

[LOG]
Lua Error: /mod/addons/chrono/superload/mod/natelib/natelib.lua:211: bad argument #1 to 'max' (number expected, got nil)
	At [C]:-1 
	At [C]:-1 max
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:211 getCombatSpeed
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:218 getSpeeds
	At /mod/addons/chrono/superload/mod/natelib/natelib.lua:330 drawChronoArcs
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:102 displayChrono
	At /mod/addons/chrono/superload/mod/class/uiset/Minimalist.lua:57 display
	At /mod/class/Game.lua:1208 
I was playing a reaver and was trying to equip an artefact whip offhand, which resulted in a loop of the above :). Cheers and hope this is also helpful.
~ [ RexOrcorum, a.k.a "rexo": Official Visual Magus, Addon Beautifier, Achiever, Knight of the 561 Trees, Dark Interfacer ] ~
darkgod wrote:~ [ DarkGod whips rexorcorum with Suslik (& many others as well) ] ~

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: Graphical clock for ToME 1.0.0

#20 Post by jotwebe »

nate wrote:Still, I might make a verbose version (v1.0.0 showed a full clock for you and your mouseover target), with configuration options from the main game menu. It sounds like the info you're after is, "how many actions of type x can the target take during one of my actions?" Is that accurate?
It's less "how many actions" as specifically "one or two actions" I'm interested in. The only case where more than that would be relevant is with enemy movement infusions and such and I'm happy to say "a whole lot of actions" in those cases and leave it at that.
nate wrote:Because the marker for time of action doesn't show you how long the enemy takes to act, just when they're going to act. I want to approach that problem in as general a way as possible. Not just for most players, but for future compatibility (new classes, new modules, other addons, etc).
Exactly. The general approach is why I came up with the method I proposed: in the situation where a mob is at a distance, what you want to know most of the time is whether they'll be able to reach and have enough energy for melee after you take an action. Since the result may vary depending on the type of action the player takes, I suggested the one I think is used most generally in that situation - movement.

Similarly for the case where the mob is in melee range. Except there I think it's a melee attack which is the most useful standard.
nate wrote: What if I just allowed full display of mouseover target speeds with a configuration option? It would display your clock, make a small offset (ten pixels maybe, scaled to your scale, not much) and then draw a clock for the target on top of your clock. (No extra clock texture, of course.) That way, you'd see the target's move speed the way you see your own, and you could probably just eyeball it: "Well, the wolf's move arc looks less than half as long as my move arc, so I guess I'd best stand and fight." There'd still be some surprises when stuns expired during your action, or similar things happened. Would that give you the kind of information you wanted?
Hmm... One reason I liked the white circle was that I had several occasions where eyeballing the current marker failed - I thought it looked like I'd get an extra attack, but didn't actually. Then I figured out the circle thing and was enlightened.

So this would run into the same problem: In cases where it's close, it's difficult to see sometimes. And it's the nature of the beast that "extra" attacks/moves deriving from a global speed advantage will more often than not be close things.

Still, it would be an improvement to an already good thing, and it might work better in practice (and with practice :D ) than I think, so I'd be happy with that. I'm pretty happy with the current state!

I still think "mob is/is not adjacent" is a pretty good heuristic on whether you'd want to see movement or melee speed, and that would work with only showing the arcs as well. Colors should keep it clear which is which.

tl;dr: Bad at eyeballing, want rings! But eyeballing better than nothing. Movement at range, melee up close.
Ghoul never existed, this never happened!

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Graphical clock for ToME 1.0.0

#21 Post by jenx »

Are they cooling down on turn rollover, or relative to when they were triggered?
I think the latter, because they can vary.Certain talents adjust talent cooldown rates by a percentage. It wouldn't make sense if they clocked over at turn rollover.
MADNESS rocks

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: Graphical clock for ToME 1.0.0

#22 Post by jotwebe »

jenx wrote:
Are they cooling down on turn rollover, or relative to when they were triggered?
I think the latter, because they can vary.Certain talents adjust talent cooldown rates by a percentage. It wouldn't make sense if they clocked over at turn rollover.
Pretty sure those get rounded down. So if you've got a 10% cooldown reduction, you're only going to see an effect at cooldowns of 10 or more.

Since cooldowns don't get faster with more global speed, I'm pretty sure they do cooldown on rollover.
Ghoul never existed, this never happened!

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Graphical clock for ToME 1.0.0

#23 Post by jenx »

jotwebe wrote:
jenx wrote:
Are they cooling down on turn rollover, or relative to when they were triggered?
I think the latter, because they can vary.Certain talents adjust talent cooldown rates by a percentage. It wouldn't make sense if they clocked over at turn rollover.
Pretty sure those get rounded down. So if you've got a 10% cooldown reduction, you're only going to see an effect at cooldowns of 10 or more.

Since cooldowns don't get faster with more global speed, I'm pretty sure they do cooldown on rollover.
What about the brawler type talent that reduces cooldowns, so much so that eventually an entire turn is reduced from cd?
MADNESS rocks

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#24 Post by nate »

v2.1 is now up.

-- v2.1:
-- Fixed bug causing Lua error when wielding a weapon without a proper physspeed.
-- Classic UI is now supported.
-- Verbose mode is, umm, begun. Change chronometer modes by choosing "Chronometer" from main menu (hey, you can even turn it off now, could there be any functionality more useless?)
-- The action bar for mousedover entities has been shifted back a bit, hopefully making it more clear when they will act (before you, when acting at the same tick).

Notes:
Thanks for the bug reports, this should fix the problem. Tested with offhand weapons, and it's working perfectly (actually used it to figure out that the character sheet doesn't show attack speed properly when wielding a slower off-hand weapon).
Would love to hear feedback from any Classic UI users. Not sure if that's a good size, placement, etc. There are the untested beginnings of code to play nice with other widgets, so you could hopefully one day expect that they'd all share some space down there at the bottom.
Tested talent cooldowns a bit, and what I saw was that they were cooling down at the rollover. There may be exceptions to this, and I'd love to hear about them.
Verbose mode isn't what I yet want it to be, but you can play with it if you want. Chronometer mode is saved between sessions, and the saved info doesn't get read by plain ToME.
Some significant rewrites, and rather than making sure everything is perfect, I'm releasing. Because I'm tired, and because there was an important bug to fix. So watch out for new bugs.
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

stinkstink
Spiderkin
Posts: 543
Joined: Sat Feb 11, 2012 1:12 am

Re: Graphical clock for ToME 1.0.0

#25 Post by stinkstink »

Online validation is broken with the update.

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#26 Post by nate »

I don't know what's going on. I'm seeing the same thing, but the MD5 code is correct (double checked, re-entered from a fresh download). Anybody?
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#27 Post by nate »

v2.2 is up. The add-on page has changed-- I had to delete the old one to get validation working, but validation is now working (woot).

Here's the new page: http://te4.org/games/addons/tome/chronometer

What's new in v2.2:
--Verbose mode is now cool, check it out.
--Added jotwebe mode, which works just like jotwebe asked it to.

Issues:
--Classic+verbose freaks out for a second the first time you mouseover a mob. After that, you're fine.

Todo:
--Nothing.

Notes:
-- I did extensive code diving and testing, and it turns out I must have been smoking crack earlier: I consistently saw effects cooling down at the turn rollover, and I saw code that said that's how they're supposed to act. So no mouse-over for effects is in the works.
--I have yet to see any errors in the mod's computation of speeds, and earlier errors I saw were in the context of editing player speeds via Lua console, which gave me other wierd bugs as well which shouldn't have anything to do with my add-on-- so I'm removing this from the buglist. If you see disagreement between Chronometer and reality, without a good reason, please let me know, I can add error-reporting code.
-- Jotwebe mode is going to be in a state of quasi-support for a while. I'm wary of including this mode, but it's easy to implement, and so I decided to see if this was how people wanted to use the mod. If you like jotwebe mode, there are a few things you can do to get it to stay more than a few versions, one or more of the following:
a) Test it, and report bugs
b) Run code that I supply if you run into bugs (I won't upload new versions for jotwebe mode bug fixes)
c) Send me a save without cheats enabled where the conditions jotwebe describes are valid-- it never happens for me without cheating, and I don't trust the game when cheating
d) Come up with a concise synopsis of how jotwebe mode works
e) Come up with a name for jotwebe mode
f) Just say that that's how you prefer to run the add-on
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: Graphical clock for ToME 1.0.0

#28 Post by jotwebe »

nate wrote:-- Jotwebe mode is going to be in a state of quasi-support for a while. I'm wary of including this mode, but it's easy to implement, and so I decided to see if this was how people wanted to use the mod. If you like jotwebe mode, there are a few things you can do to get it to stay more than a few versions, one or more of the following:
a) Test it, and report bugs
b) Run code that I supply if you run into bugs (I won't upload new versions for jotwebe mode bug fixes)
c) Send me a save without cheats enabled where the conditions jotwebe describes are valid-- it never happens for me without cheating, and I don't trust the game when cheating
d) Come up with a concise synopsis of how jotwebe mode works
e) Come up with a name for jotwebe mode
f) Just say that that's how you prefer to run the add-on
I'm very grateful for you to including this despite your reservations. And I'll have to see if it works out in practice as I envisioned it - quite possibly I'll find it overcomplicated, as you suspect!
Ghoul never existed, this never happened!

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: Graphical clock for ToME 1.0.0

#29 Post by nate »

It wasn't really any work to include that-- it was like 7 lines, and they may just be the only 7 lines that worked the first time I wrote them. And I offload the in-depth testing onto you :)

It's not that I'm concerned that you'll find it overcomplicated-- I was just concerned that other people would get confused. The less explanation necessary, the better the interface. Since I've got the mode-selection thing going, with which people probably won't bother, it's less of an issue.
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

Row
Higher
Posts: 54
Joined: Mon Aug 20, 2012 10:57 am

Re: Graphical clock for ToME 1.0.0

#30 Post by Row »

I think the Chronometer causes the game to load very long, making it basically unplayable. I also had a freeze - had to close the game from Task Manager. This never happened before without the Chronometer. Also after I loaded the crashed char, I couln't enter stores in Last Hope. Finally I just deleted the char. And again, it takes AGES to load a char or start new game with the Chronometer addon.

Post Reply