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
Lork
Oct 15, 2007
Sticks to clorf

roomforthetuna posted:

Is the laser sweeping laterally (like always pointing due north while moving west to east) or rotationally (pointing northwest and sweeping through to pointing northeast)?

And is it sweeping with a motion or by setting its position to a new position each frame?

Either way, could you do something with creating a mesh that encompasses the width of a frame's sweep? That way you at least wouldn't be skipping by never actually hitting.

(If it's lateral movement then you'd have a box collider the same as before, but with a new width that's the width of a frame's worth of motion. If it's rotational movement you'd probably have to build a wedge shaped mesh and use a mesh collider.)
It's sweeping rotationally and I'm moving it by setting its position each frame. However, the dropped collisions seem to have been caused by a different issue that I have since resolved. I discovered that if a part of a compound collider has children, those children aren't counted as part of the compound collider, and accounting for that in my detection code seems to have cleared everything up.

Instead I have a new problem. Because the origin of the beam is usually above the player, if the player stands right next to the origin the beam will fire in a very narrow arc almost straight down at the ground. I want the beam to always follow a large sweeping arc so I'm trying to set a minimum angle for the beam's target, but I have no idea how to change only one axis of a Quaternion.

code:
beamTarget.transform.position = beamWeapon.transform.position;
			
Quaternion rotationForRightNow = Quaternion.Slerp(startRot, endRot, 1.0f - weaponTimer / attacks[currentAttack].length);
			
if(rotationForRightNow.eulerAngles.x > 20)
	//Insert new rotation with minimum x component here
			
beamTarget.transform.rotation = rotationForRightNow;
beamTarget.transform.position += beamTarget.transform.forward * 30f;
			
beamWeapon.Fire(beamTarget.transform.position);

Adbot
ADBOT LOVES YOU

FuzzySlippers
Feb 6, 2009

Is this a non kinematic rigidbody? That would cause problems if you aren't using rigidbody.MovePosition to move it. That seems a bad candidate for relying on collision anyway though. I would spherecast or whatever from the laser origin down its length to determine a hit and remove the collider and rigidbody.

As I am fairly math stupid, I tend to abuse functions like LookRotation to solve these kinds of rotation problems without having to muck around with determining my rotation directly.

I would look into examples of how people handle turrets. There is a lot of information on that on Unity Answers about rotating within constraints that would seem relevant to your problem.

Lork
Oct 15, 2007
Sticks to clorf

FuzzySlippers posted:

Is this a non kinematic rigidbody? That would cause problems if you aren't using rigidbody.MovePosition to move it. That seems a bad candidate for relying on collision anyway though. I would spherecast or whatever from the laser origin down its length to determine a hit and remove the collider and rigidbody.

As I am fairly math stupid, I tend to abuse functions like LookRotation to solve these kinds of rotation problems without having to muck around with determining my rotation directly.

I would look into examples of how people handle turrets. There is a lot of information on that on Unity Answers about rotating within constraints that would seem relevant to your problem.
I wasn't even aware that there was such a thing as a "spherecast" so maybe that's a better solution, thanks. I'm having trouble picturing what that actually does, though. It would make the most sense if it was like doing raycasts to every point within a circle of the given radius, but if that was the case shouldn't it be a "circle" cast, not a sphere?

Also the rigid body is of course kinematic. I wouldn't want the beam to be moved or obstructed by anything other than the script. The collision part of it actually seems to be working perfectly, so I might just keep it the way it is for now.

Lork fucked around with this message at 02:21 on Nov 13, 2013

FuzzySlippers
Feb 6, 2009

From the Unity docs: "Think of the sphere cast like a thick raycast". You can do a series of raycasts so your hit target isn't tiny but a spherecast is simpler.

What you are describing is an "OverlapSphere" which casts out in a radius from a point of origin. I use overlapsphere for my target code (select the nearest enemy) as an example.

Lork
Oct 15, 2007
Sticks to clorf

FuzzySlippers posted:

From the Unity docs: "Think of the sphere cast like a thick raycast". You can do a series of raycasts so your hit target isn't tiny but a spherecast is simpler.

What you are describing is an "OverlapSphere" which casts out in a radius from a point of origin. I use overlapsphere for my target code (select the nearest enemy) as an example.
Yes, I read docs page, but that doesn't explain what it actually means. "Thick" in which dimensions? If it was thick in two dimensions it would be as I described, but that would be a circle, not a sphere. If the thickness was spherical then wouldn't it just be the same as a sphere collider, which would make no sense? Unless what it's actually doing is detecting anything within a sphere radiating out from the point at which a raycast hits, in which case it's just poorly explained.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Lork posted:

Yes, I read docs page, but that doesn't explain what it actually means. "Thick" in which dimensions? If it was thick in two dimensions it would be as I described, but that would be a circle, not a sphere. If the thickness was spherical then wouldn't it just be the same as a sphere collider, which would make no sense? Unless what it's actually doing is detecting anything within a sphere radiating out from the point at which a raycast hits, in which case it's just poorly explained.
I'd call it a cylindercast myself, since otherwise a raycast would be called a pointcast.

But given the change to an "extruded shape" model of reference, perhaps it's a spherecast rather than a circlecast because it touches an object along the ray that's less than a radius beyond the length? (ie. the collision shape might be a capsule rather than a cylinder.)

Goffer
Apr 4, 2007
"..."
Does anyone here do much sprite art? An old college friend of mine that lives out in the sticks has developed a pretty neat tool for making depth & normal maps for sprite drawings. He just started a kickstarter for it, but I reckon it would make a whole lot of peoples' animating and 2d game making a whole lot more awesome. Dynamic lighting and stuff for 2d drawings is kind of cool.

http://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art

Synthbuttrange
May 6, 2007

I was just shown that by a friend. Looks amazing!

Lork
Oct 15, 2007
Sticks to clorf

roomforthetuna posted:

I'd call it a cylindercast myself, since otherwise a raycast would be called a pointcast.

But given the change to an "extruded shape" model of reference, perhaps it's a spherecast rather than a circlecast because it touches an object along the ray that's less than a radius beyond the length? (ie. the collision shape might be a capsule rather than a cylinder.)
https://www.youtube.com/watch?v=RbTUTNenvCY

Well, that schools me, I guess. Thanks for explaining that.

I still maintain that the name and documentation are confusing, though. :colbert:

Goffer
Apr 4, 2007
"..."

SynthOrange posted:

I was just shown that by a friend. Looks amazing!

He's already more than halfway to his goal in under 2 hours, and someone straight up pledged $1000 to it as well. Seems like it might be a useful tool.

superh
Oct 10, 2007

Touching every treasure
Yeah, that looks awesome! Gonna send that around work and see what people think.

I imagine if you're doing keyframe animation you'll have to do 3-6x the number of drawings, but if you can reuse the assets in many more situations throughout the game, it will probably pay off.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Lork posted:

I still maintain that the name and documentation are confusing, though. :colbert:
You're totally right about the name - if a spherecast encompasses a capsule then by the same rules a raycast would be a plane and a pointcast would be the proper name for a raycast. Dunno about the documentation though, "raycast with thickness" seemed pretty clear to me.

So really, since raycast is pretty standard and I've never heard of a spherecast before, they should be calling it a capsulecast. :colbert:

xzzy
Mar 5, 2009

Cylindercast. :colbert:

Obsurveyor
Jan 10, 2003

Why don't they just call it by it's real name? A swept sphere test. :colbert: :eng101: :colbert:

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

Goffer posted:

Does anyone here do much sprite art? An old college friend of mine that lives out in the sticks has developed a pretty neat tool for making depth & normal maps for sprite drawings. He just started a kickstarter for it, but I reckon it would make a whole lot of peoples' animating and 2d game making a whole lot more awesome. Dynamic lighting and stuff for 2d drawings is kind of cool.

http://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art



Yep totally backing this.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

xzzy posted:

Cylindercast. :colbert:
A cylinder has squared off ends, not rounded ends :colbert:

Obsurveyor posted:

Why don't they just call it by it's real name? A swept sphere test. :colbert: :eng101: :colbert:
I'm with this guy.

Though honestly, sphere cast seemed pretty sufficient. Didn't seem that confusing. Biggest issue I have is there is still no box/rectangle cast. I just want a wide cubic/rectangular ray, the math's not hard / it'd be cheap, but no, they want me to use a crazy swept pill instead I guess. :shobon:
Seriously considering backing this. I've been rolling our own tech for lighting a 2D tile/sprite world, and this tech covers the one area I was going to skip - accurate sprite lighting (because hand drawing sprite depth maps is a bitch).

... though it's also obnoxious. Right now, the idea's novel and cool, but by the time I finish Hot Tin Roof and get Next Game far enough along to show, lighted sprite tech is apparently going to be old hat. :smith:

Shalinor fucked around with this message at 06:10 on Nov 13, 2013

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Shalinor posted:

Though honestly, sphere cast seemed pretty sufficient. Didn't seem that confusing. Biggest issue I have is there is still no box/rectangle cast. I just want a wide cubic/rectangular ray, the math's not hard / it'd be cheap, but no, they want me to use a crazy swept pill instead I guess. :shobon:
Is there no "arbitrary object/collider, what does it overlap with?" function? That seems a bit daft. But I suppose if there was that then it would seem daft to have a special capsulecast function too, since capsule primitives are available!

Obsurveyor
Jan 10, 2003

roomforthetuna posted:

Is there no "arbitrary object/collider, what does it overlap with?" function? That seems a bit daft. But I suppose if there was that then it would seem daft to have a special capsulecast function too, since capsule primitives are available!

I believe the issue is that Unity's physics engine can't handle the collider's volumes changing at runtime.

Dirty
Apr 8, 2003

Ceci n'est pas un fabricant de pates

roomforthetuna posted:

You're totally right about the name - if a spherecast encompasses a capsule then by the same rules a raycast would be a plane and a pointcast would be the proper name for a raycast. Dunno about the documentation though, "raycast with thickness" seemed pretty clear to me.

So really, since raycast is pretty standard and I've never heard of a spherecast before, they should be calling it a capsulecast. :colbert:

Yeah, I've been trying to figure out if a spherecast is actually an elongated sphere, stretched along the length of the ray, or an actual capsule.

I can live with the name if the documentation would just get specific. "Thick raycast" could mean a variety of things. "Capsule" pretty much means "capsule", so if that's what it is, then please use that word somewhere, Unity.

Hel
Oct 9, 2012

Jokatgulm is tedium.
Jokatgulm is pain.
Jokatgulm is suffering.

I was going to say that thick raycasting is obviously beamcasting , but according to wikipedia that uses pyramids, it does link to conecasting which might be it.

Either way I really appreciate this thread, I've learned a lot just by reading through it.

Now I just need to set up a backup/source control so that the next time my computer blows I don't lose half the project. Bitbucket is the recommended option for single person ,non-open source right?

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Dirty posted:

Yeah, I've been trying to figure out if a spherecast is actually an elongated sphere, stretched along the length of the ray, or an actual capsule.

I can live with the name if the documentation would just get specific. "Thick raycast" could mean a variety of things. "Capsule" pretty much means "capsule", so if that's what it is, then please use that word somewhere, Unity.
I'm fairly sure it would be either a capsule or a cylinder, simply because the math for those is extremely simple (it's basically the same as a raycast except instead of testing <0 you test <radius). I suppose an elongated sphere isn't much less simple math-wise, but it is horrific in that what the hell would ever be that shape?

The simple test, I suppose, would be to make a very tiny object at 0,1,0, and one at -0.5,0,0, and then do a spherecast from 0,0,0 direction 1,0,0 radius 1 length anything and see which objects it hits. If it hits the first then it's not an elongated sphere, and if it hits the second then it's a capsule not a cylinder.

Mind, the documentation does use the word capsule, but it says "Returns
bool True when the capsule sweep intersects any collider, otherwise false." which is retarded because it drat well should not be a capsule sweep, a sphere sweep is a capsule, a capsule sweep is some weird-rear end shape.

There actually is a capsulecast function, so they probably copy and pasted that bit of documentation from there and didn't fix it.

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:

Hel posted:

I was going to say that thick raycasting is obviously beamcasting , but according to wikipedia that uses pyramids, it does link to conecasting which might be it.

Either way I really appreciate this thread, I've learned a lot just by reading through it.

Now I just need to set up a backup/source control so that the next time my computer blows I don't lose half the project. Bitbucket is the recommended option for single person ,non-open source right?

BitBucket is great. Git Extensions is also great.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Bitbucket with SourceTree is about as easy as it's going to get.

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

Yodzilla posted:

Bitbucket with SourceTree is about as easy as it's going to git.

Fixed.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Atlassian should send you a check.

quiggy
Aug 7, 2010

[in Russian] Oof.


Goffer posted:

Does anyone here do much sprite art? An old college friend of mine that lives out in the sticks has developed a pretty neat tool for making depth & normal maps for sprite drawings. He just started a kickstarter for it, but I reckon it would make a whole lot of peoples' animating and 2d game making a whole lot more awesome. Dynamic lighting and stuff for 2d drawings is kind of cool.

http://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art



Aaaand pledged. This looks loving awesome.

littlebirdy
Oct 31, 2013

Goffer posted:

Does anyone here do much sprite art? An old college friend of mine that lives out in the sticks has developed a pretty neat tool for making depth & normal maps for sprite drawings. He just started a kickstarter for it, but I reckon it would make a whole lot of peoples' animating and 2d game making a whole lot more awesome. Dynamic lighting and stuff for 2d drawings is kind of cool.

http://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art



I'm kind of surprised that something like this doesn't already exist.

xzzy
Mar 5, 2009

The plague doctor animation is pretty eye popping.

Normal maps for 2D sprites seems so obvious, now that someone has pointed it out. :v:

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
People have been using normal maps on 2D sprites for a long time, but typically they are just built by hand or with a custom tool. This is just the first 'formalized' tool that I've seen, i.e. polished up and intended for other developers to use.

Polio Vax Scene
Apr 5, 2009



I wasn't too thrilled then I saw the rock wall. Backing the crap out of this now.


Guy seriously needs a haircut and shave though

Zizi
Jan 7, 2010

littlebirdy posted:

I'm kind of surprised that something like this doesn't already exist.

It kind of does, in that there is almost no difference between using this tool and hand-painting normal maps for sprites. From what I can tell, their tool basically just makes it a little more understandable, unless I'm missing something. You're still painting a greyscale image to represent lighting information from top, bottom, left and right, which is no different than hand-painting the R and G channels of a normal map. Basically, I don't really understand how this thing is different from a moderately-clever Photoshop action(or a mildly technical artist).

EDIT: To be clear, I'm honestly not out to put this thing down. I'm just having trouble seeing the value and would genuinely like a reason to be as excited as everyone else is about it.

Zizi fucked around with this message at 01:50 on Nov 14, 2013

Goffer
Apr 4, 2007
"..."

Zizi posted:

It kind of does, in that there is almost no difference between using this tool and hand-painting normal maps for sprites. From what I can tell, their tool basically just makes it a little more understandable, unless I'm missing something. You're still painting a greyscale image to represent lighting information from top, bottom, left and right, which is no different than hand-painting the R and G channels of a normal map. Basically, I don't really understand how this thing is different from a moderately-clever Photoshop action(or a mildly technical artist).

EDIT: To be clear, I'm honestly not out to put this thing down. I'm just having trouble seeing the value and would genuinely like a reason to be as excited as everyone else is about it.

Confederate Express and Legend of Dungeon both use kind of similar approaches in their games, although the plan for this process is to make a reusable tool for general use in games (and I guess other applications that use dynamic lighting).

I like to think this project has a different approach to the whole thing than using a photoshop tool. The process starts off with a diffuse image rather than a shaded image, so the artist doesn't initially have to spend time doing the highlights and shadows on the object.

Most of the photoshop and image processing stuff I've seen uses the pre-existing shadows and stuff in the image to generate the normal maps.

Also it's probably because it can run off rough hand sketches:


Don't think I'd really want to spend the time painting the R and G channels of this.

Tres Burritos
Sep 3, 2009

I read somewhere a while ago that if you wanted to make games you should just ... make games. Start simple and just finish one and then do the next. Well I feel like I pretty well "finished" my Asteroids clone and I gotta say it's a lot of fun to actually have made a game, no matter how simplistic it is.

Also I kinda like JavaScript now.

I mean I guess I could put in a score counter and sounds using the Web Audio API but I'm thinkin' I'll work on a Web Audio / Three.js game thing next. Gotta come up with an idea though.

J4Gently
Jul 15, 2013

Hello,
I'm looking for a CryEngine talent who would like to join a group to compete in the Star Citizen "Next Great Starship contest"
https://robertsspaceindustries.com/contest/the-next-great-starship

Basically make a startship for a pretty great game over a number of weeks and win cash, prizes and fame !!
Total first place prize of $30,000.
https://robertsspaceindustries.com/contest/the-next-great-starship


We have concepts and a Maya Artist(I can PM his demo reel) but need someone who can work in CryEngine, please let me know if any of you are interested.

Thank you

Here is a video on the contest
http://www.vimeo.com/76645112

(USER WAS PUT ON PROBATION FOR THIS POST)

YO MAMA HEAD
Sep 11, 2007

Tres Burritos posted:

I read somewhere a while ago that if you wanted to make games you should just ... make games. Start simple and just finish one and then do the next. Well I feel like I pretty well "finished" my Asteroids clone and I gotta say it's a lot of fun to actually have made a game, no matter how simplistic it is.

Also I kinda like JavaScript now.

I mean I guess I could put in a score counter and sounds using the Web Audio API but I'm thinkin' I'll work on a Web Audio / Three.js game thing next. Gotta come up with an idea though.

I got caught in a 'Game Over' alert loop until I told Chrome to stop allowing alerts from that page. That allowed me to keep flying around in a frozen asteroid field. Alerts are tacky anyway, especially in a "retro" setting.

Don Mega
Nov 26, 2005
Anybody get a chance to mess around with Unity 2D yet? I have not, but I was curious on other peoples thoughts. I watched the overview video and it seemed pretty awesome.

Zizi
Jan 7, 2010

Don Mega posted:

Anybody get a chance to mess around with Unity 2D yet? I have not, but I was curious on other peoples thoughts. I watched the overview video and it seemed pretty awesome.

I noodled around with it a bit, but most of my project that could use it are already established. Happy to have some of the new stuff as a backend to 2D Toolkit's continued awesomeness, mostly, but if I didn't already have tk2D I'd probably be inclined to use it.

Tres Burritos
Sep 3, 2009

YO MAMA HEAD posted:

I got caught in a 'Game Over' alert loop until I told Chrome to stop allowing alerts from that page. That allowed me to keep flying around in a frozen asteroid field. Alerts are tacky anyway, especially in a "retro" setting.

Just :f5: man. I did asteroids mostly because I'm too stupid to figure out anything else at the moment.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Tres Burritos posted:

Just :f5: man. I did asteroids mostly because I'm too stupid to figure out anything else at the moment.
For getting into it it's maybe a decent idea to take this attitude, but at some point you're going to have to engage with the horribleness that is menus and restarting and junk of that nature. It takes five times as much work as the actual game. On the other hand if you leave trying that until you're doing a big project it will be even more disheartening than it will be doing it for a simple game.

I hate menus so much.

Adbot
ADBOT LOVES YOU

Corbeau
Sep 13, 2010

Jack of All Trades

roomforthetuna posted:

For getting into it it's maybe a decent idea to take this attitude, but at some point you're going to have to engage with the horribleness that is menus and restarting and junk of that nature. It takes five times as much work as the actual game. On the other hand if you leave trying that until you're doing a big project it will be even more disheartening than it will be doing it for a simple game.

I hate menus so much.

Amen. AI and GUI are easily the least enjoyable categories of work I've done so far.

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