HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Selection Bug.

12-29-2007, 01:21 AM#1
Anarki
If any of you have played a roleplay map; then I'm sure you have heard of this horrible, game crippling, annoying, harassing bug. If you've experienced it in another map, then please tell me; I'd be delighted to know, as each piece of knowledge I gain is one step closer to destroying this annoying selection error.

For those who have not experienced the selection bug, then you are lucky; and I will enlighten you on what this foul beast can do.

First off, there is a genre of maps on WarCraft III called role play maps. Not RPG's, RP's - a sandbox game, where you roleplay out scenario's. This game is plagued by the selection bug - a horrible creature, which has this effect:

The selection bug will secretly select units which you are currently not selecting, and can unselect units that you are currently selecting. These units will take orders from you (unless it is not under your control), which results in random units moving half-way across the map. These units are also affected by the "Is selected" flag, which is extremely annoying when using a text-based selection-based command, which is what most RP maps are based around - selection-based commands.

These roleplay maps are conducted on epic-sized maps, with lots of preplaced destructibles and doodads, and most of the newer maps have horrible memory leak issues, inefficient triggering and an obscene amount of triggers, and a LOT of custom units. Yet, my map, which I have been working on, has much more efficient triggers, less triggers, and lots of memory leaks cleaned up, as well as less custom units - although it has the same amount of preplaced destructibles and doodads. Yet, my map is more prone to the selection bug - although the other maps still fall victim to it. It is quite irritating. The only way to fix it, is to select a gate - no one knows why, but the bug seems to go away when you select a gate... for a while.

If anyone has any insight at all on this bug, please post. I'll be conducting tests to see what seems to cause it, but I am not certain that they will be successful.

My personal hunch, is out of two things:

1. Map size. Just the massive amount of destructibles and doodads.
2. There is a trigger, which, when the Spawner is issued a smart command, it is moved instantly to the location of the command. That might be causing it.
12-29-2007, 02:09 AM#2
Zandose
Is this completely random? Can you upload your map or the other map you were refering to.
12-29-2007, 03:33 AM#3
Anarki
Well, the uploaded file is a beta engine of my map - and testers say that the 'selection bug' is much, much worse then most of the roleplay maps they have played. It uses WEU GUI triggers.

http://www.hiveworkshop.com/resources_new/maps/5889/

That's a link to another RP map which is also affected by the selection bug - but not as severely as this map. Also in WEU GUI, unprotected.

I don't think this bug occurs often when you play single player - it is when you host a game with lots of people, is when it is very noticeable. You'll find that units will not respond to your commands or orders, and that the hero half-way across the map you told to hold position is crossing an entire desert to reach you.

OT: The night elf in the NE skin is so damn cute!

EDIT: Is this the right section for this? I'd assume the problem is trigger based... a trigger which seperates RP maps from other maps... but I don't know what...
12-29-2007, 04:27 AM#4
Zandose
I started to get scared just opening the thing in WEU, its so big. Anyways, I don't want to even begin looking though the gui triggers. I suggest you start by testing every trigger one at a time, turning off everything but one trigger. I think this is a instance where vJASS is called for?

@Tide
I fully understand GUI since I started there and only changed over to vJASS a few months ago, but its crazy to read the stuff.
12-29-2007, 04:37 AM#5
Tide-Arc Ephemera
Dayum, I use GUI triggers and I'd confidently say I'm pretty good... but I use UMSWE because I use Mac... I wish I could help you.
12-29-2007, 04:42 AM#6
Earth-Fury
Your map requires WEU which is just annoying to me.

15837 lines in war3map.j ... Thats just insane. Notepad++ can't even syntax highlight half the lines! THAT is why you learn JASS for large and complex projects, and then use it.

Collapse JASS:
function GetUnitsSelectedAll takes player whichPlayer returns group
    local group g = CreateGroup()
    call SyncSelections()
    call GroupEnumUnitsSelected(g, whichPlayer, null)
    return g
endfunction

The function the GUI is using to get selected units. Considering it seems to be a network based issue, the problem would be coming from SyncSelections(). It may have to do with the frequency in which that function is called in a map as heavy on enumerating selected units as an RP map. A definitive answer as to the cause and optimal solution to this bug would need some multiplayer testing. (Or that idiot toadcop, he seems to know everything already. if you can understand his shattered English.) May wanna look at TriggerRegisterPlayerUnitEvent() with EVENT_PLAYER_UNIT_SELECTED and EVENT_PLAYER_UNIT_DESELECTED.

Collapse JASS:
// NOTE: These funcs are reserved for Blizzard maps as they
// could be used for nefarious scripting otherwise
A note in common.j above the SyncSelections() native's section. Odd. (old common.j, too lazy to build a listfile for war3patch.mpq)
12-29-2007, 05:20 AM#7
Anarki
15837 lines?!? Are you sure?

I explicitly avoided using WEU advanced triggers! I thought I deleted them!

The only thing that should take up a lot of lines are the initialization arrays, maybe two thousand, but not OVER NINE THOUSAND!

(My map is the uploaded one, not the one at the hive, that's someone else's map. I really hope you were talking about that map, and not the uploaded one...)

---

@Earth-Fury

I could barely understand that post, sorry; my knowledge of JASS is extremely limited. But from what I could gather, you're saying it's a problem with the GUI function itself?

Is there any way I could circumnavigate this, without resulting to learning JASS?

EDIT: I've figured out how to reduce the problem significantly - thank you all, anyway, for your help.

I'm still curious, however, of the cause of it.
12-29-2007, 07:15 AM#8
Tide-Arc Ephemera
Well if you post up your "significant solvent" maybe we can work backwards and find out what it is. You'd need BEFORE solving, at SOLVING and SOLVED.
12-29-2007, 07:29 AM#9
Anarki
Alright.

Basically, with most of the triggers which affect units which are selected, what I did before, was to put (Triggering Player's) selected units into a temp global unit group, and destroy it later. But all 12 players shared the unit group - so I changed it, so that my temp global unit group was a size 12 unit group array, and changed all my triggers accordingly to set (Triggering Player's) selected units to tmpUnitGroup01[Player number of (Triggering Player)].

Well, it worked - my friend hosted a public game, got a bunch of people to screw around and have mass wars, and although there was still a selection bug, the frequency it would appear at was very minimal compared to the previous test I did.
12-29-2007, 07:38 AM#10
Tide-Arc Ephemera
How was the bug showing itself? Selecting other units? Your units? What?
12-29-2007, 10:57 AM#11
Captain Griffen
SyncSelections should never be used; not unless you know EXACTLY what you are doing. You aren't a JASSer, so you don't.
12-29-2007, 11:06 AM#12
Tide-Arc Ephemera
Quick question, what the hell does it do?
12-29-2007, 11:39 AM#13
Captain Griffen
Theoretically, I'd presume it's supposed to sync selections. It never got properly made, me thinks, since Blizzard never expected us to sync stuff. You CAN sync selections, but you have to very careful how you do it, and it's an area I don't really dip into much given that it's a minefield, and syncing selections isn't something you ever really need to do. Only use I can think of is for syncing bits of information, but that's normally unnecessary.
12-29-2007, 11:49 AM#14
Tide-Arc Ephemera
It sounds like it's virtually useless... has anyone made a well known use of it?

Also... what do they mean by it could be used nefariously?
12-29-2007, 01:20 PM#15
Vexorian
Quote:
15837 lines in war3map.j ... Thats just insane
It's bellow average though...