View Issue Details

IDProjectCategoryLast Update
0003849AI War 1 / ClassicSuggestion - New FeaturesSep 19, 2011 7:54 am
Reportertwinnuke Assigned ToChris_McElligottPark  
Status closedResolutionnot fixable 
Summary0003849: Overlapping Shield Rendering Idea
DescriptionInstead of displaying all the shields and not being able to see anything underneath when you turtle up against an incoming wave why not have it select the shields that spread the farthest out, render them and only the the parts that are around the perimeter and not crossing over another shield. (Example Below)

To indicate which shields are being displayed have an orange outline around the edge of the shield icon/sprite(model).

Adding text below the shields (when zoomed in upon) could display their current health out of 100% (as seen in example below).

I'd imagine this could be accomplished by setting up an array for shields on each planet. This Array could be recreated every time a new shield is created or an old one destroyed. The Largest shields would be given the lowest values (first positions in the array). Then you could do a radius collision detection on their shield size

double radius1, radius2;

(SAMPLE CODE)
        //calculate radius 1
        if (width > height)
            radius1 = (width * scaling) / 2.0;
        else
            radius1 = (height * scaling) / 2.0;

        //center point 1
        double x1 = x + radius1;
        double y1 = y + radius1;
        D3DXVECTOR2 vector1( (float)x1, (float)y1);

        //calculate radius 2
        if (tempElement->width > tempElement->height)
            radius2 = (tempElement->width * tempElement->scaling) / 2.0;
        else
            radius2 = (tempElement->height * tempElement->scaling) / 2.0;

        //center point 2
        double x2 = tempElement->x + radius2;
        double y2 = tempElement->y + radius2;
        D3DXVECTOR2 vector2( (float)x2, (float)y2);

        //calculate distance
        double deltax = vector1.x - vector2.x;
        double deltay = vector2.y - vector1.y;
        double dist = sqrt((deltax * deltax) + (deltay * deltay));

        //return distance comparison (true = collision)
        if ((dist < radius1 + radius2) >= 1) collision = true;
(/SAMPLE CODE)Sorry this is from my Associate's Project in C++.

This is where I am inexperienced (I have yet to do much rendering coding beyond simple sprites/rotation/frame changing and what not)

You would then not render the part of the sprite that is overlapping on either sprite. I would look more into this but I have to finish other projects before I learn more about this.

- Ken
TagsNo tags attached.
Internal Weight

Activities

twinnuke

Sep 18, 2011 11:27 pm

reporter  

shield update.png (706,932 bytes)

Toll

Sep 19, 2011 6:47 am

reporter   ~0013240

While I'd love for this to happen, I fear it might be a bit too processor intensive.

Ranakastrasz

Sep 19, 2011 7:06 am

reporter   ~0013241

Uhm, last I checked shields already did not display when overlapping. What changed?

Toll

Sep 19, 2011 7:08 am

reporter   ~0013242

Shields definitely display when overlapping and, as far as I know, always have.

Issue History

Date Modified Username Field Change
Sep 18, 2011 11:27 pm twinnuke New Issue
Sep 18, 2011 11:27 pm twinnuke File Added: shield update.png
Sep 18, 2011 11:36 pm twinnuke Description Updated
Sep 19, 2011 6:47 am Toll Note Added: 0013240
Sep 19, 2011 7:06 am Ranakastrasz Note Added: 0013241
Sep 19, 2011 7:08 am Toll Note Added: 0013242
Sep 19, 2011 7:54 am Chris_McElligottPark Status new => closed
Sep 19, 2011 7:54 am Chris_McElligottPark Assigned To => Chris_McElligottPark
Sep 19, 2011 7:54 am Chris_McElligottPark Resolution open => not fixable