Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Mar 2012
Offline Last Active Nov 06 2015 08:51 AM

#5119913 Most Widely Used Programming Language (for games)

Posted by on 29 December 2013 - 04:53 PM


I don't appreciate you putting words in my mouth.

I speak in generalities, not universal truths, and I would hope you'd be attentive enough to notice that. I'm not saying anything about "everyone" I'm saying that there is a definitive trend. Which means there will be exceptions.

I also never said C++ wasn't the best available choice for some applications. I just happen to think that that's a damned shame.



What is this "trend" you speak of?  Do you have data or a study to back up your claims that the majority of C++ developers are inexperienced, closed minded people who dont know any better?  If you want to talk about trends that's fine but you have to provide some proof that there IS a trend.   You have not spoken in anything but personal opinions.  Which is fine, you are entitled to your opinion.  But there is no trend.  Simply by stating that your words represent a general truth or a "trend" about C++ developers is proof that what I said is correct: you believe your own personal opinions and biases to be fact.  They aren't.  This will be my last post on the matter, so enjoy the last word.

#5119847 Most Widely Used Programming Language (for games)

Posted by on 29 December 2013 - 10:12 AM

Why do you presume I was talking about you?

My statement stands: most people who like C++ don't know any better.

There are occasional people who like C++ and do have wide experience, which is fine. Some people also like having hot wax poured on their genitals. To each his own, but don't ask me to participate with a smile on my face ;-)


Your statement does not stand, and is extremely judgemental.  C++ is a great language with many strengths that make it a great choice (and sometimes the best choice) for a wide variety of projects, and there are many great programmers who enjoy using it, some of which I work with every day.  Of course it has weaknesses too, but so does everything man-made.  You can say the reason I like C++ is because I don't know it, and I'd respond by saying the more I learn about C++, the more I do like it.  And no, I don't like having hot wax poured on my genitals tongue.png .



People who like C++ typically are the ones lacking experience in other languages and development paradigms.


Translation: "It is a fact that what I don't like is terrible, and everyone who likes what I don't like is stupid".

#5119310 Most Widely Used Programming Language (for games)

Posted by on 26 December 2013 - 10:04 AM

I'd say that your goals are the most important thing in choosing a language.  Are you trying to get a job in the game industry? Or just make a small game for fun?  Or are you looking to make money?  Is the game going to be 2D or 3D?  If your goal is to land a job at a AAA studio doing game or engine development, then you HAVE TO learn C++.  If you just want to make a game for fun or to make money, pick a higher level language, like C#, Java, or Objective-C.  Performance is only going to matter if you have a very CPU intensive game (such as a first person shooter or any other game with lots of physics calculations).  Most of the work these days in games is done on the GPU, which is irrelevent of language.  If you are making a 2D game, these factors are even less relevent, and you can basically choose any language you want which has a high level 2D graphics library.


Best of luck.


C++ has widespread penetration in the game dev market, but it's also a piece-of-shit nightmare.


Anyone who describes C++ as a "piece-of-shit nightmare" clearly hasn't used C++11.  C++11 is a great language with speed that can only be surpassed by assembly, and freedom and expressiveness on par with Scala. 

#5071491 Pipelining Game Engine Question

Posted by on 20 June 2013 - 10:11 AM

The idea with a pipeline is that the output from one stage is the input for the next stage.  What this means is that if you change the state in state 3, that's ok, because those stage changes are probably requires for stage 4, and stage 1 and 2 will receive those changes on the next frame.  Ideally though, you wouldn't modify state in stage 3 that would be required by stage 1 or 2.  However, if you do, those updates are always only 1 frame away, which is indistinguishable to the end user.

#5071165 How to structure the 'engine' of the game.

Posted by on 19 June 2013 - 10:28 AM

It sounds like you're pretty concerned about your memory usage patterns.  I wouldn't worry about that so much right now.  You're still in your development phase.  Having custom allocators once you understand your usage patterns is very important, but you aren't even close to there yet.  Right now I'd just focus on getting something working.  The real memory eaters in applications aren't gonna be 50 unused bytes in an entity object.  It's going to be your disk assets (textures, models, maps, ect).  An extra 50 bytes per entity isn't going to break the bank (unless of course you have millions of entities, but that's not really a typical use case). 

#5070460 What video game programming language would be best for me?

Posted by on 17 June 2013 - 10:47 AM

Just to add to what warnexus said, you are asking entirely the wrong questions.  If you are ready, as a programmer, to begin learning how to make video games, language is the last concern you will have.  


As for choosing a language: this choice should depend mostly on platform, secondly what you already know, and thirdly based on the features of the language itself.  As an example:  let's say I want to make an iOS game.  I have to use Objective-C, C++, or C because of the platform restrictions.  Next, I am going to pick C++ because I know it best, and because it offers the language features I'm looking for (e.g. different levels of encapsulation, multiple inheritence, templates/generics).   However, let's say in another circumstance, the only thing that matters to me is speed, rather than convenience   In this case, I would pick C.  This is how you select a language.  

#5069532 How to go about making an auction house.

Posted by on 13 June 2013 - 02:55 PM

At the very least, you will need a server that houses a database to store your auctions, as well as user accounts, stats, ect.  You could use this same server for matchmaking  assuming it had the resources available.  

#5068094 Multipass rendering architecture logistics

Posted by on 07 June 2013 - 03:47 PM

Just thinking more about the system you posted, it seems reasonable in theory, the biggest issue I see is that it is limiting in that you can't easily change what types of techniques/passes a shape supports.  Also, all those string look ups every frame are going to kill you, you need to employ some caching, and only do those string lookups when values change.

#5068090 Multipass rendering architecture logistics

Posted by on 07 June 2013 - 03:41 PM

The way I handle this is with the following architecture:


  • Shapes represent actual objects
  • They store vertex buffers
  • Each shape has a string key which is stored which represents the current "technique"


  • Materials are represented using the entity-component model
  • Each component is represented by an Attribute class, (i.e. TextureAttribute, ShadingAttribute, BoneAnimationAttribute)
  • Each material type is represented by a Material subclass which uses multiple inheritence to mixin the attributes that material should have


  • Techniques represent a rendering method (for instance, "Phong Shading".
  • Each technique has an array of Pass objects


  • Represents a single pass of a technique (for instance, if I were rendering a line by rendering first the outline, then the inner line, i would have an "StrokePass" and "FillPass")
  • Maintains a pointer to a shader program, which it will populate with the current render state


  • Stores the current render state, including a world transform stack, current projection transform, current material, lights, ect
  • Passed through to each rendered shape, shape will push its own state, possibly pass that state onto its children.

Each type of technique is instantiated at runtime, and stored in the GraphicsContext with a string key. These techniques are then by the shape when their Draw method is called. We then bind the appropriate vertex buffer, go through each pass of the technique, apply the pass (which essentially sets the shader state), and execute our draw call.

I hope i have done a good job explaining the system and it makes sense. It has worked out well for me so far, though I imagine there will be many improvements I'll make.

#5067731 Light Shader

Posted by on 05 June 2013 - 05:21 PM

First of all I want to mention that it's FPS game.

I don't know how many light I will be having in the scene, it depends on the game mission, but I expect many different lights.

For example: I could have 30-40 light in a scene as well as multiple lights affecting many meshes, rendering each mesh 30-40 times is just a total waste of performance.

Lights are additive, so you loop through all lights in the shader and add the outgoing irradiance values for each light. You should read up on lighting and BRDFs if you are serious about having 30-40 lights in a scene.

On a separate note, if you are serious about trying to build a first person shooter game, you are going about it the completely wrong way. Gamedev.net is a great place to ask questions when you already have some idea of what you want, but if you just come in here and ask for code without really a question, you come off as lazy. Then you come here with every single error you receive for code you didn't write, instead of taking some initiative and trying to figure it out on your own. That is why you have received so many downvotes for this thread. There are many resources for learning how to do proper lighting, and shader programming.

If you are serious about learning graphics programming, I highly recommend this book:

That's just one of many books you will need if you want to be a graphics programmer.

Best of luck, I hope you soon come to realize that this is the absolute wrong way to ask for help.

Edit - On another note, have you asked yourself whether you even want to be doing the graphics yourself? Consider using an engine that already has done the lighting stuff for you.

#5065869 Is the game loop suppose to run when the user is in the main menu?

Posted by on 29 May 2013 - 11:30 AM

The game loop is nothing more than an infinite loop that prevents the application from closing.  However, during the main menu screen, the game loop should be dominated by the UI system.  There may be other systems at work such as the rendering system, or an animation system.  So yes, there is ALWAYS a game loop, it just isn't always doing the same things in each state.

#5065089 Scene graph

Posted by on 26 May 2013 - 05:44 PM

Asking for code is typically a bad approach. People don't want to write your software for you, and besides that ruins all the fun of it :). What you want to do is "instanced drawing". You load the model once into a Vertex Buffer, and then draw the same object over and over using different shader parameters.

#5064664 How to structure a game in OOP

Posted by on 24 May 2013 - 07:45 PM


  • For instance, there is no reason for a sound object to contain a pointer to a physics object. Keep your systems separate and join them using a higher level interface.

Well, this is where it gets tricky for me. The APIs for sound and graphics are different systems. I can encapsulate them in my own classes and simplify the interfaces for my use. But for example there has to be a place in the code where a sound is triggered when the animation passes a point. We are now far down a method in the animation class and we discover that we need to trigger a sound. Where is the pointer to the sound interface when we are in the animation system?

Coupling by having a pointer to the sound system as a member in the animation class?

Having a higher level interface that calls the DoAnimation() method, I need return values in order to call DoSound() afterwards. But I just shuffle the burden up the food chain. Now I have to code a ton of different states that must be passed and returned and bloat the calling code, making it more complex.

The way I handle this is with callbacks. For instance, let's take a Rock object as an example. A Rock object falls to the ground, and when it hits the ground, it should trigger a "thump" sound.


typedef std::function<void()> DelegateFunction; 

class Rock {  
  Sound mSound;  
  Animation mFallAnimation;    
    DelegateFunction delegate = std::bind(&Rock::FallAnimationEnded, *this);     

  void FallAnimationEnded()  

class Animation
  std::vector<DelegateFunction> mDelegates;  
  void AddDelegate(DelegateFunction func) { mDelegates.push_back(func); }  

  void Start(); // Begins a timer, or adds it to an animation manager, however you want to do this.  

  void Update() // Called every animation update  
    } else {     
      for(int i = 0; i < mDelegates.size(); i++) {         



So as you can see, we have no coupling between our Sound system or Animation system. The Rock is created, it will attach its FallAnimationEnded member function to the animation's delegate list, and when the animation is done, it will call all registered delegates. Obviously this code is far from complete and I'm not even sure if all my syntax is correct, but the idea should be clear.

#5060337 Another X vs. Y thread: Java + GWT vs. JavaScript

Posted by on 08 May 2013 - 09:57 AM

Learn JavaScript.  It's a pretty easy language to learn because it has loose typing, and it is the "native" browser langauge.  I've used GWT and found it to be cumbersome and annoying.  Do things the right way.  Also, if you do it in JavaScript, it will be supported in mobile browsers.

#5054922 How may vertices are typically on show?

Posted by on 19 April 2013 - 08:37 AM

Could be thousands, could be milions.  Depends on the game and the graphics settings of the user.