|
Seashell Salesman posted:Write whatever kind of three-way max you need as a macro or an inline function. I would point out, though, that if you are using Bresenham's line algorithm, doing a handful of comparisons before you go into the algorithm will be negligible compared to running the algorithm itself. On that note, is there any other algorithms you can name that might be better for casting a ray over over three dimensions?
|
# ? Aug 24, 2013 00:59 |
|
|
# ? Jun 8, 2024 20:26 |
|
Mug posted:On that note, is there any other algorithms you can name that might be better for casting a ray over over three dimensions? There are a few ways to interpret this, I think. You can plot a 2D line between two points in 3D space on the rendered scene for it (using Bresenham's), 'cast' rays in 3D space in the conventional 3D graphics sense (I'm not a full bottle on these algorithms but should be extremely easy to find info on google), or plot some kind of a block line in 3D space. Are you trying to do that last one? In that case I have no idea off the top of my head if there is a more efficient solution than extending Bresenham's to another dimension.
|
# ? Aug 24, 2013 03:44 |
|
Seashell Salesman posted:There are a few ways to interpret this, I think. You can plot a 2D line between two points in 3D space on the rendered scene for it (using Bresenham's), 'cast' rays in 3D space in the conventional 3D graphics sense (I'm not a full bottle on these algorithms but should be extremely easy to find info on google), or plot some kind of a block line in 3D space. Are you trying to do that last one? In that case I have no idea off the top of my head if there is a more efficient solution than extending Bresenham's to another dimension. I'm not really an expert, but my dilettante's view is that Bresenham's or some DDA/DDAesque thing is probably as fastest way to approach naive ray tracing a voxel volume. The key word there is naive, since you can almost certainly wrangle orders of magnitude improvements through optimizations that either restrict the voxel map in some way (height map only), allowing you to do something even more efficient than actually walking the full volume, and/or arrange your space in such a way that you can skip huge portions of the naive trace (i.e. the fastest way to do something is to not do it). There's a lot of crazy ray-tracing tech if you search around in shader algorithims for depth, offset or displacement mapping. http://www.cs.columbia.edu/~ktegan/papers/sketch_proposal.pdf http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter08.html etc...
|
# ? Aug 24, 2013 03:58 |
|
Unormal posted:I'm not really an expert, but my dilettante's view is that Bresenham's or some DDA/DDAesque thing is probably as fastest way to approach naive ray tracing a voxel volume. The key word there is naive, since you can almost certainly wrangle orders of magnitude improvements through optimizations that either restrict the voxel map in some way (height map only), allowing you to do something even more efficient than actually walking the full volume, and/or arrange your space in such a way that you can skip huge portions of the naive trace (i.e. the fastest way to do something is to not do it). Okay, I'll keep using Bresenham's, and write in a bunch of other poo poo so it can jump large distances where appropriate. edit: I'm getting these tiny inaccuracies where it will fail to cast across some "pixels" sometimes at certain angles. I've got it set to actually draw the ray-trace at the moment. Here's what the ray paths look like at 0degrees rotation (correct): But at 90degrees it does poo poo like this: It has similar issues at 45degrees. My rotation code for the start and end of each ray is like this (p = Origin): code:
Should I be rotating via some other logic? edit: Oh, I might have fixed it. Turns out it was more an issue with the way I was rounding ray coordinates to screen pixels. Mug fucked around with this message at 04:33 on Aug 24, 2013 |
# ? Aug 24, 2013 04:08 |
|
Anyone else giving this ludum dare a shot? Theme is "10 Seconds", which I think is a decent one.
|
# ? Aug 24, 2013 04:27 |
|
Mug posted:On that note, is there any other algorithms you can name that might be better for casting a ray over over three dimensions? My (vague) understanding is most 3D raycasts are done by sampling along the line at set distance intervals (so you sample at every, say, .1 units along the line). the major issue is finding a sample distance that gets you sufficient accuracy while not over-sampling. I'll dig out my game math book and see if it has anything to say about raycasting.
|
# ? Aug 24, 2013 07:39 |
|
Zizi posted:My (vague) understanding is most 3D raycasts are done by sampling along the line at set distance intervals (so you sample at every, say, .1 units along the line). the major issue is finding a sample distance that gets you sufficient accuracy while not over-sampling. Unless I'm just completely misunderstanding the question. OneEightHundred fucked around with this message at 20:14 on Aug 24, 2013 |
# ? Aug 24, 2013 20:12 |
|
This is running pretty damned fast now; I'm not using raycasting. I ended up using a bunch of pre-rendering and only re-rendering when needed. https://www.youtube.com/watch?v=g84zinrp4uM
|
# ? Aug 25, 2013 13:41 |
|
I posted this on the libgdx forums as well, but maybe someone here can help me. I'm stuck setting up scene2d in my game using multiple cameras, one for the entire screen and GUI and the other for the player character and level rendering, which needs to be able to zoom and pan independently. My code is available here I'm trying to create a simple roguelike, with a bar on the right side with player information and a small black bar across the bottom for messages. Then in the remaining screen space I want the game world and player to be rendered. Relevant classes are these: https://github.com/drt/rogueahoy/blob/master/rogueahoy/src/se/obtu/rogueahoy/screens/GameScreen.scala https://github.com/drt/rogueahoy/blob/master/rogueahoy/src/se/obtu/rogueahoy/scene/WorldRenderer.java https://github.com/drt/rogueahoy/blob/master/rogueahoy/src/se/obtu/rogueahoy/ui/UiGroup.scala Right now in the world rendering I'm clipping the sprite batch to the bounds of the world display and then switching out the Stage's camera for one that follows the player character around. Everything mostly looks fine except the game world view isn't "centered". It's centered within the entire screen, but I want to center it within the remaining screen space after the UI elements are rendered. I'm guessing that the camera needs to be offset somehow to make up for the UI elements, but I'm not sure how to do it. Anyone have any advice?
|
# ? Aug 26, 2013 02:29 |
|
Mug posted:This is running pretty damned fast now; I'm not using raycasting. I ended up using a bunch of pre-rendering and only re-rendering when needed. So Mug when is Black Annex out? Why are you posting QBasic Minecraft? What is going on?
|
# ? Aug 26, 2013 02:52 |
|
rrrrrrrrrrrt posted:Right now in the world rendering I'm clipping the sprite batch to the bounds of the world display and then switching out the Stage's camera for one that follows the player character around. Everything mostly looks fine except the game world view isn't "centered". It's centered within the entire screen, but I want to center it within the remaining screen space after the UI elements are rendered. I'm guessing that the camera needs to be offset somehow to make up for the UI elements, but I'm not sure how to do it. Anyone have any advice? Well, unless I'm mistaken it's very easy if you know how much space the ui elements use up. Your game world view would need to be offset by ((the height of the screen - height of ui elements) - height of game world view) / 2. This is assuming you only want to center vertically. So basically: (height of area you want to center in - height of object you want to center) / 2 Same thing for width.
|
# ? Aug 26, 2013 08:26 |
|
Pigmassacre posted:Well, unless I'm mistaken it's very easy if you know how much space the ui elements use up. Your game world view would need to be offset by ((the height of the screen - height of ui elements) - height of game world view) / 2. This is assuming you only want to center vertically. Yea, the absolute most basic centering is screenwidth/2. So subtracting UI etc if that's what you want makes sense, usually player coordinates have to be accounted for but since you use world cords and so on you should be fine. Just make sure that your coordinate system is standard (i.e. +x is right and +y is up). code:
DancingPenguin fucked around with this message at 09:20 on Aug 26, 2013 |
# ? Aug 26, 2013 09:13 |
|
seiken posted:So Mug when is Black Annex out? Why are you posting QBasic Minecraft? What is going on? Hahah, Black Annex is cancelled gently caress yooouuuuu nah I just make levels and sprites for it all the time now. I hunger for code, though, so I make different stuff sometimes. Who knows when it'll come out, next year I guess.
|
# ? Aug 26, 2013 09:51 |
|
So might do a little app development soon. Thinking about publishing on both iOS and Android. Pretty much know my way around Android, seems like I will have to pick up JS for that though. Does anyone have any recommendations for IDEs etc that would let me publish on both platforms without too much rewriting? Also, how annoying is Android deployment? I've heard that testing it could be a major pain given all the different systems and platforms, but Eclipse SDK (and probably many others) allow emulation, how accurate are these emulations in terms of graphics display?
|
# ? Aug 26, 2013 14:48 |
|
DancingPenguin posted:So might do a little app development soon. http://unity3d.com/ makes it super easy. In my opinion, use unity for cross-platform game development unless you have a pretty well-articulated reason otherwise. (i.e. "I know only Python and refuse to use any other language ever python supremacy suckit Java/C#/VBScript!!")
|
# ? Aug 26, 2013 15:08 |
|
Unormal posted:http://unity3d.com/ makes it super easy. In my opinion, use unity for cross-platform game development unless you have a pretty well-articulated reason otherwise. (i.e. "I know only Python and refuse to use any other language ever python supremacy suckit Java/C#/VBScript!!") Already have a grip on C#/C++, main problem with Unity is the cost. But hey, it's just a logo right?
|
# ? Aug 26, 2013 15:12 |
|
Yeah if you don't mind having the logo in front of your game the free version of Unity can do a lot of stuff.
|
# ? Aug 26, 2013 15:13 |
|
Yodzilla posted:Yeah if you don't mind having the logo in front of your game the free version of Unity can do a lot of stuff. Yea, using Unity C# right now for PC/Web, and the free editor is wonderful. So unless someone else has a better (free) suggestion I suppose that's what I'm rolling with. Would I have to stick to JS or could I use C# instead? (Since C# would allow me to lower my development time by quite a lot.)
|
# ? Aug 26, 2013 15:19 |
|
It's actually better to not use JS at all.
|
# ? Aug 26, 2013 15:27 |
|
xzzy posted:It's actually better to not use JS at all. That tiny bit of hope this gave me might be enough for me to start working on it tonight.
|
# ? Aug 26, 2013 15:37 |
|
So. This is what I've been working on for the last, oh, five months. It's Hot Tin Roof: The Cat That Wore A Fedora, and I can fiiinnnaaallly start talking about it. https://www.youtube.com/watch?v=8TKPdqR79lM
|
# ? Aug 26, 2013 15:42 |
|
DancingPenguin posted:That tiny bit of hope this gave me might be enough for me to start working on it tonight. Yeah, there's no reason to use Javascript at all. You can use C# everywhere, if you'e confused by their dumb documentation that defaults to Javascript, there's a pulldown on each of the code listings to switch it to C#.
|
# ? Aug 26, 2013 15:42 |
|
Unormal posted:Yeah, there's no reason to use Javascript at all. You can use C# everywhere, if you'e confused by their dumb documentation that defaults to Javascript, there's a pulldown on each of the code listings to switch it to C#. Haha yea, I know, the whole default thing is a bit silly. Thanks for the help everyone, and thanks for helping me avoid Javascript!
|
# ? Aug 26, 2013 15:45 |
|
I actually had someone tell me a very good reason for using Javascript in Unity as it was meant to be where you'd have backend people writing in C# and then your scripters and designers working in JS so that compile-time errors are relegated to one team and runtime scripting to another. Obviously if you're the only developer on a project this means dick-all and you should just stick to C# but if you're using Unity for a big project that can be structured in such a way JS is really valuable.
|
# ? Aug 26, 2013 15:56 |
|
Unormal posted:Yeah, there's no reason to use Javascript at all. You can use C# everywhere, if you'e confused by their dumb documentation that defaults to Javascript, there's a pulldown on each of the code listings to switch it to C#. Even better they recently updated the website so if you select C# once, it saves to a cookie and uses that as default!
|
# ? Aug 26, 2013 16:16 |
|
Shalinor posted:So. This is what I've been working on for the last, oh, five months. It's Hot Tin Roof: The Cat That Wore A Fedora, and I can fiiinnnaaallly start talking about it. I don't know how much is placeholder art, but I feel like your colours are generally way too saturated to really nail the noir look right now. Congrats on getting it together so far. seiken fucked around with this message at 16:39 on Aug 26, 2013 |
# ? Aug 26, 2013 16:24 |
|
Yodzilla posted:I actually had someone tell me a very good reason for using Javascript in Unity as it was meant to be where you'd have backend people writing in C# and then your scripters and designers working in JS so that compile-time errors are relegated to one team and runtime scripting to another. V This thread is so confusing. DancingPenguin fucked around with this message at 16:48 on Aug 26, 2013 |
# ? Aug 26, 2013 16:34 |
|
Yodzilla posted:I actually had someone tell me a very good reason for using Javascript in Unity as it was meant to be where you'd have backend people writing in C# and then your scripters and designers working in JS so that compile-time errors are relegated to one team and runtime scripting to another. Oh god no this is the worst advice ever. Forgiving scripting languages are often presented as "they don't have compile errors, so people who can't really code can code in them!" and this is horseshit. You don't want people who "can't really code" coding at all, and if they absolutely must then you certainly don't want them coding in a language where mistakes mean subtle errors and things mysteriously not working later on, rather than immediate "no you're wrong" which will at least prevent them from causing too much damage.
|
# ? Aug 26, 2013 16:43 |
|
EDIT: ^^ Bingo. If your scripter is good enough to be a scripter, they'll pick up C# fine. If they're not, gently caress NO YOU DO NOT LET THEM CODE. Give them uScript, or PlayMaker. Let them NOWHERE near source. PlayMaker is the real answer here. "IF !C#, THEN PLAYMAKER". Done and done. It's all the scripting tool a non-programmer really needs for gameplay logic, and it's easy to extend with your custom stuff. seiken posted:I don't know how much is placeholder art, but I feel like your colours are generally way too saturated to really nail the noir look right now. Also, the Q&A just went up, if anyone wants more gameplay detail. It's a bit chopped up, but lots of good bits in there.
|
# ? Aug 26, 2013 17:08 |
|
Anyone do Ludum Dare 27 this past weekend? I did the 48 hour solo competition for the first time and it was grueling but fun. I used Unity but I already had a good grasp on it from work but I still highly recommend it for at least prototyping. Also yes, just stick with C# in Unity if you know C#. Here's my submission, http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=27026 I had absolutely no clue on a game concept for probably 90% of the development and it was mostly me throwing in things that looked cool and easy to do within the time frame. This kind of stuff only makes me wish I was more creative.
|
# ? Aug 27, 2013 00:13 |
|
Since we're on the topic of languages. I came into Unity and started using Boo, for the only reason that I was somewhat familiar with python syntax. So far it hasn't really been an issue, but I know as clear as day it's the bastard stepchild of the lot, and documentation for it reads like someone got bored halfway through and just left. I'm already reading C# Unity tutorials and redoing them in boo, so I'm not completely oblivious, but anyone have any good advice on how to transition over to just using C# ? I'm kind of self taught everything else and feel like I'm probably missing loads of ground level coding info so this is probably a good time to step up to knowing why things are a certain way. So anyone have any C# advice, I mean aside from just saying start using it/go through the unity tutorials in it? That was kind of a meandering request. I just want to keep using unity but learn C# with good practices rather than my current Boo and whatever works
|
# ? Aug 27, 2013 00:42 |
|
Chance posted:Since we're on the topic of languages. I came into Unity and started using Boo, for the only reason that I was somewhat familiar with python syntax. So far it hasn't really been an issue, but I know as clear as day it's the bastard stepchild of the lot, and documentation for it reads like someone got bored halfway through and just left. I'm already reading C# Unity tutorials and redoing them in boo, so I'm not completely oblivious, but anyone have any good advice on how to transition over to just using C# ? C# syntax is a lot like java syntax but NOTHING like any scripting language syntax including python. The Unity documentation has a little toggle for flipping between C#, javascript, and I think Boo so that might be a handy tool to seeing how it goes. Other than that, I recommend doing what I do when learning a new language: Google 'for loop <language>', 'if statement <language>', etc.
|
# ? Aug 27, 2013 01:22 |
|
poemdexter posted:C# syntax is a lot like java syntax but NOTHING like any scripting language syntax including python. The Unity documentation has a little toggle for flipping between C#, javascript, and I think Boo so that might be a handy tool to seeing how it goes. Other than that, I recommend doing what I do when learning a new language: Google 'for loop <language>', 'if statement <language>', etc. Also goes without saying MSDN and Stack Overflow are very good resources for anything C# related.
|
# ? Aug 27, 2013 01:58 |
|
Shalinor posted:We're still noodling on how to balance the "noir" with the "being able to see poo poo," especially for interiors. Interiors are hard as hell to make feel noir without also making feel like some dingy forgotten basement. With the number of mods that do nothing but make TES games super dark obviously some people like those realistic dingy interiors, but I can't imagine most do. Suggesting dark with color choice and such seems way better than actually being dark. I would think when most people think of 'noir' they think black and white so once you've abandoned that you've got room on the look. It's been a while but as I remember LA Confidential and Chinatown aren't terribly dark they just have hard shadows.
|
# ? Aug 27, 2013 02:55 |
|
FuzzySlippers posted:With the number of mods that do nothing but make TES games super dark obviously some people like those realistic dingy interiors, but I can't imagine most do. Suggesting dark with color choice and such seems way better than actually being dark. Yeah, hard shadows is a good point. Everything's bold shapes and hard edges. If it's not black and white the same applies to saturation: everything is either super-saturated (and if so then it's one of like two or three colours), or else it's black and white, and there are very few actual colours used that aren't shades of grey. For example, in the first shot, other than the background, everything is basically black and white apart from the super-red lips or the yellow lights.
|
# ? Aug 27, 2013 03:38 |
|
FuzzySlippers posted:I would think when most people think of 'noir' they think black and white so once you've abandoned that you've got room on the look. It's been a while but as I remember LA Confidential and Chinatown aren't terribly dark they just have hard shadows. Anyways, once I get it right, the coloring won't matter. I'll probably stick to the bright colors at that point, because I kinda like them, and it fits nicely with the Art Deco styling everything has. Gives it all a unique flair, once the artists take the level geometry a bit more extreme.
|
# ? Aug 27, 2013 03:40 |
|
I think you can be super-noir and still really colourful if you just make the lighting very nonlinear with some kind of postprocessing or fancy shaders (this is obviously extreme. Like you said it's probably difficult to balance being able to see things)
|
# ? Aug 27, 2013 03:49 |
|
To get an authentic noir look, you'll probably have to use toon shading and render different layers with their own lighting. You basically gotta throw away "realistic" lighting and exchange it for something that's highly stylized.. that is, Sin City. A color example would be Dick Tracy.. they used colored light and built scenes with large blocks of color to give the impression of a color comic book. Advantage is that they could use normal lights and didn't need a mountain of computers to process CGI.
|
# ? Aug 27, 2013 04:02 |
|
That is one bouncy protagonist.
|
# ? Aug 27, 2013 04:41 |
|
|
# ? Jun 8, 2024 20:26 |
|
xzzy posted:To get an authentic noir look, you'll probably have to use toon shading and render different layers with their own lighting. You basically gotta throw away "realistic" lighting and exchange it for something that's highly stylized.. that is, Sin City. My topmost favorite noir film is Blast Of Silence. It's black and white, but that isn't what makes it noir. It's the way the scenes are shot, and the overlay they're using to fuzz out the edges / give the whole thing a burned look, when combined with the dramatic lighting. The Lady From Shanghai is similar, though less distinct / leans slightly more heavily on the B&W and noir tropes to give the film that feeling. Then there's The 13th Floor. Full color, but it uses careful lighting, a dramatic dark color palette offset with sharp, stark coloration, and an art deco motif to sell itself as noir. The apartment they use in it (Ennis House) is the same apartment used in Blade Runner, another (better) example of lending noir through dramatic lighting, and a stark/sharp color palette mixed with art deco. They even use it in Rocketeer, yet another noir-ish movie, though I'll grant you that they don't do much with the style there beyond touch on it. ... point is, going the Sin City / toonshading route is a bit hamfisted. It'd work, but it would amount to aping the style of something else. When you're trying to nail a style, you go back to the core and find your own interpretation of it. Borrowing someone else's interpretation is lazy, and the results will never be as memorable. EDIT: Good god, I sound like a film geek. Which I kind of am, I guess. Regardless, I will grant you that doing noir with forward-shaded point lights is effectively impossible - but that's why I'm using deferred. It lets me stuff a billion non-shadowing lights into the scenes, with which I can pull some very clever selective lighting tricks. The "trick" of it is just in figuring out the density and placement of the lights to give the scenes the right feeling, without compromising their playability. Then I need to package that technique up in a way I can deploy to all the zones quickly, with a minimum of oversight, so that I can tell my other level designer "just use these prefabs here here and here, and you're good." We're not a big enough studio where I can spend a ton of art time hand-tweaking the lighting from every angle in every scene, that'd get insane. Shalinor fucked around with this message at 05:18 on Aug 27, 2013 |
# ? Aug 27, 2013 05:10 |