Fractal Softworks Forum

Starsector => Mods => Topic started by: LazyWizard on June 14, 2012, 02:16:29 AM

Title: Economy Mod (yes, it's still in development)
Post by: LazyWizard on June 14, 2012, 02:16:29 AM
LazyWizard's Economy Mod

What will be included:

First and foremost, trade convoys will serve a purpose other than bringing the player new toys. They will also be the primary money-makers for factions (there might be other ways for a faction to earn credits, depending on balance needs). While there won't be direct player control over the economy, you will be able to hunt down and destroy these fleets to weaken a faction, with the possibility of eventually driving them out of the sector if you are aggressive enough. Alternatively, you could protect these fleets, leading to more and better supplies showing up in stations. It's up to you.

And because not every player wants to end up the sole survivor in a dead sector, I'm also planning on including ways to resurrect dead factions.

What might be included:

The big idea is dynamic fleets. Instead of creating their fleets from a static file somewhere, the faction will build a custom fleet based on available funds, technology, and need.

There are other ideas floating around, but I hate getting people's hopes up. Really, the plan is to include whatever I can get working. If you have any requests, I'd love to hear them.

What won't be included:

Player trading. Sorry, but there's no efficient way to monitor that right now. If this changes, I'll let you know.


For a more detailed look at the various components of this mod, as well as the current progress on each, see the next post (http://fractalsoftworks.com/forum/index.php?topic=3159.msg45694#msg45694) in this thread.


Mod compatibility:

Unfortunately, this won't be compatible with most other mods right out of the box. However, any mod maker who wants to integrate these systems into their own mod has my full permission to do so, though they should keep in mind they will have to tear it out once the real economy arrives. I've tried to keep this all easy to implement, though there is some work involved. I'll go into detail on that some other time.

Screenshots:
Spoiler
(http://i.imgur.com/0ATUp.png)
[close]

---------------

Original post:
Spoiler
I got bored yesterday and decided to throw a mod together. There's not much to show yet, but I'd like to officially introduce:

LazyWizard's Economy Mod

(note: this wall of text is temporary. I'll replace it with something more coherent as the mod progresses)

So what will this mod actually do?

Exactly what it says: add an in-game economy. It will also optionally add an endgame to Starfarer; more on that in a bit.

The current plan (subject to change as I explore what is possible with the API) is to give each faction a limited amount of funds to buy ships, weapons, and supplies with. Funds will be spent buying trading fleets, and lost when those fleets are destroyed. Trading fleets will get greater inventories as their available funds increase. This gives players a choice: you can protect these fleets so the station will be stocked with more goods and ships (and future fleets will carry higher-tech stuff). Or you can destroy them to damage a faction's economy and weaken their future fleets. Factions who are taking massive damage to their economy will start spawning fewer, larger fleets - this is so a low-level player can't take a faction out singlehandedly - as well as fast-but-powerful fleets to hunt down attackers (two Odysseys with Augmented Engines and a dozen fighter wings? Hell yes!). If a player manages to continue their piracy despite this, they can leave the faction unable to afford replacement ships, and thus effectively defeated - hence, an endgame.

I plan on releasing two versions of this mod. One will be as described above. The other will provide a constant flow of resources from out-of-sector to poor factions (representing support from back home), preventing permanent annihilation for those who don't want their game to end.


Why are you making this? You do know Alex is going to add a real economy to the game later, right?

Yes, I do know that. I fully expect this mod to be completely overshadowed and abandoned once the real thing materializes. This whole mod is actually an excuse: an excuse to learn the Starfarer API, an excuse to re-learn Java after letting my skills rot in favor of C#, an excuse to code something interesting. Usually when I make something like this I keep it to myself, but I've read that others want a more dynamic Corvus and I figured I could help.

And if I run into some missing API functions and nudge Alex about them, well, it's all for the benefit of the rest of the modding community, right? (sorry in advance, Alex! :D)


Will this be compatible with other mods?

With the way I have it set up now, only with extremely simple mods like ship tweaks. Corvus.java is extensively modified, and I plan on completely revamping the spawn points as well. Eventually I'll have to rewrite almost all of the faction data unless I can get direct fleet building to work (other modders: is there an API hook to add/remove ships from a fleet directly?).

However, if after I release this any enterprising modder wants to add my systems to their existing mod, feel free! Just remember it will eventually be obsoleted. ;)


So what do you have so far?

Mostly a headache ;). Like I said, it's been a long time since I touched Java, and that was Java 1.6. Janino is 1.4 with a few 1.5 features bolted on. Half my time is spent being frustrated at what I can't remember anymore, or at features Java lacks that C# has; the other half is being #!% that what I do remember isn't implemented in Janino. Progress should speed up as I re-acclimatize myself.

However, I do have a very basic economy server up and running. At the moment it's less than 300 lines of code, but the basics are there: it stores the necessary information on a faction's economy, can register new factions and look up existing ones, add/subtract funds, and prints out a nice financial report every in-game week. Right now it's running dummy data (it isn't hooked into Corvus yet beyond creating the economy server and filling it with faction data), but my next task is to start getting hooks into events going on in the sector (mainly tracking the status of trade fleets for now). The current short-term goal is to have trade fleets earn money for their faction upon delivery. Next I want them to base their cargo on how much that faction can afford. I'm taking this one step at a time.


When will you release a working version?

I honestly don't know. Probably not soon. I've been able to make cheap hacks to get around current limitations in the API. It's entirely possible that I'll run into a brick wall where the API hooks for something I absolutely need don't exist yet, and I'll have to wait for the next release.

If I do release soon, it won't be even slightly balanced, playable, or fun. I'm mostly concerned with getting the basic systems in place, not making sure all the math works out. That part requires extensive testing, and that's what you all are for. :D


If it won't be released for a while, why bother putting up a post now?

Simple. I needed a break feedback. Comments, ideas, awed praise, that sort of thing. And if another modder spots something in my description that will give me a headache implementing, it'd be nice to know now so I can redesign.


And finally, for anyone who cares (and somehow made it through that massive wall of text):

Who the heck are you? What experience do you have?

I'm just some guy, nobody special. You'll probably see me around the forums sometime. I don't post often, but when I do, I make them way longer and more technical than I need to. (Case in point! ;))

As for my experience, I'm a hobbyist game developer. I've also made game mods for my own personal use for over a decade. As for real experience, I was a programmer on a MUD (proto-MMO) for six years. Not much else to tell.


Wait, you make us read that massive novel and don't even give us a screenshot?

What, really? It's an economy mod, it has the most boring screenshots in...

You know what? Fine. Whiner. :)
Spoiler
(http://i.imgur.com/LuyoW.png)
[close]
[close]
Title: Re: Economy Mod (in development)
Post by: LazyWizard on June 14, 2012, 02:19:59 AM
Feature list:

CORE (required for the mod to function):

DYNAMIC (actually make the economy do something):

MISC (extras/feature creep):

Legend:
 * Implemented and working
 * In, but not thoroughly tested yet
 * In progress/unstable feature
 * Upcoming feature
 * [BLOCK] - API methods to allow this feature are not in the current Starfarer version, so I'll have to write workarounds

Note that upcoming features might change if something turns out to be unworkable.
[/list]
Title: Re: Economy Mod (in development)
Post by: Upgradecap on June 14, 2012, 02:35:58 AM
Wow! :o
I know this mod will be abandoned once real game economy kicks in, but this just serves as proof of what the API could do currently.


Might I interest you in a recruitment offer for the CAELUS team? ;D
...
Title: Re: Economy Mod (in development)
Post by: arcibalde on June 14, 2012, 03:29:43 AM
WWWOOOOOOOOHHHHOOOOOOOOOOOOOOOOOOOOO   !!!!

OMG Dude just, you know what, I... Make it and I will bring YOU tons of COOOKIEZSSSS  ;D
Title: Re: Economy Mod (in development)
Post by: Vandala on June 14, 2012, 04:51:23 AM
Sounds nice, I wish you good luck.
Title: Re: Economy Mod (in development)
Post by: Aratoop on June 14, 2012, 05:11:37 AM
 Sounds awesome  ;D
Title: Re: Economy Mod (in development)
Post by: Uomoz on June 14, 2012, 05:12:44 AM
I highly anticipate more development.

Just in case, will it be possible (or, more precisely, will you allow me) to implement this into Uomoz's Corvus?

Awesome work so far, keep it up!
Title: Re: Economy Mod (in development)
Post by: LazyWizard on June 14, 2012, 06:11:27 AM
Thanks, everyone. :D

Quick status update: trade fleets are being partially monitored now (creation and orders are handled from the econ server, no tracking of successful trade runs yet but that's next on my list). I've also been making custom data structures so the economy code isn't such a mess (damn you, lack of generics). It's currently 8:00 AM here and I'm still up (and at that level of tired where I spend more time staring blankly at the screen than coding), so I think I'll crash for several hours before I get to work on the hard part.

Wow! :o
I know this mod will be abandoned once real game economy kicks in, but this just serves as proof of what the API could do currently.


Might I interest you in a recruitment offer for the CAELUS team? ;D
...

I'd have to decline for now. Every time I try to juggle multiple large projects I end up neglecting one of them. Maybe when I get this mod released and stable I'll join. :)

Just in case, will it be possible (or, more precisely, will you allow me) to implement this into Uomoz's Corvus?

Feel free. I've been trying to keep it simple to implement the economy server and add new factions to it, but at the very least you would have to replace all trade convoy spawn points with the new version I'm making (I think I'll leave normal fleet spawns alone for now). And like I said in the main post, this will all be obsolete eventually, so remember you'll have to rip it out once the real economy is implemented. :)

Registering a new faction with the economy is easy right now, just econServer.addFaction(String displayName, String factionID (the one used in FactionAPI), float startingCash). This is the code I'm using to set up factions in Corvus.java right now:
Code
        // The SectorEntityToken the EconomyServer is attached to doesn't matter
        EconomyServer econServer = new EconomyServer(sector, system, hegemonyStation);
        system.addSpawnPoint(econServer);
       
        econServer.addFaction("Hegemony", "hegemony", cashHegemony);
        econServer.addFaction("Tri-Tachyon", "tritachyon", cashTachyon);
        econServer.addFaction("Pirates", "pirates", cashPirates);

The hardest part for mod makers will be generating the list of technology for each faction, and that's mostly busywork. I haven't finalized the structure for that yet, but you would need to specify what technology each faction has access to and how rare each item should be. There might be more data needed, but I'll try to generate as much of that automatically as possible.
Title: Re: Economy Mod (in development)
Post by: Upgradecap on June 14, 2012, 07:12:17 AM
Well, I'll be keeping my hopes up you'll be able to release a stable version of this mid this month, so that we may hire you ;)
Title: Re: Economy Mod (in development)
Post by: mendonca on June 14, 2012, 11:05:19 AM
*awed praise*

Sounds very natty indeed! Good luck getting things up and running in earnest!
Title: Re: Economy Mod (in development)
Post by: Alex on June 14, 2012, 12:08:31 PM
This looks very cool :)

If you do find something lacking in the API, I'm all ears - it's definitely missing lots of functionality it's eventually going to need, I just never had the time to really go through it (but will at some point!).

(damn you, lack of generics).

Tell me about it - I've got half a mind to write a regex for pre-processing, just so you can use generics in most cases. It's a pretty tricky one to get right and still be sure you never get a false positive, though.

Btw, while we're on the subject of Janino: whatever you do, don't use "break" and "continue" inside a loop. There's a bug (in Janino) that will cause the compilation of the next unit to fail with an obscure error. The annoying thing is there's actually a fix for it, but they never released that version... will have to make a custom build of it at some point to fix that, I think.

Also: while Janino doesn't support annotations, there is a hack in SF that allows the use of @SuppressWarnings (so you can get rid of those "hey! you're not using generics!" warnings) and @Override (because eclipse sticks those in all over the place) annotations. In fact, any line that contains those as a substring will be replaced by a blank line (to keep the line numbers consistent...).

(Did I set a record for the number of parentheticals in a post? Perhaps.)
Title: Re: Economy Mod (in development)
Post by: KriiEiter on June 14, 2012, 03:59:43 PM
This entire thread is why I love this community so much.

Alex, you're awesome.  Community, you are awesome.
Title: Re: Economy Mod (in development)
Post by: silentstormpt on June 14, 2012, 06:26:47 PM
Also: while Janino doesn't support annotations, there is a hack in SF that allows the use of @SuppressWarnings (so you can get rid of those "hey! you're not using generics!" warnings) and @Override (because eclipse sticks those in all over the place) annotations. In fact, any line that contains those as a substring will be replaced by a blank line (to keep the line numbers consistent...).

Have you tried NetBeans, cause personally i hate eclipse for that reason and a few more
Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on June 14, 2012, 07:06:43 PM
 Holy crap...you actually did get him to do it. :o
I look forward to this. ;D
Title: Re: Economy Mod (in development)
Post by: Alex on June 14, 2012, 07:32:24 PM
Have you tried NetBeans, cause personally i hate eclipse for that reason and a few more

It's all about the same - Eclipse, NetBeans, IDEA. Just comes down to what you're used to, imo, and I'm used to Eclipse.

I could probably configure it to not insert those annotations - but they're in general good! The "problem" is really Janino not supporting them. But I don't want to get into an ideological "this IDE is better" type of argument :) I think they're all pretty damn good.
Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on June 15, 2012, 08:18:48 AM
You know this mod is good when Alex starts posting here. ;D
Anyway, why'd you change the spawns?  Any particular reason?
Title: Re: Economy Mod (in development)
Post by: LazyWizard on June 15, 2012, 08:28:11 AM
You know this mod is good when Alex starts posting here. ;D
Anyway, why'd you change the spawns?  Any particular reason?

To tie them into the economy. If the faction can't afford to replace lost ships, they won't. If they have extra money, they might up the tech on their ships.

The other reason was to separate trade and combat fleets. Trade fleets are significantly more complicated now. ;)
Title: Re: Economy Mod (in development)
Post by: Upgradecap on June 15, 2012, 08:41:01 AM
So, when can we expect an stable release? I'm eagerly awaiting it.
Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on June 15, 2012, 08:43:45 AM
So, when can we expect an stable release? I'm eagerly awaiting it.
Probably not anytime soon.  Maybe in the next month or so, but I could be wrong.
Title: Re: Economy Mod (in development)
Post by: LazyWizard on June 15, 2012, 08:57:48 AM
It's still very early in development, I mean, it's only been two days. I might release a barely functional version to you guys in the next week or two so you can play around with it. No promises. :)

I've been kind of distracted today, what with moving to a new IDE and writing a bunch of tutorials for other modders, so progress was limited. I also had to rewrite a lot of what I wrote yesterday (tired code is NOT good code :P). I'm currently working on rewriting spawn points and splitting them between trade convoys and combat fleets. I've also been designing the code that selects the inventory for trade fleets.

Technical details: Right now, each faction has an array of possible items along with a rarity value for each item. When a fleet is created, it's given a budget and the array of items is shuffled. Then I run down the array, checking if the item is too rare to be purchased (the rarest items have a 1/5 chance each pass, the most common will be purchased every time they are run into) and if there's enough money in the budget for it. I repeat this until I go though a complete pass without buying anything (meaning the budget ran out). I'm still balancing this (convoy inventories are waaay different than in vanilla Starfarer), but after this and making successful trade runs generate a profit, the economy will be officially (barely) functional. There's still a lot to add after that before the mod is feature complete, but again, one step at a time.
Title: Re: Economy Mod (in development)
Post by: DarkerThanBlack on June 15, 2012, 09:24:38 AM
Kudos man  :D
Maybe you can git the code so others could contribute to the mod?

I too am looking into something to sink some coding time. Like you I am a C# dev but I do have a history in java.
Title: Re: Economy Mod (in development)
Post by: ClosetGoth on June 15, 2012, 12:21:52 PM
If he put the code on git then I think it would help people contribute and learn. Regardless, I think he should work on it on his own until he has finished a lot of grunt-work, so that a million people aren't telling him to do what logically follows next in his project. Although, if he ever encounters a problem, putting it on git is a great way to solve it very fast!
Title: Re: Economy Mod (in development)
Post by: ohzee on June 15, 2012, 01:02:39 PM
So in this mod the cargo ships are going to have a LOT of stuff in them? Making them more profitable for the attacker?
And if I keep attacking trading ships I can get a faction out of the system? Now that's going to be very fun. :)
Title: Re: Economy Mod (in development)
Post by: mrsnuggles on June 15, 2012, 04:06:38 PM
So in this mod the cargo ships are going to have a LOT of stuff in them? Making them more profitable for the attacker?
And if I keep attacking trading ships I can get a faction out of the system? Now that's going to be very fun. :)


in which case he might want to beef up the supply fleets
Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on June 15, 2012, 04:26:49 PM
Does it cost money for the factions to launch a convoy?  If it does, it might make sense for the faction to keep tabs on how much money is made from each run.  If it starts to loose money from convoys after a while (perhaps due to piracy, or lower produce cost), might that faction stop launching them?
Title: Re: Economy Mod (in development)
Post by: LazyWizard on June 15, 2012, 06:58:45 PM
So in this mod the cargo ships are going to have a LOT of stuff in them? Making them more profitable for the attacker?
And if I keep attacking trading ships I can get a faction out of the system? Now that's going to be very fun. :)

Not a LOT of stuff (they still have to worry about accidents), just different selections than vanilla. I think vanilla-sized trade fleets will often carry less cargo in them than before. The selection test code will occasionally pick something obscenely expensive like multiple Onslaughts, which would cripple their budget (I'm working on this).

Although you could babysit trade fleets to make sure they get to their destinations. That would give the faction more money to spend on larger fleets, and thus more cargo. On the flip side, keep in mind that the more piracy you commit, the less profit you will make in future attacks until they have time to recover.

in which case he might want to beef up the supply fleets
Does it cost money for the factions to launch a convoy?  If it does, it might make sense for the faction to keep tabs on how much money is made from each run.  If it starts to loose money from convoys after a while (perhaps due to piracy, or lower produce cost), might that faction stop launching them?

It does cost them money, but they will spend much less on the items than you would, and should make huge profits if they manage to reach an outpost (and I think most trade fleets reach their outpost in vanilla). Trade fleets will change their makeup based on the budget they used to purchase supplies (more valuable cargo = better escort; factions that are almost bankrupt will have tiny trade fleets). At the moment, I'll have to do this by adding a ton of new fleets to the faction file, but hopefully there will eventually be a way to set up a fleet entirely in code.


Which actually reminds me. I'd like to make a few demands requests of the dev team (this forum really needs an evil emoticon):


I guess I also have some questions:

Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on June 15, 2012, 07:06:40 PM
Umm...how big will these new trade fleets be?  After seeing the Pirate convoy (a ton of tarsus and enforcers), I'm scared to see what these new ones look like. :o
Title: Re: Economy Mod (in development)
Post by: DarkerThanBlack on June 16, 2012, 08:36:47 AM
I've started to look into a dynamic fleet management system.

My thoughts on how an organic faction should work. I will try to implement this in my quest to further grasp the api.
I will go into the basic outline of how I envision the core objects behavior of the mod... wall of text below

a) There should be a "Faction" object for each active faction.
This object should hold information about the faction funds, desired fleet size and type and a list of "Advisers" (we will get into this below) ... other stuff too

b) The faction behavior will be dictated (at least partially) by the type and number of fleets it will desire to achieve.
There should be a specific set of fleet types, ex: scout, raider, light assault, light defense, escort, convoy and other ...
Each type of fleet would have a characteristic behavior (ex: scout will explore as far as possible and try to avoid fighting) and a specific set of ships (ex: scout will have 1-2 light fighters or so ...)

c) My plan is to have each fleet be an "individual" entity and one of the objectives the fleet will have is to return occasionally to the main base for refitting and upgrading.
When doing so it will request of the "Faction" object to run maintenance and upgrading if possible. The faction will run throw the list of advisers an decide what to do with the fleet in question.
Thus if conditions are met a "Light Assault Fleet" could be refitted and upgraded to the next level "Medium Assault Fleet".
The faction will always try to aim for the specified fleet configuration. Upgrading a fleet would be more cost effective as oppose to creating a new fleet.

d) The "Advisers", I envision the advisers to be the core of a faction behavior.
There will be a list of them and each one will respond to a specific type of ActionRequest. For example:
There could be a FleetShipAdditionAdviser that is tasked with the question "I have a fleet requesting upgrade. Shall I upgrade it?".
If the response is "Yes", the task will be executed taking into consideration the available faction funds.
These Advisers could dictate the outcome of all sort of ActionRequests like: "Should I create a new fleet?", "Should I dispatch a escort mission?" and so on ...

Questions:
Now that I've bored you with my idea for the mod I would like to know a few things that could help me in the process of implementing it.

1) Can we have a "Faction" object that will host all sort of info like Name, Home, Desired Fleet Types, Funds and so on ...
2) Can this "Faction" object have a queue of ActionRequests that gets filled by all sort of events like, fleet has died, fleet is requesting rearmament, enemy fleet close to base and so on
3) Can each fleet be individualized? I will like to have the CampaignFleetAPI extended to support all sort of stuff like the Type of fleet and Name, basic stuff like that.
4) The assignment GO_TO_LOCATION_AND_DESPAWN, can we have this trigger/queue a specific event that can be hooked and proceeded by the advisers. I would like the fleet to not be disbanded, or another fleet to be created after this.
5) Can the assignment system be extended? I don't see how atm.
6) Is there any dependency injector? Can we access/use it in our mods?

Thank you ::)
Title: Re: Economy Mod (in development)
Post by: ciago92 on June 17, 2012, 12:35:42 PM
I would just like to say that I love this mod's idea. I really hope this gets off the ground :-)
Title: Re: Economy Mod (in development)
Post by: KriiEiter on June 17, 2012, 01:46:36 PM
So is there going to be new cargo items that are dedicated solely as commerce/trade, for making money?  AKA luxury items/ raw resources that would net better profit in a different star system/planet?
Title: Re: Economy Mod (in development)
Post by: hadesian on June 18, 2012, 11:04:06 AM
How's it going?
Title: Re: Economy Mod (in development)
Post by: sdmike1 on June 18, 2012, 03:23:15 PM
 :o :o :o :o :o
if this was minecraft i would give you diamonds  ;D
Title: Re: Economy Mod (in development)
Post by: sdmike1 on June 20, 2012, 12:02:11 PM
So how goes it?
Title: Re: Economy Mod (in development)
Post by: CrashToDesktop on July 04, 2012, 07:35:28 PM
I got bored yesterday and decided to throw a mod together.
Boredom...is an amazing thing. ;D
Gets me to do stuff I'd rather not do for my life. :)
Anyways, I hope you get around to that update you talked about in the other thread, good luck.
Title: Re: Economy Mod (in development)
Post by: LazyWizard on July 05, 2012, 01:26:02 AM
I updated the main post. Hopefully a simple color-coded list of features will be easier to keep up to date.

-------------

Sorry about the lack of updates. I did a near-complete rewrite of the mod since the last time I posted. I realized it was becoming a nightmare for modders to implement; the new version is much cleaner and simpler to hook into an existing mod.

Also, I finally got trade convoys working last week. It might not sound like much, but that was a pain to figure out. Here's a screenshot of the very first successful trade run:
Spoiler
(http://i.imgur.com/1AMkg.png)
Ignore the discrepancy in the Hegemony funds, it's just some lingering test code that gives them cash each day.
Also, ignore how ugly this is. It looks much better now. ;)
[close]

With trade convoys implemented, the core of the mod is complete. Things should go slightly faster after this. I won't give an estimate on when this mod will be finished - ever since I mostly abandoned the API to work directly with the core code*, things have gone much slower. Obfuscated code is evil. It also opens up some major compatibility problems, but I'm willing to put in the effort to fix things after each update.

I'm currently working on dynamic fleets. I think I've figured out how to get that functional, so I won't have to use the workaround of having dozens of fleets defined in the faction files. Balancing this is going to be fun. </sarcasm>

One final, minor change. I realized one-use financial newspapers were a terrible idea in a future dystopian setting, so I changed it. The new concept is that you're paying a bribe to a friend in the faction to get them to pass along information to you. This also means that if diplomacy is added in the future (by update or mod), there's a justification for receiving less information if you're hostile to that faction, or having to pay more.

*Other modders, don't worry. You will only ever need to pass in API objects to the economy. It will do all the heavy lifting for you.

-------------

Stuff that's probably only interesting to other modders below:

Per-faction technology is finished, sort of. I might need to re-write it later, it's ridiculously inefficient. You pass a massive list of technology to the faction, it creates each ship/weapon/whatever, grabs the needed data off of it, assigns it to the relevant categories, then discards the created object. This is kind of like ordering every item on the menu at a restaurant, taking a single bite of each one, then throwing them all away. In this analogy, finding a simpler method would be like asking the waiter what the meal tastes like. On the upside, all you need to do is pass a list of variant/weapon names and rarity values to it, and it does all the work. It's pretty foolproof. ;)

I've also been working on helper classes that should be useful to other modders. Mostly they let you bypass restrictions of the current API, but some of them are just for convenience. Working on them isn't taking away development time from this mod, because I'm making heavy use of them myself. I'll release them to the modding community soon-ish.
Title: Re: Economy Mod (yes, it's still in development)
Post by: sdmike1 on July 05, 2012, 02:23:43 PM
thank god that this mod is not dead!
 
Title: Re: Economy Mod (yes, it's still in development)
Post by: ClosetGoth on July 05, 2012, 03:06:10 PM
Holy wow, this gets better and better! I am really looking forward to this mod, and I think it will probably end up either being integrated into vanilla, or used as a basis for the vanilla economy (if done right). At worst, it is the basis for many mods that surpass current mod capability and epicness.
Title: Re: Economy Mod (yes, it's still in development)
Post by: Upgradecap on July 05, 2012, 03:10:36 PM
At worst, it is the basis for many mods that surpass current mod capability and epicness.

Why at worst?
Title: Re: Economy Mod (yes, it's still in development)
Post by: Sunfire on July 05, 2012, 03:18:25 PM
At worst, it is the basis for many mods that surpass current mod capability and epicness.

Why at worst?

he means at the least
Title: Re: Economy Mod (yes, it's still in development)
Post by: keptin on July 05, 2012, 05:52:28 PM
This is hands down my most anticipated mod.  I look forward to the first release and its continued development.
Title: Re: Economy Mod (yes, it's still in development)
Post by: sdmike1 on July 29, 2012, 11:11:41 AM
This is hands down my most anticipated mod.  I look forward to the first release and its continued development.
This /\
Title: Re: Economy Mod (yes, it's still in development)
Post by: ciago92 on August 09, 2012, 09:52:30 PM
just praying this is still alive and kicking. it has amazing potential! hope to see a release soontm
Title: Re: Economy Mod (yes, it's still in development)
Post by: LazyWizard on August 09, 2012, 11:33:48 PM
just praying this is still alive and kicking. it has amazing potential! hope to see a release soontm

What, this old mod? It was cancelled a month ago. Did I forget to make a post about that?



... Totally kidding. All jokes aside, development has been a bit slow lately. Since my last post in this thread I've only worked on this mod a few hours a week (and not at all since .53 was released, as I was experimenting with the new API changes). After a lengthy conversation with Alex last month, I will only be using API methods from now on. I have yet to update the mod with said changes (which is extra sad since I knew what was added to the API in this update a full ten days before the rest of the forum), but I'll put aside some time this weekend to do that. The big thing that's broken right now are trading fleets, as the current item value code is too transitory to be included in the API. I'm still brainstorming workarounds for this, as it's pretty crucial to the mod ;).

-------------------------

Holy wow, this gets better and better! I am really looking forward to this mod, and I think it will probably end up either being integrated into vanilla, or used as a basis for the vanilla economy (if done right). At worst, it is the basis for many mods that surpass current mod capability and epicness.
This is hands down my most anticipated mod.  I look forward to the first release and its continued development.
This /\

Wow, no pressure, guys. ;)

Now that I think about it, I think it's time I unleashed the:

Great Expectations (Lowerer)

Keep in mind that this mod really is just something I'm throwing together in my spare time. Don't expect some professional-grade economic systems here - I'm not looking to recreate X3 or Eve. I didn't choose to make an economy mod because I'm good at math (I'm at best only above average), but because I enjoy coding complicated systems. Also, this is explicitly a temporary mod, so I've avoided making the economic systems too detailed. A lot of what I'm implementing will be pretty basic stuff, at least at first. If I feel something could survive an actual economy implementation, I've been putting more effort into it.

-----------------------------

And because I'm a lying liar who lies, I'll follow that paragraph with a list of all the stuff I've been working on for the past month. I'm not exactly sure what the current state of completion is on some of these, as it's been almost two weeks since I even glanced at the code. :(

First up, there are several new inventory items. I mentioned bribes last time, and those are definitely in and working. Bribes are relatively cheap (5k currently), and allow you to get a one-time glimpse into a faction's finances. There is a small chance that you will be caught each time you purchase one of these, leading to a reduction in faction relationship. There is also a chance that the official will take your bribe and run (only if you have negative relations with that faction, and again only a chance). If either of these events occurs, the item disappears from the store for a few weeks to represent the time spent finding a new official amenable to bribes.

Second, you can now hire hackers to grant your fleet access to the faction's financial network. This is expensive, but permanent (though I might add a small chance to be caught over time), and is required for the weekly financial report I've shown in previous screenshots to include that faction. When you first start a new game, only the player will be shown in these reports (more on that later).

Third are donations. These are used to revive dead factions, or if you want that faction to bring better cargo in future convoys. The donations are anonymous, so you don't get a relations boost by buying them. Right now there are three 'tiers' of donations with set costs, though I might switch to a single 1-credit item with a massive stack size. Opinions?

Modders:
Spoiler
These items are relatively painless to implement. You just need to follow the proper item id naming conventions (factionID followed by base item name), and they will be added automatically to any faction stations registered with the economy. If the item doesn't exist (for instance, if you decide your faction is too pure to accept bribes), that particular feature will be disabled for that faction.

Here's an example resources.csv that includes entries for the Hegemony
Code
name,id,cargo space,base value,stack size,icon,order
"Anonymous Donation - 10,000",hegemonydonationlow,0,10000,10,graphics/icons/cargo/econ/donate.png,101
"Anonymous Donation - 50,000",hegemonydonationmed,0,50000,10,graphics/icons/cargo/econ/donate.png,102
"Anonymous Donation - 150,000",hegemonydonationhigh,0,150000,10,graphics/icons/cargo/econ/donate.png,103
"Bribe Hegemony Official",hegemonybribe,0,5000,1,graphics/icons/cargo/econ/bribe.png,104
"Hack Hegemony Financial Network",hegemonyspy,0,50000,1,graphics/icons/cargo/econ/spy.png,105
[close]


Aside from the items, I've also been working on implementing player trading fleets (though I'd better hurry before Verrius overtakes me! ;)). The way these are planned to work is that there's a station that's basically a clone of the Abandoned Station, with one item already in the inventory. You mothball the ships and items you want in your convoy, then take the item. That triggers the creation of a friendly fleet using the stuff you dropped into the station, which immediately heads out of the sector. Provided you equipped it well enough to survive to the maps edge, it will return after a week or so. If it makes it to your station again, it dumps the ships that survived, and you get the value of the cargo plus a very healthy profit on top. This will all be implemented as a sort of pseudo-faction in the economy, so you will show up in the financial reports and everything.

There are also a few secret mini-projects, but I don't want to reveal anything on those until I know for sure that they are possible.

--------------------------

Again, sorry about the lack of updates. Whenever I sit down to write one of these posts, I end up spending hours on it no matter how short I tell myself I'll keep the post. It leads to me not wanting to post at all, as it takes away from time I could spend coding. If I go too long without an update, just PM me a nudge and I'll try to get around to making another post. :)
Title: Re: Economy Mod (yes, it's still in development)
Post by: keptin on August 10, 2012, 01:30:27 AM
Any economic system is worth getting excited over because of that additional layer of depth.  Don't worry about high expectations damage control, this is understandably a player mod with API limitations, dev time constraints, and the possibility of wavering dev interest.  The potential I see in mods like this and Verrius' is that at this stage in game development, it can help shape how Starfarer officially manages its economy and API, for example.  It doesn't have to become a super mod to be influential, just talking to the devs about what you need from the API and flushing out things that they only have on paper has a positive impact.
Title: Re: Economy Mod (yes, it's still in development)
Post by: CrashToDesktop on August 10, 2012, 08:04:51 AM
Ah-ha!  That last paragraph is my favorite already. ;D
Hopefully you'll need to provide crew and supplies to that fleet as well, no?
Title: Re: Economy Mod (yes, it's still in development)
Post by: sdmike1 on August 10, 2012, 07:44:26 PM
 Just wondering are you modding the .class files or are you using the API?
Title: Re: Economy Mod (yes, it's still in development)
Post by: LazyWizard on August 10, 2012, 07:49:46 PM
Just wondering are you modding the .class files or are you using the API?

API only. Modifying Starfarer itself would be against the license agreement. ;)
Title: Re: Economy Mod (yes, it's still in development)
Post by: Verrius on August 13, 2012, 06:41:19 PM
Aside from the items, I've also been working on implementing player trading fleets (though I'd better hurry before Verrius overtakes me! ;)).
I am impatient! The Fleet Control mod is literally detrimental to my health, it only exists to tie people (myself included) over for when somebody better can surpass it. The stuff I do is actually very basic things built off of stuff people have done before.

So hurry up before I lose my job or something :p. I actually sort of miss having a only slightly popular kitbash mod.
Title: Re: Economy Mod (yes, it's still in development)
Post by: sdmike1 on November 28, 2012, 09:35:57 AM
So how is it going?
Title: Re: Economy Mod (yes, it's still in development)
Post by: silentstormpt on November 28, 2012, 11:01:16 AM
I can figure it out by the amount of access to the API Alex added that the next update will take a while
Title: Re: Economy Mod (yes, it's still in development)
Post by: sdmike1 on November 29, 2012, 09:08:26 AM
I can figure it out by the amount of access to the API Alex added that the next update will take a while
Ok, thanks!
Title: Re: Economy Mod (yes, it's still in development)
Post by: LazyWizard on November 29, 2012, 09:15:33 AM
Quote
Last Modified: Sunday, ?September ?30, ?2012, ??10:55:51 PM
I got a bit distracted with work on the console mod ;). Now that that's released, I'll have time to work on this again.

Now, to figure out where I left off...
Title: Re: Economy Mod (yes, it's still in development)
Post by: sini002 on December 30, 2012, 11:36:08 AM
so is this mod dead or still alive?
Title: Re: Economy Mod (yes, it's still in development)
Post by: arcibalde on December 30, 2012, 01:28:23 PM
so is this mod dead or still alive?
Shush!! Do not disturb the Master!!  :P
Title: Re: Economy Mod (yes, it's still in development)
Post by: sini002 on December 30, 2012, 02:58:29 PM
so is this mod dead or still alive?
Shush!! Do not disturb the Master!!  :P

so i take that as a yes?  ;D
Title: Re: Economy Mod (yes, it's still in development)
Post by: LazyWizard on December 30, 2012, 03:16:54 PM
I'll answer on the alive/dead thing in a few days. I have another big project planned, but if that mod concept turns out to be impossible I'll resume work on this.
Title: Re: Economy Mod (yes, it's still in development)
Post by: muther22 on January 01, 2013, 08:45:56 AM
I quite like the idea of this mod.  I look forward to more information regarding it.

Shush!! Do not disturb the Master!!  :P
Where's the Doctor when you need him?