Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Feb 2011
Offline Last Active Aug 31 2014 11:47 AM

#5171005 How do I advance my C# Programming Skills

Posted by on 01 August 2014 - 06:18 PM

The way I see it, there are 3 stages to learning how to program:


1) Learning general programming concepts. Object oriented programming, functional programming, algorithms, the theory behind computers etc. This is important because its just as important to formulate your ideas correctly as it is to form the words in your chosen language. This is the real meat of programming. This is the stuff that remains the same regardless of programming language, and reduces programming languages into just a set of tools.


2) Learn the syntax. You'll need to do this for every language you learn. Learning syntax is the easiest part of programming and also the least valuable.


3) Practice. Do this every spare moment you have for the rest of your life.


It sounds like you've been following "tutorials" and other online resources. Unfortunately they are quite notorious for only teaching #2, skimming over #1 and barely mentioning #3.


I would recommend stepping back a bit from learning "C#" and focus a bit more on learning the general concepts and then move onto the practice. I remember being in a similar situation to you where I was stuck and wondering how I could go from depending on other programmer's to writing my own code without copying anyone. In hindsight, I would say my problem back then was essentially that I didn't have the foundation that allowed me to quickly and easily decompose problems I cared about into the set of tools a programming language provides.


I learned my foundation through a computer science degree, which is probably one of the best options. If that doesn't work for you - then maybe some of the other members can recommend some excellent books on the topic. What I recall from my textbooks was that they were horrible - so I won't bother recommending them. "The Art of Computer Programming" by Donald E. Knuth is a classic, but you might want something that guides you along a little more. Generally you can try searching Amazon for programming books - look at the ones that are more focused on the design of programs and concepts such as object oriented programming then teaching you a particular language.

#5156818 What do you do when you need an idea?

Posted by on 29 May 2014 - 02:52 PM

Public transport! Hop on a bus for an hour or two. Change of scenery plus being trapped in a bus without many distractions is great for thinking.

#5156817 Good game design software?

Posted by on 29 May 2014 - 02:50 PM

I personally quite enjoy One Note for design purposes. Its less rigid than Word or Excel in terms of layout. When I'm designing, I'm not necessarily interested in making a document I can present with, I just want someplace to scribble my notes and the occasional doodle.


Excel and Word are great when you're creating more formal specifications.

#5156816 Game coding complete (Java)

Posted by on 29 May 2014 - 02:45 PM

Personally I would say its better not to know the language that a book presents its examples in. The temptation to cheat and simply read the examples and convince yourself that you understand it is too great.


Much better to learn the content, and try to implement it in a different language and have the provided examples as a guide but not a complete give away.

#5151361 How much time do you need to finish a beginners book?

Posted by on 04 May 2014 - 01:24 AM

As a comparison a university course takes 4 months and on average covers half the content in a text book.

I'm not saying that's a good or bad pace, just that it is a common pace.

It all depends on the density and complexity of information in your particular book of course. C++ is also such a big topic that no single or even a dozen books could contain everything you need to know.

Learning to program is a life long commitment. It also requires an endless amount of practice. Never stop practicing.

Edit: Don't restrict yourself to examples from books. Experiment. Don't code because you feel you have to write x lines of code to get to the next stage. Consider what matters to you and write code for that. My coding practices tends to be silly little utilities that solve random tasks for me.

#5042498 Paying to enter a shop?

Posted by on 12 March 2013 - 05:01 PM

A tax to get into the City where the best and wealthiest merchants are as opposed to the Towns where its free to enter but the selection is smaller and worse.

#5042496 political correctness and captured prisoners in rpg

Posted by on 12 March 2013 - 04:56 PM

I think in regards to the sexual assault/sex or whatever else... There should simply be a list of actions which can include a generic "Have sex". Whether the other character consents to the act is a different matter. If for example that option is used on a regular tribes woman - she might decline, and the player can try again after buying presents or doing something else to increase the "Persuasion". The same mechanic could apply to anything really - Take item, Follow me, Do a barrel roll etc. Its all dependant on how much your character is capable of persuading the NPC. 


If you implemented actions which can affect the "Persuasion" value such as: Beat up, Threaten, Compliment, Restrain.. You could indirectly allow for actions like rape, theft etc. A character refuses to give up their prized knife? Beat them repeatedly to drive up the Persuasion value until they give it up.


In the case of prisoners/slaves - their Persuasion is probably so high from being attacked/captured that when you order them to do something - they won't object... And if they do - that can be corrected through a very general set of actions which don't touch on ethically sensitive issues as much.


Also opens up the possibility of treating your prisoners nicely so they don't run away? 

#5042450 Confused on Big Oh

Posted by on 12 March 2013 - 03:22 PM

Edit: Ahh. Posts happened while I was typing that also explain it quite well... But I hope my post can offer some additional clarification if needed


Easiest way to understand Big O notation in my opinion is as follows:


Big O notation is defining the upper bounds of the growth of a function.(Note: this isn't the actual definition but it suffices to explain the first few steps. I'll expand onto the actual definition below).


So to find the Big O of a function f(x) = 2x^3 - x + 5


We begin by first considering the "upper bounds" part of the definition. Essentially if we plotted this function on a graph - we want a similar function which will act as the upper bounds so we're just looking at functions which are greater than or equal to our original function. Or in other words we're looking for f(x) <= g(x) where g(x) is the function that acts as our upper bound. The rest is essentially simplification.


I generally begin by turning all the negative/subtraction signs into positive/addition as follows:


2x^3 - x + 5 <= 2x^3 + x + 5


The next step is to consider how this function will grow for some large value of x. Immediately we can see that x^3 will dominate the growth of our function, the x + 5 portion will become insignificant over time so we'll progress further with our simplification:


2x^3 - x + 5 <= 2x^3 + x + 5 <= 2x^3 + x^3 + 5x^3


All we did was just add a x^3 to every statement. Its seems pretty arbitrary but it follows the requirements of the definition above. If we had an x^5, then we'd have used x^5 instead or really whatever part of the function would dominate its growth.


Now finally - we can simplify using basic addition


2x^3 - x + 5 <= 2x^3 + x + 5 <= 2x^3 + x^3 + 5x^3 <= 8x^3


Finally, we can drop even the 8 and simply right that our function is O(x^3). And this is generally sufficient for a quick analysis - your math teachers generally want the rest as well.


As you can probably tell - x^3 does not actually define the upper bounds to our function (because we dropped the 8) but it does provide enough information for a quick comparison of the algorithm so it worked for our partial solution. This is where we consider the actual definition - I could use all the fancy math symbols but they're a pain to write and not that easy to understand anyways so I'll explain in english.


Essentially we have two functions, f(x), and g(x) both from positive numbers to positive numbers. We can get the big O of f(x) which is written as: f(x) is O(g(x)) if there are two constants C and k such that:


f(x) <= C*g(x) whenever x > k


We actually already derived part of this with our previous work since we had f(x) <= 8x^3. C = 8 in this case.


The second part is essentially referring to the statement I made earlier "some large value of x" just before I did the second simplification. We need to define what this "some large value of x" is and we can often just get away with a bit of trial and error.


If k = 1, then x can be any value greater than 1. So we can begin by considering the case of x = 2.

2x^3 - x + 5 <= 8x^3

2(2)^3 - 2 + 5 <= 8(2)^3

16 - 2 + 5 <= 64

37 <= 64


In this case it worked on the first try. As an example of alternate values of C and k, try C = 2, and k = 5. Often times you have to play around with the value of k to make it work. In fact - often times you have to play around with both C and k to make f(x) <= O(g(x)) work. I know my teacher often gave us problems where he provided g(x), but asked us to find values for C and k. 


The following is generally what my professors accepted as sufficient for a proof:

2x^3 - x + 5 <= 2x^3 + x + 5 <= 2x^3 + x^3 + 5x^3 <= 8x^3

O(x^3) where C = 8, and k = 1.

Your profs may want more or less and they might try to trip you up with things like fractions.


PS - in case you're wondering about the value of the C and k values and why we don't just immediately look at the function and say "Great. It's O(x^3), now lets get on with our lives". Its because k is essentially your input size. It allows you to make comparisons of two functions f(x) and z(x) which detail the search performance of a theoretical data structure: f(x) is O(n), but k is 1 million, versus z(x) is O(n^2) but k is 1. We will have less than 100 values stored in this data structure. If we considered only the big O part - f(x) is the clear winner - but in practice z(x) would be the better choice for our application.

#4958538 lately my creative juices have died! ;((( need some help!

Posted by on 12 July 2012 - 02:27 PM

I like to take a long bus ride across the city. Its a couple hours without any of the regular distractions and it allows my mind to really wander. By the time I get back home I'm itching to get to work.

#4948954 [C#] Game Saving Problems, Files are too large

Posted by on 13 June 2012 - 04:29 PM

If your areas are randomly generated... Depending on how you generate them - couldn't you just store the initial seed and any persistent changes as a result of game play?

#4948888 Cannot start batch process with C#

Posted by on 13 June 2012 - 01:21 PM

Have you tried running your application as administrator?

#4947408 I need some goals for this summer

Posted by on 08 June 2012 - 10:27 AM

I can't say I've ever found any good articles or books that spend any significant amount of time covering code organization (in games anyways).

What I'd suggest is try looking at some large open source projects and see how they've structured their code. While the code itself might not make much sense, the overall structure is usually quite easy to understand. I think one of the Quake engines were open sourced? Ogre would be another good one.

#4947170 I need some goals for this summer

Posted by on 07 June 2012 - 02:02 PM

I'm going to answer your questions in reverse order...


I'm only 16. Is it unreasonable for me to start a huge project at this time, or should I just spend the rest of my teen years learning? It seems like everyone does their dream project in college, not high school.

I think the biggest problem that people encounter when they take on large projects beyond their experience/ability is you'll make some bad design decisions at some point, and you won't have the experience to spot them early on. Then sometime after that you'll start running into road blocks where your code is just getting messier and messier and you're having to code all sorts of work around's, abusing goto statements or whatever "cheats" your language of choice provides. At that point object oriented design (or functional, or whatever other approach you were using) is just another obstacle now. Suddenly things will stop behaving or they work 99% of the time but everything breaks that 1% of the time and nothing seems to make sense and when you start digging into it... You end up realizing that you have to redo everything and then you get discouraged and your project dies without having achieved anything.

At least that's my personal experience :P

Note: Just to clarify - Nothing against goto's and other "cheats" just - they should never be used to dig yourself out of a hole.


Is it bad to have a goal like this? It seems like everyone else fails when they try to make a complex dream project by themselves instead of making simpler games. Then again, most of these people have no idea how hard it is to coordinate a project like this-- I do.

Its always good to dream big as long as you keep the resource and time commitment requirement in mind. And don't forget - we're always biased one way or another towards our own abilities.


Is it too soon to begin my "dream project" after having only 1 year of C++ practice and a half year of SFML/SDL practice? What is a reasonable goal to begin my project? (remember, GOAL not deadline)

I'd say its never too soon to begin your dream project as long as you accept that there will be a lot of detours along the way. No one ever enters any project with all the knowledge they'll need to finish it, they will always have to stop and learn something along the way. With your experience - you might have to make a lot of detours to learn various things.


Should I immediately begin to learn networking ASAP? Or should I focus more on making more complex graphical single-player games first, even though that's not my goal.

I'd suggest that you should write down a basic design document for your dream project. Figure out the overall requirements don't worry about any specific details just yet. Then work on simple projects which share just one of those requirements. You can't avoid the experience requirement for big projects but working on silly little projects which you don't care about can be pretty discouraging - so try to focus your time on smaller projects which you can see clear benefits towards your dream project.

#4946515 Laptop game developers... minimum requirements?

Posted by on 05 June 2012 - 11:20 AM

Get something with an AMD APU. You won't approach the levels of performance that you might get with proper dedicated cards, but you'll have slightly above average performance, all the new DX11 features, and decent battery life. You'll be much better off than with the Intel Integrated graphics.

#4942987 Need some advice on Game Engines

Posted by on 24 May 2012 - 01:31 PM

Don't give up... But its important to have realistic expectations.

The language you use is going to be among the least important decisions you'll make in the process of making the game. Pick any major programming language and just start programming random projects. In a few years you should have a more realistic idea of what will and won't work and then you can proceed from there.