ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sat Jun 24, 2017 12:15 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Jul 14, 2016 11:27 pm 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1345
Location: A shallow water area south of Bree
It's the bane of every Alchemist that ever found Silk Current or Feathersteel Amulet or anything that increases your movement speed: waiting at the end of every long corridor for your golem to catch up to you. Thus my new Golem Speed Lock addon. It adds a fortress action (costing 20 energy) that "upgrades" your golem to increase its movement speed as necessary to equal yours. [I've never had cause to give my golem speed-boosting equipment to make it faster than me, but if you do, this upgrade won't slow the golem back down to your speed.]

[Technical notes:]
Code:
Hooks:
  Chat:load [to add our new action to the fortress butler's chat]
Superload:
  mod.class.Actor:
    combatMovementSpeed() [to adjust the speed of our upgraded golem]

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Jul 14, 2016 11:28 pm 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1345
Location: A shallow water area south of Bree
Frequently Asked Questions:

What if I get more speed-boosting equipment after I upgrade my golem?

Your upgraded golem's movement speed is computed "on the fly"; it will always be equal to the larger of either your current movement speed or its own current movement speed as it would be without the upgrade.

Hey! The upgrade is making my golem's movement speed higher than mine!

Is your global speed higher than your golem's? What this addon attempts to equalize between alchemist and golem is their "effective movement rate", which is global speed times movement speed; as a result, if the alchemist's and golem's global speeds are different, their resulting movement speeds will be correspondingly different.

For instance, suppose your global speed is 125% and your movement speed is 160%; then your effective movement rate is 200%, meaning that you are moving twice every normal-speed turn. If your golem only has 100% global speed, then to achieve the same effective movement rate, the addon will increase the golem's movement speed to 200%. Since its global speed is unchanged in this example, the golem will still be slower than you when attacking or casting a spell, so it may lag behind you in those cases.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Last edited by Zizzo on Fri Jan 27, 2017 4:39 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Jan 26, 2017 12:37 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1345
Location: A shallow water area south of Bree
[slaps forehead] Aaand I completely forgot to take global speed into account. Well, more likely I assumed that Actor:combatMovementSpeed() was already factoring in global speed (which I really should have known better than to assume, since movement speed and global speed are applied in completely different places). :oops:

Let me lay out the problem: At base speeds all around, an Actor needs 1000 energy to move and gains 100 energy per tick, and thus moves every 10 ticks. Now, let's say our example Alchemist has, for mathematical convenience, +25% movement speed (thus needing only 800 energy to move) and +60% global speed (thus gaining 160 energy per tick); combined, this means we move every 5 ticks. Our golem, by contrast, has no mods to global or movement speed except for the speed lock, which effectively gives it +25% movement speed; combined with its +0% global speed, though, that means it's only moving every 8 ticks, completely defeating the point of the addon.

Now, there are two ways we could address this problem:
  • Have the speed lock also increase the golem's global speed as needed to match the player's global speed. I can see that people might think that's too powerful.
  • Have the speed lock compute the appropriate movement speed to give the golem the same effective movement rate as the player. In our example above, for instance, we would have to increase the golem's movement speed to +100% to get it moving every 5 ticks. That could be fiddly in general, though, and could still lead to the golem lagging behind if it does something other than moving.

So. How do people here think I should fix this?

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Jan 26, 2017 1:20 am 
Offline
Sher'Tul

Joined: Sat May 15, 2010 9:17 pm
Posts: 1396
... probably the first. Don't think golems are strong enough it's going to really break anything.

Second would be more ideal from a least-impact point of view, though, definitely. Maybe do that, and then add some kind of check where if the golem isn't within a certain radius (keyed to the golem's leash distance?) of the player for more than a few turns, it teleports the golem to you? Kinda' like thought forms. Just nix the effect if enemies are visible, extend the yank-back effect timer if the golem's been controlled recently, tried to attack something, stuff like that, so the effect wouldn't be screwing with golem micromanagement. Would think that would catch most edge cases without too much extra trouble.


Top
 Profile  
 
PostPosted: Fri Jan 27, 2017 12:29 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1345
Location: A shallow water area south of Bree
Frumple wrote:
... probably the first. Don't think golems are strong enough it's going to really break anything.

Second would be more ideal from a least-impact point of view, though, definitely.

Yeah, I've just about talked myself into going with the second option. (Turns out it's actually easier, even; the first option would require me to arrange to recompute the golem's global speed every time the player's global speed changed.)

Frumple wrote:
Maybe do that, and then add some kind of check where if the golem isn't within a certain radius (keyed to the golem's leash distance?) of the player for more than a few turns, it teleports the golem to you? Kinda' like thought forms.

I dunno, the goal here isn't really to actually prevent the golem from getting too far away from the player; it's just to keep their speeds matched up, so that the golem doesn't get left behind when auto-exploring or running down a long corridor. There's always Invoke Golem for emergencies.

Frumple wrote:
Just nix the effect if enemies are visible, extend the yank-back effect timer if the golem's been controlled recently, tried to attack something, stuff like that, so the effect wouldn't be screwing with golem micromanagement. Would think that would catch most edge cases without too much extra trouble.

(scratches head) …well, I suppose from a non-coding perspective, that could be viewed as "least-impact". :? :wink:

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Fri Jan 27, 2017 1:06 am 
Offline
Sher'Tul

Joined: Sat May 15, 2010 9:17 pm
Posts: 1396
Hey, it'd just be the thought forms effect with a couple extra checks, right :lol:

Though yeah, the thought was that what it'd do is just kinda' catch the golem if it did start falling too far back during autoexplore or a long corridor. That's what all the check addendum was about, to keep the effect from replacing invoke golem or messing with distant scouting or whatev', while still keeping the golem close even if the movement speed adjustment was hiccuping occasionally. Just something to make sure the mentioned edge cases were caught in some kind of net.


Top
 Profile  
 
PostPosted: Fri Jan 27, 2017 4:36 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1345
Location: A shallow water area south of Bree
Frumple wrote:
Hey, it'd just be the thought forms effect with a couple extra checks, right :lol:

Famous last words. :mrgreen:

In the meantime, I decided to go the simple way with the second option, as seen here:
Attachment:
speed.png
speed.png [ 37.82 KiB | Viewed 227 times ]

That just went out as v1a. I also added a new Frequently Asked Question above to cover the change.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group