Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Telastyn

Member Since 13 Oct 2003
Offline Last Active Aug 01 2014 04:34 PM

#5072014 How exactly are video games made?

Posted by Telastyn on 22 June 2013 - 07:43 AM


Can I ask, though, why has nobody mentioned Direct X? To my knowledge, that's a very big one, unless I've missed something.

 

In general, Direct X (or OpenGL) is more low level than people need to accomplish their goals. It's there, you can use it, but for the majority of games (and all For Beginner's first games), SDL and SFML will do what you need with 80% less headache.




#5072013 Basic Concepts of Programming

Posted by Telastyn on 22 June 2013 - 07:37 AM


Can anyone please relate to me and see why I'm struggling?

 

I can't really. I mean I never really encountered these problems, but let me see if I can explain my understanding.

 

1. Computers are "computation machines". Thus all of the things they do boil down to math. Do you know what a function is? Do you know how to generate functions to solve word problems? Do you know how to combine functions to achieve more complex results? That is all programming is, and all computers do when you boil it down.

 

2. All these things are tools you use to solve problems. Why would you return void? Because your problem doesn't require a result. Many things are like this. The tutorial can't say when you would use them because they don't know the problems you face.

 

Now on to the specifics:

 


"If I return 0 in another function, what would happen? Why would it cause an error?"

 

If you return 0 in another function, the caller would get 0 as a result. It would only be an error if you were really supposed to get 1 or 42 or whatever as a result. And even then your program would run, just incorrectly.

 


They say this differs from traditional programming methods but I have no idea what traditional methods were and how different they were.

 

Traditionally, programs were very function oriented. They said "do this, then do that, if x=y then this other thing". Object oriented programs are designed more like "make a dog and a cat. make the dog chase the cat". Instead of focusing on the operations/recipe to do something, it focuses on modeling the parts of the problem as objects.

 


I don't know the difference between my "code" and the "data".

 

Data is variables.

Code is operations performed on variables.

 


I know that it's more effective to use a single instead of a double when you're working with a smaller number, but why?

 

That's the thing, it isn't always true. singles are 4 bytes (in most languages) doubles are 8 bytes (in most languages). So if you don't need the range (larger min/max values) or precision (more decimal point accuracy) of a double then you can use 4 less bytes to store that variable. Since you have less bytes to work with, operations should be faster too.

 

Unfortunately, on some machines, working with 8 bytes at a time "fits" better with how the processor works, so is actually faster.

 

That said, the performance difference is negligible and saving 4 bytes here and there is also usually meaningless these days.




#5070659 How do I implement a new rendering engine?

Posted by Telastyn on 17 June 2013 - 08:16 PM

Your modeling app is only rendering that model, and it's doing it in not real time. Rendering engines need to render a bunch of models at high frame rates, all while doing all of the other logic involved in games.

Frankly, the odds of your game making any profit are nil. Just use cryengine.


#5064823 Optimizing code statements into expressions?

Posted by Telastyn on 25 May 2013 - 01:10 PM

There is no design flaw.

 

How naive...

 

You know enough to say that there will always be boxing/unboxing in non-trivial code but fail to realize that any non-trivial code will have design flaws or at the very least, sub-optimal design trade-offs.

 

Of all the possible performance improvements in C#, boxing is like 10th in modern codebases. Have you curtailed your allocations? Have you chosen the right collections/algorithms? Have you pre-allocated your collections? Have you looked into pre-JITing to your target platform? Have you looked to parallelize/memoize your common algorithms?

 

Have you actually compiled in release mode and benchmarked the differences?

 

Look OP: you may be right, but understand that we see literally hundreds of people coming in here complaining of performance issues or claiming they NEED to do these things that the best of the best universally see as frivolous. We're just playing the odds that you're not the sub-one percent that really do need to do these things...




#5059981 Alternatives to singletons for data manager?

Posted by Telastyn on 07 May 2013 - 05:25 AM

2. If you are the only coder on the project, do not over-engineer for the sake of some higher principle / book / pattern / <insert random bullsh*t reason>. Refactor, so that you, as a coder, have to spend minimum (preferably zero) time on that class you wrote 18 months ago.

 

3. Prefer "Ugly" code [that works] to a "Beautiful" code that hides/obfuscates dependencies [and suddenly stops working].

 

There's a reason that good programmers advocate the use of 'best practices', it's because worse practices cause actual, real life problems. KISS, and YAGNI matter of course, but "just slap it together" cannot be universally employed to produce quality software. Refactoring is important, but cannot be your only route to good design.

 

There needs to be a balance, and doing some simple things like not using singletons in your design will make the code significantly better and save you time - regardless of how many developers are on the project.




#5046833 Is it bad to use an IDE when you're just starting out with programming in...

Posted by Telastyn on 26 March 2013 - 05:47 AM

I feel it is garbage. An IDE in modern programming is nearly as influential as the language itself. Why spend so much time fighting your non-IDE? I find it hard to believe you learn better/faster with so much overhead.


#5036871 Programming languages characteristics and behaviors

Posted by Telastyn on 26 February 2013 - 04:17 PM

Any language that has has the ability to execute an arbitrary string as code needs to have an interpreter, and those are the languages that use interpreters as the primary launch point.

You can always ship a compiler and linker with your software, and exec() can invoke the compiler and linker, and load the resulting executable into the current process image...

 

It's not pretty, but it's been done more than a few times, and I wouldn't really call it an "interpreter".

Quoting for emphasis. .NET has one as part of the standard install (though you need elevated privledges to use it of course). Wrapping that into a simple exec()call is dead simple.

 

The categorization between compiled and interpreted isn't nearly as useful as it was 15 years ago.




#5035991 Can I use reflection to do this?

Posted by Telastyn on 23 February 2013 - 09:42 PM

Sure, but providing an indexer (or simple method) to make the textures look like an array would probably be clearer and faster.


#5035373 Javascript Closures vs. Prototyped Objects

Posted by Telastyn on 22 February 2013 - 06:24 AM

Not exactly. The outer scope only lets you use things as constants if those things are actually constant. If the other scope's variables change, then the closure will see them change.

This is what I meant about closing over _variables_ rather than values or references.


#5034279 Javascript Closures vs. Prototyped Objects

Posted by Telastyn on 19 February 2013 - 03:17 PM

In practical usage, though, it looks like you end up making a thing that has data members and functions that interact with those data members.

 

This is not exactly correct, at least not in most languages. The thing you make refers to the same variables as are being closed over; not just the same data or the same references. You're not actually making any new data members. Closures can be made to look like objects (and vice versa due to computational equivalence) but are different beasts. This is more important in a language like C# where concurrency can cause weird (and/or awesome) effects with closures. Javascript does not have that concern.




#5034149 C# Reference Types

Posted by Telastyn on 19 February 2013 - 07:41 AM

They are a reference type, a reference to the (shared) value - not a reference to the variable.




#5029163 getting better at c++

Posted by Telastyn on 05 February 2013 - 03:04 PM

Tutorials and videos don't make you a better programmer - programming does.




#5020149 Lines of Coding Per Day

Posted by Telastyn on 10 January 2013 - 10:07 PM

Obligatory link: http://folklore.org/StoryView.py?story=Negative_2000_Lines_Of_Code.txt
Code complete (iirc) has that study, though I remember it being 10 lines of code per day, per dev, on average.

In general, I can implement one straightforward feature with tests and documentation and team communication (meetings) in 4 hours. A mildly complex feature takes about a day.


#5017335 Programming progression

Posted by Telastyn on 03 January 2013 - 08:23 PM

I would like some core themes to follow as I learn programming.

 

Write programs. There are many soft skills in the craft of making programs that you can only grasp by making programs and learning from your errors (and successes).




#5016085 Best language to start programming?

Posted by Telastyn on 31 December 2012 - 09:52 AM

If you know Java and Gamemaker, then use Java and/or Gamemaker. There's nothing that would prevent you from getting to your end result using them but you.






PARTNERS