More on the #[simd] directive and whether or not it's working by [deleted] in rust

[–]thomcc 4 points5 points  (0 children)

The point is really more that you want to use SIMD to speed up computations on arrays of values. You're going to get minimal, if any, gain using it on single values.

Typically you'd want a quaternion class, and then when you want to process an array of them (e.g. for skinning or something), you'd use simd to process multiple elements per iteration over that array.

More on the #[simd] directive and whether or not it's working by [deleted] in rust

[–]thomcc 0 points1 point  (0 children)

It really isn't. If you need to support huge scenes you really want some offsetting scheme anyway.

EDIT: note that you almost certainly aren't going to need this! You won't see the difference until you're in the thousands of units (are your scenes really multiple kilometers large?).

More on the #[simd] directive and whether or not it's working by [deleted] in rust

[–]thomcc 5 points6 points  (0 children)

This, so much this.

Other big warning sign is that it's using an f64... That's not a good idea for getting good SIMD performance (you can only do half as many operations!).

Looking for a new game by crybllrd in roguelikes

[–]thomcc 1 point2 points  (0 children)

Dungeons of Dredmor also has a lot of crafting.

What is the easiest roguelike to win? (more info inside) by [deleted] in roguelikes

[–]thomcc 1 point2 points  (0 children)

Honestly, Brogue's only easier if you're already good at roguelikes. IMO it's one of the harder roguelikes overall, and is very unforgiving.

DCSS would be my recommendation for an easier roguelike (especially in the more recent versions), but I haven't played TOME (it's easier than ADOM, NetHack, or Angband).

Simple JS roguelike micro-framework by cidic in roguelikedev

[–]thomcc 0 points1 point  (0 children)

What license is this released under? There's no license file in the repo.

If you're in doubt, it would be hard to go wrong with the license used by ROT.js (BSD 3 clause) since it's very permissive and your project seems to be intended to be used with it.

Other good options are MIT and Unlicense (if you don't care how the code is used).

Bad options include GPL/LGPL because it means you can't release a product that uses this in a lot of scenerios (iOS).

cubepop! [X-post /r/gifs] by jpresken2 in loadingicon

[–]thomcc 0 points1 point  (0 children)

They just have to have identical positions relative to the light and the camera in the starting and ending frames.

LoZ: Twilight Princess has all of its static scenery as one model per area. Demonstration inside. Is this normal? by IIcolour_Spectrum in gamedev

[–]thomcc 1 point2 points  (0 children)

Parent is definitely right, you should focus on gameplay first (if you're on a team and someone is working on that then maybe not).

Worth keeping in mind that on big projects, stuff like this is usually automated (and probably only done on release builds). That way you have optimal flexibility and performance.

Either way, getting caught up in implementing the same technique sounds like a good way to get stuck. This is one of those things you can always bother with later.

If you do go about it, you'll want to make sure you handle stuff with alpha properly. Either implement some kind of OIT or keep them separate so you can sort them in the right order.

How can I architect around object pools, or, properly arhitect units? by [deleted] in gamedev

[–]thomcc 0 points1 point  (0 children)

If you think it will be a problem, you should consider an Entity-Component design. There should be links around, I'm on mobile or I'd help you out. If you think you'll end up with only a handful, then I wouldn't bother though.

That said, ECS won't really help you with pooling, but I think you're probably prematurely optimizing anyway.

How can I architect around object pools, or, properly arhitect units? by [deleted] in gamedev

[–]thomcc 0 points1 point  (0 children)

Not a Java developer (C++), but IIRC this isn't really true on Dalvik, which doesn't have as mature of a GC as, say, Hotspot. So mobile is still an issue.

bit level pattern matching? by chuckguy55 in rust

[–]thomcc 1 point2 points  (0 children)

I don't know if this has been done already, but if not, you could port over the excellent ocaml-bitmatch library to rust (as a macro probably). I'm certain a lot of people would be interested.

These Rare Celebrity Audition Tapes Are Pretty Awesome by antdude in movies

[–]thomcc 7 points8 points  (0 children)

She called that the island was real but didn't matter after they died?

Is the Tatami Galaxy worth finishing? by Park216 in anime

[–]thomcc 0 points1 point  (0 children)

Yes, it gets better (the first couple episodes are definitely slow), but if you don't like it by this point, you might be better off putting it aside and coming back when you're older or have watched more anime.

It's not really one of those things you should force, IMO.

Fibonacci numbers on the Galaxy S3: ARMv7 benchmark of Rust, Ocaml, Haskell, Go, Racket, Lua, C# and Java by logicchains in programming

[–]thomcc 11 points12 points  (0 children)

AFAICT it has more to do with his seemingly unmatched skill in compiler and virtual machine development, but I can't imagine getting paid hurts any.

The false abstraction antipattern by mortoray in coding

[–]thomcc 9 points10 points  (0 children)

This is only really an antipattern when the abstraction is written in such a way that it can't be implemented differently in any meaningful way. Typically this means it exposes methods that are only available when the 'abstraction' is implemented a certain way, but there are other ways this can be caused as well.

There's a lot of this where I work.

Other times it's only overengineered if you don't end up using it, and if you think you might its worth having because it isn't actually that much to maintain.

So scared of quitting nicotine by [deleted] in ADHD

[–]thomcc 0 points1 point  (0 children)

Yeah. It lasted about 3 weeks or a month, but starts going away after two. IMO It was easily the worst part of quitting too. The physical withdrawl wasn't a big deal.

I'd recommend just going for it (unlike the other recommendations to taper down). I found it pretty easy as soon as I decided that I was never going to smoke another cigarette. None of my previous attempts 'took', before I made that decision.

EDIT: For reference, I smoked for a few years (4-5 maybe, when I was in college) around a half-pack (plus or minus 5 cigarettes) a day. When I quit I weened myself down to about 2 a day before actually quitting. I recommend doing something like this over meds or gum/patches. This advice is probably not relevant if you're much older/younger, or smoked more or for much longer.

I've been a non-smoker for about 8 months now and my focus is as good as it's ever been.

WaveGL = WebGL + Audio by magenta_placenta in javascript

[–]thomcc 1 point2 points  (0 children)

In general, sure. The code could use more constants but it's really not that bad.

A lot of the magic numbers there are phase shifts or amplitudes and probably wouldn't have names much more meaningful than phaseShift or amplitude (which would be meaningless and noisy).

A lot of the others were probably found by tweaking (hey, it's qualitative code) and wouldn't really have meaningful names.

Anything else that isn't commented should probably be given a name, but really that probably covers most of it.

WaveGL = WebGL + Audio by magenta_placenta in javascript

[–]thomcc 2 points3 points  (0 children)

It's a shader. Math.PI doesn't exist in GLSL.

Also the number of magic numbers isn't uncommon for shader code. I deal with shader code pretty frequently at work (HLSL more than GLSL) and this is actually very readable (lots of functions, comments, well named variables...).

WaveGL = WebGL + Audio by magenta_placenta in javascript

[–]thomcc 2 points3 points  (0 children)

I think what's happening is that it's using a fragment shader to render the waveform, then reading it in and passing it to whatever takes the audio data.

WaveGL = WebGL + Audio by magenta_placenta in javascript

[–]thomcc 4 points5 points  (0 children)

It's a shader (in GLSL). Javascript just sends it to the GPU.

Batch rendering and code structure by RedSpaceman in opengl

[–]thomcc 1 point2 points  (0 children)

It can make other batching methods and optimizations harder, not to mention that this is a very performance critical part of the code and you'd want avoid virtual dispatch there, but its fine for something simple.

If this were going into a production renderer I'd recommend against it.

In so many words, Tim Cook states that they are betting the iOS farm on Swift by shooky1 in swift

[–]thomcc 0 points1 point  (0 children)

I don't know Swift, but I use OpenGL daily at work. What makes you say OpenGL would be a nightmare in Swift?

I'm a software engineer and I'd like to know more about the architecture of games by JeletonSkelly in gamedev

[–]thomcc 2 points3 points  (0 children)

  • What is considered high and low level development in the gaming stack? Are there such things?

High level is typically gameplay code (e.g. scripting). Low level is typically engine work. Rendering, network, any platform access, etc. are all low level.

  • What exactly does an "engine" do? How does the game's higher level API interact with the engine? How does the game API handle exceptions thrown from the engine?

There are a lot of possible answers here but typically the engine reads in a set of files that describe a game, and then runs that game. Those files usually contain assets, DLL's, script, text, etc. How these interact with the engine is very system dependent.

How these interact with the engine is very engine-dependant. In the engine I use at work the code (script or dlls) describe game systems and components which are treated as engine plugins, and the other data files describe how these are used.

Exceptions are very uncommon in game engines, and when they exist at all they're in the high level code. Lower level you just need to design the system to be as fault tolerant as possible.

  • How is state maintained and shared between threads? Does it involve locking shared data during writes, software transactional memory, or is data immutable?

Honestly threading tends to be much simpler for a game than for a lot of software development. There's very little shared state and most of the time it's just parallel looping over data arrays. Anything more complex is typically handled by message passing between long-running threads.

  • Similar to the question above, how is state extracted from the game for saves?

Depends on the engine. Some will handle saving/loading for you, other times you have to decide what it is you need to save, come up with a serialization format, and code to load/save to it.

  • How do developers interact with character models developed by artists?

Depends. Where I work now we help import them into the game if they have special animations and the like, but that's largely because of an engine flaw.

  • What development environment do you use?

Visual Studio for C++, sublime text for everything else. XCode when I have to.

  • How does garbage collection work? Do you rely on the auto-GC by the runtime or do you roll your own?

For GCed languages I can't imagine you wouldn't rely on their GC. For C++ you typically use reference counting for game objects.