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

Post

Week of March 2, 2014

#1
Sunday, March 2, 2014

Started the month off right with another battle-planning day. Many Bothans died to bring us these plans :(

This month, I'm challenging myself to play the game as little as possible. What?? :shock: Yes. I'm challenging myself to do that because it's difficult to focus on the macro-scale and the AI from within the standard game's first-person perspective. What I'm going to do instead, is make maximal use of my external tools wherein I view the game world from a larger perspective (much like the system map, except with more information). That way, I can once again get back to focusing on the bigger picture. That's what this month is all about. The bigger picture :) At this point, the graphics are fantastic, the first-person feeling is quite good, and the gameplay is on the way. I think what most people are concerned about, if there remains any concern, is the bigger picture. The large-scale AI activity, the economy, the rise and fall of factions, the simulation of planetary activity, etc.

Well, it just so happens that I'd like to focus on that this month ;) One might call it....Macro March Madness! :lol:

Not only is this macro focus going to give me a good chance to get back to the good-old-days of AI, but it'll also afford an opportunity to work on things like fleet control and RTS-style command again. Maybe it's a bit too ambitious to think that I can get to all that this month, but there's no harm in trying :D My SC2 playing during the day off has left me with a strong desire to be able to intuitively command large numbers of units while still trying to maintain an economy :)

I hope you'll excuse me, I gotta go see about a universe :geek:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#2
Monday, March 3, 2014

All about that AI :cool: It's good to be back!

Today I introduce a new notion to the AI, in preparation for scaling up and allowing more NPCs to think simultaneously. One of the major performance bottlenecks with the AI at the moment is that it requires sampling to solve certain questions. For example, to answer things like 'where can I buy a transfer unit,' 'where can I mine Viritium,' or 'where can I post a contract,' an NPC actually must pick an object from the world and examine it, either saying, 'ah yes, that meets my criteria,' or 'nope, not that one.' As you can imagine, the answer is heavily-stacked towards the latter. In general, most objects in the world are not a solution to whatever question the NPC is asking. The AI has no way to quickly/automatically filter out objects that aren't even possible candidates, and this causes a good deal of computational waste.

To reduce that waste, today I introduce the 'entity cache' to the AI engine. The entity cache is pretty much exactly what it sounds like - a cache of objects that has been pre-filtered in several different ways to allow fast querying of a number of different questions. It will help NPCs find solutions far more quickly, by allowing them to query the world in a more precise way. Now an NPC can directly say 'I need to find a way to get Viritium,' and the entity cache can hand back a list of entities that have it in the system. Note that this doesn't circumvent the information mechanic: in order to use a result of the query, an NPC still needs to know about it. In other words, as soon as you come into a system, yes, you will be placed into the entity cache for all of your cargo items...but that doesn't mean every NPC will suddenly know about you ;)

What I'm still giving some thought to is at what level the entity cache exists. It makes a lot of sense to have a per-system cache. But I wonder if we could have some kind of hierarchical cache as well? Something regional and super-regional even? Maybe NPCs with higher intelligence could have access to a cache that covers more area, hence, consider more options when looking for the answer to an object-based question. Lots of interesting territory to explore here :think: The good news is that it's very fast, performant territory :D

The more I think about it, the more I come to believe that this general pattern of pre-calculating information about the game world and caching it for use by all NPCs is going to be one of the critical factors in allowing me to scale the AI up to the scale that I'd like. I need to identify all of the places where I can factor out computation without changing the expressiveness of the AI. That's one of the great things about the entity cache - yes, it provides fantastic acceleration of NPCs' thinking, but it doesn't at all influence the results! The NPCs' thoughts remain equally expressive. That's awesome!! :D

Well, as I guess you figured out from the tone of the log, the entity cache and related ideas currently live only in a densely-populated region of my notebook...tomorrow we will see how they look when transferred to implementation ;) Hoping for huge speed gains and lightning-fast AI reasoning :geek:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#3
Tuesday, March 4, 2014

Powering through, but not there yet :geek:

I'm working on the entity cache, the interface, the AI architecture..everything at once! :) I'm almost done with the entity cache and I gotta say, the more I write, the better I feel about it :clap: Everything feels right - the way the entity cache is basically just operating on the component nature of objects, the way the AI solvers query the cache to get an immediate, exact solution to finding the type of object they need to put together a plan that makes sense...it all feels right. I probably should have done it this way from the beginning :think:

To understand why it is so fundamentally different, consider an NPC that's trying to figure out how to make some money. Via heuristics, he knows that 'selling' is one way to do that. Previously, the NPC would have to sample the space of inputs to the 'sell' action to try to find one that reported feasibility. The NPC might consider all sorts of strange things like selling ore to jump holes, selling credits to chunks of ice, etc. :lol: That same expressiveness allows the AI to be highly creative, however it's obviously wasteful. The better way to solve it is to place constraints on the parameters of any given action. For example, we can say that the target of a 'sell' action needs to have a market. We can say that the item being sold needs to have some value. We can say that the item being sold cannot be credits :roll: This creates a constraint solution problem that vastly reduces the size of the valid input space. But without any fast way to solve those constraints, it really makes very little difference whether you solve the constraints via rejection sampling and then assemble the action, or whether you just assemble a random action without regard to the constraints, and then check that it is valid (this is what the AI did previously).

It always made me a little uneasy that the AI had to use rejection sampling to solve things. But now, we can do so much better, because the cache allows us to solve basic constraints in constant time. I can now directly say 'give me an object with a market,' and I can directly say 'give me an item with some value that's not a credit,' and get solutions immediately. This means that I can assemble a sensible 'sell' action in constant time, with very high probability that it will make sense. Does it guarantee that the overall plan will be a good one? No, definitely not. But just being able to traverse the space of 'sensible' plans efficiently is a huge step towards large-scale AI. I cannot wait to see the results....! :D If I can get to the point where literally no cycles are ever wasted on considering an impossible / nonsensical action, then I will be a very happy camper. And so will the NPCs. I imagine their brains will feel a lot less fuzzy :ghost:

In other news, I'm still working on the external viewer tools for checking out the universe, and am making solid progress towards a nice RTS view. As I've mentioned before, my ultimate goal is to get back to the 'command interface' look. This time, of course, it will be completely implemented in terms of the nodal UI. So when the nodal UI is capable of effortlessly building something as cool as the command interface, well...we'll know that we've won ;)
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#4
Wednesday, March 5, 2014

Ok, yes, I did plenty today: I finished the e-cache, used it to implement very fast AI reasoning, whipped the AI back into shape to the point where we're (once again) mining, etc etc. But I'm more excited about something else right now, so I want to talk about that instead! :D

Today, feeling that I didn't have a solid handle on what I wanted to achieve for the macro game, I decided to try to visualize and describe it more precisely. They always say visualization is key to making it happen, and I absolutely agree with that. Sometimes I get lost in that world of coding but forget why I'm coding, or what I'm trying to achieve. So today I've outlined my vision for the macro game (the large-scale things that are happening as you play in the LT universe). I'm actually really excited for it now :D I realized, what I want to / need to see is...an RTS, where AI factions are duking it out on-screen! I mean, that's obviously what's supposed to be happening in the background of LT all the time. Living universe and such. Everyone going about their business while you go about yours. But it never really clicked for me that, when you watch the game from a higher-level perspective than the first-person (e.g., from my tools' omniscient perspective), it should actually look much more like a legitimate real-time strategy game where factions are hiring people and gathering resources, building, researching, expanding, declaring war, harassing each other's operations, and of course, mounting full-blown attacks and takeovers. Not just a blob of entities doing random things. No, it should look structured, strategic, and intentional - like an RTS. It should be a fun game in it's own right, just to watch the LT macro interactions unfold! Wow, wouldn't that be so ridiculously exciting to watch (and even more-so to learn about it as you play at the low level)? It's exactly what LT needs to look like in order for the macro game to be compelling. Why I didn't look at it like this before? Who knows. I'm thick-headed :shifty:

So I've got a three-step plan to see this LT-RTS appear on-screen. In the first phase, I will just be looking for a basic gather-construct-attack loop. This phase will be ensuring that basic AI is working, that the AI can chain together simple tasks to achieve goals (both the faction leader as well as the subordinates), and that combat 'works'. In the second phase, I will want to introduce technology and the idea of teching up, as well as strategy (such as countering your opponent's technology). I will also want to see tactical maneuvers. In the third and final phase, I'll want to see large-scale construction (new stations), leading to expansion into new territories to set up new operations, as well as dynamic and intelligent interaction with the surrounding world (really 'plugging' the RTS into the world of LT). I'll probably also want to see scouting and intel play. That third phase may need to be split up into more phases as it's quite large :D

Really, the insight here is that, by dropping the details of the micro game and viewing the game from a larger perspective, we can more effectively construct interactions on a larger scale, which will then remain in place when we later drop back down to the micro. I think that makes a lot of sense - for a game that spans so many scales, you need to split it up and focus on making each level of scale a compelling experience. You also need to have a model for what a compelling experience looks like at that scale, so that you can say whether or not the game achieves it. What does the compelling micro-scale experience look like for LT? Of course, it has to be Freelancer :D But what does the compelling macro-scale experience look like? More like EVE, an RTS, or 4X game.

I'm so excited...I just wish I had more hours in the day so I could get this to unfold faster :geek:

PS ~ Have you noticed this pattern of me getting interested in random things, then channeling that interest into a core piece of LT? I think that's how I work best. Remember when I got obsessed with structural programming? Remember how that turned into the data editor, and then into the node-based UI? Yeah. That was pretty great. Now, for whatever reason, I'm strongly interested in strategic, large-scale play (mostly inspired by RTSs). I think this is coming at exactly the right time, as I'm going to channel that excitement to build the macro part of LT. Finally time to get the big picture in place. Great timing, too :thumbup: :D

PPS ~ Maybe I should have said '4X' rather than RTS. I guess an RTS is mostly focused on warfare, but the LT macro game can be focused on a number of different aspects, and doesn't necessarily have to be violent.
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#5
Thursday, March 6, 2014

Such focus. I think I can count the number of unproductive minutes of today on one hand :geek: It's definitely a result of my excitement to see this macro game come together. For once this week I have not gotten enough sleep (which is, of course, a good thing) :D

At this point, I've got the individual AI established and working. Most of the hard work remaining for the first phase of the macro game lies in the delegative AI, and figuring out how to frame everything to make faction leaders work most effectively. This is where delegation must step up to the plate. This is where the LT AI shows that it is a social creature, capable of command and of complex interaction with other beings.

Lots and lots of questions here to be answered. How does a faction leader think of resources? Does he think 'I wish to acquire resources for myself,' or 'I wish for my faction to acquire more resources'? How does the faction asset pool work? Is it like an access control list? Or more like a tiered pool, where each level of the faction hierarchy has access to higher- and higher-valued assets? How does a leader form individual units into coherent groups (such as fleets for attacking, mining ops, trade convoys)? Is it by delegating a leadership task to a subordinate, and letting the subordinate effectively 'become' the group? How does a leader reason about 'hurting' his enemies? How does a leader reason about the most effective ratios of allocation when he has hundreds, perhaps even thousands of resources (subordinates) to allocate to tasks? What about the leader himself? How does he reason about his own worth and what he should be doing with himself, when he has potentially-thousands of other beings that he can allocate to any given task?

Yes. Lots of questions, and many answers on the way. Factions are coming. They're coming quickly :D

Sorry I can't provide those answers yet. But a few more days of this no-minute-wasted mentality and I'm certain we'll have more than a few ;)

PS ~ Still no press on Update #14, which I think is a shame given that it's definitely one of, if not the, best yet :cry: Where are you press folk....I know you're out there somewhere.... :) :squirrel:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#6
Friday, March 7, 2014

Ah, nothing like a nice, relaxing Friday night...just kick back, and curl up with a nice copy of...................'Corporate Finance, 3rd Edition'?? :wtf: Yep. That's how exciting my Friday night was ;)

I kept grinding the mental gears concerning factions today, and I just started to realize that I don't have enough of a clue how groups of people really do operate (in the real world) to answer all those questions that I kept bringing up. I thought, you know, corporations in the real world have long since solved all of these problems. I should probably look to them for help. Hence my first foray into understanding corporate finance :geek: So I read a few hundred pages of one of the leading textbooks in the subject, so that I could get a better grasp on how things work. I glossed over a lot of the mathy parts that were more focused on the market economy (I'll come back to that in a bit ;) ). For now I just want to understand corporate structure, management, and especially the relationship to shareholders. This was definitely a worthwhile experience, as I have a lot of inspiration and insights related to faction play now.

The first major insight came after only a few pages of reading. The text emphasized how a corporation, in the U.S., is treated very much like a legal entity in and of itself, separate from the owners, managers, and employees. A corporation has it's own assets, liabilities, taxes, etc. For LT, at least, this makes sense to me and clarifies the whole factional assets concept. It's simple: a faction's assets are completely separate from the owners & members. If faction money is used for a purchase, the purchased asset belongs to the faction. The faction is an entity. It has it's own bank account, essentially. Assets do not transfer in or out unless there is an equal exchange of cash (e.g., someone buys or sells an asset to/from the faction). Money does not transfer in and out unless there is an investment, or a work-related compensation.

Until now, I've been thinking of factions as kind of...a person hiring other people to do work. But I realize now that's a very dry and, frankly, wrong way to look at it. I think a faction is much more about a group of people coming together to achieve common goals that they would have difficulty achieving on their own. "Hey, let's set up a trade station in this outskirt system. It would benefit us all!" and thus, Borderlands Trade Corp. is formed. Yes, you can still hire people to do stuff. But I think that's actually not the core of a faction. I would rather think of the core of a faction as a 'mission statement,' along with assets, management, and shareholders who are dedicated to furthering that mission statement. You can think of factions as the entities that are trying to bring about large-scale changes in the universe.

In fact, I actually like to think of factions a lot like Kickstarter projects! Hear me out here. Reading all of this corporate finance stuff, I found it a bit dry how we basically invest in companies for two reasons, both of which are about money: 1) dividend payout and 2) capital gain (e.g., stock price increase). True, you can also invest just because you like what the company is doing. But the tangible rewards are...monetary. Frankly, I'm a lot more inclined to invest in a Kickstarter project. Why? Well, for one, Kickstarter projects have very clear, tangible goals that are generally a lot more focused in scope than corporate goals. But secondly, Kickstarter projects offer rewards that I actually care about. Not dividends, not future money, but shiny goodies like game boxes and maps and little models of in-game characters and all those other wonderful things that I actually do care about :D What if that's how a corporation worked in LT? What if shareholding was more like KS backing? First of all, you know the mission statement of the faction. If you like what they're trying to do, you may invest simply on the basis of wanting to see that goal achieved (it could be anything from developing new weapons technology, to crippling the operations of another company, to developing a mining outpost in a previously-empty system, etc. etc..). On the other hand, they could also provide an incentive structure. A 1000-credit investor may get docking rights with that faction's assets for as long as the investment is held. A 10,000-credit investor may be entitled to a few hours of having a single escort ship from the faction, once a week. A 100,000-credit investor may be able to rent one of the company's research modules for his own use as long as the investment is held, etc. I suppose, for the sake of having a tangible value associated with the investment, there should also be a dividend payout.

Of course, for those that only care about money, shares can still be traded for the purpose of capital gain. Just like in the real world, a faction's shares will increase in value as the faction becomes more profitable and pays higher dividends. That only makes sense. Shares in LT aren't necessarily a gameplay feature, so much as a necessity to allow factions to raise capital effectively.

So. We've got a good bit of faction mechanics established right now. We know why they're formed and what they're supposed to do (a group of people wanting to achieve one or more large-scale goals). We know how they get capital to make things happen (offering shares to the public). We know that they are entities in and of themselves, and that their assets and cash belong strictly to the company. Most of my remaining questions are concerning management and employees. What exactly is the relationship of an employee to a faction? In this case, I think I would rather break from the real world's model. I want it to feel more personal than just being a cog in the machine, getting a paycheck, etc. But how? To be determined :D

PS ~ Sorry, I know this wasn't a particularly coherent dev log, but I had a lot of thoughts to get through today...:crazy:

PPS ~ I'm not married to the 'incentives structure' idea. I recognize that monetary dividends are the most 'efficient' mechanism for rewarding investors, as that money can then be used by the investor to purchase whatever it is that the particular investor cares about.
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#7
Saturday, March 8, 2014

Oh man. Ohhhh man. It's coming. That macro AI...it's coming :D

Today I had a massive revelation concerning macro AI and how to think of corporations. The key is a very simple conceptual change: don't think of large-scale AI in terms of discrete actions, think of it in terms of processes. Same for a company - don't think of it in terms of the actions that it performs, think of it in terms of the processes that it sets up.

Let's have a look at the implications of this. If you want to get really cute, you might look at this as a shift from 'time domain' planning to 'frequency domain' planning, in a similar way that the scanner shifted :) Instead of planning discrete actions, for the macro AI we want to plan periodic processes. Instead of 'planning trees,' 'process trees.' This way, we require no effort to continuously do something, which is a good thing.

Instead of thinking about preconditions, action, and postconditions, when an AI is designing a long-term plan (especially for a company's business strategy, for example), the AI will think in terms of input, process, and output. It will connect these together like a circuit to form a business operation. For example, suppose we want to build a business to produce product P1 and sell it to market. We can have a process 'produce P1 at L1,' where L1 is our factory site. As an input, the process requires the raw materials that are needed to produce P1 - call them R1, R2, R3. Let's say we know where to find R1 and R2, because they are raw ores that can be extracted from nearby asteroid fields. We can set up processes 'mine R1 at M1' and 'mine R2 at M2', two different mining sites that will provide the raw materials. These processes happen to take no inputs. However, the outputs are R1 @ M1 and R2 @ M2 - location matters, so we must set up two additional processes - 'transport R1 from M1 to L1' and 'transport R2 from M2 to L2', so that we now have R1 @ L1 and R2 @ L1, which is exactly what our production process requires. But, alas, we don't know where to find R3, and we still need it to produce. Luckily, OmegaCorp happens to sell R3 in bulk. We create a contract process with OmegaCorp to provide R3 @ L1. As an input, the process takes R3 @ L1 (which belongs to OmegaCorp), and credits (which belong to us), and outputs R3 @ L1 (which belongs to us) and credits (which belong to OmegaCorp). So a contract process basically just changes the ownership of the inputs / outputs. Contract processes are the boundaries that designate where one corporation ends and another begins. And voila, now we just need to create transportation processes that take P1 to markets, and we've got a working business! Once we have the structure of the process tree set up, it's very simple to quantitatively evaluate the the net input / output, which can tell us whether we've created a profitable business or not (in this case, it depends mostly on how cheaply we can buy R3 from OmegaCorp, and how good of a price we can get at the markets where we choose to ship P1). Furthermore, from the process tree we can ascertain things like 'startup cost' to set up the processes (we will need to purchase mining equipment and production units). To satisfy startup costs we can try to start small and fund the venture out-of-pocket, or we can try to start medium-to-large by IPOing and leveraging the shareholder capital to purchase our equipment. In the latter case we will probably need to divulge the process tree to prove to other NPCs that it is a profitable business model.

Already, with this conceptual model, you can see how an AI can quickly learn to build massive businesses. Once the process management algorithm is in place, I see no reason why an NPC couldn't outperform any real-life operations manager :geek: A really intelligent NPC could, perhaps, create operations involving thousands of processes occurring all over a region, perhaps involving hundreds of contracts with third-parties :D For the AI it is no problem. And the process model is so conceptually elegant that...ah. You know. It's just great :monkey:

Now, it gets even more exciting when we think about 'meta' processes. This is something that I was never really able to understand in time-domain planning: how to get 'better' at something. But in terms of processes, I think I really understand it. You can understand that every process has factors that influence throughput. In general, 'quantity' is always an implicit factor - you can always assign more 'processors' to increase the throughput of the task (be it production units, subordinates mining, etc.) However, consider that the process of mining can be increased in throughput by increasing the transfer unit efficiency. You can understand this to be a 'meta' input to the mining process - although it's not actually an input, the transfer unit efficiency influences the way the process works. Hence, if you want to invest in increasing the efficiency of your processes, you will want to achieve higher transfer unit efficiency. Suddenly, we see exactly where research becomes a demand in the economy! A big mining corporation that wants to focus on increasing operational efficiency will have a demand for new transfer unit technologies, which can lead to the genesis of a new company dedicated to transfer unit research, for example. One minute you're trying to build up a great mining company, the next minute you're seeing the IPO of a new research firm with a mission statement that is suspiciously similar to...well, exactly what you need! Dynamism, supply and demand, the birth and death of companies, cooperation and competition, ...just a few of the buzz words that will need to be used to describe how amazing this macro game is going to be :geek:

I know I've been fairly incoherent today and yet have only just touched on about 10% of this new macro-AI model...but...can you see how powerful this is? Can you see how ridiculously cool this is going to be for macro AI? Gah. So. Awesome!!! :D I haven't even mentioned things like the demand for protection on trade routes (creating opportunity for merc corporations), the demand for corporate espionage and outright attacks (creating demand for destruction of the competition's assets), etc. There's so much to talk about. But let's save some of it for another day :ghost:

PS ~ Yes, today's revelation was also inspired by textbooks...today I read some 'operational management' and 'strategic management' books...man, I never realized that stuff actually means something :shock: Amazing!!

PPS ~ In case you haven't noticed, I'm on a roll. This month is going to be amazing :cool:

PPPS ~ Oh, also forgot to mention - process trees? LOD simulation? Do I even need to say it? The net effect of a process tree can be expressed as a simple list of time-dependent changes in the world. Simulate a year coarsely? Sure, just multiply the effects by a year. Boom.
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of March 2, 2014

#8
Summary of the Week of March 2, 2014
  • Implemented entity cache for faster / more accurate AI planning
  • Started serious planning for the macro game
  • Studied corporate finance and operational strategy books to better understand factions in LT
  • Lots of progress on faction and large-scale AI theory
  • Process-based AI breakthrough!
“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 1 guest

cron