|
I too started with Unity-Javascript, and switched to C# when I kept getting hung up on things the Javascript wouldn't do properly.
|
# ? Apr 19, 2012 14:48 |
|
|
# ? May 26, 2024 05:53 |
|
Azazel posted:I'm going to back this up as well. I went the UnityScript route at first, and while it's reasonably powerful, I kept expecting it work like ECMA Javascript and was getting frustrated with it's behavior. I finally retooled everything in C# shortly after getting started and haven't looked back. I wish there was a nice Ruby derivative though, sigh. (chalk up another that started jscript then went c#) Unity jscript isn't bad, but seems to have been designed to act as a designer scripting tool, while actual code is written in c#. If you follow that flow, it also keeps your level scripting nice and airlocked away from core code.
|
# ? Apr 19, 2012 15:01 |
|
The Playstation Suite SDK open beta was officially released today. Has anyone picked this up in hopes of tinkering around with making Vita games or apps? I'm curious if there are any goons as interested in making Vita applications as I am.
|
# ? Apr 19, 2012 15:02 |
|
CaptainPoopsock posted:The Playstation Suite SDK open beta was officially released today. Has anyone picked this up in hopes of tinkering around with making Vita games or apps? I'm curious if there are any goons as interested in making Vita applications as I am. I was in the closed beta for a bit since GDC and I like it well enough (haven't been any support to test on Vita until this morning) in terms of API and such. I've bitched about it in the Vita thread but the big thing that I hate hate hate hate is the memory limit, which is stupidly restrictive. You're given 96mb, which you have to split between heap and "resource" memory (meaning audio AND video). It gets even dumber that there is no support of texture compression as well. It's all setup so you can have one exe that runs on all PS Suite platforms. I only care about the Vita god damnit.
|
# ? Apr 19, 2012 17:25 |
|
If you don't have texture compression then one thing you can do is convert it to a luma/chroma colorspace and subsample the chroma channels. YUV420 gives you effectively 2:1 compression and usually isn't noticeable. A while ago I was tinkering with fractional chroma values, which tends to have better spatial coherence and might let you subsample even more. OneEightHundred fucked around with this message at 18:55 on Apr 19, 2012 |
# ? Apr 19, 2012 18:49 |
|
OneEightHundred posted:If you don't have texture compression then one thing you can do is convert it to a luma/chroma colorspace and subsample the chroma channels. YUV420 gives you effectively 2:1 compression and usually isn't noticeable. Any links on this? I don't know much about luma/chroma or subsampling so I don't have the slightest idea what to google for
|
# ? Apr 19, 2012 19:50 |
|
ShinAli posted:Any links on this? I don't know much about luma/chroma or subsampling so I don't have the slightest idea what to google for http://en.wikipedia.org/wiki/YUV is the most common luma/chroma colorspace. Basically, the Y channel is an unsigned luminance channel, it stores the (perceptually-weighted) brightness of a color, the U and V channels are the amount of red and blue (respectively) that you'd have to subtract from the final color to make it gray, ultimately representing the coloration of it. A grayscale color will always have zero U and V for example. The reason this is useful is that the human visual system is significantly better at detecting details where brightness changes than where color changes, so you can exploit that to store the latter using less information. You can usually cut the chroma resolutions in half and get no perceptual difference, in fact every DVD you've ever seen is using half-resolution chroma. Fractional chroma exploits the fact that the range of the chroma channels is always proportional to the luma value, so you can get more resolution by storing them as a fraction of the luma instead, which has the side-effect of flattening out chroma values in spots where hue and saturation are roughly the same but intensity varies (i.e. pretty much every shadow). This winds up changing the representation of the color channels to the fraction of the Y value that those 2 channels compose. For subsampling, basically what you'd do is store 1 full-resolution grayscale texture and 2 half-resolution grayscale chroma textures, and do the transform to RGB in the shader. If the chroma is consistent enough, you might even be able to subsample further. The nice thing is that because they're normalized to 0..1, the amount of subsampling is totally transparent to the renderer, though you do have to watch out for edge artifacts. OneEightHundred fucked around with this message at 22:11 on Apr 19, 2012 |
# ? Apr 19, 2012 20:10 |
|
ShinAli posted:I was in the closed beta for a bit since GDC and I like it well enough (haven't been any support to test on Vita until this morning) in terms of API and such. I've bitched about it in the Vita thread but the big thing that I hate hate hate hate is the memory limit, which is stupidly restrictive. You're given 96mb, which you have to split between heap and "resource" memory (meaning audio AND video). It gets even dumber that there is no support of texture compression as well. It's all setup so you can have one exe that runs on all PS Suite platforms. Hey, Sony doing any form of Unified Memory is something to cheer about, not bitch. Going from 360 having 512 memory for heap/resource as you put it to having Sony have 256 heap, 256 video is always a shock.
|
# ? Apr 19, 2012 23:13 |
|
AntiPseudonym posted:Well honestly I've never started a megathread before, so it'll be a learning experience. I do know where to get a tonne of really good tuts, though. A really interesting thing I saw done in another spriting thread somewhere was mini contests periodically. A palette and theme would be selected. (For example, a bunch of shades of orange and 'mob bosses' was the first challenge.) Doing something similar every month or so would be awesome. Also, I'm a terrible spriter, and this might be a good motivation to practice.
|
# ? Apr 20, 2012 00:16 |
|
OneEightHundred posted:Great info Thanks! Little bit worried about using up three texture units (unless I put the two half res chroma textures in a row right below the luma texture?) but probably not as a big deal as I'm thinking it is. As for alpha I'd probably have to make a separate alpha map texture, right? Hughlander posted:Hey, Sony doing any form of Unified Memory is something to cheer about, not bitch. Going from 360 having 512 memory for heap/resource as you put it to having Sony have 256 heap, 256 video is always a shock. Not saying unified memory blows or anything like that; I think the way 360 has done it is pretty much the way to go, at least for console development. The problem is it'd be hard to determine the split between heap and resource as it'll immediately crash if either goes over the allotted limit. Does the 360 require you to define a split or does it just go with heap/stack/video all at once? Anyways, I still don't like it. I mean, the Vita has 512mb of system memory and 128mb of video. The memory limit of PS Suite applications is a fraction of the video memory itself, and I do not even get why audio and video are combined to be resource memory. Hell all PS Suite supported devices so far have at least 512mb, while 1gb is becoming more common with Sony devices. It kind of effectively kills off 2D games unless you're going for some pixely look. I'd be totally cool with a 256mb budget, with audio going into heap and whatever the max for video can be. I know about device compatibility and so forth but they could setup device profiles to let developers scale for whatever hardware or really just let them choose minimum requirements. EDIT: and texture compression. I would think this would be really important!
|
# ? Apr 20, 2012 01:32 |
|
Pfhreak posted:A really interesting thing I saw done in another spriting thread somewhere was mini contests periodically. A palette and theme would be selected. (For example, a bunch of shades of orange and 'mob bosses' was the first challenge.) Doing something similar every month or so would be awesome. Didn't get around to doing it last night because I was exhausted after work, sorry guys. Although I'm getting some resources together now to start the thread, so it's going to happen. Also the mini-contests are a great idea, especially given the limitations of spriting it can pose for some very interesting challenges. Anyone have any opinions on where the thread should go? CC seems like it'd be the most appropriate choice.
|
# ? Apr 20, 2012 01:59 |
|
AntiPseudonym posted:Didn't get around to doing it last night because I was exhausted after work, sorry guys. Although I'm getting some resources together now to start the thread, so it's going to happen. Also the mini-contests are a great idea, especially given the limitations of spriting it can pose for some very interesting challenges. Definitely CC, though I'd ask the OP here if they'd mind putting a link to it in the.. uhh.. OP, here (why must they both be called OP's?) I can't wait. I'm no artist, but I'd love to at least try my hand at it, in the comfort of a megathread with other goons discussing all-things-pixelart.
|
# ? Apr 20, 2012 02:14 |
|
I'd love to have forced things to sprite too, I really need to get better at this kinda stuff. I'd say just do weekly contests, because unlike the gamedev one, not quite as much work has to go into them.
|
# ? Apr 20, 2012 02:21 |
|
Jewel posted:I'd love to have forced things to sprite too, I really need to get better at this kinda stuff. I'd say just do weekly contests, because unlike the gamedev one, not quite as much work has to go into them. I should probably point out that I don't think I'll be able to spare enough time to run the competitions myself, although if anyone wants to put their hand up, let me know!
|
# ? Apr 20, 2012 02:25 |
|
I'm being kind of dense here I think, but it's been a while since I took trig. In a 2D game, how do I find the angle between to rays? Is there 360 degree option I can use? Sin/cos all seem to work for 90 degrees and I have to find out what quadrant the second point is in.
|
# ? Apr 20, 2012 02:39 |
|
code:
|
# ? Apr 20, 2012 02:45 |
|
Jewel posted:I'd love to have forced things to sprite too, I really need to get better at this kinda stuff. I'd say just do weekly contests, because unlike the gamedev one, not quite as much work has to go into them. I would too. I am no artist by nature but having some motivation to work on spriting between games would be great.
|
# ? Apr 20, 2012 05:30 |
|
Okay, OP's almost ready to go, just need to gather up some tuts and images and it'll be good to go.
|
# ? Apr 20, 2012 08:04 |
|
AntiPseudonym posted:Okay, OP's almost ready to go, just need to gather up some tuts and images and it'll be good to go. The site that got linked before has a huge list of tutorials. http://www.pixelprospector.com/indie-resources/ Copy some of those into the OP and link this site too for further reading I guess!
|
# ? Apr 20, 2012 08:25 |
|
ShinAli posted:Thanks! Little bit worried about using up three texture units (unless I put the two half res chroma textures in a row right below the luma texture?) but probably not as a big deal as I'm thinking it is. As for alpha I'd probably have to make a separate alpha map texture, right?
|
# ? Apr 20, 2012 09:33 |
|
Jo posted:I had a REALLY hard time with this, too. It worked for single boxes, but multiple ones killed me. Finally got it working perfectly after many painful hours. Here's the code I used. I used it as a starting point (mainly the getBlockPush method) and got this as something that... "works" code:
The code also doesn't work if I use my characters regular framesize (which is 32x48), thus I use a collision rectangle that has the same dimensions as a tile. This is not a big deal, however, though it was annoying to realize that I should've done this from the start. Knowing me, I've probably overlooked something simple, and maybe I'm not showing enough code (mainly due to post length), but how do I fix the vibration and "column stopping"?
|
# ? Apr 20, 2012 10:58 |
|
Paniolo posted:
That should go in the OP maybe? edit: Haven't been able to try it yet, but from reading arccos only goes 0-180 degrees. Which is better than 0-90, but do I have to do any sort of checking on the original vectors to see which half the vector is in, or is this a 360 degree solution? Physical fucked around with this message at 13:58 on Apr 20, 2012 |
# ? Apr 20, 2012 13:20 |
|
Alright, the pixel-art thread is up! Tried to get as much info as I could into the OP, let me know if you guys want to add anything.
|
# ? Apr 20, 2012 14:33 |
|
So Jordan Mechner just put the Prince of Persia source code for the Apple II on github. It's pretty interesting and I just thought I'd share.
|
# ? Apr 20, 2012 15:08 |
|
Physical posted:You're the best. Thanks! The angle between two vectors cannot possibly be more than 180 degrees. But perhaps the problem you're looking to solve isn't simply angle but something else as well. edit: If it's signed angle (i.e. you want to know the angle is clockwise or counterclockwise) you can use: code:
Paniolo fucked around with this message at 16:27 on Apr 20, 2012 |
# ? Apr 20, 2012 16:19 |
|
Paniolo posted:The angle between two vectors cannot possibly be more than 180 degrees. But perhaps the problem you're looking to solve isn't simply angle but something else as well. Given a point and a 2d vector to look at, how do I translate that to an angle?
|
# ? Apr 20, 2012 16:26 |
Feeling a little ambitious right now. Can Direct3D 11's geometry shader conceivably render a minecraft-like game by taking in 3-integer tuples (for the blocks position) and an enumerator for the block type, then turn that into a rendered voxel landscape?
|
|
# ? Apr 20, 2012 22:49 |
|
Physical posted:Hah! Yea you are right. I am using box2d and the only way I can represent rotation/look-at is via an angle. Maybe this is a better phrasing of the question: If you mean that you have an object at some point and you want to orient it to some normalized look-at vector, then something like theta = atan2(vector.y/vector.x) would do it. Two caveats though: (1) You need to pay attention to physics vs screen coordinates, since most physics simulations will treat +y as the up direction while the screen coordinates treat +y as the down direction, and (2) You also need to know what direction your physics simulator considers to be theta=0 and adjust the result to match that expectation by adding an offset if needed.
|
# ? Apr 20, 2012 23:27 |
|
Alternatively, if you mean you have a point represented as a 2D vector, and another point for it to look towards, also represented as a 2D vector, then PDP-1's answer is still right except first vector = lookatpoint - originpoint; (Also the look-direction vector doesn't have to be normalized, atan2 doesn't care. And atan2 takes two parameters, so it's not (vector.y/vector.x), it's (vector.y,vector.x))
|
# ? Apr 21, 2012 00:05 |
|
Shameproof posted:Feeling a little ambitious right now. Can Direct3D 11's geometry shader conceivably render a minecraft-like game by taking in 3-integer tuples (for the blocks position) and an enumerator for the block type, then turn that into a rendered voxel landscape? Yes, but you can go beyond that. You don't actually need to pass the block position at all; if you know that the dimensions of a chunk are UxVxW, you can use the SV_InstanceID value (which is generated by the system and doesn't need to be provided by you) to calculate u, v and w. To really squeeze it down, you can fit multiple blocks into a single vertex. If you have only 16 block types, for example, you only need 4 bits per block and can squeeze 8 into a 32 byte vertex. That would let you render a 32x32x32 voxel grid in only 16k of vertex storage. Heck, you could take it really far and do RLE of blocks. Long runs of similar blocks are pretty common in Minecraft games, so you could probably get it down to a few bytes per row. You'll run into the maximum allowable vertices emitted by the geometry shader though... to get around that, run a two pass algorithm, the first pass using the GS to decompress the block data, then pipe the results using streamout into a temp buffer which is then used by the second pass to emit the world geometry. Wouldn't be surprised if you could get it down to under 1k of persistent vertex data for each 32x32x32 chunk. Paniolo fucked around with this message at 00:13 on Apr 21, 2012 |
# ? Apr 21, 2012 00:06 |
Oh man! Actually if you're down to riff for a bit I have some other ideas on boosting A DirectX Mine-like's draw distance. I think huffman encoding the block types could go give some gains. If I go with an octree, then not only does view culling work better but I can also do LOD mapping at mid-level trees. For example, if there's a mountain with like 6 brown blocks and two greys, I can have the octree holding them record in that it is greyish-brown. Then if you are more than 100m away it shows up as a 2x2x2 sized greyish-brown block.
|
|
# ? Apr 21, 2012 00:49 |
|
What exactly are you trying to accomplish?
|
# ? Apr 21, 2012 06:33 |
|
So I graduate soon, and have a good amount of time before I start my job. Can anyone recommend any good tutorials/books/guide for learning shaders and the various types of rendering processes?
|
# ? Apr 21, 2012 08:34 |
|
PDP-1 posted:If you mean that you have an object at some point and you want to orient it to some normalized look-at vector, then something like theta = atan2(vector.y/vector.x) would do it. roomforthetuna posted:Alternatively, if you mean you have a point represented as a 2D vector, and another point for it to look towards, also represented as a 2D vector, then PDP-1's answer is still right except first I think PDP-1's answer applies more to what I want to do but I'll explain this hopefully a litte more clearly. And this little tid-bit that you added quote:vector = lookatpoint - originpoint; Best way to think of it is as a 2d rendering of the map, like gps, or Counter Strike when you could open the map and see which way the enemies were pointed. Context: I have a 3D FPS. I want to make a 2D map representation simultaneously with the map representation of the player looking in the same direction as the 3d version. So the math is really simple, I just ignore the Y in the 3D version and the X,Z left over translates pretty easily to a 2D system that allows me to do a look-at Vec2. However the library I'm using for the 2D system doesn't have a Look-at(vec2) function, but it does have a SetAngle(float) function. Thus my need to get an angle. Physical fucked around with this message at 19:50 on Feb 9, 2013 |
# ? Apr 21, 2012 13:42 |
|
No, the code vector = lookatpoint - originpoint; has nothing to do with checking which side of the x-axis it's on. The angle from point A to point B is exactly the same as the angle of the single vector from A to B, which you should know from elementary mathematics is (B - A), that's all that that is doing. It's what you need if you are finding the angle from A to B rather than the angle in direction V. And atan2 does give you back the angle you want, it's just from -pi to pi (i.e. -180 to 180 rather than 0 to 360). So to conclude if v is the direction your guy is looking in then the angle is atan2(v.y, v.x). But this is really really basic trigonometry stuff and you're definitely gonna need to know about that so you should probably learn it
|
# ? Apr 21, 2012 15:01 |
|
seiken posted:It's what you need if you are finding the angle from A to B rather than the angle in direction V. = What is the difference between "finding the angle from A to B" and "angle in direction of V"?
|
# ? Apr 21, 2012 15:16 |
|
If you just have a "direction" vector V then you take atan2(V.y, V.x). So for example if you know "my dude is looking right" i.e. V=(1, 0) this is what you use to get the angle. If on the other hand you have two points A and B you need to turn that into a direction vector by taking the difference (B - A). So if you know "my dude is at A=(3, 4) and the enemy is at B=(7, 9)" you can take V=(B - A) to get the direction and then proceed as before. (Equivalently, "angle in the direction of V" is the special case where A is the origin) (Seriously learn maths! I'm impressed with however far you have gotten without it but it will help so much) seiken fucked around with this message at 15:40 on Apr 21, 2012 |
# ? Apr 21, 2012 15:26 |
|
seiken posted:(Seriously learn maths! I'm impressed with however far you have gotten without it but it will help so much) I've already learned it, in high school and in college. It's just that it evaporates if I don't use it for a long time. Which is the current case. But as for the rest of your post: Thanks! It's really helped. I think trying to describe and understand a visual problem without visual aids just kind of added to the confusion. I thought that the "angle in the direction of V" meant that A was the origin and the vector had already been figured out, but of course had to ask to confirm. Here is how I figured it out before in an older project: code:
Physical fucked around with this message at 19:53 on Feb 9, 2013 |
# ? Apr 21, 2012 15:55 |
|
The code you're taking from uses atan, which takes a ratio as its parameter and as such can't give you a full 360 degree range (because -1,-1 has the same ratio as 1,1). atan(y/x) is also a disaster whenever x is zero. The wonky 'if' is dealing with converting from the up-to-180-degree angle atan returned into a 360 degree angle; it also offsets by 90 degrees because, presumably, someone wanted angle 0 to mean north rather than east, or something like that. We're telling you to use atan2, which does give you a full 360 degree range, so you don't need the wonky 'if'. Whether you still want to add 90 degrees, or half-pi radians, to make angle zero mean something different, is up to you. (The angle will be returned in radians, so if you want to work with degrees you'll still want to do *180/Math.PI, but you shouldn't want to work with degrees.)
|
# ? Apr 21, 2012 17:00 |
|
|
# ? May 26, 2024 05:53 |
|
Thanks alot to everyone that helped explain this to me. What trig learning resources would you guys recommend? All the sites I find look like they were written in 1996. Short of that I'll just get my college textbooks from my parents house next time I go. Having a nice resource on the internet with images would be way more handy though.
|
# ? Apr 21, 2012 18:06 |