I want my own asteroid

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: I want my own asteroid

Post by Capt. Murphy »

I'll have to agree with Mauiby de Fug that I don't think it's possible to do this given the current limitations of the the game engine and scripting interface. Whilst it may be possible with a lot of hard work to approximate the illusion of the player being able to own multiple ships using something along the lines of your idea, the illusion won't be very good for the various reasons already posted (having to invoke dummy cargo/missiles, stopping those being visible on the HUD, no difference in pitch/roll between ships, many OXP ships having special features introduced by script etc) so I don't think any of the current crop of scripters would want to go there.

Most have probably considered the problem in some detail at some point as it's often raised as a wanted feature.

But if you wanted to have a go there is nothing to stop you and the scripting interface it's not that difficult to pick up, especially if you have some prior experience.

I believe Cmdr James either is or was on the development team so I imagine he knows what he's talking about and that is was planned at some point to separate player and ship, but that has not happened yet. Will it happen? Hope so but who knows.

If the shipyard code and routines were exposed to JS, with an ability to specify that certain ships are present then that would be a great start. I don't think we'll see that for a while though.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: I want my own asteroid

Post by Mauiby de Fug »

Essentially for the reasons that Capt. Murphy and Cmdr. James said. The only way to actually change ships is through the shipyard, and that is not exposed to scripting, and neither can you guarantee what will or will not be sold.
Big Bene wrote:
- Methinks it's part of the fun of modding to squeeze everything out of the tools given to you and find workarounds for any obstacles.
I wholeheartedly agree! As you say you've got some experience scripting, you might have a look at some of these pages on the wiki: http://wiki.alioth.net/index.php/Catego ... _Reference and http://wiki.alioth.net/index.php/OXP_howto

I have them both bookmarked, and find them useful reference pages when tinkering about on my own, or looking under the hood at other peoples' oxps. And gives you more of an idea of what is and isn't available.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Re: I want my own asteroid

Post by Cmdr James »

The thing is, most of the work has to be done in oolite anyway. There is no way to change ships properly using an OXP this would all have to be changed, shipyards have to be rewritten. Ways to change the cost of ships but not the value (so we dont mess up maintenance costs and resale for example). We would also need a way to buy a ship without selling the one you are in but then how do you get your old ship to the asteroid? Many questions, Im sure many more things will surface.

To change the ship just with javascript of course requires not only changing all the stats, and awarding equipment, but also adding turrets programatically, setting the depreciation state, sorting out passengers and cargo, changing the location of exhausts. Maybe even legal state, what about trumbles if one ship has them do all? Dont forget you also need to update the location of all of the external and internal views. Lots of thing.

To get an idea of why ships and players need to be separated, take a look at a save game, and work out which bits need to be stored per ship and which are unique to the player.

So if doing all that anyway, why not simply do the job properly and create a nice mechanism for changing ships which is exposed to the OXP, then no need for all this complexity.

I think if I were to implement this, Id look to have a variable number of shipyards per station that are all scriptable (so two OXPs both wanting to and one can do so and not conflict). So we would be able to have one system that has a scripted python dealership, and a mission that adds an experimental ship to a special one off shipyard etc. One shipyard could then be fairly easily reused as a garage, add some simple operations for changing ship, and a way to store them in the savegame... But I also think this isnt something you would want to add to oolite as is, its more of an oolite 2.0 thing, and I dont know if that will ever happen.

Im not active on the development team any more, mostly because I moved to Germany, and my life is now simply different and I dont sit around all evening writing code. So realistically I am not going to get around to doing any of this. But really it shouldnt be much more work than what is required to make these other ideas work.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: I want my own asteroid

Post by Switeck »

Steps to owning a Rock Hermit Asteroid could involve ever-increasing costs.

The cheapest, at 10,000 credits could be "Sponsor this Rock Hermit Asteroid"...and many such asteroids are already sponsored by someone else so you can't sponsor them.
Doing that would make that asteroid always appear in the same system, although it could be at a different spot for each system visit and also have small numbers (0-4) of regular asteroids around it to mine. Presumably, it has very weak transit engines capable of moving it 1 km a day? Or it gets pushed around by a "tug" ship. (Basically making it appear like an added-on-demand Pirate Cove...minus the part about being hostile.)

Whether this should also give tiny amounts of credits per day awarded to you on visiting, I don't know...perhaps as an upgraded form of sponsorship?

Once you've already sponsored an asteroid...you'll want to upgrade its facilities! Such as:
Giving it better shields (shield boosters/military shields/more energy/higher energy regen rate) -- will require a different ship for each one.
Acting as a storage depot for your cargo. (up to 1000 TC?) This would require some clever scripting, like what Hypercargo does...with the difference that this works only when docked with this asteroid and doesn't fail. Maybe even have orders to shuttle this cargo to the main station little-by-little to sell it off when the prices are high?
To make this more of a mission OXP, many of the upgrades may require specific cargo loads, credits, and significant time to build. The credits covers the arrival of work crews via shuttles/freighters as well as the equipment costs they need. You might even need to defend the supply line to the main station, especially if word gets out to big pirate gangs or other rivals... :twisted: (similar to what Oo-Haul does.)

Improving docking facilities and commodities market so some/more trader ships visits the asteroid. (Basically converts it into a Free Trade Zone.)
Improving (hired? bought?) shuttle traffic from asteroid to main station to transfer ores/cargo. (Adding shuttle traffic via scripts isn't too hard.)

Add a beacon buoy (or building such into the asteroid itself) to increase the number of trader ships visiting...at the expense of also attracting possible trouble? (Somewhat duplicating Rock Hermit Locator, except people won't have to pay for that extra to find this place.)

Increasing the number of defense ships hired to defend the place. Either requires a new asteroid ship with the extra number of defense ships, or can be done through mission scripting.
Buying/improving the quality of the defense ships hired to defend the place. (Vaguely like how Hired Guns OXP works.)

Equipment buying/selling at the asteroid could slowly become higher tech level as the asteroid is upgraded, though probably around TL10-12 should be peak and cost a gold mint.
Equipment prices could also become cheaper once you pump a LOT of credits into the asteroid for various upgrades.
Getting your ship overhauled here could be given a discount, though if this place is lower TL than nearby systems you're better off going to them instead.

At some point, the asteroid gains its own shipyard buy/sell menu...though you still cannot "park" your ship here as a garage and get it back later because of game limitations. :(
Mounted equipment on your ship might be removable/re-addable with some clever scripting though! This should cost some credits...maybe 10-100 credits? (cheaper if you've upgraded the asteroid more.)

Not that I've ever seen it, but what's stopping a station from having missiles as defensive weapons?
If that's possible, a somewhat upgraded asteroid might have a small launcher with a small number of missiles...and the most upgraded asteroid would have a maxed-out battery of hardhead missiles. I think it could have 32 such missiles without doing any missile-adding scripting tricks.

By the time all the upgrades are completed, (and they should take TIME to do as well as credits) your asteroid could resemble the Seedy Space Bars found in Random Hits -- because all the extra add-ons could not possibly fit inside a standard Rock Hermit's diameter. 8)

Having said this, you should probably only be able to own 1 asteroid...at least per Galaxy Chart? :lol:
The reason for this is partially because of the likely savegame size increase caused by having to save all the asteroids with their various states of upgrades, as well as game balance issues.
I guess you could change asteroids by UN-sponsoring your current asteroid. This could cost ~1000 credits, to discourage doing it lightly. Whether this causes the asteroid to "disappear" when you revisit the same system will be left up to whoever dares try code such an OXP!

It will be like your home base, and "save anywhere" like feature should definitely work here. Make sure to choose it in a system you like!
Post Reply