Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Feb 2007
Offline Last Active Sep 10 2014 12:11 PM

#5099238 Guidance for my son...

Posted by Ravyne on 06 October 2013 - 06:57 PM

First of all, props for being an involved parent, too often so-called parents can't be bothered enough to even learn the first thing about what their kids are into, or to the other extreme, force their kids into re-living the life they had, or wish they had had. It sounds like the your kid will turn out alright whatever he ends up doing.


Don't worry about whoever says your son is too young for X or Y. In kids especially, simple curiosity and a logical mind are an astonishingly good substitute for a proper education. Besides that, we tend to limit kids by thinking of them as being similarly intelligent to their peer-group, but the factory-model education system cages in most of that potential so that they don't wander too far away from the others. As a result, we think of kids in general as far less capable than they actually are. All kids have awesome potential, but schools can't cope because it's directed in every which direction -- just encourage and facilitate him following his interest and prepare to be amazed.


I started with BASIC--we didn't have fancy Lego robot sets, Roblox, or Minecraft back then-- when I was around 10, and the only resources I had were the 4-5 dusty programming books in my rural school system's library, and an equally-dusty Apple IIe (we had much newer computers, but none with Basic). That was enough to set the hook in me, and I started working summer jobs about as soon as I could so that I could buy my own computer and continue learning to program. At some point in the late 90s we finally got internet at home, and I started visiting this forum and other sites. By the time I graduated high school in 2002 I had written about half a dozen substantial programs (games and game tools), and probably 2 dozen other smaller programs. There's quite a high concentration of well-known programmers who had a similar experience starting young, so your son is in good company. Its fairly uncommon, I think, to find people who self-identify as starting their path at a young age in just about any other field.


I'm going to second love2d that someone mentioned above. Lua is a great beginner-friendly language, the love2d community seems pretty friendly, and Lua is widely used in the games industry so its a practical skill too. Other options would be something like pygame or pyglet, or maybe something like Cinder if your son is interested/becomes interested in C++ (although that end of the pool is probably not a good place to start without guidance). Unity is also pretty good, but it can also be distracting, if not difficult, to mold it into something that's not supported out-of-the-box -- for example, its fairly well known that doing a 2D game in Unity proper is not terribly straight-forward (although, Unity 4.3 should be out soon and includes proper 2D support, so that'll probably change. Its currently in Beta.)


Anyhow, there's a lot of great frameworks out there, just beware that the ones that might look most flashy and professional aren't always the best choice, because sometimes there's a big nest of circuits behind it that has to be rewired before you can do anything simpler with it.

#5098172 Would this be a good idea? (Episodic release)

Posted by Ravyne on 01 October 2013 - 07:55 PM

Ultimately, what you want to do from a business standpoint is maximize revenue. Revenue is numbers sold multiplied by whatever profit you take per copy sold. Market principles are such that the number of sales made are inversely proportional to the price of the good or service you offer -- there are various details regarding minimum pricing to consider -- but in general the principle holds. Ergo, give it away for free and the number of copies 'sold' is literally the number of people who are interested, price it too high and no one buys it at all. In either extreme, your revenue is zero -- the only place to make money is in the middle.


Its the market that determines where in the middle you will make the most revenue -- not your desire to sell at 5, 10, or 20 dollars; Your job as an industrious marketeer is to consider relevant factors and determine where your market is centered, then to set your prices there. Factors to consider would include the typical going-price for similar goods or services, the value proposition of competing goods and services, and whether or not there's a dearth or glut of competition.


If you look around the landscape, AAA games have economies of scale that allow them to sell massive amounts of content that's taken hundreds, if not thousands of man-years to produce, for the Crazy-Eddie bargain price of just $59.99. You may not think of AAA games as your competition, buy you're are, in fact, competing for the same valuable entertainment dollars and entertainment hours as everyone else. Heck, for the same $7 you propose, I can go see half of a blockbuster film (or the whole thing, during a matinee), I can buy 1/8th of a new AAA game (or about 1/3rd of an AAA game that came out three months ago), I can buy a paperback book, buy 4-10 songs from iTunes, I can buy 7 whole games from the app store, I can keep my spotify or netflix subscription running for another month, I can put two gallons of gas in my car and spend the weekend someplace nice, or I can go the the bar and buy a pretty girl a drink.


Like it or not, competition for people's entertainment dollars has never been so fierce. They have limited money and time to spend, and other people are literally giving away content just for the chance to convert some of their clients into cash-cows (the so-called freemium business model). You can call it a race to the bottom if you like, but that doesn't change what the market is, and it couldn't care less whether you think you need to charge $7 to keep your lights on.


If you can't make the living you want in the way you want, throwing in the towel and making a living elsewise is a sound business decision. But marketing decisions can't be driven by the results you want to achieve, they need to be driven by maximizing the opportunity that is there.

#5097964 All matrix operations in shader?

Posted by Ravyne on 30 September 2013 - 05:06 PM

Whether or not you can think of a good reason to do it in production is an entirely separate question than why your professor wants you to do it in a particular way. It might feel a bit icky, but the professor might well have a good reason for doing things this way, for example, if the exercise intends to show that students know how to multiply matrices together, or matrices and vertices, inside a shader, then the instructor might (probably rightly) believe that this exercise is a simple way to demonstrate the students' abilities by using a concept everyone ought to know. If they chose a more "real-world" scenario, then he's no longer grading the students' ability to do matrix/vector math in a shader, but also in their ability to solve whatever other problem he presented, which might not be level-appropriate.


In short, programming in a educational environment has very different requirements than in a production environment. Just give the professor what they are asking for, and don't worry about demonstrating the "right" or "best" way of doing things -- that's not the assignment. If you're ahead of the game enough to know that there are better ways, you're already doing fine. And if you feel the need to scratch the itch of doing it right, no one's stopping you. That's what learning is all about.

#5097058 AMD's Mantle API

Posted by Ravyne on 26 September 2013 - 01:00 PM

I think its an incredibly smart move by AMD. For anyone else to strike out with a new low-level API on the PC would be fool-hardy, but because AMD has GCN in both next-generation consoles they can leverage the work that devs are doing anyways and bridge it to the PC. Even if the specifics of the Xbox One or PS4 APIs are spoken differently, the concepts will be very close to identical. Glide lost favor despite being faster because 3Dfx started facing stiff competition from nVidia, and then-ATI -- market share started moving away from Glide-capable hardware, and also DirectX was getting better and better. But for the next ~7 years there will be more Mantle-capable, GCN hardware in PCs, in Xboxes, in PS4s, and there's no getting away from it. Maybe 250m units or more by the end of that time -- probably more than an order of magnitude greater than any PC-centric GPU, and ~3 times as many as any GPU that a console has ever been built around. On top of that, as much as Direct3D has improved the mutli-threading and draw-call overhead situation, that's essentially up against the wall now -- DirectX might get more features, but I don't see multi-threading or draw-call overhead getting much better than it is now. not without significant architectural changes through the API and even the driver model.


What's really interesting, if you recall, there was some controversy awhile back about how D3D 11.2 would maybe be the last version of D3D. Well, that's not so far fetched if what that really means is that D3D 12.0 will be a significant departure towards a lower-level, mantle-like API. Even if you sacrifice half of Mantle's gains to support other hardware vendors, its still 5x more available draw-calls per frame, better multi-threaded rendering, and easier console ports. I think that ultimately that's the path this will take -- Mantle will be a proving-ground a what a modern PC-graphics API could look like, and will serve as prior art for a new cross-platform API that's lower-level than Direct3D or OpenGL today. nVidia will be forced to go along in some fashion, there's simply no way they can afford to give up that kind of performance advantage in the software stack, and if it starts being the case that literally every PC games looks and performs better on AMD GPUs, its really going to press them out of the market.

#5095281 BASIC

Posted by Ravyne on 19 September 2013 - 04:23 PM

There are some neat tricks you can do in a similar way to save code-space, for example if you have reoutines to calculate sine and cosine, you can write the function for sine, and instead of writing a very similar function for cosine, you just add an instruction or two ahead of the sine function that shifts the cosine period to align with the sine period, and then continue through the sine function. There's not much reason to use this exact structure where code-space isn't a concern, but its common to see similar things where code-space is limited, such as in microcontrollers.

#5093657 Reality vs Game Mechanic

Posted by Ravyne on 12 September 2013 - 02:43 PM

If reality were always fun, we wouldn't need games to entertain us.


I've brought this up a number of times, but I once knew a guy who's grand MMORPG idea called for a fuedal class system, wherein you would achieve knighthood, and before entering battle you and your squire (who is another real person playing the game, hoping to become a knight someday) spend--no joke--a full 15 minutes putting your armor on for battle through tedious little mini-games. His desire was to be as real as possible, and to prevent people from logging in fully-suited and responding to events more quickly than real reality would allow.


How anyone could confuse this with actual fun is beyond me, but the way in which is eyes would light up with wild abandon assured me this person was somewhat actually crazy--and I took comfort in the fact that he had found some ideal to be so impassioned by that didn't involve seeing what peoples insides look like on their outsides.

#5092853 Placement new

Posted by Ravyne on 09 September 2013 - 06:26 PM

It can also be used (with care) to initialize memory-mapped I/O devices if you want a direct object representation of the memory that controls it. Sometimes its better to have an object representation which is a proxy for the object, but sometimes not. You can use placement new with careful construction in the latter case. I say careful because you have to make sure your class's data members line up with the in-memory registers, and you also have to initialize some of those registers in the manner and order that the hardware requires -- but its a neat parlor trick when the opportunity arises.

#5092801 c++ 2d tilebased collision theory craft allowing many units to wander on map

Posted by Ravyne on 09 September 2013 - 02:47 PM

Also, are you testing collision each and every frame? This may be unnecessary if movement logic and path-finding take place at tile-level granularity. For example, if an entity always walks fully onto a tile or not at all, even if the movement is animated over several frames, you only need to check for collision once for each movement, not for every frame in between.

#5092755 How to cache?

Posted by Ravyne on 09 September 2013 - 11:02 AM

Caching on the CPU generally works like this: The entire memory space is chopped up into 64-byte chunks conceptually -- whenever you read any byte within that chunk, the entire chunk is loaded up. So if you read the first byte of a chunk, all the bytes after it are loaded too. If you read the last byte, all the bytes before it are read. If you read from somewhere in the middle, all the bytes before and after are read. This is typical of L2 and L3 caches; I think L1 cache sometimes (still? used to?) operate with smaller cache-lines that were 16 or 32 bytes. Each cache 'line' corresponds to several chunks (total memory / total cache), so it can be the case that reading from some other memory location will sometimes evict a line from the cache prematurely; a direct-mapped cache would always evict because there's only one cache line to go around for all the memory locations it corresponds to, but an n-way set-associative has has n 'slots' (an abstraction of a cache line) so that nothing will be prematurely ejected as long as you aren't actively reading from n+1 or more memory locations simultaneously (most desktop systems today are 4-way set associative, which is sufficient for most access patterns.


On a GPU, caching for texture access is prioritized for spacial-locality (in texture coordinates) rather than linear access patterns. I'm honestly not sure what the state of automated caching is for GPU compute, but there's also a small block of memory for each cluster of SIMDs in a GPU that's under direct programmer control, which fulfills the role of cache too.

#5092584 CS Degree - Is it worth it?

Posted by Ravyne on 08 September 2013 - 07:22 PM

I would say that if you have the opportunity to go to a good school, go. Maybe you're a programming prodigy, maybe you aren't -- right now, you're the only one that's convinced of it (even as you acknowledge your known shortcomings, if you think that you might be better off without university, you're already considering yourself as one among a rarified breed). But, a degree from a good school and the work to show for it has a tendency to convince nearly everyone with hardly an argument about it. There's also the matter that most young people who might be quite accomplished in a narrow field don't actually know enough about the broader field to even be aware of what else is important to know. Left to your own devices, would you slog through set theory? Category theory? Discrete math?


I was probably 11 or 12 when I started writing little programs of my own. I had read about programming and modified code from the backs of books before that. By the time I graduated high school I had written a couple small games, 3 graphics programs, a map editor, and a number of other small tools and utilities, some in C, others in QuickBasic. I did pretty much coast through my first year in college getting good grades, but sometime during the second year I began falling behind -- probably less due to any kind of lack of intellect, and more due to poor study and work habits, and to a general sense that I would be able to complete programming assignments and other work faster than I actually could. This had a cumulative effect, and I even failed a number of courses before getting myself back on track. This cost me a lot of time, and a lot of extra tuition, too. We have a lot of things going for us at the age when we graduate school -- our youth, our health, our positive outlook -- but we also tend to have a lot of hubris, and a stunning lack of ability to clearly see much more than 6 months into our own future.


Another way to think of it is this: whatever level you're at now, your contemporaries who go to university will probably have caught up or surpassed you in the 3-4 years it takes them to graduate. If you're able to skip university and enter the workforce now as some kind of developer, you'll compete with people fresh out of university, likely every bit as competent as you, but with a degree to show for it and 4 years wiser. If you are able to land a job, you'll likely do so at extreme entry-level, and it's probably going to take 2-4 years before you convince people that you do, in fact, know what you're doing despite the lack of any kind of degree. In your work, you'll likely spend those years focused on a fairly narrow niche, and while you may end up very proficient in that niche, your proficiencies in other areas will not be nearly as developed. This is not an uncommon experience, I know a very brilliant guy who's been at Google for 5 years now -- he's payed incredibly well, he gets great reviews, and when he says something, people at work listen. He's also a little worried that he's so focused on the task of making other people's code scale up, that's his ability to write his own code from the ground up is starting to decline. When you start working, you generally start getting pushed into one pigeon-hole or the other, for better or worse.


The point I'm making here is that its easy to see going straight into the work-force as "Proceed directly to Go, Collect $200." But if we're talking strictly about your professional life, its not about who can run the first 400 meters most quickly, but about who can cover the most ground before they run out of gas. Having a shortcut right out of the gate is a leg up, but others will come on quickly. If you intend to keep ahead of them, then you need to develop the legs for it. Very few places do that better than a quality university.

#5092154 How to save a scene in higher resolution?

Posted by Ravyne on 06 September 2013 - 02:57 PM

You can render to a render-target, then you'll only be limited by the max texture size, rather than the display resolution, I believe -- to 8k+. If you want to go even larger, you can render in multiple sections at some high resolution. Bungie used to do this on their servers for premium bungie.net members (you could take a high-res shot from a captured gameplay video). You have to mess with the frustum/projection I think, since it becomes non-uniform. I think they may have done a whitepaper on how they did it.

#5092137 DX11 - API - Disadvantage of vector multiplication.

Posted by Ravyne on 06 September 2013 - 01:23 PM

It is likely because multiplying one vector by another component wise doesn't make sense as an operation on vector spaces. Under what circumstances do you need to use component wise multiplication?


Sure it does, its just a non-uniform scale. Granted its not the most common operation for 3D graphics, but its hardly unheard of, and it has wide applicability in other domains. In my own vector math library, I overload operator * and operator / between vectors to mean piecewise multiplication and piecewise division (non-uniform scaling), and between vectors and scalars by extending the scalar to a vector of same rank (uniform scaling). I feel that this configuration best satisfies the recommended design principles of "principle of least surprise" (particularly regarding operator associativity and operator precedense) and "do as the ints do". I provide for the dot, cross (and 2D psuedo-cross) product as (non-member) functions, along with some other useful ones. I'm pretty happy with how orthogonal this makes things, and while its not as terse as with operator overloading, it forces you to state the order of operations explicitly.

#5092123 How to cache?

Posted by Ravyne on 06 September 2013 - 12:12 PM

On the GPU its hard to really take any concrete action on the very low-level. For the most part, you can't rely on any set of GPUs behaving in the same way WRT caching because each vendor has their own secret sauce. Newer GPUs are becoming more homogenized across generations and even across vendors as GPU compute becomes more and more a factor in their hardware designs, but there's still quite a bit of variance today. I predict they will continue to trend closer and closer, but I doubt we'll ever see the kind of homogeneity that exists between, say, AMD and Intel processors.


What you can do instead is be less worried about specific caching behaviors, and more worried about the capabilities defined by different Direct3D versions -- D3D specifies the number of instruction slots, registers, and shared memory available, among other things. You also need to be aware of how GPU execution differs (e.g. branches execute both sides if even one element goes in each direction, results are masked and merged -- and this grows exponentially). Optimal GPU code loads in some memory that no other thread-group wants to touch at the same time, parties on it for a bit, writes back the result, and moves onto the next bit of memory.

#5092121 What type of game can One person make ?

Posted by Ravyne on 06 September 2013 - 12:01 PM

In 3-6 months, what you'll have for some of those simpler games (a'la Zelda, Broken Age, Fez, and maybe Diablo) is probably a fairly functional engine and maybe an hour or two of unpolished content. There was a similar thread just recently in which I pointed out that polish is really the factor that determines time to completion. I, and probably most of us here, can knock out a C-grade engine with a few hours of C-grade content in 3-6 months. But bringing the engine and content to A-grade will take 3 times as long. This varies depending on experience, and we're talking man-hours here, so two people can do this in half the time, but realistically, 1 year is about the minimum for one person to produce 4-6 hours of polished content in any of those game types.

#5091428 As a one man team, would it be possible to make these kind of games?

Posted by Ravyne on 03 September 2013 - 04:36 PM

It also largely depends on how polished the product that you want to ship is. Usually its the polish that consumes the most time out of anything, and its also probably responsible for how well your customers receive your game to a very large degree. Having done most of it a few times, I can probably knock together a very functional console-style JRPG in 3 months or so if I were able to dedicate myself full-time to it. But for me to get from there to a product that's really polished in terms of its implementation, together with the *game* and its assets polished to a reasonably degree is probably another 9-18 months time, depending on the number of playable hours I hope to provide.


A polished game usually takes about 4-10 times longer to make than does a stable and mostly feature-complete prototype of it.