Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: [1] 2 3 ... 6

Author Topic: Starsector PSA #1: Your Ship's Bounds Polygon Is Too Detailed  (Read 138244 times)

Trylobot

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1170
    • View Profile
    • Github profile
Starsector PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« on: September 04, 2012, 06:25:44 PM »

Modders,

I've noticed folks going overboard on their bounds polygons. What I mean by this is: "using more coordinates than absolutely necessary to evoke a convincing level of hit-detection in-game."

The question you should now be asking is: "gee Trylobot, if you're so smart, what the heck should I be doing instead? I haven't noticed any problems."

Good question modders, I'm glad you asked. The problems you haven't noticed are insidious. They don't really affect anything at small scales. But when your ships are used en-masse, say in a mod compilation like U.'s Corvus or similar, these super-complex bounds polygons will slow down the computers belonging to the "economy / mid-range" level. In other words, not hardcore gaming machines like you and I are so fond of. And you should be worried about this, because these folks are technically your audience. You're going to all this work, authoring this mod, ostensibly so that as many people as possible can play it. So you want to Optimize.

Best optimization: consider removing literally every bounds coordinate you currently have and making a new one from scratch. If you want to look at perfection, load up some of the vanilla ships and look at their level of detail. Then think to yourself, "self, if the bounds polygon looks like this, and in-game I didn't notice anything funny, then isn't this enough?" The answer is yes. Yes it is. Use as few bounds coordinates as possible to look right, and not a single one more. It's better for the game, better for performance, and better for the perceived quality of your mod.

EDIT: Here's an example from Ghoti:
Spoiler

[close]

This concludes a Public Service Announcement.

Update: April 19, 2013 - PRO TIP from Vinya
Use your image editor's "Pixelate" effect, and give a size of 5 (or higher). When setting up your ship's bounds, use this pixelated version of your ship. That way you won't be as inclined to include unnecessary details in the polygon.

Update: Addendum from Astro with illustrations

« Last Edit: June 27, 2017, 08:08:14 PM by Trylobot »
Logged

Wriath

  • Captain
  • ****
  • Posts: 280
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #1 on: September 04, 2012, 07:42:34 PM »

I've got one of those trash rigs, thanks for putting this out here Try, hope to see people follow the advice.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #2 on: September 04, 2012, 07:59:26 PM »

Can you give us some rough guidelines, i.e., what targets to shoot for per size?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #3 on: September 04, 2012, 08:06:17 PM »

Just get the general shape of it.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #4 on: September 04, 2012, 08:13:00 PM »

I'd like some numbers; I'm already skipping a lot of little details, I just want to know if I'm getting close-enough or if I need to redo my bounds again :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Ghoti

  • Captain
  • ****
  • Posts: 283
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #5 on: September 04, 2012, 08:13:16 PM »

Thanks for reminding me to fix up some other bounding boxes.

Quick tip. You're unlikely to need more than 6 vertices for fighters. if you can get away with 4 (preferably 3!), you're good!

I just want to know if I'm getting close-enough or if I need to redo my bounds again :)

judgement call, refer to handy picture:

[attachment deleted by admin]
« Last Edit: September 04, 2012, 08:39:18 PM by Ghoti »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #6 on: September 04, 2012, 08:27:29 PM »

Ah, I'm mainly OK then, I was being pretty conservative with the later ones.  Might have to go back and redo the first ones though :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Trylobot

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1170
    • View Profile
    • Github profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #7 on: September 04, 2012, 08:53:04 PM »

Ghoti, you are spot on. Perfect.

judgement call, refer to handy picture:
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #8 on: September 04, 2012, 08:53:20 PM »

Any particular numbers for each class? Just so folks (possibly including myself, I am rather known for being... excessive with bounds :P) know whereabouts to try and keep within. It's all well and good saying "Keep them bounds nice and simple", but it won't be much use unless there are some hard numbers out there
Logged

Trylobot

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1170
    • View Profile
    • Github profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #9 on: September 04, 2012, 08:58:48 PM »

To xenoargh and K-64: Sorry guys! There are no such numbers. I'm not being facetious here. I mean literally; there is no correct or easy answer to this.

I'll put it absolutely as simple & clear as I can: as few as possible. If you can get away with 3, use 3. If you think "no, that misses an entire section," add 2-3 more. If you get it "pretty close" with that many, you're probably good. To be sure, go and playtest it in game. Err on the side of fewer, and only add more if you see in-game weirdness.
Logged

Psycho Society

  • Commander
  • ***
  • Posts: 121
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #10 on: September 04, 2012, 10:29:44 PM »

You're defining a shape, so unless all your ships are regular polygons, no one can tell you how many points to use. Just keep it simple, dang guys.
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #11 on: September 05, 2012, 12:24:42 AM »

Hm. I`ll check my ships now.

XpanD

  • Captain
  • ****
  • Posts: 380
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #12 on: September 05, 2012, 01:58:20 AM »

Great info, thanks! I know that my Positron mod had some overly detailed bounds - I'll make sure the Worksmen ships are a bit nicer to slower machines. ;)
Logged

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #13 on: September 05, 2012, 04:07:47 AM »

Heh...one of my old fighters have 70 bounds in total... a bit to much XD

EDIT: Woah.... the first ship i made have 332 bounds in total... Better fix that >.>
« Last Edit: September 05, 2012, 04:13:25 AM by ValkyriaL »
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Starfarer PSA #1: Your Ship's Bounds Polygon Is Too Detailed
« Reply #14 on: September 05, 2012, 05:01:30 PM »

I'm mad guilty of this. Going to take a look again when I resume working on my mod.
Logged
Pages: [1] 2 3 ... 6