Jump to content

  • Log In with Google      Sign In   
  • Create Account


First Game Help Ideas


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Ares1989   Members   -  Reputation: 137

Like
0Likes
Like

Posted 10 March 2013 - 02:34 PM

Hi, I'm new here and also new to programming. I've spent a couple weeks getting familiar with the basics of C++ to start planning what I would need for my own first game to use as personal learning experience. I am planning to create a game similar to Frank Hunter's American Civil War game called American Civil War: From Sumter to Appomattox. If anyone is familiar with the title, can you give me coding pointers for battle results, movement and the like? Any help here would be greatly appreciated. Remember, I'm working with C++.

 

If you aren't familiar with the title, it is a civil war turn-based strategy game operated on a hex-map. The player issues orders to armies (Set up as an HQ), corps, or divisions as well as oceanic or riverine fleets. The player also can create units, assign the commanders, set up weapon supplies, recruitment levels, etc. This has been a favorite game of mine from a young age and was the initial inspiration to get started in programming, so I felt being able to create a similar yet different game would be an appropriate first for my experience build.

 

If anyone wants to help but needs to get familiar with the title, it is freeware so a google search of the title will bring up multiple results for downloading the title if you need to play it a little to get some coding ideas.

 

Note: I am not planning on starting the project soon; I know I need more work on the text-base program level before I move up but I am getting there, so planning is in order and thought I'd appeal for thoughts, pointers and maybe even some guidance.



Sponsor:

#2 powly k   Members   -  Reputation: 649

Like
3Likes
Like

Posted 10 March 2013 - 05:39 PM

About the whole idea: It does sound big, but also you seem to be going nice and slowly about this, so it just might work.

 

You'll want to have a nice class setup thought out before writing anything - a tile might have its own class, and so could troops, objectives, collectible things or buildings. Depending on what you want to do with them. It's also a good idea to consider how many of each thing you need and how it's bounded - dynamic allocations can be hard to manage and are surprisingly rarely absolutely necessary, just keeping large enough arrays cuts it most of the time. Especially with this kind of a game - if your player would have thousands of units, a single turn would become a very long and possibly tedious task to complete. Lots of things will be like this - you can go with the "proper" approach or with whatever works - someone put this nicely into words; "you can either write good code or good programs". Usually getting the thing done is more important.

 

Another a big thing to consider is interaction; graphics, audio, inputs. There are tons of ways to handle it, some fitting and some less fitting. As you're probably going for some sort-of-isometric 2D projection instead of 3D graphics, I'd recommend looking into things like allegro, SDL and SFML - they handle pretty much everything you need, aren't too hard to grasp and are widely used so getting help won't be a huge problem. They're also cross-platform, if that happens to be your thing. As a small disclaimer, I've only used SDL out of those three. But from what I hear, SFML does things "the C++ way" and is very modern with its approaches to things so it might be the first one you should try when learning how to do things.

 

Good luck - though it's not as necessary as determination.



#3 minibutmany   Members   -  Reputation: 1582

Like
0Likes
Like

Posted 10 March 2013 - 06:43 PM

you can either write good code or good programs

 

Good stuff.

If it works, don't fix it.

Remember that, and you will finish your projects faster.


Stay gold, Pony Boy.

#4 Ares1989   Members   -  Reputation: 137

Like
1Likes
Like

Posted 10 March 2013 - 10:09 PM

@ Powly k Thanks. That actually answers my question of api on the gpwiki as I am assuming you're referring to the Allegro, SDL and SFML APIs. What I'm mainly looking for, however, is structuring code tips like "write this function for starting battle", "Write that function for moving units", etc. Just to get a feel for how the code can be written and can give me ideas for when I'm versed well enough in C++ to actually start my project up. Like I said, I'm not quite there yet. I do appreciate the pointers for allegro, sdl and sfml, don't think I'm blowing that off you suggesting either of those helps me down when I get closer. I'm still learning the language and that includes syntax for it at the moment. I don't want to learn the language only and write a section of code where it shouldn't be. I did that with HTML before and woah was I in a world of hurt on the project (Note that was a project for my vocational school, but it made my time on it miserable).



#5 powly k   Members   -  Reputation: 649

Like
1Likes
Like

Posted 11 March 2013 - 05:32 AM

Ah, that's the stuff you had in mind. A couple of things come to mind, though lots of coding is experimentation and depends a lot on the game and the guy writing it.

 

Hexagonal movement isn't always easy - having a clear idea of your coordinate system should be very helpful, since lots of things require you to fiddle with positions - you might want to have a class to handle a position, so you can ask where things are, move them without problems (maybe turn them to look at a certain point) and change between world and screen positions for rendering and mouse interactions. Your unit class, for example, could have the position it's at and the position it wants to get to once it has enough movement points (or however you limit your movement per turn).

 

For a battle you might actually want a class instead of a function, so you could handle everything that goes on in there separately from the possible overworld view and possibly interrupt battles to continue different ones. And archive them somehow, if you want statistics. But it's already justifiable for a nicer flow for the program and having less global variables to care about - they're not as evil as many people say, but having a few member variables in a class is usually easier to handle than the same globals. And you clearly see where they should be used and it's even enforced by the language if you use privates.

 

The other option would just be a battle function that gets some details as a parameter - which map file to load, maybe a briefing text, goal of the battle, stuff like that. You might even want to have a map file complicated enough to hold all scenario details.



#6 Ares1989   Members   -  Reputation: 137

Like
0Likes
Like

Posted 11 March 2013 - 12:37 PM

The tactical level will be stage 2 of the project. What I'm planning for right now is a strategic-level map with automated battle results via a dialog box message for now. Nothing too big, but the tactical level included will be stage 2, so those suggestions still help. Thanks and I'll make sure to note everything down.

 

Edit: Note, this project will have many stages, starting how I described and moving to RTS style. I know Those changes will result in major changes in the code, but it preps me for multiple styles of games for programming that I can get some early experience on multiple game genres.


Edited by Ares1989, 11 March 2013 - 12:41 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS