PDA

View Full Version : Mech Warfare MWScore Scoring System



Upgrayd
04-15-2012, 08:16 PM
We do not really have a general scoring system discussion thread so I figured I would start one...

For the 2012 season we have worked very hard to provide a solid scoring system for this year and years yet to come.

Scoring System New Features:

Data Logging
Data from all matches is now logged and saved in a text format. We will now have a history of all match results.

Team Match Support
The scoring system now allows team matches to be scored. Any number of teams of any size are supported. 2v2? 1V1V1? 5V10V2? Yes yes and yes!

Match Data Broadcast
The most exciting new feature that we will demo this year is the ability of the scoring server to broadcast match data to other computers connected to the same network as the scoring server PC. Official score and time remaining can now be integrated into competitor's control systems.

Watch this short video demonstrating some of these new features:

http://www.youtube.com/watch?v=DIu0MV4z6gE
http://www.youtube.com/watch?v=DIu0MV4z6gE

Open Design:

Scoring system source code, transponder firmware and transponder board design are all available to download now from my website (http://offkilterengineering.com/projects/mwscore/index.html) (scroll to the bottom). Source will be added to a google code website sometime after RoboGames.

Questions, Comments and Concerns relevant to the MWScore system all belong here!

DresnerRobotics
04-16-2012, 01:38 AM
Absolutely fantastic job all around on the scoring system. Seriously people, we owe Ryan a lot for all the hard work and effort he put forth into this revamp.

Mitch
04-17-2012, 08:34 PM
HUD question:

I don't know too much about python networking sadly...

Is your "SocketClient" over UDP or TCP?

Looks great and very simple to use :) Thanks for the hard work!

Upgrayd
04-17-2012, 09:11 PM
Is your "SocketClient" over UDP or TCP?


IPv4 TCP

Mitch
04-18-2012, 12:33 AM
IPv4 TCP

Gracias.


3961

Up n' running in .NET (ala Unity in this case).

Lemme know if anyone wants source; i'll clean it up a bit.

Something I was wanting: The ability to tell how many teams there are, and which team they're on :)
I'm assuming for the case of Mech Warfare its going to be even teams (or just fill in a dummy bot) or something like that; but if we ever had a 3-team match or what not that "VS" symbol would be impossible to place without a liiiittle bit more info coming over the stream :)

Upgrayd
04-18-2012, 06:27 AM
Something I was wanting: The ability to tell how many teams there are, and which team they're on :)
I'm assuming for the case of Mech Warfare its going to be even teams (or just fill in a dummy bot) or something like that; but if we ever had a 3-team match or what not that "VS" symbol would be impossible to place without a liiiittle bit more info coming over the stream :)

.Net!?

Match data is sent as a single string delimited by colons and includes the team each mech is on.

Example: MatchTime:MatchType:NumberMechs:Mech1Name:Mech1HP: Mech1Team:Mech2Name:Mech2HP:Mech2Name: ... MechNName:MechNHP:MechNTeam

MatchTime - Time remaining in match in seconds * 10
MatchType - 1 = Team Match, 2 = Free For All
NumberMechs - Number of mechs participating in the current match
Mech#Name = Name of mech
Mech#HP = HP total of the mech
Mech#Team = Team mumber mech is registered with in the match

So with that info you can determine how many teams are in the match and what mechs belong with what team. Teams can be unbalanced without filler "dummy" mechs.

Mitch
04-18-2012, 12:22 PM
Awesome - so THATS what that third entry was for :P

I read your comments and your parser, but not your builder heh. Thats what I get for not being thorough :P


# MechName and MechHP for each mech in the modules MechList
for m in self.MechList:
data += ":" + str(m.Name) + ":" + str(m.HP) + ":" + str(m.Team)

Also, .NET!? Dont be hatin :P

Upgrayd
07-06-2012, 01:34 PM
We are starting to make plans for canges to the scoring system transponder for 2013.

So far we have identified the following items:

Reverse polarity input protection.
Clear silk screen markings for input polarity, target panel inputs, and led indicator output terminals.
Settable/Selectable transponder ID via onboard dip switches removing the need for each transponder to be programmed with a unique ID.
Voltage regulator with larger input range and greater output current capacity.
Decoupling capacitors on target panel inputs to help with the EMI some users are still experiencing.
Does anyone have any other changes they would like to see made or can share any other issues they had with last year’s transponder?

gdubb2
07-06-2012, 03:54 PM
Sooo.. we're not going to be required to change them out again are we??

Upgrayd
07-06-2012, 04:44 PM
Sooo.. we're not going to be required to change them out again are we??

I would think not but it is not totally up for me to decide.

DresnerRobotics
07-10-2012, 10:27 AM
Sooo.. we're not going to be required to change them out again are we??

Nope.

jwatte
01-27-2013, 11:42 PM
Two comments/questions:

1) I assume the match server IP:port will be provided on competition day? Or is there a discovery system, like mDNS?

2) I'm *so* re-naming my mech "On:yx" :-)

jwatte
01-27-2013, 11:50 PM
I found a bug in the scoring code (in more than one place.)

TCP does not guarantee packetization. Thus, when you call socket.send("blah") and the other end calls socket.recv(1024), the other end may see "blah" or may see "b" in one packet and "lah" in another packet. I notice that you've seen this happen, as there's some code that verifies that the number of colon-separated fields is divisible by 3. Would be better to actually do it right :-)

What this means is that each message MUST be framed somehow. Two common mechanisms include prefixing the message with a length (great for binary protocols) or terminating each message with a newline (great for text protocols.) I *strongly* suggest you add a newline at the end of each message sent, to make the stream correctly parseable.

Also, there is no guarantee that "add me please" will make it as a single packet to the other end. Thus, using that as a test in the connection setup means some connections may be prematurely closed.

It's pretty easy to write a wrapper around recv() that returns newline-separated lines. If you want me to help with that, give a holler and I'll be happy to.

jwatte
01-28-2013, 12:47 AM
Actually, I just did it. You've got pull request :-)

https://github.com/RyanLowerr/mwscore/pulls


(https://github.com/RyanLowerr/mwscore/pulls)

Upgrayd
01-28-2013, 09:11 AM
Cool! I will incorporate the changes whenever I get some time to look it over. I added the socket server score broadcast last minute last year just to see if I could get such a thing to work.

Good to know that at least someone has some idea how these things should work. :wink:

Gertlex
01-28-2013, 10:48 AM
Upgrayd, if you recall, at Robogames last year, I made some sort of modifications so that the server stuff was correctly received on a Windows machine... do you recall if you made those changes on your end? If not, I'll attempt to identify what it was... vague recollection is it had something to do with a newline, maybe.

Upgrayd
01-28-2013, 11:25 AM
Gertlex,

It had something to do with incorrect packets or how python on windows handled strings. I can not recall exactly.

I belive that the changes jwatte made correctly address the problem.