• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Savalric

New to programming

9 posts in this topic

I learned how to program in Java my freshman year in high school. However, i didn't continue to learn programming, mainly because I still didn't know what I wanted to do. It's now my freshman year in college (ironic) and I've decided to pick it back up. Right now, i'm reading the tutorials on cprogramming.com and I've gotten the hang of the basics again (cin, cout, strings) and I'm trying to wrap my head around some of these other concepts.

First, what purpose do arrays serve, namely a program with this sort of code:

 

#include <iostream>

using namespace std;
int main()
{
	int x;
    int y;
	int array[8][8];

	for ( x = 0; x < 8; x++ )
	{
		for ( y = 0; y < 8; y++ )
			array[x][y] = x * y;
	}
	cout<<"Array indices:\n";
	for ( x = 0; x < 8; x++ )
	{
		for ( y = 0; y < 8; y++ )
			cout<<"["<<x<<"]["<<y<<"]=" << array[x][y] << " ";
		cout<<"\n";
	}
	cin.get();
}

The final thing that I would ask to you guys is this: what sort of programs should I write for practice? Keep in mind my knowledge is limited as far as syntax goes, but if you guys could give me some ideas, it'd help me practice. Unless theres a topic for that already... So far the only thing I can come up with is a simple choose your own adventure text based game.

0

Share this post


Link to post
Share on other sites

Also, the guide neglected to mention how exactly to make a program into an .exe. So far, i've been using the extension .cpp in Visual Studo 2010 Ultimate, but I'm not sure how to run the source file as an executable.

0

Share this post


Link to post
Share on other sites
what purpose do arrays serve

Arrays allow you to store a large amounts of variables under one name. For example in game programming you could use a two dimensional array to store blocks in a 20 by 20 tile map. Simply use a "for" loop to reference each piece of data with a minimum of code.

in order to make your program into an exe, you need to compile it. Visual studio also has a 'run' and 'debug' button which save and compile before running. Your resulting exe should end up in your bin or debug folder.
0

Share this post


Link to post
Share on other sites

If you are using Visual Studio it is already compiling your code to exe.

Check your project folders for a bin folder, it should be there.

 

Other than that, arrays:

Array are just a "bag" of something. for example lets say this, I want to store the name of 100 students.

 

How would you do it?Create 100 variables?

Ok it works. but what If I want to create 1000 students?

 

As you can see it becomes really troublesome to manage, so you create a array of strings in this case.

 

string array[1000]. 

It basically creates space in memory for 1000 strings.

 

To access a value you use array[index] and it returns the value that is stored there.To Save a value you do the same thing, but instead o array[index] = something.

 

Arrays are one of the most useful features in any program language.

 

In your case, this int array[8][8] creates a double indexed array, that means you have 8 positions and each of those positions has 8 more.

So in total you have 64 positions.

 

One example I can give you is, think of it has you have 8 students and each of those students have 8 grades that you need to store.

So each of those students could be simple array that holds grades right?

You could have 8 arrays, but the same as before what if I want 100 students?

You would create a 100 arrays? Why not use a array?

 

That is pretty much what it means.

A double index array is just a array of arrays. You can have in theory any number of arrays like int test[8][8][8][8] depending on your needs ofcourse.

 

 

As your second question, I learned to code by making programs for things that I needed. I needed to calculate vectors for maths class, so I made simple console program to calculate the vectors for me, and so on. Create Programs that are fun to you and at the same time useful, you will be motivated and ideas are everywhere. That is my major advice for you.

1

Share this post


Link to post
Share on other sites

Thanks guys, you two basically answered everything I needed. I missed the part about indexing values and strings inside of the array, which would make a lot more sense than simply using it as a multiplication chart lol. As for what you said Morphex, I used to make simple programs that would calculate my runescape combat level and max hit in java, but i'm no longer proficient at Java, especially since I only took an intro course.

0

Share this post


Link to post
Share on other sites
You might want to get a good intro book for C++.

The problem I usually find with books and online tutorials is that sure they teach you, but they rarely give you good ideas for practice. They tell you what to make, and then show you how they did it. But then again, I should probably finish all of the tutorials before I start small projects lol I'm only up to command-line arguements. Perhaps I'll come up with another idea by the time I've finished.

0

Share this post


Link to post
Share on other sites
You might want to get a good intro book for C++.

The problem I usually find with books and online tutorials is that sure they teach you, but they rarely give you good ideas for practice. They tell you what to make, and then show you how they did it. But then again, I should probably finish all of the tutorials before I start small projects lol I'm only up to command-line arguements. Perhaps I'll come up with another idea by the time I've finished.

 

Still, a good intro book will teach you a lot of small stuff that you need to know, but might not necessarily get in online tutorials... even things like what the compiler and linker do, how the basic data types work, etc.  You need to learn a lot of little things before you can really put it to use.  This is especially true if you're coming from another language like Java, where some things are inherently very different.

0

Share this post


Link to post
Share on other sites

Programming is beautiful. Keep posting on any doubt to come and we'll feedback to you as soon as we can. 

Now your questions has been answered, there is no much to say but: keep practicing and learning math! 

0

Share this post


Link to post
Share on other sites

For an example, the webstie learncpp.com not only has detailed explanations of stuff and even starts from the very basics of programming, but it has 'tests' with programs for you to write for practice at the end of each lesson. There are other sites like this, too. Since you liked writing the program to calculate your Runescape info, you can also try http://projecteuler.net/ ... it's a site with just a bunch of math-based problems that you can solve with programs. They get harder as they go so that you are kinda forced to learn more about programming as you clear them. You make an account on the site and can keep track of which you have completed and stuff, and there's a forum if you need help or want to see how other people solved it. Plus you can use whatever language you want to do it, so you can do Java or C or whatever.

 

Does your college offer programming courses that you could take as electives? (I'm assuming you're not there to study programming, or else you'd be taking them already) You could try taking those courses for your math requirement or something, or just for fun. Or if you can't take them for some reason, try asking one of the instructors if you could have a copy of the syllabus with descriptions of the lab assignments (or ask a student taking the courses). Then you could try following along with whatever materials you want, learning the concepts in the order they use in the course, and using the labs as your practice.

 

Another thing is to just think of what you know already and what you're able to program now, and then think of a program you could write that seems just a little outside your reach. Like you might need to learn a new concept or use the ones you know in a way you didn't think of before. Then write that program.

0

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  
Followers 0