Dun dun dun!
what was the story?
In game development what's next?.
1: Storyline development for the first game i'm making
2: Global lore and world map creation and design (god damnit the world map part really gets me, but I just had an idea that maybe I should try to design it by racial preference, for example humans are capitalists so their cities will usually either by position as needed for military or economical reasons, garax don't care, undeads build all their stuff to defend from others so military, again, demons build wherever the fuck they want.... yeah I can work out some system like that, but first i'd need to develop the geography, the base land)
3: Code, Code, Code, Code, Code (Prototyping, Testing out various programming languages for this and that (like QT and C++ which are next in line) as well as other game engines)
4: Moneymaking; develop this or that mobile phone app. I may end up doing this sooner rather than later depending on how keen the government is on renewing my pension.
5: Everything else (including but not limited to data gathering (real life stories or research on things my games touch on), playing other games to learn more about their design, 3D modeling and animation.
That was the story, so I need to develop the storyline and global lore/world map.
Those are H.A.R.D. to do at this point. It's like writing a 600 page book, which is one of the reasons why I'm learning art. So that I can DRAW the world map instead of Write it. It is generally a good idea to create the land first, then it's key locations, and then create the lore that happens there, not the exact reverse (which I have been doing so far)
And as such, I should reprioritize a bit (it's just really hard for me to move on before I create the whole world map! or at least Kalhiri and south Cestaria)
So with that I'm splitting today between art and code. Code is easy, code is something I can do at any time without anything more than just a computer and a keyboard.
Now lets see, shift of priorities, priority number 3 traded places with priority number 1. I have already written a near-complete RPG foundation in python. My task should be to translate that to C++ and combine it with QT for a GUI.
But. There is a third piece missing, I want to turn this into a whole side project. I want to make a full 2D animated sandbox game where you can fight and *dun dun dun* fuck! (Something in the spirit of Corruption of Champions) this will be a lot of birds with one stone. It will give me something to draw. Something to code. Mountains of stuff to learn and experiment with, but most importantly of all, it allows me to combine all of these things.
Tricky part: if I'll go for animations (which is likely) how will I do it? can it be done in QT? would I need to get another engine in there? Do I need to learn OpenGL (Graphics Programming) to do this? (THAT WOULD BE HELL. BUT I'D STILL DO IT!!!)
Lets go check. (<- You can consider that an announcement)
And while I wait for an answer, how about I pick up C++?
Sadly, my favorite tutorial website has nothing on C++ nor QT but it does have some Graphical Design tutorial that I can use. I also think learning PHP would do wonders for me.
Before I got to it i got a comment on my question, someone pointed towards OpenFL, I googled around a bit and found out that the developer of one of my favorite tower defense games (defender's quest, check it out, it's on steam) is using this for defender's quest 2! ! This was surprising, scrolling down through that article and finding out it was written by a developer of a game I've spent 20 hours in! I am thrilled!
I've got a lot of languages added to my list now.
C++
QT
Haxe
Lime & OpenFL
HaxeFlixel
The last 4 together (From the article I just linked) are legit for making a complete 2D game of any kind. Sadly none are well documented and this mightbe a killer for me since i'm only an intermediate/beginner programmer at best. I've got the tricks but I don't got the knowledge.
Now here's something I want to learn but am TERRIFIED of even trying
OpenGL.
If I was good with both OpenGL and C++ writing my own advanced game engine would be a trivial task (by trivial I mean highly doable lol, game engine is not a small task. Ever.). But this isn't really what I'm looking to do. Oh how I yearn for that time when you can just buy information and stream it straight into your brain from the internet (like we buy games from steam)... I could buy C++ for a couple of dahlahs. Pricing could be higher dependant on how many people know it.
But what else have I got? I must admit though Lime at least is very very tasty, it's low level graphics code, but user friendly and not as big and scary as OpenGL (in other words exactly what I need) but it's badly documented /cry
So, until I've written a lot more code (preferably learned all other languages I want and extensively used them) I can try wrestling with the likes of OpenGL. Graphics programming is only for the best :/ theres a reason graphics programming arrived so much later than traditional programming. It's because it's hard. It took a (massively optimistic) genius called David Braben and a friend of his whose name i forgot (but no less impressive) to invent true 3D programming against all odds. Before them was 3D monster maze which was only 3D in the sense that it was like a grid based dungeon crawler (you can walk forward and to the sides but it's not really "3D" it's like... lightning warrior raidy, but much less impressive (no pictures, only lines and pixel-art) but they made Elite. Now making Elite: Dangerous which I look forward to playing, i'm in the second round beta :D
Ok, so get started with C++? C++ is one of the most powerful programming languages in the existance, but it's also one of the hardest languages any programmer will ever learn
Well, I bettered just stop delaying and get with the coding, but first.. sublime.
I think I hit some sort of jackpot here. Old, but might just be gold! (I wanted to learn it the fast way, not the easy way, I'm impatient. This may shoot me int he leg some time but I can learn it better over time. Luckily I have good programmer friends that I can ask about stuff.)
C++ is actually not very suitable for the kind of development I will be doing, but it is THE language to learn programming by, because it is hard to pick up. Every university will teach this language to you (or it's a bad university)
If you want to learn C++ start here, then go up a bit to "compilers" (since you need to have a compiler to run a c++ program you've written, this kills development speed.) to be honest though, if you want to learn programming you're best off starting with C# or Python and then going from there to harder languages like this one (thats exactly what I am doing here) I recommend C# as a well documented and fairly standard language. But I recommend python as the easiest languge you're gonna get your paws on (and it's good all right, so good that even after I learn the likes of C++ I am probably still going to use it excessively, developing on python is also a lot more fun than most other languages.) What I'm doing by learning C++ is essentially moving to a lower level so I can have a better understanding of how programming works at it's core. I only know this stuff by concept. But just to mention how powerful C++ is. Python was written in C++ (i.e. many of the most well known programming languages of today were made with C++)
Actually. reading through that is a REALLY good place to start with programming, it's a mountain of information all fast, but if you can understand it, you have understood programming.
In fact, do you want to get into programming? right now? just start with reading compilers. Then download a compiler of your choice (if you're on windows. Visual Studio/Visual Studio Express, if you're on Mac, I'm sorry I can't help you (Clang presumably is needed + a frontend) and on Linux we traditionally use GCC. but if you're on linux or mac or if you want to go pro from the start on windows. Get Eclipse)
I have never used Eclipse, but my advice if you go with visual studio which is one of the easiest ways to just jump into programming in my opinion is to not get overly attached to it unless you never want to be able to develop for anything else than windows or don't mind being bound to windows (trust me, windows is nice, I consider myself an expert windows user, and I have been for many years, theres not a single problem I can't fix on windows as far as I'm aware, I always find a solution (on google :D) but I got bored of windows. I literally got bored of it and this is one of the reasons I started using linux. You will never know if this might happen to you too if you become a developer, you just might want more freedom, and only Linux and BSD are viable to give that to you, and if you go there you can't take visual studio with you.)
I in fact might go ahead and get Eclipse some time soon, I hear nothing but good things about it (multiples claiming it's the best IDE out there) but enough of that. This will get you started.
Now after reading what I just linked, go here and learn the info in there like the back of your hand, and more importantly, write the program. Don't copy-paste. write it. experiment, toy with all these commands, write other things until you think you've got the hang of this part (I know since I learned programming recently that this does not feel like a program. BUT IT IS. It is the most basic form of a program you will find, and just this knowledge is the key to all other programming, so learn this well)
Then go further down the list to here, and understand all of that. Now, with just these 2 pages there is a mountain of stuff you can do.
Note: You don't need to actually remember ALL of the Identifiers, the main ones you want to remember are the following:
int (and short and long), double (float), bool(true/false), string (not listed, but it is lower down in the thing)
These are essentially "Whole Number"(int/short/long) which is a number like 1, 200 or 20000. Double or Floating number which can be 1.5 or 35.289. If I remember correctly one of these two can also pull off stuff like 1.3.5 (more than 1 comma)
Bool for boolean values are basically 1 and 0 (true or false) so you can do stuff like
bool value = false
and then later on
if value == false
then stuff happens
else
other stuff happens (this will come later, and this is pseudocode I just wrote, meaning it would not actually work, i'm just teaching you a concept)
finally string, string is letters and numbers and symbols. like "Dnmjpjreg.58oplikus" that's a good password btw.
The difference between numbers in a string and numbers in an int or double is that the program can use the int or double in math formulas, but the string is always just a string (as in, it cannot read the number directly unless you convert it to an int or double first, this can be done but it can get tricky and is generally not needed)
Also. You don't need to memorize the table in fundamental data types, it's not something you really need. Just use int and double and you'll be fine unless you're working with HUGE numbers which means you can go into longs and long doubles.
I'll give you homework. Write a program that creates an integer value (int) as a number of your choosing, then prints it out as a part of a string like
say "int value = 5"
then I would want a string that would say "the number 5 was chosen".
I will create another piece of homework for you here. Write a program that converts KG to LBS (google the formula for this, it's easy)
To make it simple for you, you should do this by creating integers "kg" then a double (i assume) for the "converter". Then you create a "result" variable which would be something like "lbs = kg * converter" then you print (cout) "lbs" and you've converted the kg value to lbs. Not a very practical program yet since you need to access the source code for editing the "kg" value, but you can learn user input later :)
at least by now you've already created a program that's useful. One of my first programs was a program that shuts down my computer at a specific time or in a specific amount of time. Easy, but useful (for example if I'm downloading stuff in chrome but want to go to sleep and want my computer to shutdown afterwards. Or if i'm downloading a game thru steam)
One thing you notably need to learn on your own is how to apply integers to strings. I haven't done this in C++ but it's relatively straightforward. after converting the int to a string I think it should be as simple as adding a +, like so "cout << mystring + convertedint + otherstring", it is in most other languages anyways.
So i'm pretty much understanding everything so far without writing a program myself (i'm being lazy here, i'm too lazy to get a compiler since i'm in windows as is, otherwise i'd just be using GCC + Eclipse or somethin, maybe just GCC alone lol)
Wait a minute.. u can do it online! here! (press the "try it!" button next to the code. of ocurse this is not as convenient as using a proper IDE like eclipse, codeblocks or visual studio, but I hear terrible things about codeblocks so don't go there.
Anyhow, the only 2 things to confuse me are the << sign following "cout", and the "return 0" which i'm not used to but quite know what is.
Yup, this is as easy as I thought it is (hint: "to_string(number)" is your very bestest friend here)
ok now that that homework assignment is behind us. lets move on. Next you go here. These are mostly concepts you want to understand, but you may never use much of this stuff (depends on where you go in progrmaming) but one of the things it explains is the difference between integers and float. That page is essentially going a lot deeper into what you just learned on the last page.
Apart from Hex and Oct numbers which you don't actually need to fully understand (you can use calculators if you ever come across them) this should be reasonably easy to comprehend. Take your time to understand it, and while doing so remember to write it in code and test it (it's the quickest way to remember)
One thing I do when I'm picking up new languages is to write down in documents all the code i've learned as one big program with LOTS of comments. You should see my python studies, they're just a few well sorted .py files where I wrote the commands I learned alongside with my own description of them as "comments" (comments can be //comment or /*comment*/ the latter can be used accross multiple lines but // only in one line)
Now next, we go to operators. where the real fun is starting. One you may have a hard time getting the hang of is the modulus/modulo operator, it works like this if I remember correctly.
6 % 2 = 0
6 % 4 = 2
Modulus essentially calculates how much of the intial number can be divided by the second number evenly.
So basically Modulus is the "leftover" after you divide. so essentially you can only take 4 out of the 6 to divide it with 4 which leaves 2 (modulus doesn't take into account half values) I don't remember the precise use for this, but trust me, it is needed.
I had some programs around that used it excessively, but i have lost them (old school projects) which is a damn shame cus that was like a goldmine for me to go to to remind me about programming related stuff (hot damn) I carelessly deleted it all on purpose thinking I wouldn't need it again since I remembered it all or would easily pick it all up again. I was partially right but clearly only partially.
This is a shame because I was pretty sure I had a backup on my desktop! Come on! remember, i'm sure it had to do with a currency converter... Hmm, calculating spare change maybe? yeah that's it, it was a program that took values of 1, 5, 10, 50, 100, 500, 1000, 2000 and 5000 (standard icelandic bills, we also have 10000) then you threw at it money value, and it would spit back how much change you'd get. But how was modulus required again?
Ah yes! it was at the tip of my tongue, it is required for the conversion. I used like exactly the formula in here. But there are more uses for it in games for example, I also used it in my RPG base somewhere I'm sure. Either way, I really want to master the use of the modulus because it can be used for A LOT of good, but it's not easy to just pick up >_>
But lets say we had 13600 in there.
The formula I'd use would be(psuedocode, but might actually execute in python.... however it's not complete, you'd have to remove the (2) and (1)s though)
c = 13600
fiveth = floor(c / 5000) (2) //3600 <-
twoth = floor((c % 5000) / 2000)) (1) //1600 <-
oneth = floor((c%2000) / 1000)) (1) //1600 <-
fiveh = floor((c%1000) / 500)) (1) //100 <-
oneh = floor((c%500 / 100)) (1) //0 <-
Then the rest of the values (fifty, ten, five and one) would result in a 0 and the program would spit out "2x5000 bills, 1x2000 bill, 1x1000 bill, 1x500 bill, 1x100 coin" it's basically an ATM machine.
floor (which can be used in python, the function is different in c++, as in has a different name) basically prevents any extra letters by chopping off any extra letters (so 2.72 becomes just 2)
I remember now precisely what modulus does, i always forget man. It stores the remaining value. What i did above was divide the biggest number with the main number which can only match 2x up to the main number, then after that I calculated (with modulus) how much would remain of the initial number after being divided with the number. I'm sure you get it by now.
5000*2 goes into 10.000, 5000*3 goes over 13600 which means modulus gives 3600 (what remains of the initial number)
There, modulus explained. The rest is super basic. I really like answer 2 in there. That's something I might actually you know... use. (Make progress bars cost less processing power. "n" times less to be precise.
What I mean here is that we have a loop (a loop is basically code that repeats itself indefinitely, or until a certain point is reached, this can be done with the "for" and "while" statements, you'll learn this later)
But basically you're looping, you have a counter that counts how many loops you've been through. And when "counter % n" hits 0 (they're the same number) the progress bar will update itself (so say go from 1% to 2% IF it's time to go there, for example when installing a program.)
I have done this many times in the past though, I just do it by if "counter == number". I don't see why to use modulus for this. God damn internet (it's out cold)
Rule of thumb in programming: There's a more efficient way to do it than you're doing it (in most cases, there is. This might include using a different language (hint: Binary))
Here I learned something new, conditional ternary operator (?)
Its a shorter version of the basic "if" statement.
This may seem a bit pointless for me from your perspective, but I assure you it's not. If you're using this to learn programming then it's helping me remember all the things you're learning.
So far I'm not learning anything in particular i didn't already know. Minor stuff. (Meaning I can largely just pick up and write c++ code as is) but i am going to study it a bit more thoroughly myself and i'll pull you along with me (if you're interested).
Even if you're not writing in the code like I suggested you should (and you definitely should, its fun), just reading and understanding what i'm writing here (and everything on the pages I'm linking) will help you at least understand how programming works, and understanding how it works means it'll be easy for you to pick up in the future if you ever want to (it also helps you understand better how computers and programs work)
Also take note that if you learn this language, you can learn ANY programming language. It's basically that simple in programming, if you learn one language, it's gonna be more easy for you to learn another. But the problem is that you need to make programs as you learn.
So here's an assignment for you, make a program that takes a value of milliseconds, and turns it into hours, minutes and seconds and spits it out as a string. This requires you to use integers, modulus and probably longs.
Now if you scroll down to the bottom of the last page i linked you see a chart. You want to remember the values at these numbers.
9, 13, 14 and then 15. (the upper part of 15) the rest are either no brainers or something you don't need to worry about as a beginner. (advanced so to speak) even I don't use that stuff yet.
9, 13 and 14 are the most commonly used symbols when working with numbers in if sentances.
so for example lets say we have a and b
a = 5
b = 5
c = 10
if a == b : true (if a is equal to b)
if a != b : false (if a is not equal to b)
if a != b || c == (a+b) : true (if a is not equal to b (false) OR if c is equal to a + b (true))
if a == b && c != (a+b) : false (if a is equal to b (true) AND c is not equal to a+b(false))
if a == b && c == (a+b) :true (you get it by now right?)
then in the case of 15 you've got
+=
-=
*=
...
this is basically, lets say we have:
a = 5
b = 5
a += b
(a = 10)
this is the same as:
a = 5
b = 5
a = a + b
(a = 10)
or
a *= b would be the same as a = a * b.
I'm sure you get it, it's simple but makes your coding feel like you're doing it a lot faster. it also shortens the amount of letters in your code which is more efficient. Fewer letters & lines = better code basically. (general concept in programming)
Seems like my internet isn't planning on coming back today....
Oh there it popped in (restarted router)
Anyhow, it's time for the last of the basics. Input! in my opinion this should have been stage two, not 5, but i guess thats an opinion right? with this you can now actually make usable programs.
If you feel like you're just not up for this, an easy entry level point is modding games. You'll learn how (game) developers structure their folders, and make good games better (Skyrim and Oblivion are excellent places to start since they're highly moddable and have a very accessible mod maker and modding community, this is the place I recommend getting started if you want to just take it easy at first, have fun with scripting.)
Anyhow, if you're not a wuss, finish reading down that page and you've earned the beginner programmer badge (after you've written it in code and run the code testing if it works) :D
Just to make sure you've got this, with all that you've learned so far. After writing all the code on that page, make a new program that takes an input value of milliliters and divides it down to kiloliters, liters, decileters and centileters in a similar way as I showed you my currency converter.
To do this you need to have user input (cin), modulus/modulo (%) and understanding of output (cout)
The next important thing for you to learn is else and if. And this tutorial quite agreed with me. If is the most used combination of letters in the history of programming. You bettered get good at it. Better yet; get good at avoiding it! Master this page, and you're roughly at the level I was when I started this whole thing. The sky is the limit when you've got all of these bits down, but theres more, however it's up to you if you want to stick with C++ or just hop straight to python at this point like I did.
One last assignment which should be an easy undertaking after rolling down through that page.
Make a program that allows you to pick between 3 games.
Dice (Roll a dice of 1-6 with the computer) you'll need to google up how to make it spit out a random number, shouldn't be hard to find. The higher roll wins. Make the computer count the wins (this might get tricky for you. Hint: For/Do/While loops)
21 (harder) make a game where you have all 13 basic cards (1-king) and you get to draw a random card and the computer gets to draw a random card. You get to choose whether to draw again or whether to not draw again, then the computer decides the same thing, here you actually have to write the AI, design AI so that the computer will intelligently decide whether or not to pick a card depending on how high her current total number is. You can go into advanced chance based calculations if you're that type, or you can just say that if it has 18 or higher it won't draw again. If both you and the computer won't draw again, the winner is determined by who has a number closer to 21. if you go above 21 in score you auto lose (computer too) remember to apply string values to each number (as in 13 = king, 1 = ace 2 = two 11 = jack, etc) you can also make this even better by showing your total value after you draw a card so you don't have to do any sort of math. There are tons of ways to do this, have fun! and remember to make the computer count the score so you know who won more by the end of it. Don't hesitate to cheat while you're testing this (i.e. make the computer show you the output of what it's drawing)
Math (easy) make a game that will throw up two random numbers between 1 and 100 and a modifier between (so like 5 + 3, 10 * 9, 12 / 3, 10 - 4), the rule is that the latter number is always lower than the former one (for division and substraction) you can use whatever means you would like to determine the modifier (i've never done this before actually) if you get into trouble and google can't help you, stackoverflow will.
Have fun! This is (literally) the level college kids will be at after the first season if you got this far. So be proud, and do more of this for hte next couple of days, do what i'm doing, make a game or something. Make that program you always wanted. Let me tell you though, if you stick with C++ rather than shifting to something else (i honestly recommend python) it's gonna get much harder from this point on. Next up you will need to learn about functions which is something I only just came to understand this year after I started writing these (on the older blog that is) functions and classes, oh man.
Basically so far it's the same stuff as I know but different syntax + includes and namespaces. But here's where it differs. In python a function is just a function. In C++ a function is defined by what type it is. Void is new to me. But the type is based on what the "return" value is (if it's a number it's an int) but sometimes the function is just a set of statements/commands in which case you can get away with using void (most of my functions are in fact voids)
And now we're moving into territory i'm not familiar with, efficiency. Optimization, crucial but really ahrd to get a handle on. I didn't do much (any) coding today, but it's becoming more and more clear where I'm going now and it is also clear where I'm planning to go next after that. Tomorrow I'm reinstalling my linux and im gonna try to set a record for doing it fast. And then after that's done (granted I do it in only a handful of hours, i will need to back up a load of config files to achieve this, like my fstab and bashrc and whatnot) I assume I will toss up QT creator in there and start programming C++ and QT giving a GUI to my RPG prototype. Drawing (probably) won't start again at the throttle I'm oging for till Thursday, so if you're waiting for that one, it's 2 days (sorry! but don't worry, ready or not, i'll start uploading shit on DA by the end of May)
No comments:
Post a Comment