Sunday, December 27, 2009
Solved!
I solved it!!! Before asking for help I decided to work on it a bit myself. I slightly changed the system, so that dead pieces instead of being assigned no field, get assigned a special field for dead pieces. I really still don't see a reason why the previous solution would not work, but since everything is fine now I'm simply going to stop worrying about it :)
Problems solved, come back twice as bad.... :/
I've been working a lot today again. I have added the limit of not being able to go backwards, I added kings (crowned pieces, those can move back and I've allowed them to). I also solved the problem of not being able to beat. I even played a match with my cousin, although the game is NOT finished, so we had to remember the rules ourselves - the program does not have all the functions needed just yet.
Unfortunately, the breaking mechanism somehow broke. I found out EXACTLY which line of code makes it break, but I have NO idea why it does so and how to fix it. The weird part is that I have not changed this mechanism between it working and it breaking. I have added other things, but this part was not changed. I'll probably have to ask for help with this one, because I really don't know what is wrong with this.
Unfortunately, the breaking mechanism somehow broke. I found out EXACTLY which line of code makes it break, but I have NO idea why it does so and how to fix it. The weird part is that I have not changed this mechanism between it working and it breaking. I have added other things, but this part was not changed. I'll probably have to ask for help with this one, because I really don't know what is wrong with this.
Wednesday, December 23, 2009
The Pieces are Moving!
A few more hours of work and I arrive at the stage where I can move the pieces. Unfortunately not correctly ;) For some reason white pieces move where i direct them, but when i mark a black one, a white one moves instead. I need to experiment with the code to see what is wrong there and hopefully i will be able to move the pieces the way they are supposed to even today.
UPDATE [15:50]
I found the mistake! What's interesting is that the new bits were (in most part) correct and it wasn't these that caused the problem. Once I went through them over and over and was sure that they are correct, I started looking back and found the mistake in the set up of the board. It was just a wrong list given in one spot that didn't influence anything until this spot.
UPDATE [18:55]
I kept improving the code and right now all the pieces move well - only diagonally by 1.
However some of the things which I have implemented don't work yet - the pieces don't beat yet and I have to see what is wrong there.
Lastly there are some things which I simply didn't put into the game - for example the pieces move backwards as well as forwards at the moment.
I think I am well on at least 30% with the game. The following is a quick list of what I still have to add (not strictly ordered):
UPDATE [15:50]
I found the mistake! What's interesting is that the new bits were (in most part) correct and it wasn't these that caused the problem. Once I went through them over and over and was sure that they are correct, I started looking back and found the mistake in the set up of the board. It was just a wrong list given in one spot that didn't influence anything until this spot.
UPDATE [18:55]
I kept improving the code and right now all the pieces move well - only diagonally by 1.
However some of the things which I have implemented don't work yet - the pieces don't beat yet and I have to see what is wrong there.
Lastly there are some things which I simply didn't put into the game - for example the pieces move backwards as well as forwards at the moment.
I think I am well on at least 30% with the game. The following is a quick list of what I still have to add (not strictly ordered):
- Beating Pieces and further movement restrictions (as above),
- Kings,
- algorithms for the program to make sure the game is run properly (so the program can "see" if there is a piece that can be beat etc.)
- the order of the game - start and finish, checking if ended (won), turn system.
Monday, December 21, 2009
Keep on working
The problem I mentioned at the end of the last post I've already found a solution to - I had to JUST NAME the dependent class before describing the one depending on it.
Yesterday and today I kept working on the code. I realized that I get so much fun from the challange. Every problem I solve leads me to a next one. But only sometimes I feel frustrated - that's when I have no idea what is wrong. But when they are all a series of problems that I keep moving through (that doesn't mean that they're easy!!) then it all really does bring me joy (especially once I solve something particularly difficult ;) ).
Yesterday and today I kept working on the code. I realized that I get so much fun from the challange. Every problem I solve leads me to a next one. But only sometimes I feel frustrated - that's when I have no idea what is wrong. But when they are all a series of problems that I keep moving through (that doesn't mean that they're easy!!) then it all really does bring me joy (especially once I solve something particularly difficult ;) ).
Already yesterday I've started setting up the pieces on the board. It made me realize a problem which you might have noticed on the previous blog if you look at it carefully, but it was in fact very easy to overlook. The board I had was 7x7! I've digged through pretty much the entire code that I've wrote by now and finally realized my mistake. C++ in many cases counts from 0, not from 1. It is a rule I've remembered to watch out for, however once I got too mixed up when also using variables that I've subtracted 1 from them ending up with what I did. It can be thought of as if the board was moved up and left by one square so 1 column and 1 row got hidden behind the window border. I've fixed that by now as well as many other obstacles I met these two days and I have the board set up!
Now I will search for a solution to another problem - the pieces flick as if the program kept redrawing the board, than the pieces over it then the board again and so on.
UPDATE - found out the problem, it came from the fact that I am building the program slightly differently than I saw and practiced before. I needed a good description of a Windows message WM_PAINT and I found it easily on MSDN as well as more functions which let me solve the problem.
So now this stage is completely done and I can move on to the interaction stage - adding the implementation of functions that will let me move the pieces. Then algorithms that will serve as rules.
UPDATE - found out the problem, it came from the fact that I am building the program slightly differently than I saw and practiced before. I needed a good description of a Windows message WM_PAINT and I found it easily on MSDN as well as more functions which let me solve the problem.
So now this stage is completely done and I can move on to the interaction stage - adding the implementation of functions that will let me move the pieces. Then algorithms that will serve as rules.
Sunday, December 20, 2009
Code work kicked off!
Today I’ve spent 3 hours coding. I’ve come across a BUNCH of different problems, but most of them I was able to solve after sometime. A lot of these problems were simply syntax or ‘layout’ – I would not be sure how to put some stuff together for it to make sense etc. Part of it are also small pieces of information that are not important until one tries to use them. E.g. I had to change a constructor of Field because it had to be empty for me to be able to put it into the array of Board. It is just a requirement of the language because one excludes the other. This problem and many other I had to look up and the C++ dla każdego book was indispensible here, especially that I was working in the car, without internet.
I was heavily using the tutorial to code the window creating code. A lot of it was pretty much copied, with just slight changes, because this part of the code does not differ from program to program much and it is also quite lengthy, so it takes a lot of time to be able to remember and write it all without reference.
Once I’ve finished the making of the window, I created a function which would display the board in it. It was going step by step – I had to implement the Field function; then create an abstract board as an array of Fields; then write the code which would go through the array and display the fields one by one (I could have made this easier and shorter, but this lengthy approach takes off some load from future – I would have to do it sometime anyways). Only once I had that ready and tested I made the colors alternate making it a real checkers board.
This concept is really important for me right now. I can’t make everything right away at the same time. So being able to separate the process into some steps which are than developed is the way to go. It is quite a challenge, because the different parts of the code are inter-related and intertwined which makes it hard to take only a part without having to drag the rest with it.
For example, I’ve had to create the Field class to be able to create the board. But my main focus of the moment was to create the board not the fields in their full detail, so I only wrote the most important parts of the Field class that allowed it to function. As I was expanding the program I was adding more and more functionality to Field AS I NEEDED IT.
The process I showed last post is only somewhat correct. The basic idea is correct, but all the steps are really blended together and really only the first one was the only one I did by itself. Later all the steps are too much connected for me to keep the rigidity of a step-by-step plan – it is much more dynamic than that.
Right now I am stuck on one quite big problem - I want to create the two classes of Field and Piece which both point to one another. The problem is that the second function in the code can recognize the function that comes before it. However the one that is first can not point to the one that comes afterwards because at that point the compiler doesn't know that it exists.
Right now I am stuck on one quite big problem - I want to create the two classes of Field and Piece which both point to one another. The problem is that the second function in the code can recognize the function that comes before it. However the one that is first can not point to the one that comes afterwards because at that point the compiler doesn't know that it exists.
Thursday, December 17, 2009
In my initial start of the program I started with writing the classes of the object. I thought it would be a natural step to create the building blocks of the program first and then connect them and use them to make the actual game. However I have now realized that this way I can't test things as I write them, because I can only run a program, not a part of it. I decided I need a different approach. I have changed it especially because of not much experience with programming, in terms of not actual amount of code I wrote in the past and the time that has passed since my last bigger programing project. Another thing is that I never used some of the components and functions before.
The actual change was that I will start with the frame of the program - the Windows' protocalls which actaully create the program in Windows' "memory". This way I will be able to run the program at early stages of development to test the components as I add them. Another advantage is that the Windows' functions are mostly the same for all programs, so they are not really the hard part of the coding.
So the coding in terms of time will look somewhat like this (latter parts might change):
The actual change was that I will start with the frame of the program - the Windows' protocalls which actaully create the program in Windows' "memory". This way I will be able to run the program at early stages of development to test the components as I add them. Another advantage is that the Windows' functions are mostly the same for all programs, so they are not really the hard part of the coding.
So the coding in terms of time will look somewhat like this (latter parts might change):
- Windows "frame"
- Basic graphics (The board)
- Classes (pieces, fields)
- Movement graphics
- Structure of the game
- Final improvements, fixes, etc.
Thursday, December 10, 2009
December update
Unfortunately due to a sickness right after the 3 week long school clousre I've fallen behind with some school work and had to catch up on that, so my PP has been pushed out of the way by some more urgent matters.
Now I have 1.5 month to finsh the game. I believe I can finish the game in this time, although with quite a big effort. I will use the winter break to its full extent for this. However, even if it so happens that I do not manage to create the full game, it should not hurt my PP, because my goal is to learn from the creation, not to create. I will finish the game anyways, weather it will be within PP or already afterwards.
I figured that when I have a problem with my code, it would be a great help to have someone I can actaully physically come up and talk to - online tutorials and such are good, but when there's a specific problem this kind of help would be much much better. I have contacted an IT teacher, Mr. Vitaly, who has some experience with C++ and making games. He is happy to help me if find any obstacles that I don't know how to tackle.
Now I have 1.5 month to finsh the game. I believe I can finish the game in this time, although with quite a big effort. I will use the winter break to its full extent for this. However, even if it so happens that I do not manage to create the full game, it should not hurt my PP, because my goal is to learn from the creation, not to create. I will finish the game anyways, weather it will be within PP or already afterwards.
I figured that when I have a problem with my code, it would be a great help to have someone I can actaully physically come up and talk to - online tutorials and such are good, but when there's a specific problem this kind of help would be much much better. I have contacted an IT teacher, Mr. Vitaly, who has some experience with C++ and making games. He is happy to help me if find any obstacles that I don't know how to tackle.
Saturday, November 21, 2009
Code work started
I have just started working on the code of the checkers. I have no idea how long it will take me to write the game, so I am not going to plan any deadlines other than specified by the project. At least for now - later when I will know how much I have done and how long it took me, I shoudl be able to see the time that I need more clearly. I have already modified a few things from the notes I initailly had, some becuase I reallised I need to and some because I found a new, better way of doing it.
Tuesday, November 17, 2009
Notebook update - ready for Programing
I think I have done enough design work and that its time to get to the programing. Here is what my virtual notebook looks like at the moment. Again, it will change throughout the programing - some features might change, but mostly i'll be adding details that I didn't feel necessary to create just yet.
I can't post the notebook contents here, because of some things saved as images. It would also interfere with the blog's width. So I've put it up as a Google doc, here is the link. It took quite some working around, but its there :D. Oh yeah - there is a bunch of hyper-links there - i use them to ease the navigation around the notebook. They won't work here, so don't try. :)
Just a quick note on the way I have kept my notes. I am the only writer of the program, so I am the only one who needs to understand these notes :). Of course it is a good thing to keep them coherent and make them make sense, but since it is a small project (in terms of programing, not school :)) I could make them a little... spontaneous. Most of the notes will not be understandable to someone without programing/C++ knowledge and much of it won't be understandable to anyone but me. But there they are. I'll probably include them in an appendix to my essay.
I can't post the notebook contents here, because of some things saved as images. It would also interfere with the blog's width. So I've put it up as a Google doc, here is the link. It took quite some working around, but its there :D. Oh yeah - there is a bunch of hyper-links there - i use them to ease the navigation around the notebook. They won't work here, so don't try. :)
Just a quick note on the way I have kept my notes. I am the only writer of the program, so I am the only one who needs to understand these notes :). Of course it is a good thing to keep them coherent and make them make sense, but since it is a small project (in terms of programing, not school :)) I could make them a little... spontaneous. Most of the notes will not be understandable to someone without programing/C++ knowledge and much of it won't be understandable to anyone but me. But there they are. I'll probably include them in an appendix to my essay.
Friday, November 13, 2009
Design Update
I am just about 2/3 done with the design preceding the creation. I have set up a few more pages in the oneNote notebook and it is working just fine. When i was thinking of using Visio - it would be for procedure diagrams. However the biggest of such diagrams that I needed was the general program outline which I have created with oneNote(see two posts ago). Perhaps it is not the neatest outline ever, but it suits my needs just fine :).
Once I'll have done enough design to start the creation I will post all my notebook pages here. I am glad to see that the designing process is in fact taking me just about the amount of time that I wanted it to and planned for it, despite the fact that it was a fairly unprecedented thing for me to plan for :).
Once I'll have done enough design to start the creation I will post all my notebook pages here. I am glad to see that the designing process is in fact taking me just about the amount of time that I wanted it to and planned for it, despite the fact that it was a fairly unprecedented thing for me to plan for :).
I have just learned a lesson is object oriented programing (OOP). Not read a textbook chapter on that, no - I have known the concept before. But I have just realized something myself while trying to solve a problem and the fact that I have realized it myself should make that lesson all the more valuable.
C++ fully supports OOP and therefore not using it is usually a mistake and complication of one's task. In OOP the idea is to make the code a virtual representation of the reality as close as possible in order to simplify the code. The main tool of OOP are classes - sets of variables and functions that represent a single object. For example, a car class would have variables such as size, current speed, brand, etc. and methods (class' functions) such as accelerate and break. Code represented in this way is set up much more the way we think than a procedural code and therefore easier to write and edit.
I was planning to have a single class in my game - the piece. It would have a color and the position, an indicator that would say weather it was a king piece and an indicator of weather it was still in game or not. I was not planning to make a class of a player, simply because I was not going to implement a lot of player specific options. The other possible class would be the board. The reason why I did not want it was the fact that then the information would double - the board would know what piece is where and the pieces would know where they are standing. Therefore if a piece was moving I would have to change the piece's variables as well as the boards. However when I was planing out my algorithms I realized it would be very useful to be able to refer to the field instead of search through the pieces to find the one that has the specific coordinates.
I also did not want to have the pieces be variables of the fields' (which is, however perfectly possible) because
a) it was not a good representation of reality - a piece is NOT a part of the field and
b) it would mean that every time piece is moved, it would have to be destroyed at one field and re-created at the other.
I thought about how to solve it for quite a while and then I realized the perfect solution - it was even than my initial plans. I realized that it is in fact NOT the piece's duty to know its coordinates - it only stands on a field. So the field will be the only class storing the position. So I needed a way of letting the piece "know" where it is and the field to "know" what's on it. I remembered the perfect way to do this - through pointers. Pointers are a basic type of variables, which, instead of a number, stores the address of a different variable. It is in fact much easier than it sounds and all it means is that I can have every field have a "link" through a pointer to the piece which is standing on it. It is in fact the most exact representation of the reality - the physical contact takes the form of a pointer. That last sentence is much more important than it might seem - it points to the moral of the whole problem. OOP is not just a fancy way of manipulating the information - it is in fact a great facilitation and the more accurately it is used the more helpful it is.
PS sorry for the bore but it is a really important point for my reflection - this is the kind of learning experience which I can't get without making and is so valuable. :)
PS sorry for the bore but it is a really important point for my reflection - this is the kind of learning experience which I can't get without making and is so valuable. :)
Tuesday, November 10, 2009
Initial design brainstorming
I have written out the basic structure that the program will follow. Then I went through it picking out some relationships and obvious structures/functions that I will have to implement. You can see those on the right of the above steps.
Those, of course, are only a part of all the classes, variables, functions and algorithms that will make up the game, but they are a good start. I should try and design most of them before starting to write the code yet. As I have now, I should be using OneNote for that. I will create a page in the OneNote notebook for each object/group and connect them with hyper-links for the easiness of use, which is essential since it is something that I should be using throughout the coding, not just a beginning step.
I will keep updating the pages in the notebook as I think of new things, also during the course of writing the program - it is a help tool, not a strict plan I cant adjust. It is all very flexible and similar to the design cycle from D.T.
Those, of course, are only a part of all the classes, variables, functions and algorithms that will make up the game, but they are a good start. I should try and design most of them before starting to write the code yet. As I have now, I should be using OneNote for that. I will create a page in the OneNote notebook for each object/group and connect them with hyper-links for the easiness of use, which is essential since it is something that I should be using throughout the coding, not just a beginning step.
I will keep updating the pages in the notebook as I think of new things, also during the course of writing the program - it is a help tool, not a strict plan I cant adjust. It is all very flexible and similar to the design cycle from D.T.
Tuesday, November 3, 2009
Random Color
I have combined this with another practice problem to create functions that would display regular penta- and hexagons. The "regularity" is debatable, but I am not sure how to make it better - I've run through my math again and again and it is right. They seem to be regular but stretched - anyway, here are the results. they are put at a random point and with random color.I have also clipped the window to a circle shape - although it doesn't really look like a regular window (no title bar, frame, x-button, weird shape) it's still in fact a window in its full meaning. Quite an interesting thing, which is possible and correct to do, yet it is not used much, if not at all by programmer - we don't see windows of shapes other than rectangles.
Tomorrow i will start the design of checkers. I will use M$ OneNote. This is quite unprobable, however if I feel like it will be useful I will download a trial of M$ Visio.
Monday, November 2, 2009
Chapter 4 Update
I have now completely finished reading through chapter four and therefore the entire tutorial. Of course it doesn't mean it was the last time i looked at it - on the contrary. It is going to remain the main source of my project. The goal of reading through it was not to learn everything right away - that would be almost impossible. Instead, it was more like a look around, an indexing of the possibilities I have. This way I can plan on how I will make the game, design it and when I'll be actually writing it, I will be heavily relaying on the templates, tables, examples and the exact definitions that I've met throughout the tutorial.
I have also completed one of the practice problems - since it was a long and final chapter, there's quite a few of them and they're more advanced. I may choose to skip some of them, if they are not directly relevant to my game.
The problem I have finished now was a modification of a given code. I was given a program that allowed one to draw lines with the mouse and I added to it color and line type change. I had the basic program ready, so I could concentrate on the new material covered only in this chapter. It took me quite a while to finish this program, but most of it was a one time research that I would have done sooner or later because I will be needing it for my game.
I have also completed one of the practice problems - since it was a long and final chapter, there's quite a few of them and they're more advanced. I may choose to skip some of them, if they are not directly relevant to my game.
The problem I have finished now was a modification of a given code. I was given a program that allowed one to draw lines with the mouse and I added to it color and line type change. I had the basic program ready, so I could concentrate on the new material covered only in this chapter. It took me quite a while to finish this program, but most of it was a one time research that I would have done sooner or later because I will be needing it for my game.
Saturday, October 31, 2009
I am almost done with reading the fourth part of the tutorial - it came out to be probably the longest of them and it took me longer than I expected. Once I finish I will run through the practice problems and start designing my own checkers. If we get lucky enough to miss out on some school days due to flu, it will give me a good time when I wont be bothered by other subjects and I'll be able to concentrate on this.
Monday, October 26, 2009
Learin to program + a bunch of other stuff
One of the things that I really like about learning programing is the amount of the extra information that comes with it. I am a really curious person and such side-notes make the reading much more pleasant for me. I guess not every book/tutorial has as much side info as the one I'm reading and I'm glad I've found one so rich in it. It also pops in a joke once in a while and in general is written in a very accessible way.
Back to the side note theme - one of them was an explanation on how color works - color of things as well as light, the difference and similarities between them which I was not aware of before. To know this is of course quite important when dealing with graphics, but it is also a piece of knowledge that is also useful outside of programing. Another side note like that was an explanation on what Bezier's curve, a mathematical way of describing free curves which is used throughout vector graphics and also helps me to better understand some functions in Gimp, an image editing program I use. It fact, I might even do my math presentation on these.
Back to the side note theme - one of them was an explanation on how color works - color of things as well as light, the difference and similarities between them which I was not aware of before. To know this is of course quite important when dealing with graphics, but it is also a piece of knowledge that is also useful outside of programing. Another side note like that was an explanation on what Bezier's curve, a mathematical way of describing free curves which is used throughout vector graphics and also helps me to better understand some functions in Gimp, an image editing program I use. It fact, I might even do my math presentation on these.
The game
I've decided what I game I will make - checkers. It is one of the games that fulfills the requirements I needed it to: there are no items that can be visible to only one of the players (like one's 'hand' in cards), it is fairly simple and is 2D. But there is also another reason, which comes from the fact that I really do not know how much time it will all take me. If I find out that I have created the game really quick and I have more time for development, I can easily turn the game into chess (easily, in the fact that I will have most of the graphical content ready - I will have to recreate the game mechanics. It is just a door for development that I am leaving open to myself.
Tuesday, October 20, 2009
Supervisor Meeting
I've met with Mr. Depooter today. It was a simple update and clarification meeting - there were no actual problems to discuss. As I've said I am planning to finish going through the tutorial during the break - which would be until the end of Oct. It's not a deadline which I need to keep or the whole project will collapse, however I do want to make it.
Then I will have to do the design. It will be mostly involving the diagrams of the different structures that I will use within the program, of how the different objects of the real game will be represented in the abstraction of a program. I am not sure how much this step will take me, especially that the amount of work I do here will reflect on how easy it will be to actually write the program. An initial deadline I'm setting myself is three weeks since I finish the tutorial - around the 22nd of November. That will give me the end of November, December, January and half of February to write the program - including the tackling of any problems that I will encounter etc. Also, just like with any other product making work, the design may change throughout the making.
With this amount of time I should be able to finish writing the game (also depends on the game, but about that - in a moment). However if somehow I do not manage to finish the game, or I will only be able to create something lesser, not the complete product, I believe it would in fact be a small damage to the whole project. This is because the ultimate goal of the project is not to make a game, but to learn about creating Windows API based games using C++. The game itself is, one could say, a by-product of this process. Of course I could consider going through the tutorial all I need to know about it, but one only really learns programing by doing it. Also, what is the point of learning it if I wouldn't use it after all?
______________________________________________
A few days ago I wrote a practice program from the end of chapter 3. It was really quite simple in what it did, yet it did require the use of some new techniques and features. It put the typed text into its title bar. I have also implemented the backspace as the erasing button - by no means was it automatic. Then later when I showed the program to my dad, he used backspace completely without thinking about it - it was natural and he took it for granted. It really felt good to see someone use the program (even so simple) in such an intuitive way. I think this is one of the big things when one is making things that are supposed to be used by others - it brings great satisfaction to see others enjoy and use your product.
Then I will have to do the design. It will be mostly involving the diagrams of the different structures that I will use within the program, of how the different objects of the real game will be represented in the abstraction of a program. I am not sure how much this step will take me, especially that the amount of work I do here will reflect on how easy it will be to actually write the program. An initial deadline I'm setting myself is three weeks since I finish the tutorial - around the 22nd of November. That will give me the end of November, December, January and half of February to write the program - including the tackling of any problems that I will encounter etc. Also, just like with any other product making work, the design may change throughout the making.
With this amount of time I should be able to finish writing the game (also depends on the game, but about that - in a moment). However if somehow I do not manage to finish the game, or I will only be able to create something lesser, not the complete product, I believe it would in fact be a small damage to the whole project. This is because the ultimate goal of the project is not to make a game, but to learn about creating Windows API based games using C++. The game itself is, one could say, a by-product of this process. Of course I could consider going through the tutorial all I need to know about it, but one only really learns programing by doing it. Also, what is the point of learning it if I wouldn't use it after all?
______________________________________________
A few days ago I wrote a practice program from the end of chapter 3. It was really quite simple in what it did, yet it did require the use of some new techniques and features. It put the typed text into its title bar. I have also implemented the backspace as the erasing button - by no means was it automatic. Then later when I showed the program to my dad, he used backspace completely without thinking about it - it was natural and he took it for granted. It really felt good to see someone use the program (even so simple) in such an intuitive way. I think this is one of the big things when one is making things that are supposed to be used by others - it brings great satisfaction to see others enjoy and use your product.
Sunday, October 11, 2009
I have been programing for a long time today - i found the Code::Blocks IDE almost as useful as Visual C++. There are some flaws and things that are not as good as I am used to, but it does the job. This will allow me to work on the project easier - I do not need to use my mom's computer for it anymore.
I have been having a lot of problems today which required a LOT of additional research. Some of the problems I still have not found the answers to. It would make it a lot easier if I had someone that knows C++ and Windows Programing from whom I could ask advice.
Fortunately, most of the problems I cant find solutions to, I either may still find them in the upcoming chapter of the tutorial, or they are related to things that I probably will not be using in the final game.
One very useful thing that I have found today was a conversion between a number and a string (a set of characters creating a word/words). This is certainly useful for a lot of things, mostly notifying the user of some in-game parameter. Surprisingly I found it outside of MSDN where I spent a lot of time trying to find a good answer to it and failed. I should remember for the future not to limit myself to it.
I have been having a lot of problems today which required a LOT of additional research. Some of the problems I still have not found the answers to. It would make it a lot easier if I had someone that knows C++ and Windows Programing from whom I could ask advice.
Fortunately, most of the problems I cant find solutions to, I either may still find them in the upcoming chapter of the tutorial, or they are related to things that I probably will not be using in the final game.
One very useful thing that I have found today was a conversion between a number and a string (a set of characters creating a word/words). This is certainly useful for a lot of things, mostly notifying the user of some in-game parameter. Surprisingly I found it outside of MSDN where I spent a lot of time trying to find a good answer to it and failed. I should remember for the future not to limit myself to it.
Saturday, October 10, 2009
Goal Clarification and Process Update
Programming (in C++) is something I have been interested in for over two years now. However, I always found it difficult to continue developing it as my hobby in the times of the heaviest school work - it is something that demands a lot of time and commitment. Even when I had more free time, I found it more difficult than other hobbies due to the fact that it requires hard mental work, which is as tiresome as work. Therefore in 8th grade I decided to use the opportunity to make it part of my school - to have it as my personal project.Then I made a simple word game using the Win32 console. This time I wanted to move my skills further and use the Windows GDI - the usual windows structure found in Windows.
I am planning on becoming a game programmer in future, so this project does not only allow me to explore my hobby but also allows me to learn bases of my future career.
Therefore, the most important part of my goal is not the finished product - the game itself, but everything that I will have to learn and use in order to create it. The game will simply be a kind of presentation of what I have learned. Shortly, my goal is to learn about using Windows GDI with C++ through the creation of a computer game.
The process will be all about Approaches to Learning due to the heavy concentration on the skills that I want to gain through it, as well as Human Ingenuity - I will be designing and creating a program and will have to face the challenges that will come with it.
The general outline of the whole process looks like the following:
At the moment I am still going through the exercises of the 3rd chapter in the tutorial. Soon I will be starting the 4th and last one.
I am planning on becoming a game programmer in future, so this project does not only allow me to explore my hobby but also allows me to learn bases of my future career.
Therefore, the most important part of my goal is not the finished product - the game itself, but everything that I will have to learn and use in order to create it. The game will simply be a kind of presentation of what I have learned. Shortly, my goal is to learn about using Windows GDI with C++ through the creation of a computer game.
The process will be all about Approaches to Learning due to the heavy concentration on the skills that I want to gain through it, as well as Human Ingenuity - I will be designing and creating a program and will have to face the challenges that will come with it.
The general outline of the whole process looks like the following:
- Go through the "Od zera do gier kodera" tutorial - a tutorial that covers the bases of game programing.
- Design the game (in programing terms. I will design not the game mechanics, but the implementation of the game I will choose into a C++ program. The project is not about inventing a game, but about creating a computer game - the program.
- Write the program.
The first step is essential before I can go on any further - I need to know what it is I am able to do before I start even thinking of the design. After that I could theoretically start writing the program without doing the design, but that would be suicide :) It is important to think through it and create a plan before I start working on it - just like when creating a physical product. However the design may change as I am already writing the game, when I reach problems I have not thought of.
Throughout the 3rd step I will heavily be using tutorial and MSDN - the C++ and Windows programing documentation site in order to solve upcoming difficulties and to find ways around problems.
Lastly a bit on the game choice - looking at the project focus it really is not that important what game I will bring into the digital grounds. It could be tic-tac-toe as well as chess. Of course it would take more work and be harder to implement the mechanics of chess. The only strict thing I will have to keep to is that I can't have computer players- I am simply not able to create AI yet. Therefore I can either create a single-player game such as solitaire or a "hot-seat" multi-player. I was thinking of creating a digital version of Monopoly, however I think that might be a little too much to implement into the game. Right now I am thinking of checkers, however it is not the final decision yet and I will not have to make one until I finish going through the tutorial.
_______________________________________________________
At the moment I am still going through the exercises of the 3rd chapter in the tutorial. Soon I will be starting the 4th and last one.
As of the problem with Visual C++ on my computer - seems like can not really do anything about it. No one answered the forums posts where I asked for help - obviously no one had an idea of how to solve the problem. I will therefore try a different IDE (The entire programing environment, including the compiler). Most likely I will try a Borland compiler.
New IDE
I have downloaded and installed the Code::Blocks IDE and using the fact that I need to complete a few practise programs for the third chapter of the tutorial I will see if I can use it well, or if it will be to hard / take too much time to get used to it within the time I have. Hopefully it will not be much different from MS Visual to which I already got used.
Saturday, September 19, 2009
3.2 - check!
I've finished the next chapter. It was dedicated to the window structure and controlling it. Most of the information here I will not use this project, however it is still good to learn it - to know what the possibilities are. It also helps one to draw a general picture of how things work in windows.Certainly I'm not saying that I should have skipped this chapter, no - there were quite a few essential things that I've learned from it, both for this project as well as for programing in general.
I am managing to go through this really fast - I am using the fact that I have a reasonable amount of time not dedicated to other subjects' work. I am doing so partially because I don't know exactly how much time it will take me to write the game.
I feel soon I should already specify what game I want to make. Some of the choices I'm thinking about are:
I am managing to go through this really fast - I am using the fact that I have a reasonable amount of time not dedicated to other subjects' work. I am doing so partially because I don't know exactly how much time it will take me to write the game.
I feel soon I should already specify what game I want to make. Some of the choices I'm thinking about are:
- tick, tack, toe
- solitaire
- chess
- peg solitaire
- etc.
I am not planning to create any AI for my game (computer based opponents) - that would be too complicated. That's why I can't have any other card game then solitaire - the player's would see each other's cards.
Wednesday, September 16, 2009
First Windows API Programing
I haven't updated the blog much for a while - not only because of the fall trips. I still have not managed to solve the Visual problem on my computer, but I've been able to use my mom's for the time being - for the exercise programs. I've already done a few - suggested as practice in the end of the first chapter of the tutorial (3.1) which I have studying. I've crated the following programs:
Maybe it doesn't look impressive. But what it is, is the introduction to the Windows API - the structures of Windows' windows and how to use them. I also refreshed myself on the use of the random function - very useful for games. Following the style of programing used in "Garfield" I could easily program any sequential "game" - like many quizzes found in magazines (set of questions where the answer leads to a next question until some kind of an end box is reached).
While writing those little programs, I've already came across some of the most common problems which I will surely encounter again while writing my final game. One of them was a single line I've missed in a complex structure - unfortunately it was important enough to fail the whole application. It was also a mistake that the Visual C++ Program did not find - like it does with simple typos and incorrect type usage. It took line-by-line comparison to find the mistake. Later on in bigger projects I will try to include crash prevention and notification scripts (so called exceptions).
Some other problems I encountered were needing me to do a further research into specific queries on MSDN (the ultimate C++ documentation :)) which were not described in the tutorial. Again, I am sure I will be doing that over and over when creating the final program - it is one of the specifics of programming. It is good I'm already getting practise with that and I'm getting used to using MSDN and its documentation style.
There is one more practice program to do - a window that makes sure you really want to exit (a prompt like in most of programs, e.g. Word). After that I will hit the 3.2 chapter.
[UPDATE]
I have finished the last program - it only required me to research a specific function and apply it. Now I'm going through the 3.2 chapter.
- "computer die" - Random number picked from 1-6. Uses windows message boxes, like the one on the right.
- "Garfield" - a little sequential interactive program that also uses message boxes. The outcome depends on the decision of the user.
- "Click" A window. When you clock it it tells you you did so with a... message box :D.
Maybe it doesn't look impressive. But what it is, is the introduction to the Windows API - the structures of Windows' windows and how to use them. I also refreshed myself on the use of the random function - very useful for games. Following the style of programing used in "Garfield" I could easily program any sequential "game" - like many quizzes found in magazines (set of questions where the answer leads to a next question until some kind of an end box is reached).
While writing those little programs, I've already came across some of the most common problems which I will surely encounter again while writing my final game. One of them was a single line I've missed in a complex structure - unfortunately it was important enough to fail the whole application. It was also a mistake that the Visual C++ Program did not find - like it does with simple typos and incorrect type usage. It took line-by-line comparison to find the mistake. Later on in bigger projects I will try to include crash prevention and notification scripts (so called exceptions).
Some other problems I encountered were needing me to do a further research into specific queries on MSDN (the ultimate C++ documentation :)) which were not described in the tutorial. Again, I am sure I will be doing that over and over when creating the final program - it is one of the specifics of programming. It is good I'm already getting practise with that and I'm getting used to using MSDN and its documentation style.
There is one more practice program to do - a window that makes sure you really want to exit (a prompt like in most of programs, e.g. Word). After that I will hit the 3.2 chapter.
[UPDATE]
I have finished the last program - it only required me to research a specific function and apply it. Now I'm going through the 3.2 chapter.
Friday, September 4, 2009
Problems with Visual C++
To try and solve the problem of Visual C++ not wanting to install, I tried installing it of a CD rather than a file on the computer. Unfortunately it has had the same effect.I have supplied more details about the problem to the official Visual forum (MSDN) and am waiting for an answer now.
There is another thing that I can try - install the trial version of the full Visual software (the Express Editions are free). However, it only lasts 90 days, therefore I will only try it after we get back from the trips - not to waste the time that we're away.
Wednesday, September 2, 2009
Start of leraning + more on the Visual problem
I have started my lecture on the Windows API. Unfortunately I still cannot fix the problem with Visual C++ and I don't really have any way of 'fighting' it - I have to wait hoping to receive help from forums where I posted the problem. I can do exercises on another computer where the software works, however I probably won't be able to do the whole project there and even if, I'd rather do it on my own computer. If I don't get MS Visual working by the time I will start to write the actual program, I might choose to use an alternative program - it will be less easy on me since I got to know Visual before, but it might be the best solution
For now I will just keep on going through the tutorial.
For now I will just keep on going through the tutorial.
Monday, August 31, 2009
Visual C++ problem
I have some kind of an error popping up every time I try to install the compiler MS Visual C++. I have already posted the problem on a few forums hopping for some help on it. If I don't find a solution to the problem i might have to look for an alternative compiler. I would rather not do that though because I already know Visual somewhat and learning to use another compiler would just add to the extensive amount of work I will have to complete for this project.
Saturday, August 29, 2009
Initaial C++ knowledge summary.
This is the initial summary of the C++ components that I know, or at least used to know :). Any of these I should be able to use. For many I will probably need a refresher, especially the ones I have only learnt in theory. I will not include the very basics of programming, such as "variables and constants" or "functions".
Topics covered in theory (from the book):
Topics covered in theory (from the book):
- Functions
- Object Oriented Programming (OOP)
- Loops (also the switch instruction)
- Pointers
- References
- Inheritance (*)
- Polymorphism
- Static data
- Pointers to functions
- Namespaces
- Templates (**)
- Exceptions and error handling (**)
For the past few months I have been doing some recalling from this tutorial: http://www.gamedev.pl/tutorials.php. I have went over the first section, which, the basics and a few of the above topics. In order to create the game of the level I want to, I should also go over then 3rd section, skipping section 2 if I need to, since it contains more advanced C++ topics, which i probably won't need. What I will need is the Windows window applications topics, from the Windows API section.
Anything that I will need during the project but this tutorial won't provide should be easy to find on other sites, starting with MS's official MSDN.
Anything that I will need during the project but this tutorial won't provide should be easy to find on other sites, starting with MS's official MSDN.
Soon I will update this post with the list of things that I have actually used in the hangman game two years ago - it will be an indication of which things I have the most experience with.
(*) Not sure of the name - Mast of this I learned in polish and I am not sure of all the correct names - the ones I am the most uncertain about are marked.
(**) Certainly a recall needed.
Thursday, August 27, 2009
Proposal Questions
Broad outline of the project:
In 8th grade i have used my personal project as an opportunity to start learning and studying programming - I created a very simple game hangman, preceded by a period of intense learning of the C++ programing language in order to be able to create the game. This year, as my final Personal Project I would like to continue this idea; learn more of C++ and finalize it with a simple, yet more complex then the previous game.
What is your idea?
As above.
What is the purpose of the project?
It really is an opportunity to learn, explore and practice C++, as well as gain experience of game making.
What do you expect to have completed by the end of the project?
Write an executable game in C++ and learn another chunk of C++ while working at the game. I am thinking about a level of complexity at the level of a 'tic, tac, toe' game.
What resources will you need?
Internet: Tutorials (e.g.http://www.gamedev.pl/tutorials.php?x=category&id=18), MSDN(http://msdn.microsoft.com/en-us/default.aspx).
Programs: Microsoft Visual C++ (compiler, free version available), OneNote, or similar for easy design (in possession)
Other: book of C++ bases (in possession), any additional feedback from school community members with C++ and/or programming experience will be useful.
What study skills will you need to use to complete the project? What other skills?
The further learning of C++ is not only a process and means of getting the game done, I treat the gained knowledge and experience as a product of its own. However to be successful with this goal I will need to develop the ability to have a self-thought course of C++. I will also need to decide on the game soon in order to know exactly what parts of C++ to explore for it to benefit me the most.
Which area of interaction will it focus on? Why is the area fundamental to your project?
This project will very clearly concentrate on Human Ingenuity - it will be a creation of a game on a very technological basis. However, because this project is also about learning, I feel it will have an even heavier emphasis on approaches to learning that an average PP.
How will you explore the area of interaction within the project?
The whole design and creation process is the best example of Human Ingenuity. I will have to face a whole bunch of problems with often many solutions and i will have to come up with the most efficient and appropriate solutions.
How will you display the project at the PP Exhibition
I will have the program up and running on a laptop where everyone will be able to try it out for themselves.
Welcome!
Hi!
This is a blog where I will collect all my Personal Project Material. I will describe the process of my work asa well as reflect on it right here. It will serve me as a diary and help me on the final report on the process and product I will create within the project.
This is a blog where I will collect all my Personal Project Material. I will describe the process of my work asa well as reflect on it right here. It will serve me as a diary and help me on the final report on the process and product I will create within the project.
Subscribe to:
Posts (Atom)

