[Closed] [needs randi]Overlays for Actors

Moderator: GZDoom Developers

[needs randi]Overlays for Actors

Postby Major Cooke » Tue Jun 21, 2016 11:05 am

Leonard2's Pull Request

Allows overlays to be set and destroyed on actors. Useful if someone makes remote controlled things such as flying attack robots with guns that can be controlled until destroyed. ;)

Summon D in console. It will display the rocket launcher sprites on its own, switching between frames A and B.

Code: Select allExpand view
Actor D
{
   +NOINTERACTION
   States
   {
   Spawn:
      PLAY A 15
      PLAY A 16
      {
         Thing_ChangeTID(0,20000);
         ChangeCamera(20000,1,0);
         A_Overlay(2,"Test");
         A_OverlayOffset(2,0,32);
      }
      PLAY A 17
      {
         if (!A_Overlay(2,"Null",true))
         {   
            A_PrintBold("This one's still rollin!");
            A_SetTics(17*9);
         }
         else
         {   A_PrintBold("That ain't good.");   }
      }
      PLAY A 17
      PLAY A 0 ChangeCamera(0,1,0)
      Stop
   
   Test:
      MISG A 17 A_PrintBold("10")
      MISG B 17 A_PrintBold("9")
      MISG A 17 A_PrintBold("8")
      MISG B 17 A_PrintBold("7")
      MISG A 17 A_PrintBold("6")
      MISG B 17 A_PrintBold("5")
      MISG A 17 A_PrintBold("4")
      MISG B 17 A_PrintBold("3")
      MISG A 17 A_PrintBold("2")
      MISG B 17 A_PrintBold("1")
      Stop
   }
}


Image
Last edited by Major Cooke on Thu Jul 28, 2016 5:24 pm, edited 7 times in total.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Snarboo » Wed Jun 22, 2016 1:02 am

Would this allow for attachable accessories, such as satchels or damage decals, or would this be restricted to parallel functions, such as allowing monsters to summon child actors independently of what state they're in?
User avatar
Snarboo
Bacon doesn't know it's not dogs
 
Joined: 29 Nov 2005

Re: Overlays for Actors

Postby Nash » Wed Jun 22, 2016 3:24 am

Good, I'm tired of the disproportionate performance overhead from attaching multi-part monsters via A_Warping them together.

Even if a monster is only made up of two parts - let's say upper body and lower body - the amount of actor processing is already doubled (it's like for every 1 of those monsters, there's 2 of them because they're separate, full actors all with their own LOS/AI overhead - even if the attached part doesn't need them!)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Overlays for Actors

Postby Major Cooke » Wed Jun 22, 2016 6:19 am

Snarboo wrote:Would this allow for attachable accessories, such as satchels or damage decals, or would this be restricted to parallel functions, such as allowing monsters to summon child actors independently of what state they're in?


The latter.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Gez » Wed Jun 22, 2016 8:10 am

I'm afraid of the performance hit that'd happen if every actor has to be processed for multiple sprites.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Overlays for Actors

Postby Major Cooke » Wed Jun 22, 2016 8:44 am

The only sprites to process are if the camera's being viewed from within them, i.e. ChangeCamera. Otherwise, they're not rendered at all. It would be no different than ticking inventory, only on the actor itself instead of an inventory.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Xaser » Wed Jun 22, 2016 9:26 am

Seems like there's a disconnect between the actual suggestion and our perceptions of it -- I was confused too at first. :P

I think what Cooke is asking is for the ability to attach PSprite layers to things like cameras or monsters so that they get displayed on the player's screen if you ChangeCamera to the actor... this by itself is would be an oddly-specific use-case that could be dismissed with a "use HudMessage", but the second key point is that the PSprites have full state sequences that can affect its parent actor, so a monster can have multiple DECORATE state loops going on at once.

I still like Nash's interpretation better, though. If we could somehow figure out how to do that, then we can do some kickass visual stuff and get the multi-state benefits as described above.

TBH, A_Warp has matured rather nicely, so I still dunno the true feasibility of this given you can sorta do it already. Just spitballing/translating.
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: Overlays for Actors

Postby Major Cooke » Thu Jun 23, 2016 8:35 am

Edward-san (from another thread he meant to post here) wrote:Sounds so much WFDS, but maybe I'm too pessimistic :mrgreen:

Maybe so, but the code is quite similar so perhaps that could be something going for it. As you can see in my PR, I managed to just extend DPSprites to non-players.

Xaser wrote:I think what Cooke is asking is for the ability to attach PSprite layers to things like cameras or monsters so that they get displayed on the player's screen if you ChangeCamera to the actor... this by itself is would be an oddly-specific use-case that could be dismissed with a "use HudMessage", but the second key point is that the PSprites have full state sequences that can affect its parent actor, so a monster can have multiple DECORATE state loops going on at once.

Leonard2 was going to do this, now that he has the base overlays in for players. However, it appears he's taking a break for the time being so I jumped on board after he provided some... inspiration. Admittedly though, he probably would've done it a lot better than I would have. But, it was a lot easier than I thought it would be which I'm proud of.

Xaser wrote:I still like Nash's interpretation better, though. If we could somehow figure out how to do that, then we can do some kickass visual stuff and get the multi-state benefits as described above.

That's unfortunately all doomscript material I think.

-----

And I'm done. Now I just need people to review my code.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Major Cooke » Wed Jul 06, 2016 11:17 am

Updated. Cleaned up the merge conflict.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Rachael » Wed Jul 06, 2016 12:42 pm

Alright - I was pretty darn confused reading this whole thing until it finally clicked what this is actually trying to accomplish.

So for those people who are as confused as I was - here is my interpretation of it (in Lehman's terms) -

Basically, it's like attaching weapon sprites to a non-player view for when you ChangeCamera to said actor. So if you are controlling a non-player "monster" (let's just call it that) you still get a "weapon" on your screen belonging to said "monster".

Please feel free to correct me if I am wrong.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Overlays for Actors

Postby Major Cooke » Wed Jul 06, 2016 12:44 pm

That's basically my github commit message with expanded detail. :P You nailed it on the head. Note that what the monsters draw is their own overlays. So if you have a plasma rifle up and you set a rocket launcher for a monster, the rocket launcher will be visible instead of the plasma rifle when using ChangeCamera.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby The Zombie Killer » Fri Jul 08, 2016 2:37 am

This would be incredibly useful for possession (and Classic Arcade too, if it works on camtextures!)
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Overlays for Actors

Postby Major Cooke » Fri Jul 08, 2016 8:51 am

Agreed. I'm not sure if it works on camtextures or not though. I've always been a little fumble-some with those, can't ever seem to get them to work right. :|

That is, generally speaking, not involving my submission at all.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Overlays for Actors

Postby Arctangent » Fri Jul 08, 2016 11:04 am

Out of curiosity, are there any issues that could arise if you use this on a player?
User avatar
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: Overlays for Actors

Postby Major Cooke » Fri Jul 08, 2016 11:06 am

On the contrary. It was built for the player. This just happens to expand it to actors. In fact, every weapon call technically puts them ON the player itself.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Dark-Assassin, TweetMeme [Bot] and 1 guest