Newb programming question

Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Newb programming question

Post by Bleppe »

Hi all!

Been a lurker on these forums for quite some time now and finally got around making an account.
I'm currently working as an IT tech and was thinking of broadening my skills, and since I've been a gamer pretty much all my life (started out with intellivision and vectrex so it's been a while) I was thinking of learning programming.
I know most games are developed in C++ so I guess my main goal is to learn that in some point in the future, but I was wondering if any seasoned programmer have some advice on where to start?
From what I understand many languages are very similar, so is there any language I should start learning as a complete newb or should I just tackle C++ right away?

And since this is the Rift forum I have to say I can't wait to get my hands on one! It looks friggin awesome :D
My only concern is if I should order the first devkit or hold out until after E3 and see if there's any news on DK2.
User avatar
GeraldT
Certif-Eyable!
Posts: 1057
Joined: Fri Jan 18, 2013 9:10 am
Location: Germany
Contact:

Re: Newb programming question

Post by GeraldT »

if you have no programming experience, then I would say learn C# - it is a very beginner friendly language. once you have the basics try out Unity - this is the indie standard for game development and it's very easy to create games for the Rift with it.
I started myself 7 months ago here: http://cgcookie.com/unity/2011/11/30/un ... in-30mins/

Of course there are other alternatives - I do love Unity though.
want to demo the Rift or check it out? click here
User avatar
Pokey
Two Eyed Hopeful
Posts: 53
Joined: Fri Feb 01, 2013 8:21 pm

Re: Newb programming question

Post by Pokey »

I second Unity, as it is free and you can start in high level concepts with a game running, instead of starting with a blank screen and building every little thing yourself.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

Awesome! Thanks for the tip.
Might have to go down to the bookstore tomorrow and grab a C# book :)
spire8989
Cross Eyed!
Posts: 173
Joined: Wed Jan 16, 2013 11:51 am

Re: Newb programming question

Post by spire8989 »

I disagree, I think learning C++ first is superior, sure it's harder, but you're already a professional techie - not some high school kid.

Check out www.gamedev.net - coding site for people interested in games. You'll probably get more in-depth responses on the forum there.

For example: http://www.gamedev.net/topic/643347-sta ... questions/
User avatar
Pokey
Two Eyed Hopeful
Posts: 53
Joined: Fri Feb 01, 2013 8:21 pm

Re: Newb programming question

Post by Pokey »

spire8989 wrote:I disagree, I think learning C++ first is superior, sure it's harder, but you're already a professional techie - not some high school kid.

Check out http://www.gamedev.net - coding site for people interested in games. You'll probably get more in-depth responses on the forum there.

For example: http://www.gamedev.net/topic/643347-sta ... questions/

I would agree with this if you're looking to be a professional programmer. I got the impression it was more of a hobby thing for the OP where immediate results would trump rock solid foundation skills.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

Well it's a hobby thing that I hope to evolve into something else later on. But first and foremost it will be a hobby. And if I get good enough at it then I might consider making a career out of it. But I gotta start somewhere :)
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

Bleppe wrote:Well it's a hobby thing that I hope to evolve into something else later on. But first and foremost it will be a hobby. And if I get good enough at it then I might consider making a career out of it. But I gotta start somewhere :)
For a hobbiest programmer, C# was created specifically because C++ programmers could not be trained fast enough (needing to deal with complications like memory management and such) back when there was still a growing demand for IT professionals. It runs in a managed environment just like Visual Basic, with
"garbage collection" (automatic memory management) and other features to protect a new programmer from hidden dangers and low-level complexity of other programming environments. In fact, people at Microsoft once said that C# was originally a "C++ styled skin" over the Visual Basic engine, to give it the best of C++ and Visual Basic, so that new programmers could be trained and brought up to speed much more quickly.

However, you will not get the same low-level performance in a managed environment as you will with C or C++, but that does not matter if you offload as much as you can to GLSL shaders and optimized library functions.

But with the new HTML5 features, a lot of people are using that to develop apps too, and things like Three.js + Cannon.js + Node.js + socket.io can go a long way toward making interesing games that run (fullscreen) inside your web browser(s):

http://www.youtube.com/watch?v=-TiZzovx5YE

And there is already a thread here for using Three.js with the Oculus Rift:
http://www.mtbs3d.com/phpbb/viewtopic.php?f=140&t=16341

And don't forget vr.js, that also supports the Razer Hydra:
https://developer.oculusvr.com/forums/v ... f=20&t=753

But personally, I like "programming on the bare metal" (for maximum perfomance and exotic applications), so I am a plain old K&R C fan, for sure (with a little assembler language optimization mixed in)... :D

Some people like lua and python, so you may want to check those out too. You should probably try a number of different programming environments before you decide which is best for you.

But if you just want to make games, with a minimum of raw programming to deal with, then try Unity, or UDK, or Ogre + OgreKit.

Or, for just getting in and modelling with your bare hands, perhaps you want Sixense MakeVR (when available):
http://www.youtube.com/watch?v=VvPb7Lo6S-I

Or perhaps another immersive Vr content-creation tool like "Cube 2 (Sauerbraten)" which alread has a ton of maps, and is free:
http://www.youtube.com/watch?v=2rS075Bp-E0

These "hands on" instant-gratification world building tools look quite exciting and fun to me.

Depending on whether you ACTUALLY want to write lines of code, or just start building virtual worlds right from the beginning, only you can decide that.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

I've been looking into Python a bit already and it was one of my alternatives, but since I might want to start using what I learn at work I think c# is a better alternative.
From what I understand, once you've learned one language, learning others will be much easier? Like java, c++, python etc. Or am I wrong?
What I want right now is to learn one language and get the basics and then move on from there.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

Love the remixed mirrors edge soundtrack in the second vid btw :D
I'm a huge mirrors edge fan. Can't wait for mirrors edge 2!
The singer is swedish btw and really hot xD
spire8989
Cross Eyed!
Posts: 173
Joined: Wed Jan 16, 2013 11:51 am

Re: Newb programming question

Post by spire8989 »

Bleppe wrote:I've been looking into Python a bit already and it was one of my alternatives, but since I might want to start using what I learn at work I think c# is a better alternative.
From what I understand, once you've learned one language, learning others will be much easier? Like java, c++, python etc. Or am I wrong?
What I want right now is to learn one language and get the basics and then move on from there.
That's mostly true, but also the reason I recommended C++ first. Learning C# and then learning C++ is almost like learning to program twice (in my opinion) whereas learning C++ first will make C# and Java (similar languages) a cakewalk.

I'm glad geekmaster showed up though, figured his head would appear here. I've never had the ability or need to write assembly code, in most cases it's not worth doing - so I'm told.

Uh, anyway, learning C# first is fine, especially if it's mostly a hobby thing, it's still a high-level powerful language - you just don't have to deal with the intricacies of memory management and such.
User avatar
TheHolyChicken
Diamond Eyed Freakazoid!
Posts: 733
Joined: Thu Oct 18, 2012 3:34 am
Location: Brighton, UK
Contact:

Re: Newb programming question

Post by TheHolyChicken »

Try not to over-complicate things, guys.

If you want to see quick results, and fun rather than learning, go and do Unity. You'll be able to quickly and easily start making little prototype games and such, and hopefully have a blast in the process.

If you are feeling more serious about programming, with games in mind, it probably makes most sense to learn C++, or perhaps C#. Either language will teach you the important broad programming concepts and "how it works", and once you know that, changing to another language is mostly just learning how the syntax is different.
Sometimes I sits and thinks, and sometimes I just sits.
Caine
Cross Eyed!
Posts: 103
Joined: Tue May 21, 2013 11:09 pm

Re: Newb programming question

Post by Caine »

My 2 bits - I started with Unity about a month ago with zero game development experience (only a bit of BASIC with a Commodore 64 as a kid), and have been amazed by all the free learning resources/tutorials, etc. I've been learning by getting template scripts (both C# and JS) and through trial and error adapting them to suit my needs (and learning on the way of course, and watching many tutorials and checking the Unity answers website). Since then I've been able to come up with the start for a FPS survival horror game, with full body awareness, head position tracking and razer hydra support -
http://www.youtube.com/watch?v=2L1RInjqpdM

So based on my experience if you want a quick start and see enjoyable results as soon as possible I'd go the way I did :) If there are ever any questions I could help you out with, I would be happy to.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

Tanks Caine :) I did a little Basic on C64 as a kid aswell haha
Some textbased rpg games and such... went on to learn myself some html as a teenager but other than that I have no programmingskills what so ever.
I do think I will start with c# first though, since I want to be able to use it for work aswell as for fun :)
Your game looks awesome btw :)
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

spire8989 wrote:... I'm glad geekmaster showed up though, figured his head would appear here. I've never had the ability or need to write assembly code, in most cases it's not worth doing - so I'm told. ...
That is getting more true except when trying to do things like generate analog video with an embedded processor of other timing-sensitive tasks using low-power hardware. However, on any level of hardware, it is good to know what is going on "under the skin" so you can write your high level language in a way that the compiler CAN do a good job of optimization. If you do not understand, it is all too easy to write code that the compiler CANNOT optimize. It helps a lot to have the assembler language skills so you can examine the compiler OUTPUT to verify that your code is properly optimized ESPECIALLY for low-latency applications like we need here. You can "tune" your source code until it generates good and fast assembler output, and learn how to write high-level code that you KNOW will compile into fast optimized assembler language code underneath.

And besides, learning new things keeps the brain young. Modern computers with flat memory architectures and orthogonal instruction sets are a pure joy to program at a low level, especially when compared to old x86 CPUs with segmented memory architecture and specific register-dependent (non-orthogonal) instructions. And these days, I just use a little inline assembler, only as needed in an inner loop. In many cases on modern compilers, there are "intrinsics" that LOOK like a function call, but really just stick a special assembler instruction right there were you need it, such as _BitScanReverse(), which is really just an inline x86 BSR instruction. Yes, I use a lot of "bit-basher" instrinsics... After all, geekmaster is well known as a "bare-metal bit-basher and pixel-pusher" (or at least his human persona had such an "industry-wide reputation" way back in the "olden days", plus that "bailing companies out of the fire" thing...).
:lol:

So yeah, even though there is rarely a NEED to WRITE assembler language, it is very important to have that skill so that your knowledge can help you write good high-level code by knowing exactly what that code is doing down below.

I was a HUGE fan of Michael Abrashe's optimization books back in the "olden days", and I strongly recommend checking out this website for modern code optimization methods:
http://www.agner.org/optimize/

And even in C#, the libraries it USES need to have this level of optimization deep down inside, or we will have unwanted latency issues...
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

geekmaster wrote:
spire8989 wrote:...
So yeah, even though there is rarely a NEED to WRITE assembler language, it is very important to have that skill so that your knowledge can help you write good high-level code by knowing exactly what that code is doing down below....
That's exactly why I want to learn atleast the semi-hard way first and not jump into some pick and click developing.
usb247
Two Eyed Hopeful
Posts: 81
Joined: Sun Mar 31, 2013 12:48 pm

Re: Newb programming question

Post by usb247 »

I use unityscript or javascript whatever it's called.

It's the most straightforward programming language I've used. Everything is very intuitive almost like pseudo code.

declaring a function would be something like

function do_something
if(this)

then(that)


very straightforward. I guess you would need to know what a function is first though. :P
Every game object in unity has two functions. Init that tells the object what to do when the game starts and Update that tells an object what to do while the game is running.

Update function for a ball might be

if(player collides with ball)
then
ball.parent = player

(the player now has the ball)
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

Bleppe wrote:
geekmaster wrote:... So yeah, even though there is rarely a NEED to WRITE assembler language, it is very important to have that skill so that your knowledge can help you write good high-level code by knowing exactly what that code is doing down below....
That's exactly why I want to learn atleast the semi-hard way first and not jump into some pick and click developing.
Back when I taught computer programming, we always started with assembler language and built upon that foundation. Modern "top down" methods of teaching this subject are exactly why managed languages like C# became necessary, due to a huge quantity of programmers who did not understand what their programs actually did deep down inside, leading to persistent bugs with pointer errors and memory and resource leaks (especially critical for long-running processes that reside in the Windows tool tray). Things like MFC were a disaster when it came to trying to DEBUG a program. Which is why I stuck with WINAPI in my code, although I much prefer writing device drivers and "talking to the bare metal" (I/O chip registers, etc.). Existing device drivers often do not effectively use the available capabilities of the chipsets they support, just supporting the "lowest common denominator" of a family of I/O devices. When you have absolute control over the hardware, it is often amazing to see just what they can do if you actually use them to their full power.

But these days, GPU programming is "where it's at", so I suggest spending some time with GLSL shaders in an online shader sandbox like ShaderToy. Learning to program by reading source code is an excellent way to learn. You can tweak the source code for these shaders and see what your changes do in real-time, here:
https://www.shadertoy.com/view/Mds3Rn
https://www.shadertoy.com/view/MdX3Rr
https://www.shadertoy.com/view/4sXGRM
https://www.shadertoy.com/view/Mss3zM
https://www.shadertoy.com/view/Xdl3R4
https://www.shadertoy.com/view/MdfGRr
https://www.shadertoy.com/view/lsf3zr
https://www.shadertoy.com/view/Msl3Rr
All that stuff above is generated in REAL-TIME inside those shaders whose source code you can see at those links above. And I was pleasantly surprised at how many Shadertoy shaders work on my Raspberry Pi (some requiring a little simplification).

And I also suggest reading the well-commented code released by id software. John Carmack (et al) wrote some awesome code that you can learn a "thing or two" from:
http://rc3.org/2013/01/15/john-carmacks-beautiful-code/
usb247
Two Eyed Hopeful
Posts: 81
Joined: Sun Mar 31, 2013 12:48 pm

Re: Newb programming question

Post by usb247 »

I think you're going too deep for a programming newb. Shader is pretty advanced. That's beyond programming even because you need to understand the graphics pipeline to do any of that.

Order I would go in is

1. Javascript (three.js and unityscript)
2. OpenGL 1.0
3. C

learn C instead of C++ because C++ will gloss over the fundamentals.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

usb247 wrote:I think you're going too deep for a programming newb. Shader is pretty advanced. That's beyond programming even because you need to understand the graphics pipeline to do any of that.

Order I would go in is

1. Javascript (three.js and unityscript)
2. OpenGL 1.0
3. C

learn C instead of C++ because C++ will gloss over the fundamentals.
Naw... Just sandboxed shaders already in the online shadertoy framework. Instant feedback and gratification, while teaching the basic fundamentals of a simple C-like language. Then he can move to C# or something. I was just listing available options. It is really his choice. There are many places to begin that all teach effective programming methods. I just happen to like assembler language and C. And yes, learning simple C programming first is good, because that knowledge can be using in C#, or C++, or GLSL shaders...
User avatar
BloodShed
Two Eyed Hopeful
Posts: 63
Joined: Wed Mar 27, 2013 10:18 am

Re: Newb programming question

Post by BloodShed »

usb247 wrote:learn C instead of C++ because C++ will gloss over the fundamentals.
I used to recommend the same thing. But it really depends how devoted the person is.

If you are confident you want to make a living as a software engineer, I agree with usb247 and you should learn the essentials of C before tackling C++. You don't need to, but I recommend it.

If you're not sure yet, I definitely agree with GeraldT and you should start with C#. Memory management/garbage collection is automated. There are language restrictions that will help you avoid common mistakes (multiple-inheritance is not allowed, switches cannot fall-through, etc.). The .NET Framework libraries with IntelliSense and XML commenting will be extremely helpful as you're starting out. Meanwhile, you can still familiarize yourself with a strongly typed, case sensitive language, targeted at object-oriented design and very similar to C++ and Java.

If you decide to make a career of it, I also recommend making an effort toward understanding the role of the compiler. There are far too many developers out there that have no idea how their code will be handled. For example, they couldn't tell you how a property differs from a field or how a switch is different from a large if...if else...if else...else statement.
usb247
Two Eyed Hopeful
Posts: 81
Joined: Sun Mar 31, 2013 12:48 pm

Re: Newb programming question

Post by usb247 »

Thankfully I'm not a professional programmer or this would be embarrassing, but how is a switch different from if then else else?

I kind of assumed they would both be compiled into branch statements.
User avatar
nateight
Sharp Eyed Eagle!
Posts: 404
Joined: Wed Feb 27, 2013 10:33 pm
Location: Youngstown, OH

Re: Newb programming question

Post by nateight »

I'm basically in Bleppe's situation ("computer guy" who never really got around to learning how to program, then the Rift happened) but perhaps a few months ahead of him on my journey. The important question is this: If "making games" is your goal, are you entirely certain you want to approach that from the programming end? I'm not an industry insider, but I think most people who are will tell you that the guys doing actual programming usually comprise a tiny segment of the workforce involved in producing any kind of modern game. Art assets take the most man-hours to generate in most circumstances, and the people doing that don't need to know how to program so much as a microwave. 3D modelers, texture artists, animators, level designers, sound engineers, and testers "are" the contemporary video game production staff; the programmers are commonly regarded as just a couple of nerds in the back room who glue all of that stuff together. Solo developers are finding some success putting out Rift demos right now, but that's mostly because there isn't much professionally produced VR content yet, and we're all starving for more. In a few months, I expect we'll be mostly back to the status quo: If you aren't part of a talented and hardworking team, not many people are going to pay much attention to your tech demos, assuming you're able to finish anything in the first place. It's a tough nut to crack, because joining a small studio or building a competent team around yourself requires that you have and can demonstrate valuable skills, and building a portfolio isn't easy when you have to be a designer, modeler, artist, and programmer.

If your primary aim here is personal enrichment, great - programming is a fantastically valuable skill to have (just don't be too hopeful you'll have much to share for the first few years of effort). If you either want to publish games ASAP or find a career in game development, however, you're much better off focusing on an aspect of game design that isn't generally regarded as something that takes ~10 years to learn. Attaining some level of competency with modeling and/or animating in Autodesk's industry standard tools (or the freeware Blender) may only take a few months, and may not even require traditional artistic talent. If you have some of that, the world needs more texture artists; if you find even modeling beyond your abilities, track down some map creation tutorials for UDK and see how you enjoy the level designer role. The easiest (and least enjoyable) way to enter the video game industry is to become a playtester, but just about any role is easier to break into with zero prior experience when compared to the programmer role.

If, after all that discouragement, you're still set on learning to program, welcome to the club. :D Personally, I highly recommend starting out with Python. geekmaster's probably right (as usual) about starting from the bottom - if you could recreate the computer you're using with a pile of transistors and a soldering iron, the code you write will probably be bulletproof. Taking that path means you won't get anywhere near anything that resembles a game for a few years, though, and I personally didn't have the resolve to slog through all that book lurnin'. You'll definitely want to wind up knowing C++ eventually, but it can be a nightmarish place to start if you don't have a grasp on some fundamental programming concepts. C# may not be a bad choice for a first language, but I suspect the reason it's cited as a "popular" language is that it makes producing internal corporate crapware "faster"; its only role in the game industry seems to be with Unity, and while Unity definitely has its merits, it also has some major drawbacks (not the least of which is the $1500 you'll need to pay to even get started developing for the Rift). Javascript is also a decent place to wind up, but not the best place to start - it (justifiably?) gets a lot of flak for having mindbending syntax, and despite making you do a lot of the low-level memory management stuff that makes starting out difficult, it's impossible to optimize to the levels required by cutting-edge engines.

Personally, I love Python because it sweeps many of the things neophytes find challenging under the proverbial carpet; whitespace delimitation is infinitely less frustrating than playing "find the missing curly brace and/or semicolon" for hours on end every time you build something, it's an interpreted language so you don't have to wrestle with a compiler and your bug-infested code, and the memory management stuff it hides isn't anything you're likely to master when you're first learning what a "for" loop is anyway. The best part is, once you've written a bunch of toy Python programs and you're ready to graduate to C++ or whatever else, the vast majority of what you'll encounter will seem like review, and you'll often find yourself still doing a lot of Python scripting in instances where you don't need to finesse every electron for maximum performance. I can't say how well Python knowledge translates into the Unrealscript or Torquescript proficiency you'll need to actually produce working game code, but I think someone comfortable with Python will be in a much better position to understand them than someone trying to start out at their eventual destination.

TL;DR: "Making games" is more than just programming these days, so that may be something to explore first. If you're determined to learn to program, that's great, and so is Python. ;)
Shameless plug of the day - Read my witty comments on Reddit, in which I argue with the ignorant, over things that don't matter, for reasons I never fully understood!
spire8989
Cross Eyed!
Posts: 173
Joined: Wed Jan 16, 2013 11:51 am

Re: Newb programming question

Post by spire8989 »

geekmaster wrote:
And besides, learning new things keeps the brain young.
Oh, but that's exactly the problem for me. I'm only 23 and haven't had enough time to learn and catch up to some of you. I have a bookcase full of programming books so I have to choose which ones are the most important at each interval. I just finished most of Effective C++ and am currently learning DirectX11 with Frank Lunas 850 page book, but I'm also learning 3d modeling, going to college, working on a AAA game, a prototype game, and two Rift prototypes. I also have a life outside of the computer sadly.

For now, learning assembly doesn't fit into my schedule... I'd love to one day though...
WiredEarp
Golden Eyed Wiseman! (or woman!)
Posts: 1498
Joined: Fri Jul 08, 2011 11:47 pm

Re: Newb programming question

Post by WiredEarp »

I prefer C++ for most of my lower level stuff (drivers, hacks, etc) - that said, I'd second learning Unity and C#. C++ is wonderful for somethings, and a PITA for others, with C# you can do more in less time.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

usb247 wrote:Thankfully I'm not a professional programmer or this would be embarrassing, but how is a switch different from if then else else?

I kind of assumed they would both be compiled into branch statements.
At least when I last studied it, large switch statements were often optimized into jump tables. That depends on the range of the conditional variable, of course. Just do an indexed branch into the jump table, and no comparisons at all (and therefore no branch prediction failure). If else chains can use different conditions at each step. Of course, a switch that was coded as an if else chain could be converted automatically by a modern compiler, and modern compilers may use different methods from my past experience.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Newb programming question

Post by cybereality »

If you're a beginner and just want to start making games ASAP, then go with Unity. No question, there is not another engine or platform that will get you working with 3D games faster than this. It may not be the best engine in certain aspects (like performance, etc.) but it is probably the most user-friendly app out there for this kind of stuff. Although you need Unity Pro for certain features (notably Rift support), you can get pretty far learning with the free version. Using the Unity version of Javascript may be marginally easier at first, but learning C# is a lot better in terms of learning the concepts you will need in a real development environment, and be easily transferable to other languages like C++ or Java.

If your goal is to become a professional game developer, then learning C++ has merit, but will be a much harder road to walk down. You could easily spend years just learning C++ and not having a game or even a decent demo together. Long-term this is probably something you will want to learn, but it may not be a good first intro into programming.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: Newb programming question

Post by boone188 »

No question, you should try learning C# and Unity.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

Gamedevelopment would more than likely be more of a hobby than anything else. I have no vision of becoming the next Carmack or Miyamoto :) My primary goal would be applicationdevelopment and such. I also have a desire of learning how things work and learn reverse engineering. However, if I get good enough and got the chance to work with games it would be awesome :) Right now I just need a place to start.
User avatar
TheHolyChicken
Diamond Eyed Freakazoid!
Posts: 733
Joined: Thu Oct 18, 2012 3:34 am
Location: Brighton, UK
Contact:

Re: Newb programming question

Post by TheHolyChicken »

BloodShed wrote:If you decide to make a career of it, I also recommend making an effort toward understanding the role of the compiler. There are far too many developers out there that have no idea how their code will be handled. For example, they couldn't tell you how a property differs from a field or how a switch is different from a large if...if else...if else...else statement.
There's also far too many developers who place far too much importance on trying to optimise code where it's simply not necessary, causing negligible performance difference often at the expense of good, clean code.

For the record, I have absolutely no idea how the compiler might handle a large if-else/if-else/if-else statement versus a switch statement, but I do know it's a code smell crying out to be polymorphic dispatch.
Sometimes I sits and thinks, and sometimes I just sits.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

TheHolyChicken wrote:... There's also far too many developers who place far too much importance on trying to optimise code where it's simply not necessary, causing negligible performance difference often at the expense of good, clean code.

For the record, I have absolutely no idea how the compiler might handle a large if-else/if-else/if-else statement versus a switch statement, but I do know it's a code smell crying out to be polymorphic dispatch.
If you read Michael Abrash's old books on optimization, you will find that due to pipeline and cache complexities in modern CPUs (since even before the Pentium), you must actually profile your code with precise measurement instrumentation to determine the bottlenecks where optimization is needed. At those critical spots, it helps to examine the assembler language output from the compiler, to be used as feedback, while you tweak the high-level source code IN THAT CRITICAL LOCATION.

If you read the Programming Pearls books by Jon Bentley, you will learn that many programs that have been painstakingly hand-optimized to the extreme by their author, could be GREATLY beaten in performance by a small unoptimized program that uses a BETTER ALGORITHM.

So yes, optimization is basically worthless if you are using the wrong algorithms or data structures. And when you HAVE made the right choices in your implementation, optimization only matters where MEASUREMENT has determined that it is needed, and assembler language code inspection can provide great feedback while doing that localized critical optimization.

There is a general set of rules for software development that I like to follow, which go in this order:
1) Make it work.
2) Make is small.
3) Make it fast.
http://c2.com/cgi/wiki?MakeItWorkMakeItSmallMakeItFast

Or, you can start with linux bash programming, like these twisted program demos:
http://www.mobileread.com/forums/showth ... p?t=172182
Then move on to C:
http://www.mobileread.com/forums/showth ... p?t=175632
Getting fancier:
http://www.mobileread.com/forums/showth ... p?t=176802
http://www.mobileread.com/forums/showth ... p?t=178356
Adding video playback:
http://www.mobileread.com/forums/showth ... p?t=177455
I am playing with the Rift now, so look for that kind of fun stuff over here in the future. :lol:

But really, you can't go wrong starting with C#. It is a powerful and safe environment for a beginner, and it will teach you things you can use later in other programming languages.
Last edited by geekmaster on Thu May 30, 2013 9:54 am, edited 1 time in total.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

if you do decide to start with C#, here is a C# wrapper for the OculusVR SDK:
https://developer.oculusvr.com/forums/v ... f=20&t=786
https://github.com/SiS-Shadowman/RiftDotNet
http://www.file-upload.net/download-753 ... s.zip.html

But personally, I want my codebase to also work on even the lowest-powered embedded processors, so I like to use plain old C more than anything. It would help to start by learning pointers and memory management right from the start, so they do not get glossed over and forever misunderstood if you graduate to C++ at some future time.

I am just suggesting various available options, but you must choose among them yourself, depending on your own personal goals. I just think it is good to learn the foundational basics first, so you understand what is going on a why when you are debugging a larger program in a different language.

Old-school computer programming teaching methods still apply in my mind, and modern methods are there for modern programmers who just want instant "progress" without needing (or wanting) to actually understand how and why the programs they write actually perform their "magic". The downside of modern teaching methods is that when software does not behave as expected, debugging can quickly degenerate into uninformed speculation and magical thinking. It helps a lot to actually KNOW what you are doing at a deep foundational level. Why build a skyscraper of knowledge on the quicksand of misundertanding? Basic foundational knowledge (built upon assembler language, followed by WINAPI) is important before learning high-level languages (for those who have the time to "learn it right the first time") IMHO...

But there is also an alternative viewpoint: "Why should a schoolbus driver know how to rebuild a jet engine?". That is fine if he wants to only be a schoolbus driver and never plans to fly to the moon and back. I have bigger plans...

Why would anybody want to artificially limit their options, their plans and goals, their hopes and dreams and possibilities in life, or their physical and mental tools and resources? It pays to be prepared for anything, hardware or software, to be adaptable, and to be ready to recognize and untilize any opportunity that presents itself to you on your journey through life and love of learning. Be a "renaissance man". Learn it all (starting with the foundations of knowledge and building upward upon that)! The renaissance of VR needs you!
Last edited by geekmaster on Thu May 30, 2013 10:21 am, edited 2 times in total.
Bleppe
Cross Eyed!
Posts: 128
Joined: Wed May 29, 2013 11:25 am

Re: Newb programming question

Post by Bleppe »

You're a wise man geekmaster :D Exactly the kind of advice I was looking for. Thx!
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

Bleppe wrote:You're a wise man geekmaster :D Exactly the kind of advice I was looking for. Thx!
If you want to follow in my footsteps, here is a good place to start:
https://www.grc.com/smgassembly.htm

Then here:
http://www.movsd.com/index.htm
http://win32assembly.programminghorizon ... rials.html

And moving into C:
http://www.zetcode.com/gui/winapi/
http://www.winprog.org/tutorial/
http://sol.gfxile.net/wintut/ch2.html

And IMGUI is useful for gaming applications (though it has religious zealots both for and against):
https://mollyrocket.com/861

And of course, don't forget Charles Petzold (a lot of great old downloadable code there):
http://www.charlespetzold.com/books.html

Ultimately leading into studying the code of our great and powerful Guru of "VR for the common man", John Carmack himself:
http://kotaku.com/5975610/the-exception ... ource-code

Then learn OpenGL, and GLSL...

But NOT necessarily in the above order. No reason to get overwhelmed or bored. Bounce around, and check out things right away like Shadertoy, and lua, and maybe even javascript and HTML5.

A renaissance man has many interests and many hobbies and many areas of interest and research to poke his nose into whenever and wherever his muse leads him. And find an artistic medium too. Personally, I prefer artist's charcoals, though I have many graphics tablets and a large collection of input devices of all sorts... I am also heavy into robotics as well (useful for VR haptic feedback and FPV research and exploration). Just do whatever interests you that advances your learning. Learning new things keeps your brain young and flexible, at any age.

For that matter, there will be disagreeable obstructionists standing in your path whenever you explore uncommon paradigms (new or old). Although difficult, do not let them stand in your way on your path of discovery and personal enlightenment. I love exploring "off the beaten path" where there are still hidden gems of knowledge to be discovered. Even Benoit Mandelbrot was harshly shunned and criticized by his peers when he published his research into fractals, but eventually, he was accepted by them. This will happen to you too as you discover new worlds to explore, even in VR. Fractal exploration in VR is something I am looking forward to, myself.

Let's build up our skillsets and cultivate our personal talents, and let's REALLY make VR become "the thing" this time!

EDIT: Then, when you COULD write your own Unity (from scratch, all by yourself), it is time to USE Unity (why write it when somebody else already did?)... IMHO. Or just take the "easy way" and learn Unity, with NO essential understanding of why it works, how it does its magic, or where its operational boundaries restrict your options, limiting what you are allowed to do within its framework. IMHO, the "easy way" is only for "normal" people...
:D

But above all else, and use this as your main guiding principle, do what you KNOW is right for you, and HAVE FUN! And continue to believe in yourself and your limitless capabilities, no matter what...

EDIT2: The choice of algorithm is much more important than code optimization or choice of programming language, so study things like these too:
http://aggregate.org/MAGIC/
http://graphics.stanford.edu/~seander/bithacks.html
http://www.cs.bell-labs.com/cm/cs/pearls/
http://www.codinghorror.com/blog/2008/0 ... -code.html
http://www.drdobbs.com/parallel/graphic ... /184404919
And a bit deeper down the rabbit hole:
http://courses.csail.mit.edu/6.851/spri ... s/L10.html
User avatar
BloodShed
Two Eyed Hopeful
Posts: 63
Joined: Wed Mar 27, 2013 10:18 am

Re: Newb programming question

Post by BloodShed »

geekmaster wrote:large switch statements were often optimized into jump tables.
Yes.
TheHolyChicken wrote:There's also far too many developers who place far too much importance on trying to optimise code where it's simply not necessary, causing negligible performance difference often at the expense of good, clean code.
Honestly, I have the opposite experience. I've seen far too much sloppy code and poor design/readability in the professional space.

Anyway, I do know what you mean but that's not what I'm suggesting. There are situations where multiple options offer nearly equal complexity and readability (i.e. like choosing between if...else and a switch). Why choose the slower route, even if it's negligible?? Especially when there's a possibility that, as the program grows, the code that seems meaningless today becomes a foundation tomorrow where it is hit millions of times.

More knowledge is always applicable. You don't need to be an optimization nut and waste unnecessary time to make use of it.
TheHolyChicken wrote:I do know it's a code smell crying out to be polymorphic dispatch.
Well, that might depend on how much work needs to be done. I'm a big fan of strong data typing and overloaded methods. I would say that polymorphic dispatch is another example of what I'm talking about. Developers have a lot of options to solve the same problem. That's why it's important to have some understanding of the differences between them.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

BloodShed wrote:Yes. ...
Your avatar name sounds familiar:
http://www.bloodshed.net/devcpp.html
;)
User avatar
BloodShed
Two Eyed Hopeful
Posts: 63
Joined: Wed Mar 27, 2013 10:18 am

Re: Newb programming question

Post by BloodShed »

geekmaster wrote:Your avatar name sounds familiar
:lol: Total coincidence. I forgot about them. I've actually never used Dev-C++. I used to use Borland (and djgcc) back in the day.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: Newb programming question

Post by boone188 »

Let's get one thing straight. There's nothing easy about using a game engine. It takes care of one of the easier parts of creating a game. The difficulty is in making a game fun. The best games made with unreal engine have been made by third parties. It's often foolish to build everything from the ground up.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Newb programming question

Post by geekmaster »

boone188 wrote:Let's get one thing straight. There's nothing easy about using a game engine. It takes care of one of the easier parts of creating a game. The difficulty is in making a game fun. The best games made with unreal engine have been made by third parties. It's often foolish to build everything from the ground up.
The stated goal of the OP was to learn programming, not to make games. The thread title is NOT "Newb game design question" after all...

But before he made that clear, my list of options included going straight to Unity3D, *IF* his goal was just to make games (which it is not, in this case).

He also stated that my list of options was exactly what he was looking for, so your comment seems quite a bit off the mark in this thread about programming (although your comment is certainly correct about game design, which may be relevant to another thread).

One of my listed options for building virtual worlds was a hands-on (in-game) modelling program, of which I listed multiple options (including Cube 2: sauerbrauten), which requires artistic modelling ability more than learning how to use a game engine. This falls on the easy side of game design.

But no matter WHICH set of tools you use, game development still needs other gaming elements such as a plot and goals and artful textures if your goal is a successful indie game, and that needs either a team or a renaissance man. To become just such a renaissance man he needs to learn that from the ground up, and building a game around your own game engine can give you Hutch-like street cred, if you luck out and it goes viral...

But then again, this thread is NOT about game design, but it could lead to that in the long run if he follows my advice.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: Newb programming question

Post by boone188 »

I just want to make it clear that using unity would not be "taking the easy way out". Regardless, most software development is done using managed languages, so learning C# will go a long way.
Post Reply

Return to “Oculus VR”