Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Ranzear
Jul 25, 2013

I do those dynamic function calls in Javascript and PHP. I consider enjoying and abusing those languages to be heretical.

Layering of effects is generally important to me too, which those achieve. You could even place sprites based on these tags.

Adbot
ADBOT LOVES YOU

Mr Shiny Pants
Nov 12, 2012
Is there any way to capture video from Shadowplay or Relive using .Net?

I have a VR game that I would like to record and I would like it to be automated so that any time the game starts it saves the video into a specific folder or something.

Unity already shows what the player sees on the mainscreen, so this should not be to hard right?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

I had tried both but I tried using the camera screen space again. It looks like it wants to make a canvas that will consume my whole screen. It does orient itself to the camera though. Is there a way to scale it to a rectangle right where I want the text to be drawn?

For that, you should be able to just move/size the canvas alongside your 3d scene.

https://docs.unity3d.com/ScriptReference/Transform.LookAt.html should be able to rotate it to the camera.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Tiler Kiwi posted:

Here's what it looks like for me: https://i.imgur.com/kP0ZnkK.png
Essentially, I just created a canvas for the scene, then wrote my implementation with the assumption that there would be a canvas lurking around in the scene for it to grab onto.
Okay so I should have many canvases but also a global, camera-bound canvas. I just child my indicators to the global canvas. Does that sounds about right?

Edit: I messed around with it over the evening and mostly got it. My main gotcha was that I was trying to put the Text UI component in the same GameObject as the Canvas. I had a few other gotchas. I had to use anchoredPosition in rectTransform. Otherwise it did God-knows-what with the position I calculated. I still don't know what to think of it because what I see in the inspector is not what I give it. I also had to use a bottom-left anchor because Camera.WorldToScreenPoint returns a quadrant 1 coordinate instead of a quadrant 4. I could just subtract the result from the screen's height and use an upper-left anchor, but that's more running around out of ritual. Does anybody make a point to use quadrant 4?

I think I'll create one global canvas handle and just attach my damage indicator prefab instances as children off of that. The alternative is generating a prefab that is technically two GameObjects in a parent/child relationship, and writing the component logic using parent/child calls. I think it's a bit delicate for what it has to be and it's also creating two objects each time. It also fits in to using a hybrid entity-component-subsystem model in Unity. I've found I've ended up attaching logic to a global handle that I think would be a subsystem in another engine.

Rocko Bonaparte fucked around with this message at 17:39 on Dec 12, 2017

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I have a vague question about rendering to two different opengl framebuffers, and then combining the two results.

I want to apply a blur to only certain pieces of the scene. So, what I am doing is rendering those objects to a separate framebuffer (the blurred buffer), and then copying that blurred framebuffer onto the main framebuffer. But this doesn't quite work, because I don't get any depth for the stuff that was written to the blurred buffer.

Both framebuffers can have their own depth buffer, right? So, is there a way to .. like.. merge two framebuffers together? Or add the depth from one framebuffer onto another?

Or can I use the same depth buffer while drawing to both framebuffers?

I have a feeling that I'm approaching this in the wrong way entirely.


train of thought edit: maybe I should draw the stuff to be blurred to a separate color attachment, and not to a separate framebuffer. Then, the draws use the same depth buffer.

baby puzzle fucked around with this message at 20:21 on Dec 13, 2017

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
You can use the same depth-buffer, if you want. I don't remember the specifics, and haven't work on this kind of stuff in a while, but you can make a depth buffer render target and bind that as your depth buffer on either, and as long as you don't clear it in between you should be good.

Sounds like what you're really after is a stencil buffer though? I.e. you draw the objects you want blurred to the same set of buffers, but also to a stencil buffer for the blur geometry, and then use the stencil buffer to specify where you want it to blur when you do your blur pass.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I might want a stencil buffer but I haven't learned that yet.. I got it working with the separate color buffer.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
We're hiring again, for a bunch of positions, come be my coworker and make cool games in a town that you can actually afford to live in.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

OneEightHundred posted:

We're hiring again, for a bunch of positions, come be my coworker and make cool games in a town that you can actually afford to live in.

Can confirm it's a good towns

Veni Vidi Ameche!
Nov 2, 2017

by Fluffdaddy

OneEightHundred posted:

We're hiring again, for a bunch of positions, come be my coworker and make cool games in a town that you can actually afford to live in.

Those benefits sound killer. Too bad I've worked in nothing but PHP, Javascript, and weird little niche and hobbyist languages for like six years. I'm not enjoying grinding out bloated customer relations software for my employer, but I'm no longer qualified to do anything else. The only C/C++/C# I've written this decade are half-finished personal projects. I'm old, anyway. I've accepted my fate.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I noticed that the Unity Text UI GameObjects I'm generating an attaching to my common canvas for that stuff are kind of overwriting each other. If I hit an enemy before the previous damage indicator has finished up, the new indicator gets drawn instead of it. I think it has to do with the proximity of the text boxes. The old GameObject is still around. Their boxes definitely overlap. Is there something about this? I figured what wasn't text was transparent and would have no effect.

Mr Shiny Pants
Nov 12, 2012
I am working on a simulation that has two identical joysticks. How can I swap these easily? Unity3d will not always map them the same way causing the right stick acting as the left controller and vice versa.

I could ghetto it and plug one in after the other right?

Mr Shiny Pants fucked around with this message at 08:34 on Dec 14, 2017

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you

OneEightHundred posted:

We're hiring again, for a bunch of positions, come be my coworker and make cool games in a town that you can actually afford to live in.

:eyepop: Rogue Spear and Raven Shield were my childhood. I am absolutely going to apply for this even though I really don't like what Ubisoft made you guys do to the franchise ever since Lockdown.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

I noticed that the Unity Text UI GameObjects I'm generating an attaching to my common canvas for that stuff are kind of overwriting each other. If I hit an enemy before the previous damage indicator has finished up, the new indicator gets drawn instead of it. I think it has to do with the proximity of the text boxes. The old GameObject is still around. Their boxes definitely overlap. Is there something about this? I figured what wasn't text was transparent and would have no effect.

You can just set the text field of the Text to some new value instead of making new Text objects. Most tween libraries additionally include tween support for them.

Also, TextMeshPro is free and better in a number of ways than UI.Text. If you don’t particularly care, it’s mildly more fiddly (need to open a new window to generate assets for fonts) but there aren’t a lot of good reasons to use UI.Text in a shipping project.

If you’re trying to make the damage fly off, you would need to make new text GOs (or pull from a pool) for each damage number. You can absolutely shove two or more UI.Text (or TMP.Text) over each other and they will both render. If you have some sort of background image, that could fight with your other text objects; it’s also written to the canvas — you could solve that with explicit sort orders, or just let it be.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

You can just set the text field of the Text to some new value instead of making new Text objects. Most tween libraries additionally include tween support for them.

Also, TextMeshPro is free and better in a number of ways than UI.Text. If you don’t particularly care, it’s mildly more fiddly (need to open a new window to generate assets for fonts) but there aren’t a lot of good reasons to use UI.Text in a shipping project.

If you’re trying to make the damage fly off, you would need to make new text GOs (or pull from a pool) for each damage number. You can absolutely shove two or more UI.Text (or TMP.Text) over each other and they will both render. If you have some sort of background image, that could fight with your other text objects; it’s also written to the canvas — you could solve that with explicit sort orders, or just let it be.

Right now, I'm making the damage indicator text move straight up for a certain amount of time before disappearing. Later when I go back through to do the personal juice, they'll get flung off of the entity opposite the direction they were damaged. I had pondered reusing a damage indicator if more damage arrives within, say, a quarter of a second, but this damage is coming in slowly enough that I should give it a new indicator even if that logic was already in place. What ends up happening is the text that has drifted a little bit upwards and clear of the area a new number could be drawn just disappears instead when the new one is generated. If I look in the hierarchy for the canvas, it has both indicator objects hiding in there. That's the part I don't get. My theory was that each of these text boxes has their own dimensions and they're outright occluding each other rather than factor transparency. One experiment I was going to try was trying to ram two Text objects over each other in an overlay campus in a custom scene just to see what happens.

I should drag in TextMeshPro. At a minimum, I won't have to Outline the text anymore.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

Right now, I'm making the damage indicator text move straight up for a certain amount of time before disappearing. Later when I go back through to do the personal juice, they'll get flung off of the entity opposite the direction they were damaged. I had pondered reusing a damage indicator if more damage arrives within, say, a quarter of a second, but this damage is coming in slowly enough that I should give it a new indicator even if that logic was already in place. What ends up happening is the text that has drifted a little bit upwards and clear of the area a new number could be drawn just disappears instead when the new one is generated. If I look in the hierarchy for the canvas, it has both indicator objects hiding in there. That's the part I don't get. My theory was that each of these text boxes has their own dimensions and they're outright occluding each other rather than factor transparency. One experiment I was going to try was trying to ram two Text objects over each other in an overlay campus in a custom scene just to see what happens.

I should drag in TextMeshPro. At a minimum, I won't have to Outline the text anymore.

The other thing you may be running into is your text moving outside the bounds of your canvas. If that’s the case, just make the canvas bigger.. :shrug:

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.

OneEightHundred posted:

We're hiring again, for a bunch of positions, come be my coworker and make cool games in a town that you can actually afford to live in.

Love what you guys have been doing with The Division, keep it up! Do you get any cool employee-only swag related to that game?

I’ll take a well-rolled House, Big Al, and Devil tyvm

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

The other thing you may be running into is your text moving outside the bounds of your canvas. If that’s the case, just make the canvas bigger.. :shrug:

Nope, the bug was between the keyboard and chair. The old damage indicator was still listening for health change events. The handler would reset the time at which it received a health change. The position of the text would scroll based on the delta between current time and that time. So it would get rewound to where the new indicator was showing up. They were drawing right on top of each other. It was really hard to see that in the inspector.

Mata
Dec 23, 2003
Gamedev thread, I need your help! I got some feedback from my testers that guys aren't taking the shortest route to their destination, which means it's time to tighten up the old pathfinding system...

I basically try to follow this guide for my flowfield implementation, but it doesn't address my problem as far as I can tell.

The issue arises from chunking the world up into small sectors, and connecting these by portals (see fig 23.1) upon which you run an initial coarse search from origin to goal. This lets you quickly reject invalid commands, and gives you a list of portals that essentially function as a bound for the flowfield generation phase, so you don't need to generate flowfields for the entire map for every path request.

Here's where it fails for me:

A villager needs to path from the mine to the town hall, and the optimal path (in orange) falls outside the bounds provided by the portal search. The actual path (blue) ends up being twice as long.
You can see the 8x8 sectors in green with the sector edges (portals) in white. The sector that the villager is currently in is grayscale shaded according to each tile's integration cost, but ignore that.

Here's what the portal search did:

The quickest route from its perspective (purple) involves 1 step before reaching the goal sector, whereas the route I'd prefer it to take would require two steps before reaching the goal sector. Note that the portal search doesn't really account for where inside the sector the origin/target is; it only looks at the portal level.

As far as I can tell, the whitepaper doesn't actually talk about this issue. In fact it doesn't really discuss pruning sectors that aren't crossed by the initial portal search, I just assume this is done - or it would keep expanding sectors outward from the goal, until the entire map is generated?
If anybody is familiar with this algorithm, could you tell me where my misunderstanding lies, or if there's additional reading material on this I haven't found?

Mata fucked around with this message at 15:19 on Dec 16, 2017

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Mata posted:

Gamedev thread, I need your help! I got some feedback from my testers that guys aren't taking the shortest route to their destination, which means it's time to tighten up the old pathfinding system...

Here's where it fails for me:

I don't know diddly about the algorithm but I want to suggest trying the same scene rotated in all four cardinal orientations. I shook out a lot of bugs in my own pathfinding that way. Heck, I think I set up my unit tests to rotate the mock level data and the asserted path. There were a few gotchas in making decisions to try different directions first over other directions that I had to shake out.

Edit: It looks like you'd also have to factor in existing entities into the calculation. It could see the dude to the right of the building and somehow just condemning the whole thing.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

HiriseSoftware posted:

Do you get any cool employee-only swag related to that game?
Yeah I've got a lot of random stuff, I think I'm taking home an average of 4 random goodies per year.

The in-game dev team patches went out the morning after you asked, but I didn't get one and I think it's because I forgot to fill out a form despite being reminded twice. :v:

Mata posted:

Gamedev thread, I need your help! I got some feedback from my testers that guys aren't taking the shortest route to their destination, which means it's time to tighten up the old pathfinding system...
I'm totally unfamiliar with the algorithm, but my guess is that it's failing to account for distance traveled within the tile, since the off-tile paths are about the same length.

It might just be a limitation of it too, crowd pathfinding might prefer logjam avoidance to choosing the shortest path. If you want to quickly get the shortest path on a uniform grid for individual objects, you should probably look into jump-point search, which is basically A* optimized for that specific case.

OneEightHundred fucked around with this message at 04:57 on Dec 17, 2017

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Well I tried TextMeshPro. I was trying to monkey with outline settings but they don't show up when I attach the TextMeshPro UI Text component to a prefab. I tried to change them through the API. I get no errors, but no change either. Stuff like this:

code:
    textComp.materialForRendering.SetColor("_Outline", Color.white);   
That's what the SDF shader shows for the outline color. I can't change the thickness either, but that seems moot. Is this something I'm even allowed to do this way?

Mata
Dec 23, 2003

Rocko Bonaparte posted:

I don't know diddly about the algorithm but I want to suggest trying the same scene rotated in all four cardinal orientations. I shook out a lot of bugs in my own pathfinding that way. Heck, I think I set up my unit tests to rotate the mock level data and the asserted path. There were a few gotchas in making decisions to try different directions first over other directions that I had to shake out.

Edit: It looks like you'd also have to factor in existing entities into the calculation. It could see the dude to the right of the building and somehow just condemning the whole thing.

This particular failure case isn't caused by that type of bug in the implementation, it's more like the results are exactly as expected given my understanding of how the algorithm works.
I think what I likely need to do is to improve the heuristic so it isn't as eager to rule out what later turns out to be the optimal path. I'm thinking I could probably cache each generated flowfield and use those to look up the actual distance between portals instead of having to rely on a heuristic at all, which means that units will get better at picking shorter paths as the game continues.

OneEightHundred posted:

I'm totally unfamiliar with the algorithm, but my guess is that it's failing to account for distance traveled within the tile, since the off-tile paths are about the same length.

It might just be a limitation of it too, crowd pathfinding might prefer logjam avoidance to choosing the shortest path. If you want to quickly get the shortest path on a uniform grid for individual objects, you should probably look into jump-point search, which is basically A* optimized for that specific case.

I was using JPS earlier, but moved over to flowfields because steering and group pathfinding was such a nightmare to get right. I want to avoid mixing different pathfinding algorithms for different cases...

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

Well I tried TextMeshPro. I was trying to monkey with outline settings but they don't show up when I attach the TextMeshPro UI Text component to a prefab. I tried to change them through the API. I get no errors, but no change either. Stuff like this:

code:
    textComp.materialForRendering.SetColor("_Outline", Color.white);   
That's what the SDF shader shows for the outline color. I can't change the thickness either, but that seems moot. Is this something I'm even allowed to do this way?

You don’t want to be mucking with the thing in code. If you do want to change things in code, it’s probably through shaders which are attached to it, or changing which style it’s using.

Just hit the sliders in the editor and double check the checkboxes.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Yeah with TextMeshPro the first step is just getting things looking the way you want in the editor before trying to muck with stuff in code.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Also remember to replace \\n with \n and so on because TextMeshPro will make it look like \\n should work in editor since it reformats the text as soon as it gets dirty but it will not get dirty in the same frame you want to feed it a text.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
If I am supposed to get it working in the editor, do you have any idea why the material does not show up until I am in game mode?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

If I am supposed to get it working in the editor, do you have any idea why the material does not show up until I am in game mode?

There are a lot of YouTube vids the creator put together on how to get up and running. They’re pretty short and will probably help you better than the off-editor rememberings you’re going to get here.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

There are a lot of YouTube vids the creator put together on how to get up and running. They’re pretty short and will probably help you better than the off-editor rememberings you’re going to get here.

Heh I blew an hour watching a six-minute video on outlining text because none of those controls showed up for me at all. The documentation made it sound simple too, so I assumed something had just changed and everything online was stale. I eventually paused the editor when I was in game mode and noticed the material showed up with a drop-down. Poof! All the cool stuff was there. It has happened in test scenes too where that was all I touched. I guess I have to check with them on their forums or something.

I was hoping to have the outline and text change colors in a strobe effect. I am guessing that I should just copy and tweak the shader, but I won't get far with that unless I can replace the material in the editor or hack it into my MonoBehaviour.

Edit: Today I got the material settings in-editor if I dropped the object in. I just can't tweak them when it's a prefab. Or something. I should add that I've been doing a lot of internal logic stuff before getting into visuals so I haven't really even been playing with materials. I wouldn't know if this is even normal or not yet.

Rocko Bonaparte fucked around with this message at 17:48 on Dec 17, 2017

ddiddles
Oct 21, 2008

Roses are red, violets are blue, I'm a schizophrenic and so am I
I'm a JavaScript dev working in the great ecosystem of the web, and I'm wanting to dive into other coding languages/dev environments to try to figure out where I want to end up.

Was thinking that learning how to build some simple 2D Unity project would be an interesting way to learn some C#, anyone have any good recommendations for some video tutorials on getting into this? My eyes tend to just glaze over if I'm just reading a book about it.

Was thinking about trying this course out https://www.udemy.com/unitycourse2/

ddiddles fucked around with this message at 20:36 on Dec 17, 2017

xgalaxy
Jan 27, 2004
i write code

ddiddles posted:

I'm a JavaScript dev working in the great ecosystem of the web, and I'm wanting to dive into other coding languages/dev environments to try to figure out where I want to end up.

Was thinking that learning how to build some simple 2D Unity project would be an interesting way to learn some C#, anyone have any good recommendations for some video tutorials on getting into this? My eyes tend to just glaze over if I'm just reading a book about it.

Was thinking about trying this course out https://www.udemy.com/unitycourse2/

Any Udemy courses with Ben Tristem are excellent.

Chernabog
Apr 16, 2007



The unity tutorials on their website are pretty good too.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Is there a typical pattern to handling items that can have multiple states in the Unity editor? I want to use the same prefab in the editor in my resources subfolder for placing items in my level as well as dropping into inventory components. However, their representation between these two forms is quite different. In particular, the GameObject for the item won't have its mesh present if its just in an inventory, unequipped. I have the whole thing laid out about how to manage the state transitions, but I don't know how to trigger them from one prefab in edit mode.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Has anyone ever read/watched any interesting articles, talks, or blog posts about how stealth game mechanics are implemented (3D, in particular)?

The intuitive way of doing it, using raycasts every tick for each actor in the world, seems super inefficient and resource-heavy. Another way of doing it, where you add an "if" check to see if the player character is within the radius of a light actor and then if so then you do the raycasting on each tick, seems less resource-heavy but also makes my programming "spidey sense" tingle in a bad way. I was trying to think of some other better ways you could do it but I haven't really found anything useful apart from that Tom Looman UE4 tutorial on Youtube. Whatever else I've found seems to agree about implementing it that way, so maybe I'm just dumb.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Love Stole the Day posted:

Has anyone ever read/watched any interesting articles, talks, or blog posts about how stealth game mechanics are implemented (3D, in particular)?

The intuitive way of doing it, using raycasts every tick for each actor in the world, seems super inefficient and resource-heavy. Another way of doing it, where you add an "if" check to see if the player character is within the radius of a light actor and then if so then you do the raycasting on each tick, seems less resource-heavy but also makes my programming "spidey sense" tingle in a bad way. I was trying to think of some other better ways you could do it but I haven't really found anything useful apart from that Tom Looman UE4 tutorial on Youtube. Whatever else I've found seems to agree about implementing it that way, so maybe I'm just dumb.

I'd assume you'd create transparent bounding volumes like frustums that are basically glued to the faces/torsos of all the actors, check for general collisions between them and the player, and only then fire your detection death ray.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

Is there a typical pattern to handling items that can have multiple states in the Unity editor? I want to use the same prefab in the editor in my resources subfolder for placing items in my level as well as dropping into inventory components. However, their representation between these two forms is quite different. In particular, the GameObject for the item won't have its mesh present if its just in an inventory, unequipped. I have the whole thing laid out about how to manage the state transitions, but I don't know how to trigger them from one prefab in edit mode.

I would probably handle the shared state with a ScriptableObject. There have been a few good talks from Unite about them in the past year or two.

xzzy
Mar 5, 2009

Rocko Bonaparte posted:

I'd assume you'd create transparent bounding volumes like frustums that are basically glued to the faces/torsos of all the actors, check for general collisions between them and the player, and only then fire your detection death ray.

Could also test what direction any NPC's are facing and if their vector isn't aimed towards the player, forget them and move on. Then if an enemy is looking in the correct direction have a value stored on the player indicating their visibility. If that passes then do the raycast to find if any scenery is in the way.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

I would probably handle the shared state with a ScriptableObject. There have been a few good talks from Unite about them in the past year or two.
I've pondered this before. I tend to be throwing a bunch of behavior on to the objects depending on the state though; these aren't just some simple containers for some item stats. I'll concede it's more likely I haven't gotten clever enough with ScriptableObjects to really run with them.

Anyways, my main issue is in being able to react to the item getting placed out from the prefab into the level or into an inventory in the level. I was particularly wondering if there are some UnityEditor callbacks I haven't otherwise seen that could trigger when the user is trying to instantiate it in-editor. I'm otherwise stuck with something like an IOU for the real object that I'd have to unpack on the first frame.

KillHour
Oct 28, 2007


Ray casts really aren't that resource heavy in and of themselves. You can probably do a hundred per frame no problem.

Adbot
ADBOT LOVES YOU

Ranzear
Jul 25, 2013

Rocko Bonaparte posted:

I'd assume you'd create transparent bounding volumes like frustums that are basically glued to the faces/torsos of all the actors, check for general collisions between them and the player, and only then fire your detection death ray.

I'd go this route. Would take advantage of your existing collision optimizations.

I have a similar problem to solve with a server-enforced vision system for a third-person game, where if you can see any part of an enemy player server-side they will appear for you in netcode. My current solution is a sphere (could be UV or iso, even a half-ellipsoid dome) that stays world-oriented around each player object. With ray-traces from and to the 'same vertex' on each bounding object, all rays should be parallel yet dense enough to do the job to call the target 'seen' if any ray reaches the other bounding object without other collision.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply