Persistent Matchmaking Groups

I'm DJ Hirko ([S2]Deejay), the lead programmer of Heroes of Newerth. I'm writing a post today to give you a look inside the nitty-gritty technical aspects of working on Heroes of Newerth.

One feature we've planned to add to HoN, and actually did have for a few hours, is persistent matchmaking groups. This would mean that after playing a matchmaking game with a group, you would still be in that group and wouldn't need to re-invite everyone next game. It's a very nice "quality of living" improvement for our loyal players.

The original matchmaking code was written to get good match-ups in a timely manner. It worked pretty well, but had scalability problems. These scalability problems laid dormant until the first attempt we made to add persistent matchmaking groups. Our stats showed the number of groups quadrupled, leading to very poor performance on the chat server. This was quickly pulled and has sat on the shelf ever since.

Now here's where it can get pretty technical. We've made huge changes on the chat server to improve its performance. Many O(N^2) algorithms were reduced to O(N) or even O(1) and we now use a separate process on the chat server to matchmake. After these changes, the chat server's peak frametime was lowered from 13000ms to 1200ms. This is a great improvement, but it's still higher than we're aiming for. In order to add support for persistent groups again, we need to further optimize the chat server, and that's where I/O completion ports come in.

Our profiling data shows that 41% of frametime (i.e. peaking at 480ms) on the chat server comes from polling sockets to see if there's data waiting, and if there is, receiving it. This time does not include processing the data - just polling and copying! Polling an individual socket is fast, but it's an O(N) problem - it grows linearly with the number of sockets (including clients and servers). The best solution to this problem that we've found is a Windows feature called I/O completion ports.

Windows supports I/O completion ports for a variety of asynchronous I/O functions - the pertinent one here being reading socket data. I/O completion ports are an OS level messaging system. When you call an asynchronous function that's hooked up with an I/O completion port, a message will be queued up when the function call is finished. Instead of processing the socket immediately, we instead associate the socket with a shared I/O completion port, call an asynchronous read, and then process the messages as they're created. This reduces the O(N) problem of polling socket data to an O(1) problem, since we no longer need to loop over all sockets - we just process the messages as they're posted to the single I/O completion port. This reduces our peak frametime from 1200ms to 760ms, leaving plenty of space for us to add a new feature like persistent matchmaking groups.

These changes will be going out soon and from there, you can expect to see persistent matchmaking groups being added in the near future.

I hope this was informative and thanks for reading!

06/13/2013 11:11 PM

Topic: Development


Community Corner: Part #1


Hey everyone! My name is AceJR and I’m the Community Manager for HoN.

In this blog series, I will be giving you guys updates on general events around the community and summaries about what’s been going on and different hot topics. Hopefully this will help you guys stay in touch with what has been going on in HoN and give you guys a chance to get involved with some of the awesome events that go on everyday in your community.

Past and Current Events

Serious Business Cup Season 11
The Serious Business Cup Season 11 was held on Sunday, June 9th. 21 teams battled it out for a total prize pool of 13000 gold coins. Team YEYE (with NoVa ringing for them) won by defeating Justice League Online with a 2-1 victory in the epic bo3 finals. The third place match was played between FTGS Alpha and team excellent, with the latter coming out on top. At first, the event was streamed and casted with Beef and iNsania on twitch.tv/complexityhon with around 500 live viewers. The finals were covered by nfgDan and Mangy of teamstaygreen with around 1600 live viewers. Also a lottery took place for all of the participants and 6 of the lucky winners recieved 5$ (200 coin) packs.

The Serious Business Cup Seasons are hosted and ran by Klejf with various helpers! They are held almost weekly and are open to players/teams of all skill level. Look for sign-ups in the Competitive Discussion section of the Heroes of Newerth Forums.

FTGS 1v1 Tournament
The clan FTGS ran a 1v1 inhouse tournament last week, headed up by PyschoX aka Maddog. The tournament had 60 people participate in it and was casted on www.twitch.tv/maddoogg. FTGS’s very own Minimaggot casted the tournament along with PyschoX. The competition was steep with many heads clashing to prove themselves the best in the clan. After some well fought semi-finals and finals games, abyssion` took the title as 1v1 champion taking home 1000 GC. Other noticeable positions were acidp0is0n in 2nd, abu11fouad in 3rd, and pxa in 4th. Also, kill3rkro3t3 was randomly selected as the “lucky skin winner” and can now be found in Newerth sporting the sexy DJ Rap City skin.

To find out more information about the FTGS clan contact anyone mentioned in this forum post or pop in on the stream, www.twitch.tv/maddoogg

BeastyBird 5v5
The 5v5 tournament was a great hit! There was a total of 34 teams participating in the tournament ranging from brand new teams to some of the more experience ones containing popular players such as Nova and megabever! Although there were some minor issues towards the end of the tournament these were quickly resolved with all players still on good terms. The teams battled hard with the team Four and a half men (led by captain Imba) meeting team Tempteam (led by captain Megabever) in the winners bracket final. Tempteam took the win and moved on to the grand finals to play the winner of the loser bracket finals, Norge (led by captain Loiz). Tempteam, again, ended up on top and took home the winnings of 5000 GC.

Congrats to everyone who participated and look for more BeastyBird tournaments on the General Discussion and Competitive Discussion sections of the forums.

Excellent Tournament
The first Excellent Tournament was played last week and it was, indeed, a great event!

We had 22 teams viciously vying for the grand prize of 5000 gold coins! The winners of the event were DCx aka Justice League but it was no walk in the park to victory. They had a hard grand finals vs “The best of five” but they took the series 2 games to 1. The finals were everything that we had hoped them to be. We saw some different, more diverse hero picks such as devourer, Valkyrie and gauntlet and one of the games came down to an epic conclusion at the 80th minute. The tournament ran well with no major hiccups, games were played on-time in an orderly fashion.

In conclusion, DCx took home the 5000 dollars, Best of five took home 3000 gold coins, and at a respectable 3rd/4th place were 4 and a half men and waveya taking home 1500 coins each.After the grandfinals we also had 2 Tempest avatar giveaways which allot of people were pumped to win! We had teamstaygreen with dan and mangy casting everything until the finals they sat around 1000+ viewers. The other day I casted the epic finals on my stream with around 500+ viewers !

For more information about Excellent Tournaments, please contact Pew or go to the website http://excellent.tourney.cc/ to get the full details about when the next one will be. As of now it is planned for June 20th, so sign up and maybe you will be the next team to take home 5000 GC!

Aluna Art Contest
S2’s own Nidhogg decided to throw an Aluna Art Contest in honor of the arrival of Stardust Aluna to Newerth. This art contest was to showcase Stardust Aluna and the current heroes of Newerth in a meeting - scenery and composition totally up to the artist. The twist was that it had to be done in MSpaint. We had 42 entries and of those, 3 reign as first place winners!

Look forward to more community events thrown by [S2]Nidhogg by checking the General Discussion section of the forums.

Lucky Monday!
Over the past four Mondays, the community’s very own EnconHun has been running the event called Lucky Monday in the General Discussion section of the forums. It has been a wonderful way for community members to earn Silver and Gold coins through simple, fun games of chance. This week the community was asked to guess some of EnconHun’s favorites in HoN for a chance to win 50 SC for each correct guess.

For your chance to win, head to the General Discussion forums on Monday and check out the latest Lucky Monday by EnconHun.

Pebbles 2v2 Tournament
Community event “2v2 Pebbles Midwars” by dmal is taking action in Newerth on June 14th at 8pm CEST. A sticky in the General Discussion of the HoN forums is where you can view what time this event is held in your timezone as well as the single elimination bracket link to see who is signed up. There are specific rules in place that each team must abide by which are also viewable on the forums, such as “Codex is strictly restricted” and stat enabled game mode.
Come check out this sweet event and sign-up.

DreamHack Summer 2013
DreamHack Summer 2013 is right around the corner! Honcast has some special tricks up their sleeves as far as entertainment goes while there is sure to be a plethora of great games played. Check out the Competitive Discussion section of the forums for further details on DreamHack Summer and tune into Honcast from June 15th to June 18th to catch all the action.

06/13/2013 1:22 AM

Topic: Community


Ultimate Monkey King