Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: T-Man on May 14, 2012, 06:11:41 am

Title: [Code Concept] Placed object detection in ast/deb field generation?
Post by: T-Man on May 14, 2012, 06:11:41 am
Q for the coders. Assuming it doesen't already, do you think it would be possible to make the generation system for asteroid/debris fields able to detect objects that start the mission within their box, so that they don't place asteroids inside models? Thought in mind is that modellers can then model and place huge asteroids to add some environmental aspects to missions set in fields (like asteroids with caves and alcoves to hide ships, perhaps even tunnels if the AI is ever accurate enough to navigate them), and it would stop the engine wasting asteroids by putting them inside these large models.

Any thoughts/ideas come to your heads, or no go for now?
Cheers
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: zookeeper on May 14, 2012, 07:49:20 am
Looking at the asteroids code, it should be perfectly feasible to do that.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: T-Man on May 14, 2012, 08:15:54 am
Looking at the asteroids code, it should be perfectly feasible to do that.
If so, that would be fantastic. :yes:
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Capt_Thunder on May 14, 2012, 08:36:27 am
That would be great!
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: mjn.mixael on May 14, 2012, 08:40:50 am
Oh please yes. I have a station that starts in an asteroid field. About 50% of the times that I run the mission there are multiple asteroids intersecting its hull...
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Dragon on May 14, 2012, 09:12:06 am
You can counter this using "inner box" inside an asteroid field. Though I agree that a proper fix would be better.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Nuke on May 14, 2012, 11:14:12 am
it seems like it wouldn't be too hard to radius check every ship with an asteroid each time one is spawned. but what the hell do i know.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: karajorma on May 14, 2012, 05:47:00 pm
The respawn code already has code designed to do this (so that ships don't respawn inside another model). So all you'd need to do is to call that.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Cyborg17 on May 14, 2012, 11:27:24 pm
Awesome.  It is a big immersion breaker to play a mission with a stationary asteroid field and then see 2 or 3 asteroids sticking out of an Orion.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: mjn.mixael on May 14, 2012, 11:34:53 pm
You can counter this using "inner box" inside an asteroid field. Though I agree that a proper fix would be better.

Can't do an inner box for a passive asteroid field.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: T-Man on May 15, 2012, 01:00:22 am
You can counter this using "inner box" inside an asteroid field. Though I agree that a proper fix would be better.
Can't do an inner box for a passive asteroid field.
Another key aspect is the inner box, while brilliant for making clearings or routes for ships to move, can only work in a single instance. This new system should allow multiple instances in a single level and allow the asteroids to be placed close to the object should the player or computer so wish.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Dragon on May 15, 2012, 07:43:05 am
You can counter this using "inner box" inside an asteroid field. Though I agree that a proper fix would be better.

Can't do an inner box for a passive asteroid field.
You can't? I though that it works for passive fields too, and that it'd make it so no asteroids will be spawned there (and the ones that move into it would be deleted). I could be wrong though, it's been a while since I messed with asteroid fields in FRED.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: mjn.mixael on May 15, 2012, 08:48:49 am
You can counter this using "inner box" inside an asteroid field. Though I agree that a proper fix would be better.

Can't do an inner box for a passive asteroid field.
You can't? I though that it works for passive fields too, and that it'd make it so no asteroids will be spawned there (and the ones that move into it would be deleted). I could be wrong though, it's been a while since I messed with asteroid fields in FRED.

You are wrong, because I just checked.. otherwise I wouldn't have stated so factually that you can't use an inner box for passive fields.
Title: Re: [Code Concept] Placed object detection in ast/deb field generation?
Post by: Dragon on May 15, 2012, 01:16:11 pm
You can define it though. Odd.