Page 1 of 2

Method for placing asteroid belts

Posted: Sat Feb 18, 2006 2:16 pm
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).

Posted: Sat Feb 18, 2006 2:23 pm
by Murgh
none of all of these methods do it for ya?
http://wiki.alioth.net/index.php/Method ... ding_ships

Posted: Sat Feb 18, 2006 3:07 pm
by Galileo
Nope, at least not in a way that's useful to me.

Posted: Sat Feb 18, 2006 3:18 pm
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.

Re: Method for placing asteroid belts

Posted: Sat Feb 18, 2006 3:40 pm
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.

Posted: Sat Feb 18, 2006 4:20 pm
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?

Posted: Sat Feb 18, 2006 6:16 pm
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...

Posted: Sat Feb 18, 2006 8:17 pm
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).

Posted: Sun Feb 19, 2006 2:59 am
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.

Posted: Sun Feb 19, 2006 3:54 am
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...

Posted: Sun Feb 19, 2006 5:02 am
by Galileo
How about 'addShipsWithinRadius'

Posted: Sun Feb 19, 2006 8:48 am
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..

Posted: Tue Feb 28, 2006 1:51 pm
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> ?

Posted: Tue Feb 28, 2006 4:14 pm
by JensAyton
No, but it shouldn’t be too hard to add a script-accessible version of -[Universe scatterAsteroidsAt: withVelocity: includingRockHermit:]…

Posted: Sun Mar 05, 2006 1:09 am
by Galileo
Giles: Thanks for adding that! Now how do I actually use it? :lol: