HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Host Detection

06-29-2007, 10:43 PM#1
Tide-Arc Ephemera
This is the tutorial that inspired me... http://www.wc3campaigns.net/showthread.php?t=86119

Anyway, The)TideHunter( made a comment about "re-rolling" the trigger so that it gets the average host.

Is there any way of repeating that trigger, getting the average etc. in GUI?

You can answer in JASS, just beware that you will have to explain almost (hopefully not literally) every line, and get bothered by me until the system gets debugged.

I REALLY need this for my map and I hope for a positive response, and thanks ahead!

The reason I need this is because there is an increasing number of Singaporeans on US West who like to play random maps, since they are from another continent, they will "lag" and then cause the system to bleed a little.
06-29-2007, 11:29 PM#2
SFilip
http://www.thehelper.net/forums/show...8&postcount=10
Links to the actual thing: http://www.thehelper.net/forums/show...76&postcount=8

Now which part do you need explained?
The original GetHost or GetHostAverage?
GetHostAverage should be quite simple to understand as it's essentially just a loop and setting some variables. Kind of works like a voting based system.
06-30-2007, 12:49 AM#3
PipeDream
The existing gethost methods don't work / aren't reliable. At all. Sorry.
06-30-2007, 03:50 AM#4
Tide-Arc Ephemera
The part I don't understand is the Average part, I don't know how to generate it. I'm unfamiliar with this system.

Other than basically analyzing the entire of the JASS for me (I am tone deaf
retarded when it comes to JASS), I'd also like to know if I need to make a new trigger.
___

Quote:
Originally Posted by PipeDream
The existing gethost methods don't work / aren't reliable. At all. Sorry.
Before I get my puny dreams crushed, I want a giant hammer to look down on them.
06-30-2007, 05:03 AM#5
Dil999
So your trying to run the trigger multiple times, and find the person who resulted in being the host the most?
06-30-2007, 08:06 AM#6
Tide-Arc Ephemera
Yeah, basically that's it, averaging it out.
07-01-2007, 03:45 AM#7
Dil999
I'll try to do this.. I just need to find time..
07-01-2007, 12:50 PM#8
The)TideHunter(
What i meant is, the GetHost function can return unexpected results.
By average, i meant you could use a loop, run it 5 times, set the host that was spit out on return for each iteration of the loop to a variable, and compare the variables and pick the one with most count, the modal value.

For example, say the GetHost function had a 1% chance to return the completly wrong player, and that 1% chance happens, then the game is screwed.
While if you run it 5 times, the 1% happens and the other 4 times it doesnt, its obviously going to be ok because your picking the one that happened 4 times.

But i have no idea what can happen on LAN or anything, you can use the function sure, but we dont really know all the problems and capabilities.
07-01-2007, 12:53 PM#9
Captain Griffen
You presume that the itinerations are independant. I doubt that.
07-01-2007, 12:57 PM#10
The)TideHunter(
Quote:
Originally Posted by Captain Griffen
You presume that the itinerations are independant. I doubt that.

Eh?
07-01-2007, 01:57 PM#11
Alexander244
The player that responds to the sync first is the player that will be returned as 'host'.
If nothing processor heavy is going on it is likely that the actual host will be returned, but if there is something intensive going on then it is likely that the player with the fastest computer will be returned. (this could still be the real host, but it is unreliable)

If we were to take an average of trials over 1 second, or even 10 seconds, it is likely that whatever is causing the host to respond slower than another computer is still going on, and therefore the fastest computer will still be returned. (especially assuming you will want to run this at, or shortly after map int, when a lot is going on in most maps.)

If you run GetHost() many times, over a long period, when not much else is going on in the map. Then you take an average. You increase the likelyhood that the actual host is returned, but there is still the possibility that it will return the wrong player.
07-01-2007, 04:48 PM#12
Dil999
I dont think so, alexander. At the start of the game most players lag if there is alot of triggers which run on map initilization. If you use a PolledWait in the trigger, taking 10 samples over 10 seconds, you will cancel out the factor of returning th fastest player. I have a trigger for this basically done, but Its written totaly in JASS and I have to test it still.