SPR_Phantom wrote:I was actually criticized by someone upon showing them these, but they didn't really explain why they despised it! I'm worried I'm not using things to their full potential.
What is this non-sense you've decided to spew, youngster? You claim to be in college at the tender age of 17... Act your age!
[quote="YouTube message TO "SPR_Phantom" - 10/06/'11"]Hello, MaxRavelle.
First off, it looks like you've copied & pasted code you've found off of MSDN (the examples), and have made no attempt to learn them, or apply them in any reasonable sense.
Second off, I'm not sure how you managed to implement that frame limiter (I'll assume you copied someone elses code, or simply their idea), but it is very impressive to me. There are alternatives methods to creating a frame limiter with the console, but that, is a pretty universal approach. I like it.
Third off, you aren't using wrapper functions, which makes reading some of this stuff very difficult. You are using the 'raw' Win32 API, which is fine... But I prefer to create wrapper functions for readability purposes. If nothing else, use a #define macro like you did for the 'W' key (you named it: "Wk").
Fourth off, aside from the fact you have INDEED created a monolithic main.cpp file, the class organization (as you stated before) is horrendous! I do not like it AT all! I do not like how you named things either (that's of no consequence, personal preference).
I found it to be EXTREMELY difficult! To locate and follow stuff. I also noticed soon on that you used a "float" type when you're assigning it "double" values; I simply changed those float's to double's and it worked fine; That may be a difference between the GCC/VS compilers though.
The fact that you have it CONSTANTLY writing to the harddrive is BAD. You do NOT need to do that! It not only will wear out the harddrive faster, but wastes system resources (not that they are really necessary for a project of this magnitude (lack thereof)). Bad habits die hard though.
Fifth off, you are using GetAsyncKeyState instead of using the console's internal buffer to manipulate key input. With how you have this set up, I do not even need the window's focus to play the game!! Select the foreground, like your browser. Let the console over-lap on top of the browser. Press the "W, A, S, D" keys, and see your character move... Disastrous, no?
This is just a basis of ideas (criticism). If you'd like to see some source code, I'd be more than happy to provide some soon. However, I am going to bed soon. I work today from 16:00 to 18:00.
Talk to you later!
"[/quote]
... Here is a partial copy of his reply shortly after (I can check my e-mail and post exact time/dates if anyone's interested):
[quote="YouTube message TO "SPR_Phantom" - 10/06/'11"]
Thank you for your tips/criticisms, I have not yet had the chance to pick up good habits as this has been my first C++ project this side of 2011 and while I did have to read up again on how to do some of it I in no way stole any of my code or simply copy/pasted.[/quote]
Yet here it is, the same day I offered more explanation, and offered more help, and awaited an eagerness on his behalf or simply interest in the project idea altogether! More lies stacked upon lies! Why must you do so? I do not understand. It is absolutely unnecessary and unreasonable! It is ludicrous, SPR_Phantom. Please don't...
SPR_Phantom wrote:I was actually criticized by someone upon showing them these, but they didn't really explain why they despised it! I'm worried I'm not using things to their full potential.
If I have failed to explain myself in depth, then tell me so! So I may try again from another approach, one that you might understand better. Do not thank me for something you do not understand, SPR_Phantom. That only wastes BOTH our time, and creates frustration (as shown). I am fully well aware you have declined any further help, due to some estranged belief that I have attacked you on a personal basis, but I will offer my hand one last time...
Normally I would send this over YouTube, but that's irrelevant to me at this point, as I believe everyone should see this, as everyone who reads it will benefit from it in a positive way, hopefully. I will again explain more and more as to why I disliked the way you went about things in your simple game:
- Monolithic main.cpp
This is a MAJOR design flaw! It is hard to locate specifically what you need. Modifying the existing code-base becomes extremely frustrating, and difficult
- Your syntax ("style of writing")
I disagree with how everything was written, at random seeming, pieced together from different sources.
- The macro at the beginning
- The "cls()" function at the end
- The irregular white spacing altogether
- The naming of variables, classes, and functions
"entitycell," "ecellrefresh," "ecid" are all hard for me to read
- General DESIGN paradigm
This seems to be lacking altogether! I see three monolithic classes: entitycell, area, and character
- Reinventing the wheel
You chose to create an ENTIRE class wrapper ("entitycell") dedicated to the console cells (color, position, etc) instead of using what's already there!
- Reinventing the wheel x2 (the console IS an array ALREADY!!!)
You implement an ENTIRE (duplicate) array to 'reference' the console within the "area" class
- CONSTANT harddrive file writes
There is NO point in continually updating the file every program iteration; This wears down the harddrive more than it needs to be. This also constantly OPENS and CLOSES the file, just asking for a corrupted save file when something malfunctions (power-outage just to name one)
- Direct Win32 API calls - UGLY!
Another personal preference, as stated in a YouTube PM once before: Wrapper functions do not only provide an 'easier' and 'more clear' way of calling library functions, but may provide MORE functionality, without constantly repeating code (see: C++ overloaded functions, C++ overloaded operators).
- main() function
Disgusting, cluster of unreadable crap! The error checking was fine. The lack of whitespace? NO! The awkward system of arbitrary seeming loops? Disgusting!!! That could've been done so, so!!! Much better!
There are more intricate aspects of your program I could criticize in larger amounts of detail, with more potential solutions (of my own), but that's not up to me. I would spend a lot more time than the half hour I've already spent creating, and formatting this reply if I did! I am simply here to say: I have attempted to help you COUNTLESS times before you joined this forum. This is the last try. I hope you heed my word, SPR_Phantom!
There were some potential solutions you'd mentioned you could do, over YouTube, such as keeping the GetAsyncKeyState() functions and simply 'working around' them to keep the wretched design that you have set up already (which leads me to believe you know of NO other way to, and are HIDING that fact!). I insisted you learn something new, such as the ReadConsoleInput() API call (among others). It's a SMALL amount of work for the LARGE SCALE amount of benefits you'd reap! There was other stuff, but I'll leave that to YOU to discuss and bring up.
Sorry about all the crap over IRC; I have not been feeling well lately, and honestly, the conversation regarding English was VERY stimulating to me. I should've taken it to a PM, but equally, you (whomever complained) could have squelched me just as easily.