Making basic games yourself with C++

Started by
24 comments, last by dimescion 10 years, 1 month ago

I envision a randomly generated world with "blocks" or areas that connect to the other blocks touching them in up to ten directions. The regular eight (north, south, southwest etc.) plus up and down. I forgot about up and down in my first post. I want to know how difficult it would be to program in region-specific areas such as i dunno, making it more likely to encounter something like dwarves around mountains. How hard would that be? How hard would my second question be? I know these will be more difficult depending on the amount of variations and such but will it be exponentially more difficult depending on the amount of variables and specific tasks involved? Maybe I am starting too fast, but at least I'll have fun crashing and burning ;)

There's no answer to this. How can someone tell you how can be hard for you do something? By the way, if you are asking, I doubt you have a clear idea of what you are talking of in terms of programming. Am I wrong?

Start coding, it's simply pointless ask "how is hard?", since there is never a single way to do things.

Start coding, and if you reach a point of "oh no I can't go on!" come back some steps, and think how to reduce the complexity, or ask for that (this would be a much better question).

Advertisement

Maybe I was asking too much. I should've understood with C++ there'd be multiple different ways of doing the same thing. *sigh* I'll just deal with it when I come to it. Sorry for wasting your time, and thanks for answering. It'll be interesting to see just how powerful C++ is.

Maybe I was asking too much. I should've understood with C++ there'd be multiple different ways of doing the same thing. *sigh* I'll just deal with it when I come to it. Sorry for wasting your time, and thanks for answering. It'll be interesting to see just how powerful C++ is.


Yeah, c++ is powerful. I'm learning it (newbie), it's not that hardd (for me) but it's quite complicated (symbolic language). When you do start learning, buy books and download pdf's (you're gonna need'em) and if you have problems, you can ask in the beginners cplusplus forum.
Can't wait to make my tic-tac-toe. (console first)

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy


Yeah, c++ is powerful. I'm learning it (newbie), it's not that hardd (for me) but it's quite complicated (symbolic language). When you do start learning, buy books and download pdf's (you're gonna need'em) and if you have problems, you can ask in the beginners cplusplus forum.
Can't wait to make my tic-tac-toe. (console first)

Thanks, I'm already learning it and so far it's pretty fascinating.

Yeah, c++ is powerful. I'm learning it (newbie), it's not that hardd (for me) but it's quite complicated (symbolic language). When you do start learning, buy books and download pdf's (you're gonna need'em) and if you have problems, you can ask in the beginners cplusplus forum.
Can't wait to make my tic-tac-toe. (console first)

Thanks, I'm already learning it and so far it's pretty fascinating.
Good. Should you get stuck in the book you are using, you could try any these pdf's/books (i don't have the books) include:
  • Programming: Principles and practice using c++ ( beginner tutorial by the c++ creator ... so it's kinda important)
  • Cplusplus tutorial pdf (from the cplusplus website)
  • Tutorialspoint c++ pdf
  • C++ programming language 4th edition (not for beginners)
  • C++ 4th edition pdf exercises
Happy downloading/buyingbiggrin.png

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

I am truly amazed at all the poorly worded and bad advice given. Yes, C++ is a complex language to learn as a first language, but it is still possible. You don't have to blow money on books to learn the language. There are cplusplus.com, cprogramming.com, tutorialspoint.com, and learncpp.com for decent tutorials to learn from. If you chose a different language like Python or Ruby, there are some good tutorials for them to like codecademy.com for example. Yes, books are more detailed and thought out, well supposed to be, but we know there are some books that are major don'ts for learning C++.

Let me say this, what you want to do is doable after learning C++ from one of the above sites, a month or two at the most if you are really dedicated. A little longer if you end up learning more. The next paragraph is for if you decide to do an RPG with graphics.

Start with the basic, simple games to build your skills and experience before tackling a graphical RPG. Learn C++, as mentioned, and then make the list of games in this article, http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976 as it has a great list to make and very logical reasoning to it. While you are making those games and learning you can be playing with aspects of the RPG to get it working. It is always better to have a few games under your belt before tackling an RPG. Don't get me wrong, it is possible to do an RPG first, but keep in mind that it will be a challenge (which is good and bad because challenges can push you to learn more, but could be bad as some find them reason to back out of something they want to do).

I hope this is helpful to you dimescion and hope you achieve everything you are wanting to get done in your RPG idea.


I envision a randomly generated world with "blocks" or areas that connect to the other blocks touching them in up to ten directions. The regular eight (north, south, southwest etc.) plus up and down. I forgot about up and down in my first post. I want to know how difficult it would be to program in region-specific areas such as i dunno, making it more likely to encounter something like dwarves around mountains. How hard would that be? How hard would my second question be? I know these will be more difficult depending on the amount of variations and such but will it be exponentially more difficult depending on the amount of variables and specific tasks involved? Maybe I am starting too fast, but at least I'll have fun crashing and burning ;)

Programming is not about crash and burn. It is more about tapping that neuron in your brain that has not been activated. Once you start to "get it", that neuron just got fired up. It is a pleasant experience. If you are using words to describe the game scene and no graphics, it is doable with really basic programming concepts. Nothing to worry about there. Anything that involves randomness usually involves a seed generator or a random number generator or something similar. C++ and Java has a feature for that.

Don't worry about how difficult it is. It will be difficult since you are starting out and learning. Every day is less difficult.

I'm sorry for... wait these are just from three days ago!!! Jeez, you all had me worrying I missed something for weeks!

Anyway, thanks BHXSpecter, I dunno if I can do it, but if it's not a challenge it won't hold my interest. I'll definitely hack away at it though.

Also, Thanks Warnexus, I knew I had seen your name before. If I hadn't looked it up I wouldn't have seen the last few posts here. I think I know what you're talking about with the neuron thing. Most especially thanks for the encouragement, it always helps.

Programming a text game is not the simplest game. The reason text games were the first RPGs is because graphics were too expensive and complicated to program for every machine. If you want a simple game to generate a “world” with points of interest, you could create a tiled map of generated terrain and render only a section of that “world” around the player. Each tile could be super simple (even ASCII characters) but could represent the player’s world. Certain icons could represent towns, forests, caves, etc…. When you “enter” a special region like a cave, this could load/generate a new map using similar icon graphics (or ASCII text) for the player to navigate through. This type of graphical representation allows the player to “see” the world around him and not just the location he is in while keeping the programming simple enough for a novice to do.

The big question is: how much programming experience do you have? My first program was in BASIC. It was a bouncing ball (circle). I then became interested in texters and found a magazine with an example text game (early ‘80s). I wrote it as specified in the article and quickly decided that saying “you are in the forest” for 10 tiles was retarded! That’s when I decided to use text graphics to represent each section of “the forest”.

Certainly, you could have a text description of each tile so when the player reaches a tile he doesn’t recognize, the words “this is a dank cave” will surely give him the impression that it’s a cave.

A note on description: If you are going to randomly generate a map, you will need to keep descriptions simple and consistent. You don’t want to have two cities with the same name.

It would likely be worth your while to look at examples of old games like Zork or Rogue. You may even find example code for them, though not likely a C++ version. Even so, you should be able to glean some insight into how they were made.

The biggest problem is (usually) not the language. Its the data structures, algorithms, data flow and and code organization/structure. But the language can often "get in the way", and I would advise against C++, as what you want isn't that resource/speed intensive and you won't be doing anything exotic like accessing hardware. You would be better off served by using Python, Java, or even C#. C++ also has no standard GUI library, Java and C# do. I think Python is still bundled with Tk which should be enough for your purposes

]I envision a randomly generated world with "blocks" or areas that connect to the other blocks touching them in up to ten directions. The regular eight (north, south, southwest etc.) plus up and down. I forgot about up and down in my first post. I want to know how difficult it would be to program in region-specific areas such as i dunno, making it more likely to encounter something like dwarves around mountains

"Blocks" screams to me "graph", which is a fairly complicated data structure. But you might want to simplify things and just go with a 3D or even 2D grid to start - in C++ this should mean using std::vector As for the "finding dwaves around mountains", well thats a specific behavior that you have to program in, or generate some type of rule system for that your program reads in, but first I would start with explicit programming the rules. E.g., each tile has a terrain type, some type of system that will generate a random encounter (on player move in the tile? real time elapsed since last encounter?), and then if an encounter is generated, depending on, among other factors, the terrain type, there would % chance of encountering each type of critter you want.

This topic is closed to new replies.

Advertisement