.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   What Are Bounding Boxes and How Do I edit them? (http://forum.shrapnelgames.com/showthread.php?t=33007)

Atrocities January 27th, 2007 11:37 PM

What Are Bounding Boxes and How Do I edit them?
 
I am in the process of setting up firing arcs for a new ship set and I have discovered that the shipset viewer has this options call Bounding Boxes.

I noticed that the ships I am working on have these boxes but they do not surround the ship like they do in other sets. The bounding boxes are oriented in a top down direct and not level with the ship. They share a common center point, but while the ships face say N and S, the bounding boxes face Up and Down. Very odd.

So does any one know anything about bounding boxes, what they are for, and how to adjust them?

Randallw January 28th, 2007 03:27 AM

Re: What Are Bounding Boxes and How Do I edit them?
 
Up and down you say. Hmm, well if a ship flies into a planet it will move up, bound perhaps, and the same if it takes up the same space as another ship, except when ramming. I'd guess this bounding box is to tell it when to move up, or down, when it moves into another ship/planets bounding box area.

Atrocities January 28th, 2007 04:16 AM

Re: What Are Bounding Boxes and How Do I edit them
 
Aaron gave me some very helpful information. I would like to share it here with you all.

Quote:



Bounding boxes are the boxes which surround a ship that detect collisions (as a second pass). They are invisible in the game, and are just mathematical constructs. When a projectile is heading towards a ship, first I check to see if the projectile is within the radius of the object. If it is, I check to see if the projectile is within the bounding box (seond pass). The bounding box is a bit more form fitting than a huge sphere. If its within the bounding box, I then check vertices to see if the projectile has hit one of the polygons of the model (this is time consuming and is only done if all previous tests say we had a hit). Bounding boxes are also used to make sure that when a weapon misses its target, it fires close but does not hit.

The bounding boxes are computed based on the models maximum extents in all 3 planes.

Ship Set Viewer - Controls
==================================================
I: Toggle command listing.
W: Toggle weapon firing point glow display.
L: Toggle weapon firing point line display.
S: Toggle object spin.
E: Toggle engine glow display.
R: Toggle engine center lines.
G: Toggle engine glow realistic and symbolic.
C: Toggle showing model center lines.
M: Toggle background grid map.
H: Toggle ground combat hexes and squares.
O: Toggle object radius.
B: Toggle bounding box.
~: Enter Cheat Code.
F1: Top Down View.
F2: Skewed View (the view will rotates level at the plane).
F3: Skewed Reversed View (the view will rotates level at the plane).
F4: Skewed View (no rotation at the plane).
Arrow Keys: Move viewpoint.
Add: Zoom In
Subtract: Zoom Out

Ship Set Viewer - Cheat Codes
==================================================

list [Model #]
Show a list of all of the firing and engine points for model [Model #].

endlist
Hide the firing and engine point list.

changefiring [Point Index] [Element Index] [New Value]
Change a firing point on the model. (Applies to the model selected with "list").
[Point Index] = The firing point index.
[Element Index] = 1, 2, 3 indicating the x, y, z coordinate.
[New Value] = The value of the element.

cf
Same as changefiring.

changeengine [Point Index] [Element Index] [New Value]
Change an engine point on the model. (Applies to the model selected with "list").
[Point Index] = The engine point index.
[Element Index] = 1, 2, 3 indicating the x, y, z coordinate.
[New Value] = The value of the element.

ce
Same as changeengine.

changeengineradius [Glow Size]
Change the glow radius of all of the engines. (Applies to the model selected with "list").
[Glow Size] = the new radius of the glow effect.

cer
Same as changeengineradius.

changepos [Element Index] [New Value]
Change the start offset position of a model. (Applies to the model selected with "list").
[Element Index] = 1, 2, 3 indicating the x, y, z coordinate.
[New Value] = The value of the element.

cp
Same as changepos.

changescale [New Scale Value]
Change the scale of the model in all planes (x, y, z). (Applies to the model selected with "list").
[New Scale Value] = The new scale factor.

cs
Same as changescale.

changeradius [New Radius Value]
Change the radius of a model. (Applies to the model selected with "list").
[New Radius Value] = The new radius of the model for the xfile class. This does not change the
actual radius of the model, just the value of the radius stored in the xfile
class. This value is used in the game to determine the size of the model for
placement in the combat grid (so we can place ships before we actually load
the model itself).
cr
Same as changeradius.

NOTE:
When the program is shutdown, all of the values for the current ship set will be saved in the file
ShipSizes.txt (including any changes you made in the program).

Side Note: Don't make changes in the data files directly. Make them in the program using the cheat codes, then shutdown the program. Load up the file ShipSizes.txt and copy all of the changes to your Ship Set Class File.

Hope this helps!

Aaron


Captain Kwok January 28th, 2007 12:16 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Thanks for that info!

Slick January 28th, 2007 12:53 PM

Re: What Are Bounding Boxes and How Do I edit them
 
So it appears by reading this that smaller/sleeker models have an advantage.

Captain Kwok January 28th, 2007 01:19 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Not anymore due to a fix in v1.24.

Whether a weapon will hit or not is decided before the animation is drawn. However there was a bug where a weapon fire that was suppose to miss would hits it target due to the target's movement and it would damage the ship - in that case your statement would be true. But now when that happens, it won't do any damage...

Atrocities January 28th, 2007 08:15 PM

Re: What Are Bounding Boxes and How Do I edit them
 
I just need to find out how to reposition them so they are surround the ships instead of facing up and down and only covering a portion of them.

shinigami January 29th, 2007 06:43 PM

Re: What Are Bounding Boxes and How Do I edit them
 
I think I've figured it out, AT. You've rotated your models in the XFileClasses but the box stays with the model's original orientation. It can be fixed, but you're not going to be happy. http://forum.shrapnelgames.com/images/smilies/frown.gif You would have to go back and rotate the models in the .x file. The downside is that doing this will screw up all your engine glows and firing points. http://forum.shrapnelgames.com/images/smilies/frown.gif

Atrocities January 29th, 2007 08:59 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Thanks, I just won't worry about it then for the time being. http://forum.shrapnelgames.com/images/smilies/happy.gif

Spoo January 29th, 2007 10:59 PM

Re: What Are Bounding Boxes and How Do I edit them
 
I'm a little concerned that bounding boxes might be abusable by "cheat sets".

For example, if you put the bounding box outside of the ship, does that mean that all shots fired at that ship will miss?

President_Elect_Shang January 30th, 2007 12:08 AM

Re: What Are Bounding Boxes and How Do I edit them
 
I wouldn't worry too much about it myself Spoo. Any cheat sets that surface will be quickly IDed and banned from play-be-web etc. The only place they will surface would be solo games and lets face the truth. If anyone is using a cheat set in a solo game it is either to test something or the AI has been improved that much. Oh and lets not forget about the consequences to reputation for the person who puts out a cheater set. They would be blackballed and it would take several more fresh non-cheat sets to repair the damage. It's not like you can say it was an honest mistake.

Atrocities January 30th, 2007 12:12 AM

Re: What Are Bounding Boxes and How Do I edit them
 
Bounding boxes don't work that way. They are a final line of hit detection only after all other calucations are made. Right now there is no way to alter the Bounding Boxes so don't worry about it. Ships are still damaged and destroyed as proven by many many combat tests.

Spoo January 30th, 2007 11:03 AM

Re: What Are Bounding Boxes and How Do I edit them
 
Okay. Good to know.

Slick January 30th, 2007 12:17 PM

Re: What Are Bounding Boxes and How Do I edit them
 
There must be something I don't understand. Why would the model or boxes have anything to do with determining hits in combat?

I would think that the calculations and determination of hit/miss would be done by the game engine and a hit/miss decided; then the game graphics would be drawn to show a hit/miss as appropriate. Sounds fishy.

Captain Kwok January 30th, 2007 12:54 PM

Re: What Are Bounding Boxes and How Do I edit them
 
You need hit detection for at least seeking weapons and collision avoidance.

NullAshton January 30th, 2007 01:55 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Quote:

Slick said:
There must be something I don't understand. Why would the model or boxes have anything to do with determining hits in combat?

I would think that the calculations and determination of hit/miss would be done by the game engine and a hit/miss decided; then the game graphics would be drawn to show a hit/miss as appropriate. Sounds fishy.

From what I understand, it has nothing to do with the determination of hit/miss. It has to do with what a hit or a miss will LOOK like. You don't want a 'hit' to be several feet off the side of a ship, do you?

President_Elect_Shang January 30th, 2007 02:41 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Quote:

NullAshton said:
....You don't want a 'hit' to be several feet off the side of a ship, do you?

Well no; not several feet anyway. However, I would be just fine with several hundred meters! Say right on the side of their ship! http://forum.shrapnelgames.com/image...es/biggrin.gif

Slick January 30th, 2007 05:42 PM

Re: What Are Bounding Boxes and How Do I edit them
 
I disagree that it should involve models. Every object has a position, from which its range to other objects can be determined. That can be used for all weapons:

beams & PD (Range determines hit %, which is instantataneous)

seekers & warhead (Range = 0 = hit)


If there is a hit or miss, then the graphics engine should THEN be directed to draw it that way. The tail is wagging the dog here if graphics determine collisions in any way; and it can lead to it affecting hit percentages.

Phoenix-D January 30th, 2007 05:54 PM

Re: What Are Bounding Boxes and How Do I edit them
 
It doesn't, Slick. Check to 1.25 patch notes.

The idea is when the projectile hits you don't have it drawn on the other side of the screen from the target ship..

Slick January 30th, 2007 05:58 PM

Re: What Are Bounding Boxes and How Do I edit them
 
ah. Now that makes sense. Just drawing it so that the player sees it. I knew there was something I didn't get. Thanks.

se5a January 31st, 2007 06:15 AM

Re: What Are Bounding Boxes and How Do I edit them
 
it's being done server side though, so PBW HAS to have all the shipsets installed, this is going to be a PITA for PBW admin.

it should have been set up so it was worked out on replay.
but aaron doesnt see it as enough of a problem to recode it.

President_Elect_Shang January 31st, 2007 09:55 AM

Re: What Are Bounding Boxes and How Do I edit them
 
I don't see why they have to have them installed. If a shipset is missing it is replaced by a generic one. How does that effect the person sitting at home processing their turn using Atrocities Klingon set. I don't get it are you saying the players are playing on the server itself? Otherwise combat will take place with generic sets which won't effect the combat results at all.

Suicide Junkie January 31st, 2007 12:21 PM

Re: What Are Bounding Boxes and How Do I edit them
 
The problem is that that generic shipset change is permanent. The player at home will see the new randomly chosen shipset.

We really need to get Aaron to make the hosting process shipset-agnostic.
The more people who email him about this, the better.

President_Elect_Shang January 31st, 2007 12:25 PM

Re: What Are Bounding Boxes and How Do I edit them
 
So what you are saying is, if the shipset is changed at the server when the turn is sent back to the player they are no longer using there chosen shipset? Instead they have been forced into changing to the new set? Well I haven't heard that one yet. Considering that new info it really does need to be fixed!

Suicide Junkie January 31st, 2007 12:27 PM

Re: What Are Bounding Boxes and How Do I edit them
 
Indeed; as an example, me and SE5a started a game, each using a shipset the other did not have.

He processed the first turn, and my shipset was changed to Druk with Phong flag.
I processed the next turn, and his was changed to Abbidon with Phong flag.

And... the game died after 5 turns.


All times are GMT -4. The time now is 03:52 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.