# market.fuzzwork.co.uk

With the introduction (a wee while ago) of the new eve market data endpoint, and the problems which surfaced at Eve Central while that was happening, I decided to create my own market data website. And so, I present market.fuzzwork.co.uk

I posted it was out a few days ago, but thought I should write a little more about it, and the process of creating it.

## Background

At fanfest, in one of the round tables, I brought up (again) the idea of an endpoint to get the order book for an entire region at once. While most people just want aggregates, that’s not something that would be easy for CCP to provide for multiple items, at the same time. In part because the aggregation takes time, and because the multiple items makes caching that data a lot harder (different people asking for different lists of things). Lo and behold, a short time later, such an endpoint came into being. It’s paginated into batches of 30,000 items, which is enough for most regions, though The Forge has 9 pages.

## Details

So I rented a new server (with an offshoot of OVH called kimsufi) and set about building one. It’s a PHP site, running on an NGINX server, with a PostgreSQL database, and Redis for caching the aggregates.

The downloading script I wrote in python, and after an abortive attempts at aggregating the data, first in the database itself, then breaking it out into the script to process, I settled on using Pandas to do the aggregation. The script version would have taken over an hour to process. The Pandas version runs in a few minutes. This lets me do the grabbing of data once every 30 minutes, retaining it for a couple of days; that means you can look at snapshots of an order over that timeframe, to see how it changes.

That retention brought problems of its own. Not so much in keeping the data (each grab adds a couple of hundred meg of data and indexes.) but cleaning it up. Or being specific, the effects on the import, of having deleted it. Turns out the database doesn’t like it when you’re inserting and deleting 1.7 million rows every thirty minutes. It’s down to how it stores it. I won’t get into technical details, but it went from a couple of minutes, to over 15. which impacted kind of negatively on the performance of the site. The process wasn’t taking much CPU time, but it completely pegged the disk activity at 100%, and led to the site timing out. Not good.

How to solve this issue? One way would be to get a server with SSDs. Unfortunately, these are kind of expensive, relative to the one I’m using. I’m not made of money, after all. So I put together a Patreon campaign. If you want to contribute to the upkeep of the servers, I’d appreciate a pledge, however small it is. (Small is good in fact. My expenses aren’t that high. I’d feel bad about offloading everything to someone else)

However, a thought came to me recently. I’m using Postgres, and it can partition data, based on specific conditions. So I can have the data being stored in a partition based on the order set, and just truncate out partitions as they age out. This is far more efficient than deletion, and shouldn’t impact on the import speed. It’s not fully tested yet, but it’s looking somewhat better already. It’ll increase my data retention a bit (up to 200 samples (4 days ish), rather than the 96  (2 days) I was planning) but space isn’t too much of a concern that way. And partitions allow for more efficient queries.

## Future

I still need to write the API interface for it, so you can request an arbitrary number of aggregate/region combinations, but that isn’t too far out. And I’ll provide a sample method for importing into google. In addition, I’m providing the downloaded orderbook as a gzipped csv, for an undetermined period of time (it’s all dependant on space, tbh. and zipped they’re not huge)

I also need to decide how I’m going to winnow the aggregates. The API will only allow for ‘live’ data, as that’s all I’m keeping in redis, but all the data is also being kept in a database table. I’ll likely add a page so you can see how they change over time. To keep the table from becoming an absolute monster, I’m thinking I’ll keep only a week at 30 minute intervals, then averages for the day, if you want to see over a longer time frame.

In case you’re interested, I’m generating a weighted average (price* volume summed up, then divided by the total volume), the max, the min, and a weighted average of the lowest/highest 5% of the orders (lowest for sell, highest for buy) ignoring any price more than 100 times the lowest/highest price. It’ll help when someone puts in a buy order for a million Gilas, at 0.01 isk. Which otherwise completely screws with the average prices.

## Other

Oh, and I put together a very simple fleet tracker. Doesn’t do anything other than show you where fleet members are, and what they’re flying. Needs a CREST privilege, and a link you get from the fleet window. And for you to be fleet boss. I may expand it a little in the future. Maybe for invites too. Though that would require me to store the access and refresh token somewhere other than the user’s session.

As normal, all my code is on my github. Might be a little behind the release, but that’s purely down to me not committing it yet.

I’m open to suggestions, if you have them.

Anyway, Steve signing out.

# Summer Summit – Day 1

As some of you might well be unsurprised to hear, just from the topic list for today, this is going to be very light on details. Because a great deal of this will fall under the NDA. I’m hopeful that you’ll hear about it all fairly soon, but there’s some potentially contentious stuff in there, and other stuff which just isn’t ready for public consumption.

Anyway, with that said, let’s begin.

The meeting with Hilmar went pretty well, with us focusing mostly on how we see things going, and how we think CCP can communicated better with you, the average player base. There’s been a great deal of focus on things like Gunjack, and Valkyrie in the gaming press, with Eve sometimes seeming like the poor step sister, hidden away in the wings. In part, that’s due to it being ‘old news’, the game that’s been around for 13 years, without any major changes or new features which would be understood by the average person who reads the gaming press. Pandas are easy to understand. A new way to take space, not so much. It’s obvious when you actually talk to the people, that the passion is still there, but it’s not always well communicated.

Also, he fed us Sandwich Cake (Brauðterta) which was a somewhat novel experience. tasted pretty good.

Then we moved onto the 3rd party session. Nothing new to report here, other than we asked for a bunch of things, some which will be dependant on the other team developing the feature, and some which Foxfour said he’d look at. I’d like to say a little more, but forgot to check what the NDA coverage was, so what I’ll say is, read the minutes. Hopefully it’ll be in there, if not, sorry folks, that’s NDA for you. (It’s a technical point, rather than a new feature)

Then I fell asleep. 😉

Well, no, but we moved onto some long, and very very talky sessions about Sov, Cap changes and power projection. Some of it was a bit above my head, some of it seemed counter intuitive, but I guess that’s mostly because I don’t spend a great deal of time in Null, and I don’t move in the upper echelons of power there. Unfortunately, a great deal of that comes under NDA. Some minutes were taken, but I’m expecting another cat picture. (Sorry, no recipes from me this year) Hopefully you’ll hear about it fairly soon, but with some of the changes being talked about, I can understand serious NDA protection. I did like what I heard about Caps and Supercaps (from my admittedly less educated perspective)

And that’s the end of the day. We spent a lot of time talking about Sov. And, I’m glad to say, things remained civil. Which is nice, considering how high tempers could have run.

# CSM 9 voting list

The Election is almost on us, and that means suggested voting lists. As you can’t just put me 14 times, I have a number of suggested candidates. Other than myself, I’m not really suggesting any particular order (me first!). Pick people that are appropriate for your play style, or where you live.

If you’re an industrialist, consider voting for the wormhole candidates, as they’ll have a clue about the pain involved with working with POS, as they live out of them.

• Me! Steve Ronuken.
• Mangala Solaris – A good understanding of small gang warfare
• Jayne Fillion – Another good understanding of small gang warfare, with good theory crafting skills.
• Ali Aras – An incumbent who’s done a good job keeping lines of communication open.
• Sugar Kyle – A low sec trader. Lowsec needs work, and Sugar knows.
• Proclus Diadochu – Wormhole candidate. Wants to hit on POS and corp management.
• James Arget – An incumbent wormhole candidate.
• Mynnna – Yes, he’s a goon, but he knows his stuff. Incumbent.
• Mike Azariah – An incumbent for the ‘casual’ player.
• Xander Phoena – Another goon, yes. He’s, on the other hand, loud and opinionated. Which isn’t a bad thing.
• Psianh Auvyander – More small gang warfare, and the merc perspective.
• Matias Otero – BNI is a wonderful concept.
• DJ FunkyBacon – I don’t agree with him on everything, but he’s not generally /that/ wrong. And he’s another Lowsec advocate.

Yes, I know that’s only 13 people. can’t expect me to do all your work 😉

Vote match may be of interest.

If you were to drop by the blueprint calculator, you’ll have noticed a few changes.

# New features

• Regional prices. You can now pick the region on the price list. It will always  default to Jita for now.
• Collapsible price list. It will remember the  state you left it in.
• Parser for a blueprint list. If you open up the S&I interface on the blueprint list (or corp blueprint), then double click on the location you’ll get a window you cut and paste from. Paste it in, that you’ll get a list of links, with a profit per unit.
• General optimization. Performance since I added the table sorting has suffered. It should now be back up to normal.
• Added a while back: Decryptors in the invention figures.

# Future plans

• Once the SSO becomes available, you’ll be able to log in, and store blueprints, if you want to. This will be on the server, rather than in the client. I’ll probably leave the option to store with cookies too, if you don’t trust me with that. Other preferences will be stored
• Once CREST becomes available, with a character sheet end point, your skills (if desired) will autofill.
• Inclusion of invention prices on the parsed results.
• Inclusion of isk/hr (ish) on the parsed results

## SSO/CREST:

Don’t worry about the security of SSO. The way OAUTH2 works is:

• You hit the login button, which sends you to login.eveonline.com with a token that identifies where you’re coming from.
• You log into Eve online, and pick the character you want to be.
• You get sent back to the source site, with a long token.
• The source site sends the token to eve online asking ‘who is this?’
• Eve responds, identifying who you are and invalidating the token for future use. (CREST works a little differently but not significantly.)

At no time do you give anyone except CCP your password. Any third party site asking for it is either badly coded, or a scam. Ideally you’d log into the forums, and then you won’t need to type in a username or password into any site.

# Manufacturing 201 – Tech 2

Tech 2 manufacturing is a clickfest. If you don’t like having to do a great deal of clicking, just wanting  to installing jobs once a week, move on. You will be clicking a lot.

That said, the profits with Tech 2 manufacturing can be pretty good. They’re more sensitive to market conditions than many T1 products, but all that means is, check your numbers before you start.

# Tech 2 BPOs

First, get the idea of Tech 2 BPOs out of your head. You will, likely, never lay your hands on one. They can make substantial profits, but they’re limited on throughput. They generally sell for several years of profit. Sure, they have a low time investment, but other than that, they’re generally not worth it. They’ll tie up a substantial quantity of capital, with a low ROI. There are one or two markets where you can’t compete with them. These are small markets, however. Ones where the BPO throughput is high enough to completely fill the demand. The majority of Tech 2 stuff, across all of New Eden, comes from Invention. And that’s pissed off a fair number of people with the BPOs.

# Invention

This is where most people start with Tech 2 manufacturing. You can, sometimes, buy T2 BPCs on the market. They’re relatively rare, however, and expensive, compared to inventing them yourself.

## Skills:

### Required:

• Science 5
• At least one of the following. They’re requirements for the science skills.:
• Engineering 5
• Mechanics 5
• Electronics 5
• At least one of:
• Amarr Encryption Methods
• Minmatar Encryption Methods
• Gallente Encryption Methods
• Caldari Encryption Methods
• At least 2 of the science skills. You’ll find these normally running in pairs, like Quantum Physics is common with Hydromagnetic Physics, or Nanite Engineering with Molecular Engineering.

### Worth having:

• The rest of the encryption methods.
• A larger number of the science skills.
• Laboratory Operations 5
• Advanced Laboratory Operations 4. These two are just so you have more slots to work with.
• Scientific Networking 1+. For when you move into a POS, or want to roam.

You may notice I’m not mentioning levels for a lot of the skills. That’s because you can work with them at 1. Higher is better, and will give you better results, but you can get started at 1. Plan to get them to 4, but it’s not a requirement to get started. Just take it into account with your math.

## The invention process

Pick something to make. Exactly how you do this, is a whole different topic. The short version is: Think about what people use; then check the math (say, using my blueprint calculator)

Tech 2 BPCs are created from Tech 1 BPCs. In general, you want max run copies for modules (300), weapons(300), drones(1500) and ammo(1500), and single run copies for ships and rigs. The ME and PE of the Tech 1 BPC is irrelevant. 0 is absolutely fine. Mine tend to be better, but that’s because I also often manufacture from the BPO they’re copied from.

The skills you need to invent from the Tech 1 BPC are on the Bill of Materials Tab, on the Invention tab (big surprise). It can be worth checking the details for the resultant BPC as well, to make sure you have the skills to actually manufacture the module. Those show up on my Calculator.

The materials needed to do the invention will also show up on that tab. They will consist of:

• A data interface.
• 2 different kinds of Datacore.

The datacores will match the science skills required to invent the module. The interface will match the racial Encryption Methods skill. There are different interfaces for doing modules/weapons/ammo/drones, rigs and ships, per race.

The datacores will be used up, regardless of if you succeed or not. The interface will not be used up, and will be immediately available for doing another run. So if you’re doing this all in the one station, you only need one of each type.

There are also Decryptors that you can use. These are getting renamed in Odyssey, to a consistent naming scheme. For now, ignore them. They’re valuable when it comes to ships and rigs, but for most invention jobs, they’re a waste of money. I’ll cover them in a note below.

You can also use Meta versions of the thing that you’re inventing. This will affect the chance of success, depending on your skills. Higher skills = a better bonus from a Meta module.

## The Method

• Stick everything in the appropriate hangar. If you’re using a POS, the BPC can be in the corp hangar at the station, but everything else needs to be in the array.
• Select the blueprint, right click it, and pick ‘Invention’.
• Select the appropriate installation slot for actually doing the invention in.
• Select the input/output hangars appropriately.
• Pick the Meta module if you’re using one.
• Pick the decryptor if you’re using one.
• Pick the output type. Some things can turn into two different types. Like a Rifter can become a Wolf or a Jaguar. Most are 1 to 1 though, requiring no changes.
• Hit ok
• At this point, you’ll get a quote. If you’ve put everything into the appropriate places, you can hit accept quote.
• When the job completed, deliver it. you’ll be told if it succeeds or fails. If it’s succeeded, you’ll have a T2 BPC.

## The Math

You will fail when you do invention. You’ll fail a great deal. Suck it up, and put the cost into your calculations.

The chance of success, for invention, depends on your skills, the thing you’re inventing, the meta level of the module you’re using (if any) and the decryptor you’re using (if any). The formula is pretty simple, but to make life easy, I have a standalone calculator, as well as building it into the blueprint calculator (just click on Invention Material Requirements).

### The Invention Formula

$Base * (1 + (0.01 * E) ) * (1 + (S * (0.1/ (5 - Meta Level))) * D$

• Base – Base chance
• Modules and Ammo have a base probability of 40%
• Frigates, Destroyers, Freighters and Skiffs have a base probability of 30%
• Cruisers, Industrials and Mackinaws have a base probability of 25%
• Battlecruisers, Battleships and Hulks have a base probability of 20%
• E – Racial Encryption Skill
• S – Science Skills. Add them together.
• Meta level – The metalevel of the module you’re using.
• D – Decryptor modifier. Use 1 if you’re not using one.

So, a Tech 1 item (no meta level) has no effect. A meta 4 item, when you have both skills at 5 makes a huge difference.

When working out how much to charge yourself for each blueprint take the number above (it’ll probably be 0.something. 0.42, if you have the minimum skills needed. Divide the cost for one run (materials, slot costs, your time cost) by that number, and you’ll get the cost per blueprint. (divide that by the number of runs, for the cost per unit) Yes, I initially said multiply. Consider that a brainfart. The calculator does it right 😉

### The Number of Runs you’ll get

In general, if you use a 1 run copy, you’ll get a one run copy back if you succeed. If you use a max run copy on modules/ammo/weapons/drones, you’ll get a 10 run copy back. If you use anything with ships and rigs, you’ll get a 1 run copy back.

The only way to change this is using a Decryptor.

The formula is:

$MIN(MAX(ROUNDDOWN( (Input T1 BPC Runs / T1 Max Runs Per Blueprint Copy) * (T2 Max Runs Per Blueprint Copy / 10) ), 1)+ Decryptor Runs Bonus, T2 Max Runs Per Blueprint Copy)$

Those numbers are all in the SDE. Specifically the table invBlueprintTypes

# Manufacturing

Actually making Tech 2 stuff is pretty much the same as making T1 stuff. Get the materials, cram them into the right hangar and install the job.

The only real difference is /what/ those materials are. You’ll have a bunch which are construction components. These are made, in general, from things made from Moon Goo. Consider making them yourselves, as the profit margins on a bunch of them are pretty damn good. You will need the science skills for this too. Cost them at an appropriate isk/hr when you do all the math for the final product.

# Notes

## Blueprint Copies

These are the hardest thing to lay your hands on, when you’re getting started in invention. Empire copy slots tend to be filled up for days in advance, and you’ll need a bunch of copies to keep up with your manufacturing. Many T2 producers throw up a POS with an advanced lab or six, to keep themselves hip deep in copies, so they can move with the market. Consider low-sec stations for your copies. They’re low bulk, so something small and fast can shift them.

## Decryptors

These modify your chances of invention, and the output ME/PE/runs of the blueprint. They’re used up when you do the invention, and tend to cost millions, so be careful what you’ll use them for. Make sure you’ll be making enough profit on an average run for them to be worth it. My calculator does /not/ take the cost of decryptors into account. Modules are generally not worth it. Ships and Rigs can be, especially with a boost to the number of runs you get back.

When you’re using a decryptor which modifies output runs, consider using max run copies for ships and rigs. These will give you 1 additional run, over a 1 run copy. With the higher copy time as the downside.

## Did CCP nerf the invention chance with this release

No. Random is random. You will get runs of bad luck, just as you’ll get runs of good luck. These may coincide with a release. If you look at the figures, as a whole, they will average out. And you will remember the bad runs, more than the good runs.

## Starting Capital

Have a lot. You’ll be burning through BPCs at multiple per hour, with a cost of >200,000 per run in datacores (successful or not). Then there are the materials for the modules. The margin is better than T1, but you’ll still need plenty.

# Manufacturing 102 – Research

Research is an important aspect of industry in EVE online, though it’s one that, initially, all you have to pay attention to is the output, rather than how to do it yourself. This is because there are plenty of people out there who are more than willing to sell you the fruits of their labours, saving you time and ISK when you’re just getting started.

All forms of research take up a slot. You can increase the number of slots you can use with the Skills Laboratory Operations and Advanced Laboratory Operations

# The Forms of Research

There are three basic forms of research which you can perform. Copying, Material Efficiency research and Production Level research. The latter is also called Production Efficiency research, just to confuse matters; it has nothing to do with the skill. For now, we are totally ignoring Invention and Reverse Engineering. I’ll return to Invention in a later post. Reverse Engineering, well, I’ve not touched it yet.

These activities can only be performed on a Blueprint Original (BPO). Once you have a Blueprint Copy (BPC) the only thing you can do is manufacture from it.

The maximum time a job can run for is 30 days (Unless a single run would take more than that.)

## Copying

This is as simple as it sounds. Install the job, get back the BPO and a number of copies with the same ME and PL.

• Put a Blueprint Original in your hangar (or a corp hangar)
• Right click on it, and select copy.
• Select an installation to put it in
• Pick the number of runs you want on each copy
• Pick the number of copies you want.
• get a quote
• Install the job.

Blueprint copies are of severely limited utility. Most of the time, you’ll just manufacture directly from a BPO. You’ll use BPCs for invention (so many BPCs. So very many), where you want to give other people the ability to use your BPOs, without handing them over. When you want to sell them to people who are just starting out, and who don’t have the funds for buying a researched BPO.

## Material Efficiency

• Put a Blueprint Original in your hangar (or a corp hangar)
• Right click on it, and select Material Research.
• Select an installation to put it in
• Enter the number of levels you wish to increase the ME by
• get a quote
• Install the job.

Material Efficiency research is important. Most blueprints have between 5 and 10% waste what’s controlled by this figure. However, ‘as high as possible’ isn’t the way to look at this. A general rule of thumb is: Each time you double the ME level, you halve the waste. It’s not quite true (The waste is multiplied by $\frac{1}{1+me}$ ) but it’s close enough. This only applies to the ‘Base’ materials for a blueprint, not the ‘Extra’ materials. Research blueprints to the point there you’re not losing a lot of isk with every run. Don’t chase perfect, because it’s not worth it. You may find high ME levels sell better, even when they’re massively above the perfect value (Rigs are easy to get perfect. I’ve seen people selling them at 10 times the perfect level)

The biggest problem with ME research, is finding somewhere to do it. Most High-sec slots are booked solid a month in advance. Your options are: Wait (High opportunity cost) Put up a POS to do it (Expensive, and requires standings) Hire someone to do it (Check the sell orders forum) and finally, nip into lowsec and install the job there (Riskier. You could get exploded and lose the blueprint)

Consider the last one seriously. Low-sec isn’t to be feared. Taken with caution, sure, but not feared.

Finally: This adds to the ME level.

## Productivity Level

• Put a Blueprint Original in your hangar (or a corp hangar)
• Right click on it, and select Time Efficiency Research.
• Select an installation to put it in
• Enter the number of levels you wish to increase the PL by
• get a quote
• Install the job.

Productivity research cuts down on the time wastage when you’re making something. It saves you a little ISK, by reducing the rental fees, but otherwise, there’s no direct boost to your profit. What you get is a better isk/hr, by producing more in the same time.

As with ME research, we’re talking diminishing returns. I’d suggest taking the vast majority of blueprints past PE 5 or 10 is a mistake.

As with ME research, this adds to the PL level, rather than setting it.

PE research facilities are generally fairly empty across Highsec, so finding somewhere to install the job is simple.

# Notes

In general, T1 blueprints have no material requirements for these kinds of research. Just to make life difficult, there are a few exceptions, such as the Prototype Cloaking Device. When you’re doing the research on one of these blueprints, just ensure you have the appropriate materials, found by doing a show info on the blueprint, in the hangar where the research is taking place.

If you want to know where the profit balance points are for a blueprint, take a look at the blueprint in the calculator under tools on this site. I wrote it to make my life easier, so you may as well use it too.

# Skills

There are a few skills which it’s useful to have when you’re doing research. Levels are less important than for Manufacturing. Train as desired. Science 4 is required to unlock Metallurgy.

• Science: 5% reduction in blueprint copying time, per level.
• Laboratory Operation: 1 additional Job per level.
• Advanced Laboratory Operations: 1 additional Job per level (needs Lab Ops 5)
• Metallurgy: 5% reduction to ME research time, per level.
• Research: 5% reduction in PL research time, per level.

# CSM 8 Results

Well, they’ve released the ballots for CSM 8, and unsurprisingly, I still haven’t won.

What you can get from the ballots, after processing them, is the following output.

So, there were a total of 17 rounds, With 31 candidates, and 14 being elected, this is pretty obvious stuff. With the way the Wright STV system works, one candidate is eliminated each round, then the entire election run again as if there had been no votes for them. When you have 14 candidates remaining, they’re all elected.

The order of elimination:

1. DaeHan Minhyok
2. Cipreh
3. Kaleb Rysode
4. Awol Aurix
5. Artctura
6. Ayeson
7. PsychoBitch
8. Roc Wieler
9. riverini
10. Travis Musgrat
11. Unforgiven Storm
12. Corebloodbrothers
13. Steve Ronuken
14. Psychotic Monk
15. Greene Lee
16. Banlish
17. Nathan Jameson

Obviously, I’d have prefered, if not elected, to be eliminated in the last round. But round 13 isn’t too bad for someone with no track record. Sure, some people have heard of me, but my name isn’t ‘out there’.

There are some people who find the system too confusing. For them, I’ll give a /very/ layman version. For a little more detail, take a look at mynnna’s blog post on it.

Short version:

It takes $\frac{Total votes}{Number of positions +1}$ to get someone elected. So, then someone is provisionally elected (You aren’t elected until it’s actually over.), you take the all the votes for that person, take all the people provisionally elected off the front of it, and reassign the votes to the next candidate on them. These votes are worth $\frac{number of votes over what was needed}{number of votes for the candidate}$

Once you’ve got a bunch of provisionally elected people, and all the votes have finished cascading, if you don’t have enough of them, you eliminate the lowest scoring candidate, scrub their number from all the votes and start all over again. If votes are exhausted (No candidates left on them) then they’re discarded and the numbers required are recalculated for that round.

It’d be annoying to do by hand, but a computer can chug through them fairly simply.

Most people had hit over 90% of voting power by the 5th candidate.

One interesting side effect of this. If it had been a 15 person CSM, rather than 14, Banlish would have got in, rather than Nathan Jameson (who was eliminated last). This is just because more would have trickled down from votes from mynnna and so on, as they’d have needed less to be elected.

I’ve seen some people saying that nullsec is overly represented. Some saying under represented. Both groups are wrong. Of the voting population, there is proper representation. Strategic bloc voting doesn’t give those blocs more power (Except by getting people to vote the full power of their ballot.) Now, I do wish more people had voted, but you can hardly complain about not being represented, when you didn’t vote.

Next year, I’m hoping CCP do more to promote the CSM to players who are hard for us to reach (without spamming the fuck out of them.) And while it’s not ideal, for a world where we have informed voters, I hope they set it up so you can set up links to prefill the ballot for people, without the need for bookmarklets.

# Using the Eve Central API with PHP

We’re going back to basics here. One thing that many sites, which are using the SDE from Eve, want to do, is access price data from EVE Central api. I don’t do this myself, having a EMDR relay, and consumer to provide my market data, but back when I was starting out, I did this. It’s a pretty simple thing to do, the only pain in the neck being the data structures that PHP wants to use, when you’re using XML. It likes throwing in arrays where you don’t think it should, which can be a bit of a pain. If you ever need to debug this, var_dump() will be your friend, showing you exactly how the data has been structured.

So, here’s a fairly basic bit of code. It asks eve central for the information for Tritanium, then prints out the so called ‘Percentile’ price. This is the price if someone was to buy 5% of the market, then average the cost out. It’s handy for ignoring the outliers, if not entirely accurate. The code is more complicated than it needs to be, but we’ll get to why in the second example.

$typeid=34;$url="http://api.eve-central.com/api/marketstat?regionlimit=10000002&typeid=".$typeid;$pricexml=file_get_contents($url);$xml=new SimpleXMLElement($pricexml);$item=$xml->xpath('/evec_api/marketstat/type[@id='.$typeid.']');
$price= (float)$item[0]->sell->percentile;
$price=round($price,2);
echo $price;  Fairly simple, really. You get the type id for Tritanium, the url that will pull back the data from the forge, mash them together, then use file_get_contents to retrieve them. Please not, some PHP installs will stop this from working. There’s a more complicated version at the bottom which may get you round this; functionally identical but using curl instead of file_get_contents. Once you have the output from EVE Central, you push it into the SimpleXML parser, grab the bit that’s just about tritanium (the XPath bit does this. This is the over complicated bit), then pull just the sell percentile out of it. The reason for the [0] is because the Xpath bit could have returned more than one entry. In this case it can’t, but the parser is taking the safe option and giving you an array. The (float) is there as without it, you’re dealing with a SimpleXML data type, which is a pain to do math with. (float) just converts it into a regular number. Now for the more complicated version. Eve central allows for multiple items to be queried at the same time. This is why I put the xpath in there. It allows us to target a specific type being returned, rather than having to go through each in turn to see if it’s the one we want, before continuing. $typeids=array(34,35);
$url="http://api.eve-central.com/api/marketstat?regionlimit=10000002&typeid=".join('&typeid=',$typeids);
$pricexml=file_get_contents($url);
$xml=new SimpleXMLElement($pricexml);
foreach($typeids as$typeid)
{
$item=$xml->xpath('/evec_api/marketstat/type[@id='.$typeid.']');$price= (float) $item[0]->sell->percentile;$price=round($price,2); echo$typeid." ".$price."\n"; }  This time, instead of a single type id, we’re asking for multiple. We store them in an array, then mash that array into the url, with a join (or implode) which adds the right number of &typeid= to it. Then it goes on as before until just after the xml is parsed, where it goes and grabs each individual element out in turn, iterating through the array. If you wanted to pull the minimum buy price, you’d replace the$price= (float) $item[0]->sell->percentile; with$price= (float) $item[0]->buy->min; and so on. It’s fairly simple. Now, the curl version, of the first bit of code: $typeid=34;
$url="http://api.eve-central.com/api/marketstat?regionlimit=10000002&typeid=".$typeid;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0);
$response = curl_exec($ch);
if($response === false) { echo 'Curl error: ' . curl_error($ch);
}
else
{
$xml=new SimpleXMLElement($response);
$item=$xml->xpath('/evec_api/marketstat/type[@id='.$typeid.']');$price= (float) $item[0]->sell->percentile;$price=round($price,2); echo$price;
}


It’s a bit more complicated, but it gives you a way of dealing with a remote site not responding. Perhaps looking at a different site for price data, for example.

Remember, the more calls you have on remote sites, the slower your pages will be to load. Consider caching the price data locally, perhaps in a database, or if you have access to it, memcache (My preference. but it’s uncommon)

# Making Sov more fun

I’ll prefix this all with: I’m not particularly experienced when it comes to Null, and Sov grinding. I’m not a Noob to eve, that’s just not an area I’ve gone into. Most of this stems from the arguments about it that I’ve seen on the forums.

From the sounds of it, the main complaints are:
Grinding Sov is dull, as you have to take out many multi-million EHP structures, to do pretty much anything to someone. Or camp their systems to stop them maintaining their upgrade levels.

This isn’t fun. Not fun at all.

The second is: There’s no space that’s not taken. Even if it’s not being used, it’s not available.

What I’d suggest is the following, with large parts stolen wholesale from Faction warfare.

If a system has neighbors which are not owned by the same alliance, and don’t have upgrades, they are ‘Frontier’ systems. Frontier systems do not improve in Strategic index, unless the system has levels in either Military or Industrial.

In all systems strategic index will decay, if there are no other upgrades.

Upgrades are not anchored at POS any more. They are stand alone structures which generate a deadspace field (with free acceleration gate) The owner can set the size of ship that can enter these. This cannot be changed after installation, without tearing it down. (This includes moon mining facilities)

Upgrades and levels of the indices spawn complexes, which can be attacked by people to reduce the index levels in a system (or knock out an upgrade). When the Indexes hit zero, a final complex will spawn (at a time set by the owner, or X hours away. Just to deal with off hours invasions) which will remove Sov from the system, if defeated.

The higher the levels of indexes, the larger the ships that can enter the some of the complexes. These complexes will have multiple entrances, to make camping the way in more difficult.

Effects:

• If you can get behind enemy lines, you can blow stuff up and mess with their upgrades. And while doing so, you can be sure you won’t be hot dropped, by staying in the smaller complexes. you’ll do less damage in them, but they’ll allow you to chip away.
• Fights should be somewhat more fun that the blobs. As you can always blap stuff in a frigate or cruiser
• Sov isn’t an all or nothing affair. You can hurt an enemy, even if you can’t knock them out. A BLOPs fleet can cause pain.
• You don’t need to take down a POS to get at the goo. I’m thinking a multipart facility. taking it entirely offline is hard, but damaging it so you can steal, easier.

# Useful bits and pieces – Eve SDE

Once you get comfortable with the CCP way of doing things, the SDE isn’t too bad to work with. You’ll have to dig around in it to get some of the numbers you want, and sometimes it’s the opposite way round from what you’d expect, but it’s not too bad, most of the time. Here are a few more useful snippets for getting information on things.