View Full Version : Combat Tracker order funkiness with equal Initiatives

April 25th, 2011, 21:21
Just wondering if anyone (Happy Easter, Source) has noticed the funkiness with the order in the Combat Tracker when you have combatants with the same Initiative values. For instance, the player CTs often show the combatants with equal INITs in a different order than the CK's CT does, and at least once I closed the CT during combat, and when I reopened it, it had reordered a couple of combatants with equal INITs.

I know you're busy, Sorce - I only mention it to 1) see if you or anyone else has any insights on the situation (as you so often do), and 2) to put it on your radar (if it wasn't already) in case it is an issue and you're mucking about in there at some point. It works ok and I'm less complaining than trying to be thorough about noting issues when I find them (especially one like this that isn't critical as far as I can tell) rather than just not say anything.

If it's getting annoying, just let me know, bud. As always, feel free to ignore/implement/light on fire and stomp on it/etc.

Moon Wizard
April 25th, 2011, 23:58
In initiative ordering, each windowlist can specify the ordering of windows using a defined sort function. If two windows have the same "sort" fingerprint, then the order is essentially undefined. If the order is undefined, then the windows can be in any order, and can vary between host/client and between different views of the same list data.

In my development version, I added a final check to each list sort function to use the database node name as the final arbiter of sorting.


April 26th, 2011, 01:41
Thanks Moon. For C&C, as far as usability is concerned, in the perfect world, I'd love the sort to be based on
1) Initiative
2) Reach
3) Dexterity if possible (monsters don't list Dex)
4) Movement rate (the combatant with the higher movement rate goes first)
5) Anything else that substantively indicates that one combatant deserves to go before the other.
6) Node Name (is that unique, even with combatants with the same name?)

Moon Wizard
April 26th, 2011, 06:49
Database node names are unique.

April 26th, 2011, 16:20
I have to admit that I have never noticed this before.

As of this moment a sort is applied based on initiative value, and then if those values are the same then the windows are sorted in name order. if two windows(NPC's) have the same init AND name then the order is not set and can change between sorts (and between host and client) as MW points out.

I suppose the reason I have never noted this before is simple. All of my monsters have unique name identifiers.

under options\combat you can select "Auto NPC Numbering", "Append"

this will append a number to all duplicate entries so that you have ORC 1 and ORC 2 rather than just plain orc. This means that if the init is the same they will have a fixed order based on name and it makes it earlier to identify which ORC players are attacking.

I will certainly take on board MW's suggesting of adding a final "node name" sort in order to set order - this would be useful to those who do not like the Append option (it does take a bit of the atmosphere away).

Note: if you already have creatures in the CT and then select append this will not append to the names unless you drop an extra creature of the same type in - then all creatures of that type will be appended. Obviously if the option is selected before loading the CT there will be no problems.

Note 2: When I say order will be fixed. I mean it will have a fixed position in the order - the position however might not be in "true" numerical order. - one of the FG quirks is that it orders 1,10, 11, 2, 3, 4 as it is sorting the names as a string and not as a number. (you might have seen this if you have tried to order your story entries based on a number order)

April 26th, 2011, 17:51
Actually I use the automatic unique number appending feature, too, but I still get names out of sequence with matching INITs. If it matters, I normally leave the characters in the CT and swap monsters in and out for battles.

I agree that the number appending option does take some of the atmosphere away, but I find it a lot more convenient to be able to reference monsters uniquely verbally or through chat. In modules, I've been uniquely identifying some monsters with a randomly generated name, so instead of "Zombie Sailor 3" I have "Zombie Sailor - Eraich"... which is a bit more atmospheric, but tend to result in longer names, and probably won't always be appropriate.

BTW, I don't suppose that the "-" character could be the culprit, or something else about the above naming scheme?

April 26th, 2011, 18:13
No I think if it was truly ordering by name it should not matter (like the numbers it might not put it in the order you'd expect, but it should be consistent). No there seems to be something a bit odd with this.

when you close the CT (and the players also close theirs) and reopen and see some reordering. Does this order then stay constant?

If so the ordering might not be updating properly.

I will have a look and see if something is wrong with the code.

anyway its now on the list.

April 26th, 2011, 18:30
Hey bud. Yeah, I did observe that closing/reopening the CT caused the list to reorder, at least on the DM's side. I had just had a zombie attack a PC, then the PC was next and attacked the zombie back. For some reason I decided to close & reopen the CT, then I clicked the 'next combatant' button and I got the same zombie again who had just hit the PC... at which point I noticed that they had the same INITs and their order had been reversed.

Without closing /reopening the CT, I have seen several times where the player's CT had combatants with equal INITs in a different order, causing the current combatant indicator flag to seem to skip somebody, then return to the skipped guy.

April 26th, 2011, 19:00
I will have to look into it a little deeper.

but it does raise a question into my mind (whats left of it)

How do you handle simultaneous actions?

I mean if they have the same Init then the CT puts them into an order of sorts - but in reality all those combatants should act simultaneously.

who do you handle that? Ask for player actions first and the state NPC actions and then make rolls or what?

April 26th, 2011, 19:27
Yeah, it's a bit sticky. C&C only has a d10 for INIT, so it pretty much guarantees that you'll have duplicate INITs almost every round if you have a handful of characters & monsters. I also add the player's DEX bonus, which works well on a d20 but is a little too drastic on a d10.

My preference for handling it is listed above. As per the C&C rules, I'd give the initiative to the combatant with the longest reach, but since the CT doesn't know who's fighting who, that's probably not possible. I'd compare DEX values too, but that's probably not easy to do in the CT.

Basically, I don't know how to resolve this in an automated fashion in the CT. I guess I'd just say that if there was a way to more easily visually indicate that a group of combatants share an INIT (like grouping them somehow or color coding or something) then at least the CK would have a heads up that there is something to manually adjudicate as opposed to relying on the CT's automatic order.

Sorry that's not much help.

April 26th, 2011, 19:50
it might not help much, but it confirms that I am not the only one fumbling around in the dark.

as I recall 1st Edition had a D6 for initiative, so that was even worse.
of course in those days I did "group initiative" - a us and them scenario as to whether all the PC's acted before all the NPC's or not. With PC's acting in "Party order".

of course it would be possible to add an option to select which die people wanted to use for initiative, not too difficult just time consuming.

or for the more adventurous I believe there are 3 (I think) math.random(10) entries somewhere in the combattracker.lua which you could change to math.random(20) to make the Roll all/roll all NPC values simulate d20 rolling (the actual init field drag/double click d10 roll uses another mechanism but is also relatively simple to alter if you want to.

The CKG gives init bonuses for dex only starting at 20 (+1) with a further +1 for every 2 points thereafter. I was going to add that to the character sheet init field as an auto calculation (it would then carry over to the CT)

There is no way to automate simultaneous stuff. I probably would decide who gets to go first based on the situation and what's best for the story at that point. but mostly I would probably let PC's have first choice as to act first or wait and then do all the NPC's based on factions - so roll all orcs and then all townspeople or whatever. It's a bit harder on the computer than Face to face. (keeping players informed and engaged) but it's doable.

April 26th, 2011, 22:31

so I can report that there is a problem with the sort code. in that it doesn't sort based on name as it should (It seems the release version i.e. v2.0 has a couple of lines of code missing).

on the up side its easily fixed, so I can do that in the next patch.

The other thing I noted (and had forgotten) is that after sorting the rolled initiative value, if the values are the same it checks the init value (i.e the plus the creature has to rolled initiative - this value is carried over from the character sheet ). This means that creatures with pluses to initiative (possibly from high Dex) gain the advantage.

As I said I will correct the name sort with the next patch (not sure when that will come out...) and add M_W's suggestion of a Database Node sort as a final check (this will not be necessary if you are using Append NPC, but if you are not it will fix the windows in a definite order to stop them jumping around)

April 26th, 2011, 23:22
As always, you da man, Sorce. I'm really happy to know that there is in fact a secondary method of determining the order for equal INITs, beyond just alphabetical by name or something kinda non-sequiturish like that.

Do any of the monster's have negative or positive INITs that would play into that secondary sorting? I notice that Zombies, for instance, has "Slow" listed under the 'Special' field (and sadly for the characters, I didn't notice that they always act last every round - oops! I was just giving them a negative on their INITs).

Also, on further thought, as long as it wasn't a pain to do, if you have easy access to the combatant's reach score in the CT, I'd vote for having a 3rd level sort based on that. Even if creatures aren't fighting each other, I think sorting on reach is at least more potentially relevant than node name, which is basically arbitrary, I believe. But only if it's not a big deal to do.

As for adding an option for INIT die type, I'd personally prioritize that lower on the list. Additional options are always welcome & I'd definitely use this one, but I can very much live with the current implementation. Again, having an inkling of the potential updates on your plate, I'd cast my vote for your time being spent on more core issues. Just my 2 cents. After I win the lottery and hire you as a full time ruleset developer (which I suppose could be viewed as heaven or hell), then we'll hash out more of the details ;)