I have released the Grid12 data at grid12.com/grid12staticdata.sql . This contains most of Grid12's art, plus most stats about damage, speed, turn rate, drop rates, etc. Just feed the file to mysql and you'll have a nicely queryable database. Some things (eg, triggers, certain older forts like GCT) are hardcoded in the server. But many of the numbers behind Grid12 are in the file.
Licensing details are in the file, but I can summarize by saying that this data can be used freely for noncommercial purposes as long as attribution is made to Jetbolt/Grid12.
The idea behind this release is for people to dig into the data and find imbalances and build wikis, DPS calculators, drop-optimization plans, etc. My sincere hope is that someday someone will make a vehicle editor that we can use at Jetbolt.
My notes about drawing tanks, which might come in handy if someone is going to build a wiki from this data:
Look in the tankdef table. Find the shapelistid. Draw these shapes.
Look in the tankdef_turretdef table to find turret ids associated with the tank. Then look in turretdef to find shapelistid. Draw these shapes, offset from the tank by x and y found in tankdef_turretdef.
Look in the turretdef_gundef table to find gun ids associated with the turret(s). Then look in gundef to find shapelistid. Draw these shapes, offset from the turret by x and y found in turretdef_gundef.
To draw a shapelist, look in the shape table to find all shapes associated with the given shapelistid.
Each shape will have points, which is a list of X1,Y1,X2,Y2,…,Xn,Yn that forms a path. In addition, if symmetrical is set, then you need to join that path with Xn,-Yn,Xn-1,-Yn-1…,X1,-Y1. In addition, if open is not set, you need to join the path back with X1,Y1.
The color is an int, but it's really an html color hex value, like 9900CC == 10027212. So you can recover the R,G,B components with color >> 16, (color >> 8) & 0xff, color & 0xff.
When drawing the shapes, there's a priority, which I don't remember how to use.
I drew each shape with a black polygon fill, then drew on top of it with a 2.5-pixel thick stroke line (no fill) with a blur filter, then drew on top of it with a 2.5-pixel thick stroke line (no fill) without a blur filter. It's not exactly the effect in Grid12 so this will need some fine tuning. Also, I used SVG filters which are implemented differently than Flash's filters. For the blur filter look at the source; I haven't found one I really like.
I know, this is a lot and I figure some of us will produce working code soon that we can all share and learn from. Things that could be useful: code to convert mysql to json, or code to draw a shapelist, or code to calculate dps.
Also while looking at gundef and turretdef there are some useful numbers for the wiki.
Post by gingerbear on May 16, 2013 13:56:56 GMT -5
I see the towers have a "faction" property. Does this mean you plan on bringing in multiple sides to the war? Or is it to allow players to build towers too? Or is it for that "color coded" concept you hinted at some builds ago (different base color for different effects)?
CSV and JSON are other good choices but given how linked all the data is, sqlite3 was the obvious first step. With CSV, I'm guessing we would just export each table to a separate CSV file, but then you have to write all the join code (eww) every time you read the data. With JSON, I'm guessing we'd perform all the joins in the conversion step. I'm guessing they're obvious but if any shapes or other records are shared we'll just duplicate them.
I now have all the player tanks drawn on www.redblobgames.com/x/jetbolt/viewer/ with shields. When you mouseover the shield it'll show you the corresponding entry in the table with shield stats. I haven't implemented anything to show weapon range.
Cool Amit. Your shield descriptions are a bit... weird. Most shields regen in 5-10 seconds (500-1000 in the table) And angles seem to be in 'deci' form 180 degrees not 1800.
The way I've interpreted clipsize is like a real gun. The only tank with this is the viking. It shoots 8 shots with cooldown (fire rate) of 400 (0.4seconds/shot ) then has a reload (in milliseconds) of 2000 (2 s), where it reloads its clip and doesn't fire. To figure DPS on the viking, I took the total time it takes to for 8 shots and reload (8*400+2000=5200) And then treated it as normal (8 shots / 5.2 s * damage per shot). All other tanks have clip 1, reload 0, meaning they just shoot the same rate all the time (easy). I get the viking to have 68.82 base dps (all 3 guns added), not the 93.34 that you get (when added).
Low prisms are level 1-3, mediums are 4-6, high are 7-8.
In the lootdrop table, quantity means quantity for gridshards, prisms, splinters and coins. However, for items (protomods, storage, tanks, augments), quantity is the base level of the item, and quantity is always 1. 50% of item drops are at the base level; 25% are at base level+1; 12.5% are at base level +2, etc. A max of 10 extra levels can be added.
grid12-static.db3 is the MySQL data converted into SQLite3. The main advantage of SQLite is that you don't need to install and run a server; it's just a file, access with libraries that are available for lots of libraries.
import_sql.py is a program to read the mysqldump file into sqlite format
export_json.py reads from the sqlite database and exports some tankdef json
grid12-static.js is the json; note that it only has tank-related stuff and not the entire db
The code is under the Apache v2 open source license; I suppose I should mark the data files as creative commons with the same license Rob uses but I haven't done this yet.
BTW I just discovered that Guild Wars 2 has been adding an API over the last few months: wiki.guildwars2.com/wiki/API:Main — it's a different style of game but it might be interesting to see what players have done there. Their API returns relatively static things like all the guilds, items, dyes, recipes, maps, but also dynamic things like all the current events and battles. For example, visit this page to see a list of the current events. There's a list of things people have built with the APIs.