Method for placing asteroid belts

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Method for placing asteroid belts

Post by Galileo »

It would be nice if there was a simpler way to place an asteroid belt/field. I know that I can use 'addSystemShips' but I want to place my asteroids way off the spacelane so that method won't work for me. 'addShipsAt' places the asteroids too close for my purposes so the only way to do it properly is too add the asteroids individually. I realise that this would be a bit of an obscure method but if it's not too time-consuming to implement it would be really handy (to me at least).
User avatar
Murgh
---- E L I T E ----
---- E L I T E ----
Posts: 454
Joined: Fri Sep 03, 2004 6:19 am
Location: Terra Firma

Post by Murgh »

none of all of these methods do it for ya?
http://wiki.alioth.net/index.php/Method ... ding_ships
The man next to you is your lunch
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Post by Galileo »

Nope, at least not in a way that's useful to me.
User avatar
Murgh
---- E L I T E ----
---- E L I T E ----
Posts: 454
Joined: Fri Sep 03, 2004 6:19 am
Location: Terra Firma

Post by Murgh »

where do you want them? using one of those methods you can dump anything, anywhere..

have you tried something like an addShipsAt: asteroids 10 (..at, say..) psu 0.0 0.0 0.5 and found that they grouped too close for your liking or something? I thought they would spread out.
The man next to you is your lunch
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Re: Method for placing asteroid belts

Post by Galileo »

Galileo wrote:
'addShipsAt' places the asteroids too close for my purposes so the only way to do it properly is too add the asteroids individually.
User avatar
Murgh
---- E L I T E ----
---- E L I T E ----
Posts: 454
Joined: Fri Sep 03, 2004 6:19 am
Location: Terra Firma

Post by Murgh »

quoting ourselves, are we? ;)

so in essence you're lobbying for a new method that could be called something like addShipsAtLoosely or spreadShipsAt, maybe with a number scheme to decide the min. distance between objects?
The man next to you is your lunch
User avatar
Rxke
Retired Assassin
Retired Assassin
Posts: 1757
Joined: Thu Aug 12, 2004 4:54 pm
Location: Belgium

Post by Rxke »

How many asteroids are we talking here? And how far apart?

I don't see the problem, frankly. the current way allows you to place stuff waaay beyond the lanes, after all it's just xyz axis stuff...
rexpop
Average
Average
Posts: 9
Joined: Wed Feb 08, 2006 11:59 pm

Post by rexpop »

I certainly think there is a case for such a method to be added. Something like addAsteroidField: which would take a position for the center of the field, the radius of area you want the field to cover and the number of asteroids to place within that radius, then let the game handle the exact positioning.

As an aside I would also like to see an easy way to add an object in orbit around a certain point (or another object). Something like addObjectInOrbit where you give it a point in space, a radius and a speed and the object will remain in orbit around that point (subject to other AI constraints).
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Post by Galileo »

Murgh wrote:
so in essence you're lobbying for a new method that could be called something like addShipsAtLoosely or spreadShipsAt, maybe with a number scheme to decide the min. distance between objects?
Yeah, that's basically it. Maybe you could give it a radius of a sphere which the objects will be distributed in. BTW, what's that ship in your avatar, Murgh?
Rxke wrote:
I don't see the problem, frankly. the current way allows you to place stuff waaay beyond the lanes, after all it's just xyz axis stuff...
I get the feeling that I didn't quite explain myself very well in my original post, so I'll try and make it a bit clearer. The following methods allow you to place multiple objects:

addShips: <role> <number> This is no good to me because I can't tell it where to put the asteroids.

addSystemShips: <role> <number> <position> Also no good to me because the <position> is a floating point number where 0.0 represents the witchpoint and 1.0 represents the station, so I can't place anything away from the spacelane (I want an asteroid belt with a station in the middle about 150km away from the spacelane).

addShipsAt: <role> <number> <coordinate scheme> <x> <y> <z> This method would be perfect if it wasn't for the fact that the objects are placed very close to each other. Here's a screenshot showing what I mean, this is 10 asteroids placed with addShipsAt and a rock hermit placed with addShipsAtPrecisely.

Image

So my only other option is to use addShipsAtPrecisely 10 times to individually place the asteroids.
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1160
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Post by aegidian »

I agree, a method with a radius over which to scatter objects is a good idea. Suggest a name similar to the others and I'll put it on my todo list...
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Post by Galileo »

How about 'addShipsWithinRadius'
User avatar
Murgh
---- E L I T E ----
---- E L I T E ----
Posts: 454
Joined: Fri Sep 03, 2004 6:19 am
Location: Terra Firma

Post by Murgh »

nice lobbying.
Galileo wrote:
BTW, what's that ship in your avatar, Murgh?
that's a spankin new Salamander, from the greatly expanded oldships I'm playtesting now..
The man next to you is your lunch
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1878
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

I was wondering about the asteroids...

looking at some of the crash reports that are submitted I notice that asteroids are generated as clusters on system creation.

Is this method the game already uses accessable for OXP-ers?

AddClusterAt: <coordsceme> ?
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

No, but it shouldn’t be too hard to add a script-accessible version of -[Universe scatterAsteroidsAt: withVelocity: includingRockHermit:]…
User avatar
Galileo
Dangerous
Dangerous
Posts: 103
Joined: Tue Nov 15, 2005 1:55 am
Location: Tasmania, Australia

Post by Galileo »

Giles: Thanks for adding that! Now how do I actually use it? :lol:
Post Reply