Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Render order?  (Read 5670 times)

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Render order?
« on: September 09, 2011, 08:12:15 AM »

Is it possible to change the order in which things are rendered? For example, on this ship, I want to make a giant beam of death come out from the center.



The only problem is that the beam is supposed to come from a part that can't be seen from the top:



Is there any way I could get a weapon to be rendered underneath the ship that is firing it?

Or, is there a way I could get a weapon to be rendered underneath a hardpoint? (My idea is to make the middle "spike" part of the hardpoint's graphic, not the ship's.)


If this isn't possible, might I suggest adding support for it? Ships feel a bit two dimensional having all their weapons mounted on the top side only.
Logged

Avan

  • Admiral
  • *****
  • Posts: 1399
  • Pioneer of Starfarer Modding
    • View Profile
    • DevDB forums
Re: Render order?
« Reply #1 on: September 09, 2011, 08:41:30 AM »

I second this request.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Render order?
« Reply #2 on: September 09, 2011, 09:45:33 AM »

Really cool-looking ship! Are you planning on making it non-refittable? Being able to change the weapon loadouts on your ships is going to be a very significant part of the game, so while making a mod with ships that have fixed loadouts is certainly a valid choice, it will miss out on a lot of the gameplay.

If weapons are configurable, it's good to be able to see them on the sprite - on the one hand, it's nice to see the effects of your customization, and on the other, it's also nice to see what weapons the enemy ships have before they actually start shooting.

You could set the slot type to "HIDDEN" to not show its sprite, but that still wouldn't quite cover it - what I think you want to do is have a very wide beam show up under the spike, along its entire length, right? I can see why you'd want that - it's a neat idea - but there are some issues with doing that. Basically, rendering the beam underneath the ship (or even just underneath the weapons) has implications for the rendering order of just about everything else in the engine. Subtle things would look wrong if you could do that. One example - some beams can go through missiles, and if missiles render on top of a beam like that (instead of under), they don't get saturated with color, and it looks odd. I suspect the beam itself wouldn't look great without a bleed effect around the edges of the "spike", either.

Also, for the purposes of the collision engine, every beam is treated as a line - so a particularly wide beam will look odd when it's stopped by hitting a fighter, or doesn't hit something at all when its edge clearly clips it.

All these things could be resolved in various ways, of course - some more satisfactorily than others - but I'm just trying to explain why it's not nearly as trivial an addition as it probably seems.

Looking forward to seeing this rather dangerous-looking fellow in-game :)
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Render order?
« Reply #3 on: September 09, 2011, 12:42:16 PM »

I see. Well, that's kind of disappointing, but you make a lot of valid points.

But, I'd still like to know a bit more on the whole "rendering stuff underneath" concept. So, as you pointed out, it doesn't work that well with beam weapons. What about other types of weapons? I'd guess that projectiles would still look fine.

In regards to your point about how it might suck not being able to see weapons under a ship, I wasn't really thinking about having weapons just plain invisible. I was thinking about having them stick out from the edges--still visible, but somewhat obscured, and not to the point that you don't know there's a weapon there. I'd also say that in a lot of cases, you could have the turret\hardpoint rendered underneath the ship, yet could still have the weapon rendered on the normal level. While it probably wouldn't be a good idea to have all of a ship's weapons come from underneath, it might be an interesting thing to see on the occasional ship. I suppose I'm just asking you give it a second thought. Even if you don't put weapons under ships in the native game, it would still be nice for modders to have that option. I'm not a programmer, but I'm guessing it probably wouldn't be all that difficult to add in an option for weapon files that lets us set which render level the turret\hardpoint are on. On the other hand, if it would take a while, then forget it, because I'd rather see new, operational features than modders-only hackjobs.


And, yes, I plan on the ship being refit capable. This thing is supposed to have the power to take out a Conquest with relative ease, and letting you (Or the AI) switch up its godlike arsenal would be great fun.

In the future, you can plan on seeing a mini-mod with similar ships to the one I showed (Most will be bigger and nastier :P). It'll be, essentially, a mission set where you and your massive fleet have to survive against giant AI controlled monstrosities that want your blood.
Logged

Avan

  • Admiral
  • *****
  • Posts: 1399
  • Pioneer of Starfarer Modding
    • View Profile
    • DevDB forums
Re: Render order?
« Reply #4 on: September 09, 2011, 04:42:56 PM »

It would be nice to have un-refitable mounts though, primarily for the sake of ships which have been built around a particular weapon, primarily for things like 'event ships' for lack of a better term, ie that take center in a mission or (speculating here) could be event or somesuch related in the strategic/rpg layer

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Render order?
« Reply #5 on: September 09, 2011, 05:18:56 PM »

In regards to your point about how it might suck not being able to see weapons under a ship, I wasn't really thinking about having weapons just plain invisible. I was thinking about having them stick out from the edges--still visible, but somewhat obscured, and not to the point that you don't know there's a weapon there. I'd also say that in a lot of cases, you could have the turret\hardpoint rendered underneath the ship, yet could still have the weapon rendered on the normal level. While it probably wouldn't be a good idea to have all of a ship's weapons come from underneath, it might be an interesting thing to see on the occasional ship. I suppose I'm just asking you give it a second thought. Even if you don't put weapons under ships in the native game, it would still be nice for modders to have that option. I'm not a programmer, but I'm guessing it probably wouldn't be all that difficult to add in an option for weapon files that lets us set which render level the turret\hardpoint are on. On the other hand, if it would take a while, then forget it, because I'd rather see new, operational features than modders-only hackjobs.

Right, I see what you're saying. Some potential trouble there, too. For example, the missile weapons that show the actual missiles racked on the weapon sprite. When launched, those would jump from being below the ship sprite to being above it. Only a problem if the missile was partially obscured, but that depends on the weapon config as much as on the slot, so you can't guarantee that it wouldn't happen by tweaking only the slot. Not a huge deal, but leaving those types of issues unresolved definitely qualifies it as a "hackjob" in my mind.

Similarly for missile launch smoke or gun muzzle flash - or even beams - since you can't really guarantee where those come out - it's easy to picture a weapon where the beam starts out way in the back of the sprite and goes all the way through it, for example - which would be a problem if that part of it was set into the hull.

I've been thinknig about this particular idea for a while... and will still keep an eye out for a good solution.

In the future, you can plan on seeing a mini-mod with similar ships to the one I showed (Most will be bigger and nastier :P). It'll be, essentially, a mission set where you and your massive fleet have to survive against giant AI controlled monstrosities that want your blood.

Excellent :D

It would be nice to have un-refitable mounts though, primarily for the sake of ships which have been built around a particular weapon, primarily for things like 'event ships' for lack of a better term, ie that take center in a mission or (speculating here) could be event or somesuch related in the strategic/rpg layer

Yeah, most likely going to have a flag for both ships and weapons indicating whether they can be used for refitting. It's easy to picture a mod that's not suited for that (the Star Control mod comes to mind right off the bat).
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Render order?
« Reply #6 on: September 09, 2011, 07:16:51 PM »

Thanks for the reply; I think I understand the problems now. I guess I'll just have to hope for that "good solution" at some point in the future :)

Oh, and yeah, having un-refitable hardpoints would certainly be nice.
Logged