Sign in to follow this  
Stargorger

Game Programmning Tutorial search: by example(?)

Recommended Posts

Hello hello hello So basically this is a request thread: if it is in the wrong place by all means, move it. Otherwise... I'm trying to learn game programming: I already have (as I've said in my other posts) some *SMALL* experience with C++ (I learned enough to write basic console programs... variable calcs, etc..., but put it aside to pick up later if needed) and am currently learning VB.NET (programming a 2d RPG while doing so), and once I've done that I have a course I will start on 3d programming with DirectX, Windows programming, and C#/C++. So. All of this is simply a means to an end: while I certainly enjoy learning along the way, my ultimate goal is to, soon, start laying the base code for designing a game: a 2-d RPG that I could eventually turn into a 3d RPG, and from there work outwards. Anyway, let me first say.. DO NOT just post to warn me about how long it will take, how hard it will be, etc... I plan for this to me a nearly indefinite study, as I have been looking for a good time-sink hobby for a while. So, suggestions and encouragement are fine, criticism and warnings unwanted. THAT said... is there any site(s) or tutorials/teaching book/etc... that give example pieces of code for accomplishing certain tasks in the game? IE, syntax-examples of how to get the door to load another cell? Most appreciated are ones that actually explain WHY the code works as it does. One of the gripes I'm having with these books and courses in programming is that they tell you WHAT the code does, but not WHY, which is really what I, as an artist, need to know. Thanks in advance

Share this post


Link to post
Share on other sites
I know, for me personally, I wasn't anywhere near ready to build some kind of useful base code until I understood some relatively advanced techniques. Building a 'code base' and then learning new technilogies later on in development and planning on implementing them probably won't turn out well without a full rewrite. I'd suggest making a 'laundry list' of the features you are looking to implement. And by features, I mean technical features, not things like 'Characters should be able to level up, they should also be able to attack'. Those are great things to include, but a true code base would focus more on rendering, scene management, lighting, etc..., rather than 'designer code'.

Once you compile a list of these items, you can easily search them or ask about them online. You had an example of 'how to get the door to load another cell', that's almost more of a design issue. First off, how do you display the cell/door, how do you process player input, how do you play any animations, how do you load a 'cell',... These technical requirements are often online but aren't in the syntax of a full game. Typically you'll find demos displaying the method specifically setup to show off whatever it is being displayed.

What language/API are you planning on building your 2D RPG code base in?

Share this post


Link to post
Share on other sites
Well, I meant along the lines of "what coding syntax do I use for area teleportation".

I'm planning on coding mainly with VB.NET as far as I can, but if that proves unmanageable I will move to either C++ or C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by Stargorger
Well, I meant along the lines of "what coding syntax do I use for area teleportation".

I'm planning on coding mainly with VB.NET as far as I can, but if that proves unmanageable I will move to either C++ or C#.


For any 'feature' you can basically break down the steps. For teleportation in a 2D top-view game:

1) Hide character (possibly play some 'teleport' animation)
2) Move character to new location
3) Show character (possibly play 'reappear' animation)

Now there are variations, if you are going to a brand new area, you'll need to load and display the area before step 2.

I can't find the source but I read a good tutorial online that compared programming to walking into a room in real life. The steps were broken down and resembled something similar to:

1) Reach out
2) Grab door handle
3) Turn handle
4) Push/Pull open door
5) Let go of door
6) Step through

While I program all I constantly think about is 'Ok, what do I need to do next?' Once I realize what I'm doing, I think, 'What am I doing this for? Why do I need to do this?' I finish that and go back to thinking 'Ok, what do I need to do next'. This applies to coding design and technical, although when programming technical items it becomes more difficult if you don't understand the process.

Share this post


Link to post
Share on other sites
Quote:
Original post by Stargorger
Well, I meant along the lines of "what coding syntax do I use for area teleportation".


I really don't think you're going to find anything so specific because the implementation for such a thing is completely dependent on how your engine is structured. You can have a generalized description of a process like what programmermattc provided, but depending on the low-level details those steps might be simple or complicated. Perhaps moving the player is as simple as changing a position. Maybe the player is stored in spatial hierarchy and moving would require removing the player from the tree and then re-inserting him. Maybe your framework has a function to abstract away the move so that you don't have to worry about it...maybe you don't.

Quote:
Original post by Stargorger
I'm planning on coding mainly with VB.NET as far as I can, but if that proves unmanageable I will move to either C++ or C#.


VB.NET should be fine for what you want to accomplish.

Share this post


Link to post
Share on other sites
Alright, not to nit-pick: let's make sure I understand now... ;-)

So basically you guys seem to be saying that, while I can come up with a general layout, there wont be specific tutorials on how to do each thing because it will be based off the way I need/want to set it up myself: I'm assuming that means that I COULD, however, probably look for examples of how others have done these things.

Right?

Share this post


Link to post
Share on other sites
Sure, other approaches can always give you new insight - how to do something, or sometimes how not to do it. There's almost always different methods to achieve what you want. Some are obviously flawed, others are overly complex, yet others are pretty good. Picking a good approach depends a lot on experience, which is gained by simply practicing.

For example, I've built a handful of game frameworks in the past and several more games/prototypes. Because of that, I can now pump out a basic platformer in a few days if I have to. When given the requirements, I can come up with a fair design simply because I know what approaches worked in the past. I usually also saw where they were flawed, so that's where I'll try to come up with improvements. There's no tutorial that can teach you all those subtle things, you'll have to learn as you go.


So, I would suggest to start with some simple games. No groundwork for your future RPG just yet. Instead, you'll be laying a groundwork of experience in your head, which will prove to be far more valuable. It will prepare you for what lies ahead, so you can actually tackle that long-term project of yours. I'm not even talking about learning how to program. There's more things to be learned in game-development, and development in general, that you'll miss if you stick to one project only.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this