Jump to content
Battlefront is now Slitherine ×

Programming wargames


Recommended Posts

Hubert,

I was just curious of your impressions of using Eiffel to program this game. Was it easier to use then C++ or Java, and what advantages, if any, were there to using this particular language.

I'm interested in toying around with making a territory based game similar to A&A but I'm not sure which language would be best suited to doing this for someone who doesn't have a huge amount of programming experience. Any advice on what would be best?

Also I was curious as to how difficult the AI was to program? This is something that many games typically fail at but your's seems to work very well. You must have really put a lot of thought into this aspect of the game.

One last thing is how long did it take to write all of the code and how massive is it all? :confused:

Link to comment
Share on other sites

Originally posted by Der Panzinator:

I was just curious of your impressions of using Eiffel to program this game. Was it easier to use then C++ or Java, and what advantages, if any, were there to using this particular language.

Eiffel was an easy choice for me as I was very familiar with it. (It was used quite often for some of my University courses). I had the opportunity to try C++ and JAVA as well but due to the design philosophy and personal preferences I went with Eiffel. There are a variety of reasons for this, but primarily for the strict Object-Oriented approach Eiffel uses, memory collection, multiple inheritance, and Design By Contract. Info on design by contract can be found here:

http://archive.eiffel.com/doc/manuals/technology/contract/

Eiffel is a very good language mainly used to build technically sound or bullet proof programs found in the financial, or engineering fields etc., but does have some drawbacks, of course not with the language or tools itself ;) , but more related to a serious lack of multimedia libraries available for game type programming. I liked the language but had to do a lot of multimedia library coding myself in order to ge the job done. C++ and JAVA will definitly have much more to offer in this respect.

Not sure what your programming background is, but regardless of what language you choose I strongly suggest taking a look at Bertrand Meyer's book "Object Oriented Software Construction : Second Edition". It is written by the creator of Eiffel but he does a really good analisys of the pro's and con's of various design philosophies, languages and designing with Object Orientation in mind. Believe me it's an excellent book and will really help you in wrapping your head around a big project such as game design and implementation.

For various languages in general each has it's pro's and con's and I would suggest doing a search for some basic comparisons between your languages of choice to get a better idea. Here are a few links I dug up:

http://www.s-direktnet.de/homepages/neumann/lang_cmp.en.htm

http://archive.eiffel.com/doc/manuals/technology/oo_comparison/page.html

http://www.amazon.com/exec/obidos/tg/detail/-/0130142697/104-4001230-1490300?vi=glance

I would also take a look at books like Marc Saltzman's book found here:

http://www.amazon.com/exec/obidos/tg/detail/-/1566869048/qid=1039498130/sr=1-2/ref=sr_1_2/104-4001230-1490300?v=glance&s=books

It's a pretty good book that won't really tell you how to design a game but has some feedback from some of the best game designers, artists etc. which I used to help me get started about thinking about how to do game design right the first time out.

I'm interested in toying around with making a territory based game similar to A&A but I'm not sure which language would be best suited to doing this for someone who doesn't have a huge amount of programming experience. Any advice on what would be best?

Again I would spend some time researching each language and going through the pro's and con's. Keep in mind things like IDE cost, executable speed, available libraries and examples, multiplatform capabilities, how good and easy to use each debugger is etc. I'm obviously biased and swear by Eiffel and if you are interested there is a free download of a basic version of their IDE found at:

http://www.eiffel.com

I would also check out the newsgroup at:

comp.lang.eiffel

Again whatever language you decide to use I would suggest starting small and taking it from there. The first serious game I programmed was a Tetris clone, I then followed that with a very basic map editor that would take a bitmap, convert it into sprites and then use a point and click method to create maps etc. Take a look at some of the examples I have at my open source project area at:

http://eiffelzone.sourceforge.net

As you will see the programming eventually went from slightly messy to a little more organized as I went along!

Also I was curious as to how difficult the AI was to program? This is something that many games typically fail at but your's seems to work very well. You must have really put a lot of thought into this aspect of the game.

The AI was tricky indeed but I got some good advice early on to use Fuzzy Logic and a very good framework on how to do it in general. Once the basics are done, the trick is to really have patience in this area and sit and watch what the AI does and fix each stupid move one after the other until eventually you have something that is worth playing smile.gif

One last thing is how long did it take to write all of the code and how massive is it all? :confused:
In total I spent just over 2 years designing and coding. In the end it's about 20,000 lines of code give or take a thousand ;)

Hope this helps and good luck!

Hubert

Link to comment
Share on other sites

Hubert,

Thanks for the very informative reply.

Sounds like you really enjoy doing what you do.

It's great that you not only provide tremendous support for your game but that you are also willing to respond with great detail to questions such as mine.

I downloaded the free basic version of Eiffel shortly after buying your game. Haven't had a lot of time to dig into it but it looked like a good solid program.

I'll have to go through some of the open source to see how things look. At first I didn't realize that the whole page was your code. I'll try to find some time to look at some of it tonight.

Luckily, I don't have any delusions of being able to program a massive wargame overnight. I will likely start with a few small simple games just to get the basics of how things work like you suggested and about anyone who has programmed will likely suggest as well. I really wish that I would have gotten into some more programming but have never really needed to do so. The one thing in my favor is that I deal with a lot of high-level computer and telecom stuff at work all day and pick up on things rather quickly. This programming thing is just still a whole different world for me.

One other question for now:

Is it easier to make a game based on a hex-grid system or irregular spaces? I would think that hex based would be easier to work with since it is based on symetrical spaces that are probably easier to program.

I have been trying to figure out how you could possibly program odd shaped graphics into a program so that it recognizes where they are on the map. It's done all the time so there must be some trick to taking the map pieces and putting them together and redrawing the screen as things are moved. Just seems like you would almost have to take all the polygon dimensions and actually program them in for every space. Seems a bit insane but its probably the only way.

Here is a link to my website which has some maps that I've been working on.

Axisdomain

I have compiled the Europe map into a program called Mapview. It is used for PBEM games and there are quite a few people play-testing it at the AAEuropeMC site.

The world map is the one that I have visions of making a computer game out of. It is made from scratch so I won't have to worry about copyrights.

It is almost too big to print out into a board game so I plan on doing a PBEM version with Mapview and then maybe in a few years can turn it into a computer game.

Thanks again Hubert for the response. I have been having some great PBEM games with a friend and have been thoroughly enjoying your game!

Link to comment
Share on other sites

You might want to check out Xconq. It's open-source. They've been working on v7.5 all year now but it's not out yet. It should have a native Windows build capability and tcl/tk interface updates so you won't need Cygwin or Linux. If you program in C/C++ you can edit the game any way you want, but you don't need to be a programmer. Game is set up to run user-defined tables which are relatively easy to set up and edit. I got frustrated with some of its current limitations but it has potential for the future. Keep an eye on it.

Link to comment
Share on other sites

Here is a link to my website which has some maps that I've been working on.

Axisdomain

Took a look at your site, interesting thing is that my friends and I played a lot of Axis and Allies growing up, so I have to admit I took a good look at your map changes/tweaks and it did bring back a lot of memories smile.gif

Looks pretty good, I've never really thought about province based gaming since the various shapes could make user input a bit tricky to keep track of, but a quick idea I had would be to use two maps. One would be the map everyone sees on the screen and the other map would be simply contained in memory with each province having it's own unique color. This way whenever someone clicks on the map on screen the mouse position is translated to the map in memory and depending on which color is selected you know exactly which province has been selected by the user.

Here is a link to a pretty good game programming page that has info on hex based algorithms including path finding etc. I used some of the ideas for SC and then came up with a few of my own simplifications but it should help a bit in terms of getting things started.

http://www-cs-students.stanford.edu/~amitp/gameprog.html

Good luck!

Hubert

P.S. Bill's Xconq link looks very interesting as well and might provide some ideas since the code is open source

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...