To The Other Noob Programmers Out There...


Kurupted_Magi

Still Fresh
Joined
Feb 1, 2010
Messages
13
To begin, if this is in the wrong category, I appologise. I am new to all this.

I have seen many people like me posting on these forums lately, looking to learn a language or two, and start presenting their own workings to this thriving community. Many times I see us getting shot down, but there are a lot of great, friendly and helpful people within these forums.

I would like to invite anyone out there that wishes to learn coding with others to PM me and put up a post here saying hello, and we can all help one another learn and even develop some games together. Obviosly there will be conflicts over ideas, but the point of this is learning, and having fun doing so.

To begin, I am Magi.
I have a good understanding of C++ and I am getting the hang of Object Oriented Programming.
I am currently working on a Text-Based RPG.
I would love input and some others to work with.

Thanks all ^^, and please don't be shy about posting - Magi
 
Butterman said:
I am currently working on a Text-Based RPG.

What happened to giving lazy foo a try? :(

I am ^^ That is a lot to absorb though. I was doing great till the fourth tutorial, I got all the bugs worked out, but it still won't freeze the pic that I display, and wait for input. Did it once on my own and once completely copying his exact source, neither works... The main point of this is to find others that would like help, so I can share the little knowledge I have gained, and they can share their's =). I hope to not have to bother random people (such as yourself, Butterman) so much this way ^^
 
Last edited by a moderator:
Hi. I mostly work in C++. I have been working on a basic top down zombie shooter. I know it isn't unique, but I'm using it to gain a better understanding of game programming concepts, like physics, graphics, and design patterns. However, I am swamped with school right now, so I haven't done anything besides documentation recently.
 
Gerix said:
Hi. I mostly work in C++. I have been working on a basic top down zombie shooter. I know it isn't unique, but I'm using it to gain a better understanding of game programming concepts, like physics, graphics, and design patterns. However, I am swamped with school right now, so I haven't done anything besides documentation recently.

Awesome ^^ I am learning SDL, but haven't even BEGUN putting it into a working game. How long have you been working on it?
 
Last edited by a moderator:
I started learning SDL at the beginning of the summer and was working on a megaman clone. I started to foresee too many challenges for my skill level, so I put it on the backburner and started working on the shooter at the end of the summer. I decided to learn some openGL around the same time. I think what I like most about this project is that I almost have something that one could consider a (very stripped-down) game. If I add zombie attacks and collision detection between players, then the framework will be complete.

I know what I do might seem amazing to some (usually the students in the intro classes at my university), but I still feel like a beginner, especially in game programming.
 
Gerix said:
I know what I do might seem amazing to some (usually the students in the intro classes at my university), but I still feel like a beginner, especially in game programming.

Game programming is an art like any other. Even a beginner amazes novices, as their skill is already vastly superior. Where you see algorithms and data structures, the layman sees magic and wonder.
 
Last edited by a moderator:
B-ZaR said:
Gerix said:
I know what I do might seem amazing to some (usually the students in the intro classes at my university), but I still feel like a beginner, especially in game programming.

Game programming is an art like any other. Even a beginner amazes novices, as their skill is already vastly superior. Where you see algorithms and data structures, the layman sees magic and wonder.
LOL. How often have I heard
"Monads? It is actually possible to *create* them on your own?"
or
"No, that algorithm (e.g. qsort) must be cheating. Right? The list isn't actually sorted?"
or
"What, you do't have to be hired by (e.g. VALVE) to use a graphics card? I thought there were licenses on that stuff."

Knowledge is power, for sure, especially in the development world.
 
Last edited by a moderator:
Hi All,

Some might know me from my suggestions in the "I'm a Noob.." thread started earlier. My name is David and I've been attempting to write a game(s) since the GP2X days. When the GP2X came out I knew nothing at all, except for a little C# (which is useless on linux... and no.. Mono is not an alternative :p). I started learning C++ and SDL and did the LazyFoo's tuts and the Jump'n'Run stuff as well, but then I let it all fall by the wayside.

Here I am many moons later trying to pick it all up again. I've been brushing up on some of the simpler stuff, but keep hitting repeated brick walls with regards to the maths involved with making things happen in games. My Object-Oriented knowledge is OK for a beginner, so I'm trying to get in the habbit of OO-Design when I do stuff. It helps a lot, but again the thorn in my side is math.

I am happy to say that after about 4 days (off and on of course ;)) I've managed to get a little movement demo working. Basically there is a blue dot on the screen which represents the player. When you click on the screen the player moves at a pre-defined speed towards that location. Basic right? .... not for me hahaha. It took me ages to wrap my head around 2d Vector Math, movement and speed calculations and getting the whole thing drawn to the screen. It's done now, but it took ages :p

It's an uphill battle, but I'm enjoying it thoroughly. One thing I still struggle with is the structure of the Engine. It's probably a good indication that a whole engine (even if only in 2D) is still a bit out of reach for my skill-level. I'll keep at it though :p

@Gerix: I was thinking of trying to do a top-down zombie shooter too. Might have to change my thinking though :p
 
Math is a bitch. I started coding in my early teens (read: 11) and it was the biggest wall for me. Once I finished highschool that stopped being the bottleneck. Pay attention in maths class guys, it's the only one that matters.

I like this thread. It's like coders anonymous: Hi guys, my name is jack, I've been using code for 10 years now (etc..).

You know what we need. A thread where people can just post programming problems and others can help them. (I swear we used to have one in this forum, if not, I'll start one, or maybe a new one)
 
Butterman said:
Math is a bitch. I started coding in my early teens (read: 11) and it was the biggest wall for me. Once I finished highschool that stopped being the bottleneck. Pay attention in maths class guys, it's the only one that matters.

Damn... about 8 years too late to listen in Maths class. Yes.. it's true.. I'm a 26 year-old that struggles with basic geometry :( Not my finest quality :p
 
Last edited by a moderator:
timbobsteve said:
Damn... about 8 years too late to listen in Maths class. Yes.. it's true.. I'm a 26 year-old that struggles with basic geometry :( Not my finest quality :p

In the same boat, why I'm a web application developer, not a game programmer. Although I could make a mean graphical adventure game with python. Just making a 3D game from scratch is most likely out of my grasp.
 
Last edited by a moderator:
@Timbobsteve

You sound like you are moving much faster than me =) I am getting the hang of OOP, but I am having trouble seeing how you keep all the variables that your character needs active without listing them globally. IE: each individual stat, level, exp, current/max: health, mana and TP, gold, items in inventory... That is the main wall I am bashing my head into. My RPG plays really well and has quite a few features I really like, I just don't know how to redesign it without using global variables.

Also, don't worry about the age vs level of math. I am not grand at math myself and I am 23 (which is extra pathetic in my case as I played violin most of my life and started guitar after, musicians do nothing but math >< )

@Butterman

I would love to have a forum/chat room for all of us. That would be awesome! I am online most of the day, learning as much as I can so I can make my games sooner. ^^
 
Kurupted_Magi said:
[snip] I am getting the hang of OOP, but I am having trouble seeing how you keep all the variables that your character needs active without listing them globally. IE: each individual stat, level, exp, current/max: health, mana and TP, gold, items in inventory... That is the main wall I am bashing my head into.[/snip]

Yeh this can be a major hurdle. In procedural game programming (before OOP) I believe globals were used left-right and centre (just take a look at the Quake 1 source code :p ). It was just the way it was done. It was from this paradigm that OOP was born though and it is a really good way to get out of the habbit of globals. Having said that, it may never be 100% possible to completely let go of globals, especially when it applies to games.

With regards to handling entities etc, it really is a matter of setting a base-class and using some form of structure to reference them all. In my code I have the following:

Code:
std::vector<Entity*> EntityList;
Which I use to hold all my in-world objects. Each object is it's own class (e.g. Player, BadGuy, balloon) but they all use the "Entity" class as a base. That way I can just do things like the following:

Code:
Player* player = new Player();
EntityList.push((Entity*)player);

BadGuy* badguy1 = new BadGuy();
EntityList.push((Entity*)badguy1);

for(int i = 0; i < EntityList.size(); i++) {
    EntityList[i]->Update();
    EntityList[i]->Render();
}

I did think at one point I might add an EntityType to the Entity class, which would allow me to safely cast-backwards to the child-class, but I've not come across the need yet. I'm sure it will occur at some stage, but I'll probably do it as follows:
Code:
enum ENTITY_TYPE { TYPE_PLAYER, TYPE_ENEMY, TYPE_NPC };

class Entity {
    public:
        int GetType() { return ent_type; };
    private:
        int ent_type;   // Set using ent_type = TYPE_XXXX
}

// .... later on ...

if(EntityList[i]->getType() == TYPE_PLAYER)
    // do something Player Specific
    (Player*)EntityList[i]->SomePlayerSpecificFunction();

Like I said, I've yet to find the need as I try to make sure each class can run independent of each other and should never require outside code to call a non-base-class function in order to achieve a result.

I would be interested in finding out if anyone else has ever found the need to cast a base-class pointer to it's child class (e.g. (Player*)Entity1->Something(); )

Sorry to spam the heck out of this thread with code, but it was just something that I am looking at now as I type, so was wondering how other people solve the same problems.

@Butterman
+1 for a sub-forum where we can discuss game programming and code-snippets etc.

EDIT: Changed some of the code so it wasn't fundamentally broken :p No use in providing broken examples.
 
Last edited by a moderator:
I don't ever recast those pointers. I split my entities into tiers.

Object -> Actor -> Digger

All objects need to be drawn. So I list the objects in a vector and draw them.
All actors need to think. So I list the actors in a vector and update them individually.
All diggers need to be told to dig out rock somewhere. So I list diggers in a vector and search through it and call individual functions.

This is especially important in my current project. I've got thousands of objects, but only a very few diggers. The function that decides which digger goes to which marked area of rock is very cpu intensive. So being able to cut out those objects when I'm going through lists is important. This way is also safer.

That said, if you're keeping it simple, there's no problem with casting pointers like that.

Just to put what I'm saying into context:
11vu0bk.png


I wasn't talking about a sub forum, more of just a thread where we can post and help eachothers problems, without the need to make new threads.
 
As people have already stated, you can avoid globals with proper data structures. Also resist the temptation to keep your function parameter lists short by using globals. Everything a function needs that is not a global constant should be passed as a parameter. Use references and pointers to avoid copying. However do not create a "master struct" that contains all your variables. A function should receive as parameters everything it needs and nothing else.

Keep these in mind and you'll rid yourself of global variables in no time :)
 
Don't worry too much about correct practice and crap at the start.

It's much more important to get something done. Don't be a code nazi.
 
Back
Top