Return to “[Archived] Daily Dev Logs, 2012 - 2015”

Post

Week of March 30, 2014

#1
Sunday, March 30, 2014

So so so so so close...the suspense is killing me :shock: I'm in the final stages of the AI supply / demand price calculation...the critical piece of the market economy that controls how the value of resources flows across economic nodes. I've already got 'project management' implemented so that NPCs in leadership positions understand how to choose lucrative projects and allocate their assets to those projects (by the way, 'project' is my terminology for the union of a task + task metrics + allocations of resources to that task). I've got opportunity caches. I've got markets and supply / demand maps. I've got NPCs capable of delegating and being delegated to.

Now I just. Need. That. Price!! :monkey: And once we have a price...the spice will flow!! :ugeek:

By the way, hopefully you've already seen either of the forum threads or my KS comment, but in case you weren't already aware, I pushed the dev update back by a day so that I can wrap up this economy implementation! Really wouldn't be fair for me to put out a video without paying implementational homage to the ridiculous amount of great theory that Macro March Madness brought us :D

Send the positive vibes my way for the next 12 hours, please :)

PS ~ Behind on weekly summaries? What? Who would have guessed :ghost:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#2
Monday, March 31, 2014

Amazing day for the LT economy. Shame that I didn't get the video quite wrapped up, but at this point, I'm feeling an odd combination of sorry and not sorry. Like...sorry, I know the video is two days late, but...not sorry, LT is getting so much better so rapidly :D

Hopefully if you're reading you've already seen on the forums or KS that I did indeed request one more day :)

But! Today I will at least not skimp on the dev log :geek:

Distributed Double Auctions for Limit Orders on the Market

So I found this whitepaper on some computational game economics algorithms for modeling situations that...oddly...seemed.........almost exactly like what I've got going on here with markets and NPCs and tasks :shock: Really, this couldn't have come at a better time. It came at a moment when I had already acquired enough of the right ideas to really understand what was going on in the paper, but had not achieved full economic clarity, hence, gained awesome insight by reading it! :)

One major thing that the paper helped me understand is the structure of a market and how to resolve orders. I had come quite close to this structure using just intuition, but wasn't quite there. Now I understand - commodity markets, at least for the sake of LT, are comprised primarily of limit bids and asks. E.g., "I want to buy X of Y at no more than Z credits per unit," and "I want to sell X of Y at no less than Z credits per unit." I also read a nice, simple algorithm for resolving sets of bids / asks known as 'distributed double auction.' It makes a lot of sense.

And all of that is now implemented! Which means the LT markets are now 100% real bid/ask-based markets. Now, for the person who does not care much about the economic dynamics in the game, they will never have to worry about this. A 'regular' player is probably just placing market orders at the current trading price, meaning the trade goes through immediately and the whole process is hidden from the user (AFAIK this is how it works in EVE Online, for example). I want to buy some ammo, I click buy, select a quantity, see a total price, and hit a shiny green button (in theory - the trade interface is not yet a reality). As a non-economically-inclined player, this is all very easy and standard. But behind the scenes, the price is calculated from real ask limit orders that have been placed by real NPCs. The converse is true when I want to sell my goods. Behind the scenes, the sale is being fulfilled with bid orders that have been placed on the local market. Hence, everything is 'real,' and the market will be subject to all the usual supply / demand effects, and both the local and global economic dynamics that you would expect of a real market economy.

I guess it goes without saying that, for the economic power player, these markets are going to be endless sources of fun :D The market automatically computes and stores historical data like bid & ask volumes, trade volume, average trade price, average bid & ask price, etc. You have all of this data at your disposal to understand exactly what's going on in the market. You'll be able to very easily tell if a good is volatile, what the bid/ask split is, recognize supply/demand differentials by looking at the volumes, and figure out exactly how much of any given commodity you should be trying to trade based on the trade volumes. All I really need now are a few cool graphs to show all of this :geek:

Very, very cool stuff. I'm not an economics guy, nor am I particularly inclined toward trading in space, but I'll be the first to admit that this really gets me excited...! :D

Progressive Greed for Robust Bid & Ask Price Choosing

I mentioned yesterday that my biggest hangup was figuring out how to compute prices based on supply/demand. With the 'real market,' it's no longer as much of an issue. What is still an issue, though, is figuring out how to place orders when supply or demand is lacking. How to get everything 'started.' At some point, there has to be a 'first trade' for any given resource at any given location. As I've mentioned before, that first trade is a little weird and awkward, because it comes at a time when there is either no supply or no demand, or the bid / ask split has not converged enough yet to facilitate the first trade. Usually it's the former, which is really the awkward case. I want to mine some ore here, and I'd like to sell it there...but there's no established market for this ore at that location. Can I still sell it? Surely. It has value there. But how much? Hard to say without an established market. I will have to make an educated guess, and then wait and see if someone comes along and fulfills my order. Same thing goes if I want to acquire a good from a market where no supply exists.

I have implemented a fairly nice algorithm for solving this today and giving NPCs a nice initial guess :) I won't explain it in detail, but it works off of the principle that, in the beginning, people should be minimally greedy to establish the fledgling market dynamics. Once the markets are established, they can become greedier and greedier until an equilibrium is achieved, where everyone is profiting maximally.

...

Well...I had two more sections planned but...I've already written so much and need to get back to coding! So I'll just leave the headings there so you know what else I did today ;)

Percolation of Resource Value Over Economic Nodes

:)

NPC Project Profitability Analysis

:)

Video coming at you tomorrow! For real this time! :ghost:

PS ~ You've probably noticed something a bit strange about the forums :lol: No need to worry, only a temporary April Fools measure courtesy of a particularly cheeky moderator... :squirrel:

PPS ~ Just to be clear, I know this is April Fools' Day and all, but this is, sadly, not a joke. The update will not come until tomorrow. Sorry! :shifty:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#3
Tuesday, April 1, 2014

Oh...I need to write a dev log :shock:

Guys. Today was...absurd. Just absurd. But I know all you want to know is when the video is coming, so here: ETA = 3-4 hours.

Worth it? Completely. Hard to imagine a world in which I would be more pleased than I already am with this month. Very hard indeed :) I can't believe it all came together here at the end so quickly. And it works :geek:

No more apologies :D

See you soon.
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#4
Wednesday, April 2, 2014

WOW :shock: Probably one of the most legendary knock-outs I've ever experienced. Having awakened from it I now feel as though I've been run over by a train and resurrected by a necromancer eight times on the same day :shock: Intense days.

Anyway.

So that update. If you didn't already realize it, I'm very fond of it. Whether or not you can see the potential in what's going on here, the fact is, this is the beginning of something great :D And to me, this month just felt...really really good. It was like, all of the 'big picture' theory that one could dream for, BUT! I also got really lucky in how quickly it turned into implementation towards the end. Really just a fantastic combo there. So happy the way it worked out!

It would be unfair to myself to not mention the ridiculous number of awesome things that happened in literally the last day before the video, so let's break out the handy old bullet-point format:
  • Recursive sliding grid layout (:wtf: this looks amazing?! Why didn't I think of it before??)
  • Graph nodes and using them for streaming market data
  • Basic planetary dynamics simulation
  • Ability for managers to dynamically switch to new projects & abandon old ones based on the economy (hence the switching between trader / miner)
  • Working price estimation mechanism by NPCs that results in semi-acceptable market dynamics!
This was one day :wtf: The single most productive day in all of LT development I would say :D Although, to be fair, it did have a slight edge on normal days given that I didn't go to sleep :lol:

Oh and why the 4 thumbs down already? Something bothering people about this update? :(

OK! Time to relax. Major relaxation. Like...big time. Not sure what I want to do yet. I know there will be some TES, and I know there will be some Starcraft 2. There will likely be beef nachos from my favorite Mexican restaurant :D WAIT! TES ESO is available now...right? Well there you have it, think I just figured out what my day off is going to be all about :)

See you! :wave:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#5
Thursday, April 3, 2014

Hmmmm dev logs are really at such awkward times these days, don't you think? I wish someone would fix that :think: :roll:

Pretty standard day off so far. Looks like ESO only ships today for me..I ordered one of the physical copies...so I don't get to play yet I guess :( Well...next month! Speaking of ESO, the day's not quite over yet and I do need to pay Skyrim a visit.

Excuse me while I do so :D
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#6
Friday, April 4, 2014

Well, I enjoyed the final half of my day off, and I enjoyed my first half day of April work as well :)

In the last half of my day off, I enjoyed the Skyrim scenery, slept for more hours than I should have, yet still managed to find a bit of time to get my rear handed to me in a few more SC2 matches (you Zerg can all go burn in a very hot place). Quite a success I would say :thumbup: (I mean, other than the rear-handing :( )

As for the first half of April's starting work day...once again taking some time to plan my attack vector on this month. I would say, building on last month's work, this month is going to be primarily about two things: faction play and expanding the economy. These basically correlate directly to the two 'most exciting' features of update #15. Obviously, having the dynamic economy up-and-running is a huge front on which we must push forward :) On the other hand, having the basic NPC 'manager' mechanics in place begs for larger command structures and faction play!

Moving into deeper faction mechanics, I expect last month's zone theory to come into play pretty heavily this month. We will need to see control of territory being reasoned about by leaders in the same way that control of assets is currently reasoned about. In general, the idea of 'control' and how acquisition thereof works as a metatask (e.g., increasing the scale and efficiency of existing tasks) will need to be stated a bit more precisely. As much progress as I've made with manager-level reasoning, I still have a hard time understanding exactly how much of the revenue stream should be fed back into the revenue process (R&D) versus how much should be employed for achieving goals.

Today I've spent a bit of time revisiting labor. In the beginning I didn't think about it very much. After some time, I moved to thinking of labor as an input to a task. Then I moved back to thinking of it as a 'dependent variable' of a task. Now I'm almost back to thinking of it as an input :crazy: The thing is, we'd love to be able to solve for the value of labor using the same market economy that exists now for commodities. How exactly would that work? Well, imagine if a 'man-hour' were a tradeable commodity. Basically, a unit of labor-time. What if I could literally buy 1000 man-hour 'tokens' to redeem for 1000 hours worth of work? That would be pretty incredible, because, just like any other input resource to a task, the value of a labor unit would properly equilibrate in the local economy over time. It would also have the awesome effect of producing a quantitative means of determining whether it's better to hire yourself out or strike out on your own. On the other hand, thinking about how one would set up redemption of such tokens is a bit headache-inducing. How many outstanding labor tokens can one person create? What if that person fails to perform the task allocated? Contracts do seem to make more sense for labor. But goods-based services are just so much more elegant :think:

Anyway, that's just a bit of a teaser for the kind of thought and implementation that we'll be seeing in April! Looking forward to another powerful month :geek:

And offfffff we gooooo!! :squirrel:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#7
Saturday, April 5, 2014

Man. If I make it through hiring & faction membership mechanics alive, it will have been the intersection of at least twenty-seven different miracles. Many neurons have already lived and died, hoping for the coming of these miracles, continually willing themselves to live just a few seconds longer in hopes that the promised land of solutions would arrive. It has not yet :ghost:

The Scope-of-Hiring Problem

The PC / NPC symmetry is really the killer. As a player, I want to be able to hire pilots and then tell them what to do. Right? Right. 'Faction membership,' you might say. I hire them, pay them a wage, and then say "go punish yonder asteroid for hanging about so smugly," and they do so. Yonder asteroid receives his punishment in due time. Nearby asteroids hang about a bit less smugly. The overall smugness in the universe is reduced. It's not much, but it's a start.

Now then. Rewind time. Little old you is just starting out. You've not got the bank to enact vast hiring campaigns and gather a massive labor pool for your ultimate vision of a universe filled with humble asteroids. You need a job, some money, and maybe a drop or two of the old Argon Whiskey. You know where to find at least two of these things. Or do you? Remember the symmetry. All you see is a bunch of greedy NPC leaders looking to hire 'you.' Not hire you for something, but just hire you. What? :shock: Why would I let someone hire me without knowing what my job will be? What if he sends me into the center of the meanest, biggest, smuggest, most armed-to-the-teeth asteroid field in the region? I'm too young to die!! :cry: :ghost:

So then, why should you be able to hire NPCs to do your bidding? Shouldn't you have to tell them what they're getting themselves into? What about the humanitarian NPCs that have no interest in asteroid cruelty? :think:

Here we come to a situation where we need to remember that Limit Theory is a game. For the most part, the PC - NPC symmetry exists to bolster the experience of the player. The idea is that a world filled with actors who are, by-and-large, capable of interacting with the world in the same way as you, should be an inherently more dynamic and interesting world. But when and where a design decision starts to seriously affect the player's ability to have fun is precisely the time and location at which we mustn't hesitate to rip that decision to shreds. I'm not positive yet, but this may be one of those situations.

For the most part, job-based hiring makes an incredible amount of sense. From the AI's perspective, it is easier to reason about. You hire people to do a specific job (task). They are expected to perform that job. Computing your net profit, including wage, is extremely easy. Scaling up and down (hiring & firing) is extremely easy. In general, everything is easy. Similarly, when a player is hired by an NPC, he will want to be hired for a task. A specific mission. Not a retainer. He will want to be told what it is that he needs to do, and he will want to make sure that he knows how he can succeed. He'll also want to make sure that it's a task that he'll enjoy before accepting it.

And yet, what of the player-side RTS play? In a job-based world, you do not simply drag a box around people and say "go kill that thing." You don't say, "sure, I'll hire you for 200 credits a month, now go do a suicide mission against my enemy over there. We'll talk about payment afterwards!" But that is no doubt what many of us want to do. I will want to try it at least once :roll: Sadly, this style of play does not seem to fit into the logical framework of the universe, so we may have to bend the framework a bit :| :ghost:

Tough decisions to be made for sure, but, like all problems, it merely requires a bit more time and a few more sacrificed neurons. We'll get those miracles one way or another. We always do :squirrel:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 30, 2014

#8
Summary of the Week of March 30, 2014
  • Implemented speculative AI supply / demand price calculations
  • Implemented distributed double auction limit order marketplaces
  • Implemented profitability analysis for NPC task selection
  • Implemented recursive sliding grid layout for nodal UI (!! :shock: )
  • Implemented basic planetary dynamics simulation
  • Implemented graph nodes and used them to create basic commodity UI
  • Managed to survive another record-breakingly-painful monthly update, but quite proud of the result!! :D
  • Started working on the scope-of-hiring problem
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford

Online Now

Users browsing this forum: No registered users and 2 guests

cron