Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3 4

Author Topic: Economy Mod (yes, it's still in development)  (Read 37072 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Economy Mod (yes, it's still in development)
« 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 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
[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
[close]
[close]
« Last Edit: July 08, 2012, 02:44:36 PM by LazyWizard »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: Economy Mod (in development)
« Reply #1 on: June 14, 2012, 02:19:59 AM »

Feature list:

    CORE (required for the mod to function):
    • Master economy object - runs the mod's timed events and keeps track of the factions
    • Faction support - Each faction has their own separate economy
    • Player information - Provide some way for the player to monitor the economy
    • Trading runs [BLOCK] - Successful convoys contribute to a faction's funds

    DYNAMIC (actually make the economy do something):
    • Technology lists - Per-faction technology availability (required for other features)
    • Ship purchasing [BLOCK] - Buying fleets costs a faction credits
    • Fleet builder - Fleets change depending on how many credits a faction can spare
    • Improved spawn points - Hook spawn points into the fleet builder
    • Dynamic cargo - Trade convoys intelligently select their inventory (being re-written)
    • Faction defeat - Remove bankrupt factions

    MISC (extras/feature creep):
    • Donations - Allow the player to directly contribute to a faction's funds
    • Trust - Player's knowledge of a faction's economy is based on relationship with that faction
    • Convoys use inventory - Convoys use ships in cargo, then strip/repair/sell them at the station
    • Multi-sector support - Low priority

    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]
    « Last Edit: September 24, 2012, 05:46:31 PM by LazyWizard »
    Logged

    Upgradecap

    • Admiral
    • *****
    • Posts: 5422
    • CEO of the TimCORP
      • View Profile
    Re: Economy Mod (in development)
    « Reply #2 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
    ...
    Logged

    arcibalde

    • Admiral
    • *****
    • Posts: 1730
      • View Profile
    Re: Economy Mod (in development)
    « Reply #3 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
    Logged
    Creator of:
    Relics MOD - vanilla balanced - Campaign integrated
    Vanilla addon MOD - vanilla balanced - Campaign integrated
    Project ONI MOD - mission only

    Vandala

    • Admiral
    • *****
    • Posts: 1841
    • We need ponies, ponies in spaceships!
      • View Profile
    Re: Economy Mod (in development)
    « Reply #4 on: June 14, 2012, 04:51:23 AM »

    Sounds nice, I wish you good luck.

    Aratoop

    • Admiral
    • *****
    • Posts: 613
      • View Profile
    Re: Economy Mod (in development)
    « Reply #5 on: June 14, 2012, 05:11:37 AM »

     Sounds awesome  ;D
    Logged
    Quote
    The community's response to a change is inversely proportional to its importance.

    What do you call a dog who's a magician? A labracadabra

    Uomoz

    • Admiral
    • *****
    • Posts: 2663
    • 'womo'dz
      • View Profile
    Re: Economy Mod (in development)
    « Reply #6 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!
    Logged

    LazyWizard

    • Global Moderator
    • Admiral
    • *****
    • Posts: 1365
      • View Profile
      • GitHub Profile
    Re: Economy Mod (in development)
    « Reply #7 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.
    Logged

    Upgradecap

    • Admiral
    • *****
    • Posts: 5422
    • CEO of the TimCORP
      • View Profile
    Re: Economy Mod (in development)
    « Reply #8 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 ;)
    Logged

    mendonca

    • Global Moderator
    • Admiral
    • *****
    • Posts: 1159
      • View Profile
    Re: Economy Mod (in development)
    « Reply #9 on: June 14, 2012, 11:05:19 AM »

    *awed praise*

    Sounds very natty indeed! Good luck getting things up and running in earnest!
    Logged


    "I'm doing it, I'm making them purple! No one can stop me!"

    Alex

    • Administrator
    • Admiral
    • *****
    • Posts: 24128
      • View Profile
    Re: Economy Mod (in development)
    « Reply #10 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.)
    Logged

    KriiEiter

    • Commander
    • ***
    • Posts: 126
      • View Profile
    Re: Economy Mod (in development)
    « Reply #11 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.
    Logged
    "If it aint broke, don't fix it."

    silentstormpt

    • Admiral
    • *****
    • Posts: 1060
      • View Profile
    Re: Economy Mod (in development)
    « Reply #12 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
    Logged

    CrashToDesktop

    • Admiral
    • *****
    • Posts: 3876
    • Quartermaster
      • View Profile
    Re: Economy Mod (in development)
    « Reply #13 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
    Logged
    Quote from: Trylobot
    I am officially an epoch.
    Quote from: Thaago
    Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

    Alex

    • Administrator
    • Admiral
    • *****
    • Posts: 24128
      • View Profile
    Re: Economy Mod (in development)
    « Reply #14 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.
    Logged
    Pages: [1] 2 3 4