Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Resource Production Mod example (Hydroponic Ship and Mining)  (Read 12477 times)

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Resource Production Mod example (Hydroponic Ship and Mining)
« on: August 14, 2012, 05:51:36 PM »

Download Link (Current Version)

Hey there guys, as I recently mentioned in my Fleet Control Mod Threat, I've been secretly working on ships that can make resources and the ability to mine. This mod probably won't be actively updated for content, I just want it to be out there so people can see and use the tech. I've TRIED to document it as best I could, but when it comes to documentation, that's what kept me from acing Computer Science, so you'll have to forgive me. Feel free to ask any questions though.

I will most likely integrate a system like this to the Fleet Control Mod, but your more than welcome to use this code. Heck, that's why it's here!

How it works:
For the Farmstead to produce supplies (I don't think I switched it to "food", it's still supplies) it must be combat ready. It will produce 3 each day, however this amount is modified by your crew level. Green crew produces 25% less, Regular produces the normal amount, Veteran is 25% more, and Elite is 50% more.

I've used Alex's Mining Pods to do the mining. Pick up a wing or two of em from the Hegemony, the fly to an asteroid. Each day a check is made to see if you (actually if every fleet in the system) are sitting near an asteroid. If you are, it calculates your mining power based on your ships. How much mining power you have depends on your combat ready mining pods. The more you have, the more resources you can drain from the asteroid. At the moment, the asteroids never actually die or anything, don't know if I can do that yet.

There are three types of resources you can drain from asteroids. Ore, Metal, and Precious Ore. Precious Ore is rare, but worth a lot to sell. It's worth noting that, as you'd expect, Ore is a fair bit heavier than regular supplies and such, so pack yourself some good cargo space.

If you actually look at the code, it's not too hard to add your own mining ships. There is a hashmap at the bottom of the SupplyEvent and the MiningEvent scripts. Simply add a value to whichever map you like with your ships ID, and the production amount/mining power, and bam it'll get to work.

Version 0.1: (Not publicly released) Added the Farmstead, a modified tanker that actually looks sorta pretty that produces supplies.
Version 0.2: Gave Mining Pods the ability to mine.

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #1 on: August 14, 2012, 05:58:45 PM »

Lucky I checked recent posts, I or I would never have found this. :)
Anyways, let the testing begin!

EDIT:
Mining pods?  Don't you mean Mining Drones? ;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.

Strifen

  • Commander
  • ***
  • Posts: 117
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #2 on: August 14, 2012, 06:03:55 PM »

No more drone wings since ship system drones
http://fractalsoftworks.com/forum/index.php?topic=3593.0
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #3 on: August 14, 2012, 06:06:40 PM »

Arg, OP.  A drone is anything that's unmanned.  The wasps have crew, presumably to take care of the drones while in storage. That's just the name of them, ok? 
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.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #4 on: August 14, 2012, 06:09:18 PM »

This looks awesome.  I'll have to look at this and see how hard it would be to make some miners go out to the asteroids to provide different targets for players and the factions, I'm really looking forward to a Corvus that has a lot of semi-autonomous stuff happening :-)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #5 on: August 14, 2012, 06:18:18 PM »

Awesome idea! Can't wait to try it
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #6 on: August 14, 2012, 06:19:31 PM »

This looks awesome.  I'll have to look at this and see how hard it would be to make some miners go out to the asteroids to provide different targets for players and the factions, I'm really looking forward to a Corvus that has a lot of semi-autonomous stuff happening :-)
Actually I think it'd be rather easy. What I plan on adding to Fleet Control are automated miners that choose a nearby Asteroid (You could also make them choose a random one) and add a go to location assignment to said Asteroid. Problem is, there is no "just sit there" assignment, once they go to the location I THINK they'll start to wander. If I use a Defend assignment, they ALSO wander, which is rather irritating to say the least. We'll have to see what happens.

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #7 on: August 14, 2012, 06:30:02 PM »

All parts of the mod work as intended. :)
Although I suggest better names for the ore, Metal might become Ore (very common in asteroids, some are entirely made of iron), Ore might become Infernium (slightly less common ore, but still reachable).

EDIT:
I find that it takes quiet a long time to find a good amount of ore/metal/precious metal, leaves you kinda vulnerable while you're doing that.
« Last Edit: August 14, 2012, 06:34:42 PM by The Soldier »
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.

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #8 on: August 14, 2012, 06:31:59 PM »

Don't bet on any updates to this thing, it's just an example :p.

I'm integrating the features here into Fleet Control as we speak.

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #9 on: August 14, 2012, 06:35:24 PM »

Ah, nice! :)
Anyways, edited my post, read my suggestions or die! :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.

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #10 on: August 14, 2012, 06:38:57 PM »

If you look at the code, you might notice I actually tried to make it so it'll do the check 10 times per day, but it obviously cares not for my attempts. You could always change the Mining Power in the hashmap to a much greater value, that'll be a good idea for anybody planning on using it.

Fun fact, it was extremely annoying to test mining at times because the pirates wouldn't get off my back. Gave me flashbacks to MMO resource gathering... I'm personally sticking to contracting mining fleets thank you very much!

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #11 on: August 14, 2012, 06:51:36 PM »

Just hang out on the other side of the system, that's what I did.  Dev mode it up, get a condor, three mining drones, and headed out for the journey. ;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.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Resource Production Mod example (Hydroponic Ship and Mining)
« Reply #12 on: August 14, 2012, 07:44:51 PM »

Quote
Problem is, there is no "just sit there" assignment, once they go to the location I THINK they'll start to wander. If I use a Defend assignment, they ALSO wander, which is rather irritating to say the least. We'll have to see what happens.
Just add a behavior loop that, until satisfied, keeps them near their target, with a random range of waiting times.  A wait time of 2-3 game days should be about right- just long enough to get intercepted.  Can't wait until we're able to mod interactions with ships other than just attacking people and 3-way battles are possible, then players can "come to the rescue" of the miners being raided by pirates, buy materials from them at "source prices" and then sell them at standard commodity prices, etc., etc. :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack