* May 24, 2013, 04:34:25 AM
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Come Chat with us live! Learn how HERE!
 
   Home   Help Search Login Register  
Pages: [1] 2 3 4 5 6 7   Go Down
  Print  
Author Topic: RC/repeater ''power rings''  (Read 10373 times)
sirshiz


Turrets: +3/-5
Posts: 75


« on: March 23, 2011, 02:52:26 PM »

Would it be feasible to implement anything like the ''power rings'' from StarCraft and use it for Tremulous? A visual indicator of where the power for the RC and/or repeater ends would be helpful. Right now you have to estimate (not that hard, I know) but it can get annoying when the repeaters are close to the RC power as you might not necessarily know if you are about to build from the RC or repeater BP.


* starcraftpylon.jpg (132.42 KB, 1049x669 - viewed 123 times.)
Logged
Meisseli
Spam Killer
*

Turrets: +83/-25
Posts: 765


« Reply #1 on: March 23, 2011, 03:08:11 PM »

It has been suggested numerous times IIRC, each time the answer being something close to: "it's not possible with the quake renderer".
Logged

sirshiz


Turrets: +3/-5
Posts: 75


« Reply #2 on: March 23, 2011, 03:15:31 PM »

Why couldn't the game just make a ghost structure (just a green line or something) along the circumference of the power area only seen to the builder? The game can make greenish repeaters and other buildings appear and they turn red when outside of the power grid so I don't think it's much of a stretch.
I'm no expert or anything for Tremulous programming but I find it hard to believe that there aren't more creative solutions to this.

Logged
David
Spam Killer
*
*
*

Turrets: +249/-273
Posts: 3543

David


« Reply #3 on: March 23, 2011, 03:21:11 PM »

The problem isn't that it can't be done.

The problem is that it can't be easily done in a way that won't kill your FPS.
Logged

Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.
sirshiz


Turrets: +3/-5
Posts: 75


« Reply #4 on: March 23, 2011, 03:27:24 PM »

The problem isn't that it can't be done.

The problem is that it can't be easily done in a way that won't kill your FPS.

Oh.  Cry
Logged
gimhael


Turrets: +70/-16
Posts: 546


« Reply #5 on: March 23, 2011, 04:36:07 PM »

You can easily draw a semi-transparent sphere that shows the radius of the repeater/rc/whatever, all you need is a sphere model in md3 format (that should be doable in blender) and the engine can compute the position and scale to show the build area.

What you can NOT do with the quake renderer is to color all the surfaces which are within this radius, e.g. you can't draw a circle on the ground like in your starcraft screenshot, but a globe that shows the perimeter of the build radius is technically possible.
Logged
sirshiz


Turrets: +3/-5
Posts: 75


« Reply #6 on: March 23, 2011, 04:37:20 PM »

You can easily draw a semi-transparent sphere that shows the radius of the repeater/rc/whatever, all you need is a sphere model in md3 format (that should be doable in blender) and the engine can compute the position and scale to show the build area.

What you can NOT do with the quake renderer is to color all the surfaces which are within this radius, e.g. you can't draw a circle on the ground like in your starcraft screenshot, but a globe that shows the perimeter of the build radius is technically possible.


I would think that would suffice.
Logged
Nux


Turrets: +257/-69
Posts: 1733


« Reply #7 on: March 23, 2011, 04:41:40 PM »

Really? How exactly would rendering a few more polygons kill your fps?

It doesn't take much effort to just edit the existing models to include a ring or sphere or cone of influence around it. The problem comes when I don't want to see it anymore. It would be nice if the 'area of influence' model could be spawned and unspawned coinciding with that blueprint stage where nobody sees it but you. Maybe you could just add a new frame to the buildings animation that is only played at that time.

EDIT: ok, people have responded since I started writing... DAMNIT
Logged

David
Spam Killer
*
*
*

Turrets: +249/-273
Posts: 3543

David


« Reply #8 on: March 23, 2011, 05:59:41 PM »

Except that sphere would be opaque, so would block your vision while being unclear as to where the edge is.  It also would only tell you the edge of the area, if you can't see the edge you don't know if your current area has power.
And for turrets etc it would just show distance, ignoring walls and other stuff that blocks it.

For it to work in a usable sort of way we would need to render where the sphere intersects the map, which isn't something q3 can do.
Logged

Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.
cron
Donators
*

Turrets: +22/-7
Posts: 185

Got UNV?


WWW
« Reply #9 on: March 23, 2011, 06:58:43 PM »

I know it's not what you're looking for, but an easier implementation might be to make the ckit's display color change and/or glow with varying intesity when building using bp provided by a repeater.
« Last Edit: March 23, 2011, 07:00:19 PM by cron » Logged

Nux


Turrets: +257/-69
Posts: 1733


« Reply #10 on: March 23, 2011, 07:00:33 PM »

The sphere doesn't have to be opaque. Even with opaque textures (blueprints are already semi-transparent) you can make a cage-like object for better viewing. If you can't see the edge then clearly it must be inside the area.

To be clear, I'm talking about displaying the range of the building you have in blueprint form. For already built buildings it'll be harder to do right.
Logged

Lakitu7
Tremulous Developers
*

Turrets: +120/-73
Posts: 1002


Watch for spinys


« Reply #11 on: March 23, 2011, 09:45:40 PM »

Certainly it's on the list of "stuff that I think everyone would like to see but it's hard," much like minimaps.

I think it'd be pretty cool if someone could create a reasonable prototype of this, but to really be useful it should also include things like tubes, hives, turrets, trappers, which adds a bit more complication since at least for trappers you need a cone.
Logged
gimhael


Turrets: +70/-16
Posts: 546


« Reply #12 on: March 23, 2011, 09:58:08 PM »

Quick proof of concept:




« Last Edit: March 23, 2011, 10:01:02 PM by gimhael, Reason: fix stupid picasa URLs » Logged
sirshiz


Turrets: +3/-5
Posts: 75


« Reply #13 on: March 23, 2011, 10:06:50 PM »

Quick proof of concept:






THAT IS AWESOME.
Logged
ziplocpeople


Turrets: +23/-20
Posts: 345


« Reply #14 on: March 23, 2011, 10:58:08 PM »

Quick proof of concept:






THAT IS AWESOME.
Gross, I can't believe people play at that resolution.
Logged

Quote from: Sir|Periculosus
yes yes spam a little more and heyll understand! yes yes
मैं स्पैम बॉट समर्थन
मैं हिन्दी का समर्थन
~The Medistation
jm82792


Turrets: +9/-34
Posts: 627


« Reply #15 on: March 24, 2011, 02:03:44 AM »

That works and would be nice.
Have a red one for the RC range perhaps?
Logged

Lakitu7
Tremulous Developers
*

Turrets: +120/-73
Posts: 1002


Watch for spinys


« Reply #16 on: March 24, 2011, 07:49:19 AM »

Looks like a great start. Looking forward to seeing how it's implemented. If it's clean and the code looks good, we're on a roll here.
Logged
Menace13


Turrets: +12/-41
Posts: 518

Proud Sir| Clan Member


WWW
« Reply #17 on: March 24, 2011, 06:43:05 PM »

That works and would be nice.
Have a red one for the RC range perhaps?


Green. Definitely green. Red makes me think of aliens.
Logged


but a small twisty barrel will have small pew pew's, and small pew pew's can hurt mr.tyrant.
IPWNU


Turrets: +0/-0
Posts: 8


« Reply #18 on: March 24, 2011, 07:31:13 PM »

that would actually be awesome. the game is already polygons, its not too much to add a slightly opaque one. but gj gimhael. i think that would come in mighty handy
Logged
Nux


Turrets: +257/-69
Posts: 1733


« Reply #19 on: March 24, 2011, 08:06:18 PM »

Just so we're all on the same page, gimhael hasn't said that he's got anything working in code. I'm guessing he's just showing what it would look like with a model in game. I don't know this though, so if you could say what you did gimhael, that would be great.

Seems to me it would take a very small amount of code and the addition of single frame to the building's animation to get this working in the blueprints. Seems like other stuff will be harder to code but I don't know by how much.
Logged

Meisseli
Spam Killer
*

Turrets: +83/-25
Posts: 765


« Reply #20 on: March 24, 2011, 08:23:23 PM »

Just so we're all on the same page, gimhael hasn't said that he's got anything working in code. I'm guessing he's just showing what it would look like with a model in game. I don't know this though, so if you could say what you did gimhael, that would be great.
Now I'm no native English speaker, but I think the term "proof of concept" means precisely he's got a crude but working prototype coded.
Logged

SlackerLinux
Spam Killer
*

Turrets: +41/-62
Posts: 555

Linux User!!


« Reply #21 on: March 25, 2011, 12:28:28 AM »

concept looks good but i think it would be better if it is overlayed on the floor instead of a huge bubble(or a combo of both) also you could prob expand it to give the attack range of the turrets and tesla in red
Logged

Slackware64 13.1
SlackersQVM/
jm82792


Turrets: +9/-34
Posts: 627


« Reply #22 on: March 25, 2011, 05:25:54 AM »

Just so we're all on the same page, gimhael hasn't said that he's got anything working in code. I'm guessing he's just showing what it would look like with a model in game. I don't know this though, so if you could say what you did gimhael, that would be great.
Now I'm no native English speaker, but I think the term "proof of concept" means precisely he's got a crude but working prototype coded.
That is correct, prototype is a crude yet functional example that is to be improved or not used.
Logged

gimhael


Turrets: +70/-16
Posts: 546


« Reply #23 on: March 25, 2011, 09:02:06 AM »

concept looks good but i think it would be better if it is overlayed on the floor instead of a huge bubble(or a combo of both) also you could prob expand it to give the attack range of the turrets and tesla in red

Painting on the walls/floor means you either have to compute the intersection of all geometry with the sphere (very expensive) or you have to use the stencil buffer to mask out anything outside of the sphere and then render all geometry again (moderately expensive, but the stencil buffer can't be manipulated by user shaders in the current engine anyway).

The code for this power sphere is pretty simple however, I just created a radius 1.0 icosphere model in blender, registered it as usual
Code:
  cgs.media.sphereModel        = trap_R_RegisterModel( "models/buildables/sphere/sphere.md3" );

and then I defined a generic helper function to render an arbitrary sphere:
Code:
/*                                                                             
==================                                                             
CG_AddSphere                                                                   
==================                                                             
*/
void CG_AddSphere( vec3_t origin, vec_t radius, qhandle_t shader )
{
  refEntity_t     ent;

  memset( &ent, 0, sizeof( ent ) );
  VectorCopy( origin, ent.origin );
  ent.axis[0][0] = radius;
  ent.axis[1][1] = radius;
  ent.axis[2][2] = radius;
  ent.nonNormalizedAxes = qtrue;

  ent.hModel = cgs.media.sphereModel;
  ent.customShader = shader;

  trap_R_AddRefEntityToScene( &ent );
}

Then for the proof-of concept I made a simple loop to add a sphere to all buildables of your team:
Code:
void CG_AddBuildRanges( int team )
{
  int             i;
  centity_t       *cent;
  entityState_t   *es;

  for( i = 0; i < cg.snap->numEntities; i++ ) {
    cent  = &cg_entities[ cg.snap->entities[ i ].number ];
    es    = &cent->currentState;

    if( es->eType == ET_BUILDABLE &&
        BG_FindTeamForBuildable( i ) == team ) {
      switch( es->modelindex ) {
      case BA_H_REACTOR:
        CG_AddSphere( cent->lerpOrigin, REACTOR_BASESIZE,
                      cgs.media.humanSpawningShader );
        break;
      case BA_H_REPEATER:
        CG_AddSphere( cent->lerpOrigin, REPEATER_BASESIZE,
                      cgs.media.humanSpawningShader );
        break;
      case BA_A_OVERMIND:
        CG_AddSphere( cent->lerpOrigin, CREEP_BASESIZE,
                      cgs.media.humanSpawningShader );
        break;
      case BA_A_SPAWN:
        CG_AddSphere( cent->lerpOrigin, CREEP_BASESIZE,
                      cgs.media.humanSpawningShader );
        break;
      }
    }
  }
}

As you can see I just reused the telenode shader because it is transparent, but maybe someone with more skill than me could make some nice shaders and a sphere model with proper UV coords.
Logged
David
Spam Killer
*
*
*

Turrets: +249/-273
Posts: 3543

David


« Reply #24 on: March 25, 2011, 10:59:35 AM »

That looks way better than I was expecting, I thought we would have to do the project-it-on-the-floor thing to make it work.

If people think it's a bit annoying, could bind it to a key or something so it only shows up when you want it.
Logged

Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.
Random ViruS
Guest
« Reply #25 on: March 25, 2011, 11:14:20 AM »

I thought we would have to do the project-it-on-the-floor thing to make it work.

If people think it's a bit annoying, could bind it to a key or something so it only shows up when you want it.
I would get annoyed too.
bind \ cg_showbuildingarea 0
Logged
SlackerLinux
Spam Killer
*

Turrets: +41/-62
Posts: 555

Linux User!!


« Reply #26 on: March 25, 2011, 11:45:18 AM »

concept looks good but i think it would be better if it is overlayed on the floor instead of a huge bubble(or a combo of both) also you could prob expand it to give the attack range of the turrets and tesla in red

Painting on the walls/floor means you either have to compute the intersection of all geometry with the sphere (very expensive) or you have to use the stencil buffer to mask out anything outside of the sphere and then render all geometry again (moderately expensive, but the stencil buffer can't be manipulated by user shaders in the current engine anyway).
....<snip>.....

that's a pity i guess the "bubble" thing is the only obvious way then it just doesn't look anywhere near as good as painting/overlaying it on the floor would

anyway better to have something that works and is fast then something that looks good and lags heaps
Logged

Slackware64 13.1
SlackersQVM/
Nux


Turrets: +257/-69
Posts: 1733


« Reply #27 on: March 25, 2011, 02:23:34 PM »

Since you're just spawning the model separately with new code, it's best that you make an axis-aligned cylinder which extends all the way up and down, as that's how the powered-range works. The only reason I suggested a sphere is for when it's fixed to the model's orientation, which it doesn't seem to be here.
Logged

gimhael


Turrets: +70/-16
Posts: 546


« Reply #28 on: March 25, 2011, 03:24:43 PM »

Since you're just spawning the model separately with new code, it's best that you make an axis-aligned cylinder which extends all the way up and down, as that's how the powered-range works. The only reason I suggested a sphere is for when it's fixed to the model's orientation, which it doesn't seem to be here.

No, power works by measuring the 3d distance, so a sphere is correct.
Logged
/dev/humancontroller


Turrets: +19/-376
Posts: 855


« Reply #29 on: March 25, 2011, 05:02:49 PM »

who is this cocksucker named gimhael? he is showing features (including models and source code) from the Amsterdam Unlimited server, as if they were his work.
Logged
Pages: [1] 2 3 4 5 6 7   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TremPlus theme by Ingar, based on AF316 theme by Fedhog
Valid XHTML 1.0! Valid CSS!