Skip to content

u/oslash

In this archive from Feb 2009 to Sep 2017

0
posts
122
comments
0
media
436
score

Yup, many interesting questions; makes sense to test these things out with short films first. Like you're watching a play on a stage—that's basically what the earliest movies looked like. Audiences got used to quick cuts. I think you could do the same with VR—teleport the viewer around to get them close to the action.

One data point from gaming: Room-scale VR lets you physically walk around, which keeps the picture in sync with your inner ear. But moving through virtual space while seated is problematic. It kind of works for looking out of a cockpit. Personally I don't have much problems with playing a first person shooter in VR, but many people can't stand it. So now some newer games have a different tactic for rotating the view around your head: instead of a smooth pan, pushing that thumb stick jumps the view over in fixed increments.

'Zooming' in spherical video looks weird; it's basically distorting the projection in a way that looks almost, but not quite, like moving the camera. Check out Henry Segerman's YT channel; he does experiments of that sort.

1 points

I don't think the idea is that viewers could go anywhere they want. I'm imagining them sitting in normal theatre chairs. It would be pretty similar to a giant screen that fills your entire view, but with better 3D, because there are no more cheap seats far from the optimal viewing position, and you can tilt your head any way you want and get an image with the correct perspective.

An advantage over watching the movie at home would be that instead of getting binaural sound through headphones, you'd have a powerful 'ambisonic' surround sound system that can reproduce a sound field very close to what you would hear from the actual physical sound sources. Some movies already come with that kind of spatial sound track, because this allows each theatre's sound system map the channels onto their individual speaker setup much better than when using a fixed audio mix that makes a lot of assumptions about the theatre's speakers and acoustics.

where do you look? What is the focus of the scene?

Straight ahead. You wouldn't want to crane your neck around or twirl on a swivel chair for the duration of a feature film anyway. I'd find it acceptable if you'd reach the edge of the virtual 'screen' if you turned your head too far. I'd be spared the temptation of looking for easter-eggs behind me, and filmmakers could continue filming on pretty normal sets, instead of having to figure out how to hide the entire crew out of sight.

The bigger obstacle w.r.t. cinematography would be limiting camera movements to avoid giving half the audience motion sickness. Giving the 'viewport' a stationary frame could help with that, too.

So, yeah, I'm basically describing expensive glorified 3D glasses. But I think cinemas would be interested in exploring the idea, because one day in the not-too-distant future, giant 8K HDR TVs will become quite affordable, making even fewer people fancy going out to watch a movie. And I guess, as VR becomes more mainstream, potential customers might find the idea more appealing and/or less gimmicky than the current '5D' (splishy rumbly smell-o-vision) theatres.

Oh, and remember how people who watched The Hobbit in HFR complained that the visuals were too good, making everything look like actors on a fake set? Tron 3 would be perfect for an early VR film. If everything looks like fake CGI ... well, it's supposed to! Disney, I don't like you guys a lot, but here's your chance to trick me into giving you money.

1 points

Time for the chameleon circuits to self-repair and then break again.

Bonus points if it happens in 1950s London, so it changes ever so slightly into the original MacKenzie Trench Mk II. The Doctor doesn't notice that it's become slightly taller (because Peter Capaldi is slightly taller than Matt Smith); slapstick ensues when he needs to enter the Tardis in a hurry without realising that the door now opens outwards.

67 points

I just meant to clear up a misconception about a TNG episode, not to defend the value of the above-linked blog spam as a plausible cosmological theory. I absolutely don't agree with the "... vindicated" headline.

That said, postulating a common origin of life does make Star Trek's ridiculous degree of convergent evolution more plausible. They can never get rid of the plot hole that necessarily appears when aliens from all across the galaxy and even different universes are all based on humans with some bits of low-budget 1960 special effects tacked on, but lowering an upper bound of the hole's size at least earns them an E for Effort.

3 points

Come on now, using a ready-made CPU and piggy-backing on its rich library of microcode is hardly original work; you're just re-using someone else's code. To properly make a game from scratch, you better solder it together from diodes and transistors!

(I wonder how many more posts it takes until we're inventing the universe :)

1 points

Yes, it is totally distinct. If the algorithm itself is fair game as far as intellectual property rights are concerned and you only look at the foo-licensed code as reference material for the purpose of learning about the algorithm, then your implementation is in the clear and not affected by foo license. For example, if you're learning Runge-Kutta integration from a textbook that provides example code under the MIT license, it makes a difference whether you copy-paste that or write your own implementation.

However, in which cases "the exact logic" incorporates anything copyrightable is notoriously fuzzy and there are differences between jurisdictions. In case of a lawsuit, it could turn out to be quite tough to actually prove that you didn't copy anything you weren't supposed to copy when you have an implementation that seems rather similar. So if you somehow wound up working on a commercial project and as part of your research looking at code from a big corporation with some iffy legalese attached, you might want to consider enlisting the help of a colleague for some clean room design just to be safe.

(IANAL but I sometimes managed to keep my eyes open while dozing off in my CS curriculum's IT law classes.)

3 points

Didn't he patch in some non-patented algorithm specifically for the GPL version

Yup, you can have a look at the non-patented version in the GPL code here. The code inside the "if ( !external )" block handles the case of the camera being inside the shadow volume. In that case, RB_DrawShadowElementsWithCounters will be called four times total (per light) instead of twice — which wasn't necessary in the original code that used Carmack's Reverse — so the GPL version is a bit slower, but that didn't matter terribly much as the game was already 7 years old at that point, and writing that fix was easier/quicker than changing the shadow volume generation.

2 points

That the first time email was sent on the internet predates the OPs link of the age of the internet by a decade.

Good clarification, thanks! I had somehow missed this earlier, but now that you pointed it out, it's clear that ihatewil considers ARPANET to have been "the internet" from the beginning.

many do, including Vint Cerf himself.

Hmm ... I'd say that Cerf considers ARPANET to have been (part of) "the internet" starting with the transition to TCP/IP in 1983.

2 points

In fact the first email sent on the internet was 42 years ago, yet this infograph states the internet did no even exist 30 years ago.

That's a bad argument; you don't need the internet to send e-mail. It's not obvious how to define the birthday of the internet, so the 30 years figure is debatable, but in 1971 (42 years ago), it definitely didn't exist. There was no internet protocol yet. (Also, no domain name service. No SMTP, POP or IMAP.) E-mail was sent over an internet (the ARPANET in the case you're referring to), which is not the same as the internet.

3 points

You don't "choose one" when making an engine because the algorithms you learned about aren't mutually exclusive, nor strict alternatives to one another. Rather, you develop a combination of techniques that makes sense for a given game or engine. So yes, devs worry about this.

Using a depth buffer is basically always appropriate (GPUs are good at it and software rendering is close to extinct), but not sufficient on its own in most cases. Once you have depth tests and back-face culling working, the main areas of concern are culling what's completely outside the current view-port (look up frustum culling, particularly BVH stuff; most often used are BSP, quad-/octrees, k-d trees) and culling what's occluded for sure or just too far away (again, space partitioning techniques are relevant; in addition, PVS and portal culling). Engines such as Unity can do several of these all at once. I don't have too much insight into how exactly they implement the hairy details, but figuring out how to make use of them is simply a case of RTFM. Sometimes you just flip a switch (particularly frustum culling), but often cooperation from the level designer is required. (Since lots of information needs to be 'baked' into the level data and the level editor needs help with figuring out stuff like which doors can close and become occluders etc.)

So the answer to "can you choose or is it built in" is: both. How much you can choose depends not only on what the engine supports out of the box, but also on how feasible it is to add a method that happens to make more sense for your game than what the engine already offers.

It's important to remember that, in basically all GPU-accelerated games, it's just the depth test that ensures correct visibility on the pixel level — everything else is just done for the purpose of increasing performance and therefore done 'roughly' instead of perfectly. If something isn't going to show up in a frame, you don't want to bother the GPU with it in the first place; but you don't want to overdo that either, because often making some unnecessary draw calls is faster than figuring out which draw calls exactly are the unnecessary ones. Apart from frustum culling, the main concern is minimising performance losses from overdraw, for which depth sorting helps in addition to occlusion culling. This is not the same as minimising overdraw itself; consider, for example, that rendering geometry that will ultimately disappear behind other geometry is much cheaper with an engine that does deferred shading/lighting.

3 points

Sorry about the incoming wall of text; I accidentally made this comment my Dvorak practice for today ;)

Broxxar's and GlacieredPyro's suggestions would work with regular mid-point displacement. Initially, I was also thinking mainly in terms of that and had similar ideas:

  1. The deterministic way: Make each height value depend on the other two coordinates (absolute world coordinates as opposed to relative position within the chunk) of the respective vertex in a deterministic manner. I.e. you still use pseudo-random numbers for the corners of each chunk and the offsets, but before generating each one, you seed the RNG with some hash of (x, y), thus forcing coinciding edges to line up.

  2. The height map approach: Assuming that you're generating a regularly spaced height map instead of a mesh with varying density (i.e. you're always terminating at a specific recursion depth), you could modify the algorithm to directly write into a 2D array. Initialise the edges that are already defined by a neighbouring chunk with the respective values and the rest with a value that won't appear in the final height map (e.g. MIN_VALUE, NaN, ...). Then, every time you're about to compute and set a height value, first check that it hasn't been set already.

  3. The really simple way: Make only this small alteration to your current code: Whenever you're about to compute a new height value, check if the height at that position is already defined (i.e. it lies on a common edge with an already generated chunk), in which case you just copy that height over instead of generating a new one.

The second option would make it easy to join up with chunks that were generated with a different version of the terrain generator, or a different algorithm altogether, whereas the first one would allow you to tweak the generation of the initial chunk corner heights such that you can have tall mountains and deep valleys that span many chunks in a smooth way. #3 has neither advantage but would be the least amount of work.

The problem with all of this is that the 'diamonds' span chunks and if you don't handle that sensibly, you'll only get the heights at the chunk boundaries to line up, but not necessarily the slopes. I.e. we're getting 'creases' and they're in an ugly chunk-spaced grid pattern, which kind of defeats the purpose of introducing the diamond step.

So here's how I propose to fix that: However you're currently handling the case of a 'diamond' that has one corner outside the current chunk A, do the following instead: Use the actual value from the neighbouring chunk B. Initially I didn't deem that feasible, because if B hasn't been generated yet, you'd need to generate a temporary version of it, but to do that you'd need B's neighbours in turn, ad infinitum. Chicken, meet egg ...

But then I realised that the temporary version of B doesn't need to be completely correct; it only needs the right values in those places A needs to know about. If you take the deterministic approach from #1 / GlacieredPyro / Broxxar, you can make that work. Say A is at (0, 0) in the grid of chunks. Run your algorithm over the 3x3 region of chunks from (-1, -1) to (1, 1). Seed that region with the known heights at the chunk corners, proceed from there. Optional addition to gain the aforementioned advantages of #2: Before you compute a height, check if it's already defined in an existing chunk, in which case you use that value instead.

So yeah that would be a leetle bit more work than just doing #3, but could be worth it if you want artefact-free terrain with a potentially unlimited number of chunks. What do you think?

1 points

That's like asking what the best programming language is without saying what you'd like to do with it. What's your OS? Your budget? Do you draw animations? Use restricted palettes? Make tile-sets? Use multiple sprites to animate a character? Draw isometric art? Pixel in a layer over a sketch? Want graphics tablet support?

If you can be more specific, /r/PixelArt should be able to help. Otherwise, check out Pyxel Edit, grafx2, Asesprite, pickle, pixen, Pro Motion, and GraphicsGale.

6 points

OpenGL is considerably harder to set up

Maybe, but you don't need to touch the OpenGL API at all for rotating sprites; SDL2 gives you that for free. Also SFML of course. I don't want do dissuade you from learning how to properly resample images — it's a fascinating topic — but from a project management point of view it would be silly not to use an existing library for the job. If you want the Terraria look, something that builds on OpenGL definitely is the way to go.

2 points

I only know a few basics about the Windows side of things:

In the setup() call, you'll need to use 'windows' instead of the 'console' keyword and also use the 'data_files' keyword to include files py2exe won't find on its own; i.e. images, sounds etc., and probably also SDL DLLs you're using through pygame (zlib1.dll etc. [depends on which pygame sub-modules you're importing]; apparently py2exe likes to mistake those for system DLLs, which makes it assume they'll be on the target machine).

I just did some googling and realised that py2exe requires a bit more work than py2app (which I use for Mac while other people deal with Windows and Linux :), but it's a popular choice for Pygame, so for most problems it's not too hard to find a blog/forum/mailing list post with a solution. Definitely check out reidrac's link; looks like it does all the right things. /r/pygame should be able to help if you get stuck with that.

Oh, and as a neat side-effect I just saw that Pygame is listed as a supported package for PyInstaller; never used that though.

1 points

I assumed you didn't look at any docs since you said you have no idea what to do. As long as you don't ask any concrete questions, all you could possibly get in a reddit comment would be an inferior ad-hoc version of a tutorial that's already out there anyway.

Where do you get stuck? What's going wrong?

I probably won't be able to help much since I don't use Windows, but someone else here might if you post a question that can be answered without psychic abilities.

1 points

After seeing the sub-thread about getting stuck in corners, now I understand how the bug occurred and why switching to ints 'fixed' it ... originally I hadn't considered the case where the sprite has just enough space between two walls. ttgdev's suggestion seems to handle that fine, so it would be an improvement for a start. It seems a bit brittle though; e.g. it might fall apart if you'd like to enable the sprite to 'cut corners' like in the original game and make some changes to that effect. In that case, snapping the sprite to nearby walls only based on player.speed (i.e. you're actually not taking into account the relative position of the wall at all) could cause all kinds of havoc. keefer's suggestion of accepting the occasional miniscule overlap and pushing back with just enough 'force' seems more robust and versatile.

I might aswell remove it (assuming I never allow any intersection to occur)

You should remove/change it either way; it just won't work. 9002's suggestion includes that part and it shouldn't do harm, but it doesn't make sense, since his algorithm only works as long as no overlaps occur — once they did, it wouldn't reliably fix them.

As to whether to allow intersections ... I'd say 9002/ttgdev's approach by itself is already good enough to prevent them, as long as there is nothing in the game that could push the sprite into a wall (such as a second player). player.rect += player.speed can cause an overlap, but that's just an intermediate result that will be fixed up before any other part of the program sees it. Alternatively you could compute how far along the current vector the sprite can move until it touches a wall and then only move it by that amount, but I think that would just accomplish the same thing with a slightly more complicated implementation.

But there's still the question of how to best do 'corner cutting'; I'd say you have to do that, otherwise the 'railway' approach would be much more simple and sensible ;) Making something more general just for the sake of re-usability isn't worth it IMHO; general purpose 2D collision detection / response is already covered by 2D physics engines. OTOH, doing it for the sake of learning how to do it, now that's worthwhile :)

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.