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

Post

Week of March 23, 2014

#1
Sunday, March 23, 2014

Getting there. All it takes is hours. Lots and lots of hours :| I can't wait to get my RescueTime graphs back so I can show you what I'm talking about... :ghost:

Hammering Down the Task / Manager Paradigm

I swear this one is going to be the death of me. The relationship between jobs, the one carrying them out, the resources being used, etc. It's going to destroy my soul, one day at a time :shock:

My current implementation is a 'tasks' component, including a task stack, a 'metatask' (I call it the 'management' task), and a manager. Is that the right structure?? Who knows. I've accepted that I'll probably never know the right answer to this, but I have to just pick something and roll with it. This seems like the best thing I've come up with so far :ghost: The theory is that the tasks stack can be changed only by the manager or a superior entity that has control over the given object. The tasks are changed either by direct delegation from a superior, or by the manager via the metatask.

The nice thing about this structure is that it unifies pretty much all AI within the game, and eliminates the need for a dedicated NPC 'brain' as I previously had. I won't do away with it just yet (I've been known to get a little trigger-happy with code deletion :shifty: ) But it seems that pulling out the task structure in this manner is going to really clear up the NPC-related code. That will make me happy :monkey: I mean, my soul will be destroyed, as per above, but at least I'll be happy... :lol:

Opinions: Everyone's Got One...

I replaced the old 'standings' system (which dated back to LTP) today with a modernized and generalized 'opinions' component, which will handle interpersonal / interfactional standings. The interesting thing about the new system is that it's framed in much more general terms. It allows, for example, for an entity to have an opinion about not just another person, but an item, a zone, a station, etc. What I'm thinking is that this could be used to bias NPCs in certain ways. Giving certain NPCs a strong liking for a certain location, place, etc. Similarly, it could be used to allow NPCs to 'learn' to avoid things that cause them problems (a zone where they keep getting attacked, a station where they have no luck finding a job, etc.) Could be interesting :)

Time for more hours? Why yes, I would say so :D
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 23, 2014

#2
Monday, March 24, 2014

Feeling much better today, as there does appear to be an end in sight! :)

Planetary Colonies as Black Box Task Networks

I've spoken before of how we might use planets as a mechanism for 'kickstarting' ( :lol: ) the economic simulation by providing a source of initial demand. Today I've expanded upon that idea and had a bit of a breakthrough with respect to how we can treat planetary colonies!

What I'd like to do is to consider colonies to be 'black box' task networks. You know their inputs and outputs (supply & demand), but you don't know (nor do you care about) the actual inner workings that create that supply and demand. The really great thing about this is that it then allows us to simply define a number of colony 'types' in order to shape the economic dynamics of the game as we like! For example, we can have mining colonies that require transfer units and perhaps food, and output various raw materials and ores. We can have farming colonies that require nothing (or maybe clothing, common goods, etc.) and output food. We can have industrial colonies that require raw materials and output various produced goods. In each case, we understand the task network in the exact same way that we understand planets: at a broad level-of-detail, rather than at the level of specifics. IMO that is exactly the place where planets come into play, and it's exactly why they have a unique and important role within the game: because they provide high-scale, low-detail abstractions for the gameplay dynamics that already exist!

Needless to say, we can still introduce other interesting planetary mechanics: growth and decline of colony population (corresponding to influencing the rate / scale of the task network), spawning new colonies, colony events such as disasters or economic boons, gradual transitions from one type of colony to another, etc. But the basic concept of a planet as a collection of colonies, where each colony is a simplified, high-scale task network, is a really solid concept IMO! :)

(And yeah, it probably sounds like 'common sense' for how you would expect planets to behave. But that's the funny thing about good solutions...they always feel like commons sense after you've heard them ;) )

Bounds and Volume in the Nodal UI

For a long time, I was under the delusion that a nodal UI removed the need for thinking in terms of bounded volumes. A traditional UI is conceived in terms of positions and sizes (usually x, y, w, and h). It seemed a good idea to me to conceive of a nodal UI strictly in terms of positions and the relationships between those positions. The idea is somewhat akin to point-based rendering, as opposed to surface- or volume-based. The nice thing about point-based representations is that they're the 'thinnest' possible representations; they carry the least amount of data. Naturally, that comes with drawbacks.

Today I finally introduced a stricter concept of bounds and volume to the UI, such that the region of space owned by any node is well-defined, much like in a traditional UI. Everything is still 'nodal' in mechanism, of course. But now we can think of a nodal layout not just as a way of relating points, but as a way of filling a volume. Perhaps most importantly, we can be much more comfortable with rendering more than just a single point for some types of nodes (this is going to be very important in some up-and-coming interfaces!)

Awesome Window Manager

As a side-note, I thought it might be worth mentioning that I've recently switched to using the 'awesome' window manager for linux (yes, it's actually called 'awesome' :shock:). Definitely lives up to it's name, and if you're a linux person and like productivity...I highly recommend giving it a shot :) Kinda makes you wonder why anyone ever thought that arbitrarily-placed and sized windows was a good idea... :wtf:

Into the final days we go!! Draw your swords noble Limit Theorists! :D
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 23, 2014

#3
Tuesday, March 25, 2014

Holy mother of the universe! This is just getting out of hand with these dev log times, isn't it :oops: Sorry!

Planetary Colonies and LOD Simulation

I spoke yesterday about how a planetary colony is basically a high-scale, low-level-of-detail version of the gameplay mechanics. In exploring the implementation today, I realized that this was basically where I start to implement the very same LOD simulation that will be used to simulate far-away systems!

That actually makes total sense - a planet is considered to be, essentially, a LOD simulation in the exact same way that the economy of far-away systems will be a LOD simulation. When I introduced task networks (under the name 'processes'), I briefly mentioned how they're awesome for LOD simulation. The reason is because they basically are low-detail models of what happens in the game world.

Ok, this really isn't anything new or revolutionary - in fact, it dates back to the revelation that I had...oh...was it, April-ish of last year? That was when I first realized that LOD sim and AI conceptualization of the world are the same thing. So this is a concept that I've grown to know and love over the past year. But it's nice to finally see it in action :)

Sorry to disappoint, but I'm in a whirlwind of a task network at the moment (and just woke up, to boot)...so I've got to get back to it! :)

No more dev log lateness records. Seriously :think:

PS ~ As of today I've got a real-time RSS feed of the forums on my second monitor. I see all :ugeek:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 23, 2014

#4
Wednesday, March 26, 2014

Yes. That is all. :)

Unification of LOD Tasks and Tasks

No need to think of LOD tasks any differently from normal tasks - they still have input, output, dependent capabilities, and requirements. The difference is that execution of a LOD task is direct execution of a change in world state, whereas execution of a standard task is execution of a behavior intended to cause a change in world state.

Today I implement LOD tasks as tasks themselves, allowing a unified interface for running any level of simulation. Planetary colonies are now able to happily run LOD simulations using the same logic that an NPC uses to execute a task-related behavior.

Unification of Colony and NPC Skills

Just a quick thought here, stemming from my continued implementation of colonies: colonies have aggregate skills, just like NPCs, that act as 'capabilities' for the task network taking place in the colony. In the same way that an NPC can have skill in combat, mining, piracy, etc., so can a colony have aggregate skills that influence the efficiency of their task network output!

Makes sense, right? Colonies are just big people :D

Technology Nodes: Implicit??

So I was thinking today. Technology nodes, as I have conceived them thus far, have a 1-to-1 mapping with blueprints. That is, when you have a breakthrough and unlock a new node in the tech tree, you are unlocking exactly one new blueprint whose attributes correspond to the direction of research.

However, I've been taking the tech tree a bit for granted. In light of this 1-to-1 correspondence, is there any actual value in having a visible tech tree? Is that not implicit in the collection of blueprints that you have? Isn't selection of a tech node to research the same as, for example, selection of a blueprint to continue researching?

I'm open to thoughts on this issue. Is the tech tree a valuable thing, or can it be implicit in the blueprints you own? :geek:

Only a few days to go :shock: Must work faster!! Going to be hunting for some code miracles in the days to come :geek:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 23, 2014

#5
Thursday, March 27, 2014

Same old everything. I could write 20 sub-headings and tell you how I made progress on each, or I could just tell you right here, right now: there are 20 walls to climb and I am climbing all of them at once. Did I make it over any today? No. Am I darn near the top of many of them? Absolutely. Am I ruling out a coding miracle? No. Is a coding miracle in progress? I think it might be. Or not! Those things are always hard to see from the inside when they're in progress you know :monkey: :think:

I have come so, so, so far in Macro March Madness. It has been a month of so many theories, of so many clarities. Now it comes down to this. How do I show it to you. How do I show you what a beautiful, elegant, and interesting place this world will be. I must show it and I must show it now.

Don't count me out yet, friends. I am optimistic :ugeek:

Oh, and I gain about 25 extra minutes by writing a short dev log...who knows what can happen in 25 minutes... :lol:

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

Re: Week of March 23, 2014

#6
Friday, March 28, 2014

Code miracle in progress. I'll be perfectly honest, I don't know how much of this is going to be visible in the video. Hopefully quite a bit. But the more important thing is that the beast is coming alive. Really, there's no stopping it now :D I've had basically all the macro-level breakthroughs I need (several new ones today!!!) :D Apologies, once again, if this log is lacking in coherence. So much to explain.

Today I finally understood money, supply and demand, life plans, the universe, and everything :monkey: Let me explain! :geek:

Money Solves Everything

It's an idea that I've been beating around for quite some time, but without having really come to a full understanding of it until today. Previously I looked at money as just like any other resource. This is a mistake. The purpose of money is far greater than that. The power of money is far greater than that. The key is in the fact that it is an intermediary. But until today, I had not appreciated just how much the presence of an intermediary simplifies everything!!

From an algorithmic perspective, money literally makes everything easier. A good way to understand this is in terms of path finding, since ultimately, that's what AI is (graph searching). If I have a resource X and I want to figure out how I can change it into resource Y, the problem is immediately recognizable as a graph problem. Resources are nodes, and tasks are edges. Without money, this problem is a full-blown graph search. It is very, very computationally expensive. But what money does is really quite beautiful. It says: "look, you don't need to solve a full graph problem. You just need to convert your resource into money, and then convert that money into your target resource." The statement is simple: to convert X to Y, I first convert X to money and then money to Y. The introduction of the 'universal' intermediary completely kills the complexity of the problem. The only 'searching' involved is how to convert a resource to money and back again. But this is not a search at all, as there is only one type of task that does so (at least for the purpose of LT): using the market.

Embedded in this understanding are numerous subtleties. Perhaps the most beautiful of all is that: by relying on supply and demand to dictate the conversion rates to and from the intermediary, we implicitly solve the full graph problem in a distributed way. I will put my resource X on the market, and issue a 'demand' for Y. If there is an easy path from X to Y, someone else may recognize it. They will buy X, produce Y, and fulfill my demand for Y. The credits that they receive for doing so should implicitly equilibrate to the path length from X to Y, plus a markup factor that reflects the cost of expended capability*time (e.g., man-hours). If it does not, a competitor should recognize the differential, say "hey, I can take X to Y for a lower price and still turn a profit," and voila, the price should be driven down up to the theoretical minimum of the cost of production. In my theoretical understanding of economics, I do not see why prices should ever drop below the cost of production. For LT I will assume as much is true, although I'm sure numerous people could present me with odd cases where this happens in real life, for whatever reason :roll:

But this has been trivial so far. Let's look at something less trivial. Suppose the existence of a path from X to Y to Z. Now we begin to see the power of the 'distributed' solving that money allows. I want to take my X to Z. I do not see how I can do it. But I trust that money can make it happen. Hence, I put my X on the market and issue a demand for Z. One NPC recognizes that he can produce Z if he has Y. He issues a demand for Y. Finally, another NPC recognizes that he can take X to Y. He buys my X, creates Y, and fulfills the demand for Y. The first NPC then takes the purchased Y, converts it to Z, and the path is then complete. At no time did anyone inside the system have to solve a complex graph problem. At no time did anyone need to determine the true path length from X to Z. And yet, we have established an economy which is implicitly capable of converting X to Z for (in theory) the cost of the path length.

Note that it will inevitably take some time before supply / demand is able to equilibrate to reflect the optimal path costs. In some sense, one could look at it like running an iterative Bellman-Ford solve on a graph, or something like that. Seems to me it's basically what an economy is doing. During the time of instability, there will no doubt be some bad trades made. But I imagine this time can quickly be overcome in historical simulation, and, by the time the player enters the universe, the economy can be sunk comfortably into equilibrium.

What beauty. I have never had more respect for the theoretical power of currency as an intermediary :shock: :lol: (Don't worry, my interest is only theoretical :P )

Bipartite Task Network Planning

Going further with the idea of money as a common ground for resource acquisition, we can actually make the mechanism of macro-level planning even more precise than it was before. We can look at macro-level planning as consisting of two distinct task networks: one for obtaining money, and the other for using it (corresponding to the discussion above that any resource translation can be broken into X-to-money and money-to-Y). Basically, we don't care about the direct correspondence between our capabilities and our goals. Yes, it will be nice if they align. But ultimately, we should be practical above all else: we should create a plan to make money using our capabilities, and then create a separate plan to use money to fulfill our goals. This allows us to very precisely understand the purpose of all of our actions. We are either trying to maximize the monetary output that our capabilities afford us, or we are trying to maximize the goal output that our money affords us. Again, using our understanding of money as an intermediary, this is actually equivalent to optimally using our capabilities (as well as the capabilities of the local market) to achieve our goals!

Implicit Resource Pipelines

So far I have not mentioned how this macro view of resources incorporates the previous idea of explicit 'task networks.' You might say, "well, that's all well and good, but what if there's no one else around to solve the other steps in the path for the NPC? How can an NPC set up a full production pipeline with just his lonesome self?" But wait a minute...there is someone else around! There's...himself! :crazy:

Who cares if an NPC is alone in his ambitions and trying to set up a production chain in the middle of nowhere? The process still works!! You see, he still puts his X on the market and issues a demand for Z. However, he also notices that there is now a demand for Z that no one is attending to, and he sees a way to take Y to Z. He issues a demand for Y. Woah, look, now there's a demand for Y that no one is fulfilling! And he sees how he could take X to Y! And look! There's a supply of X! He buys his own X, takes it to Y, sells it to himself, takes it to Z, and...there you have it! :D

Sound a bit strange? Yes, perhaps. But at the same time, it's ridiculously-elegant. Who cares if the resources / credits do not actually change hands! From the algorithmic perspective, an economic joint that is supplied and demanded by the same person is just a special case of the more general notion. Here we have the exact same effect as full production pipelines. YET. We have an iterative mechanism for creating them one step at a time, AND, even better, we expose each link in the pipeline to the public market, which, at worst, will have no effect, and at best, will allow outsourcing to someone else who will handle it more cheaply and efficiently than us. AS IF THAT WASN'T ENOUGH, we also have the added benefit that supply and demand is fully exposed at all links, rather than just at the beginning and end of the pipeline. Hence, significantly more opportunities are created all over the place. Suddenly, both the player and other NPCs can see loads of opportunities to jump in and help increase the scale of the operation taking place. All at once, the universe lights up with opportunity.

Wow.

Wow wow.

Now that, on a scale of 1 to 10, is awesome.

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

Re: Week of March 23, 2014

#7
Saturday, March 29, 2014

No time. No time for dev log, no time for...anything! Really just not enough time :shock:

Yes, that is all I have to say for the moment. Considering the abundance of yesterday's words, I feel no shame in the scarcity of today's :think: But more importantly, these minutes have use elsewhere!

Back to the coding cave!

:shock: :geek:

(It's been a long night and there is no sign of it ending anytime soon :ghost: )
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 23, 2014

#8
Summary of the Week of March 23, 2014
  • Implemented new and more general AI opinion system
  • Planet colony 'low-LOD task network' theory + implementation!
  • Implemented bounding volumes in nodal UI for tighter control over space
  • Implemented LOD task simulation as...a task :crazy:
  • Massive revelation concerning money as intermediary :D
  • Bipartite planning theory (making money, spending money)
  • Implicit resource pipeline theory!
Note from future Josh: this week was just fraking ridiculous...well-done past Josh, well done :shock:
“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