Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Tuesday, January 19, 2016

Maximize Your Learning: Code

One of the most important things a student or teacher could come to understand, is that learning cannot take place in a vacuum. Knowledge simply isn't retained without application. This is why homework exists kids, this is why most jobs will have you learn the trade onsite rather then just put you in-front of a screen with an instructional video, or rather, this is why you don't remember everything from that video or whatever they tell you on your first day, but rather you "get the hang" of it after a few days of being in the thick of it. Trial by fire.

That being said almost any video online discussing learning code will say, you can't just learn code, you have to learn code while making something. Which is.. obvious after the fact. But during it's a difficult and weird idea to wrap your head around.. like.. How can I make something when I can only attain the knowledge to first make it after I've made it. This sounds worse then the chicken and egg problem. If don't have the tools to make something how can it be that the only way to gain the tools is to make the thing?

TUTORIALS
And
The Stages of Learning that Accompany them.
Followed by
The Best Way to Learn From Them

Learning code stage one: No idea where to start

Now, the beginners answer to that is, look up a tutorial. But because often newcomers don't know how to do anything yet, they also don't know what they cannot do, or how difficult specific things are over other things. Or what the advice that guy on the forum post even meant; what are these Array, Global int. and if loop things they speak of?


Learning code stage two: You speak Latin, but your magic seems to work.

The ambitious amateur will often after a time of this learn to look up the very specific features they're being told about and watch multiple videos, and copy what they see onscreen into the program, often mistyping little bits and, not knowing what's wrong, getting frustrated to the point of starting over or quit.



Learning code the Intermission: It's-Not-Working-And-I-Don't-Understand-And-My-Career-Is-Over-Before-It-Started!

This last stage is unfortunately where most aspiring game devs get stuck and then.. well either quit or just stick with the excuse of "coding isn't for me, just can't do it." and then they focus their aspirations to working exclusively with art, writing, sound, design, or whatever small corner of production that looks as far away from coding. And there's nothing generally wrong with that path leading you to what you really love about video games, if you find you love being a producer or concept art, or sound, or animations guy more then you like anything else, that's fantastic. I'm just going to say don't let it stop you from making games. I spent years stuck in these last two stages of learning coding and years of unfinished projects and lost potential lessons because I let this pressure of never getting it to work or never finishing or not being smart enough, or ready to learn something, prevent me from making game. The important thing to learn from this temporary road bump in learning code is that it's one of those things that happens to everyone, and it by no way is a sign from above punishing you for trying something outside of your destiny, it's just a part of learning. You can overcome it. Honestly.

Learning code stage three: Learning in Application 

The best thing about stage three is you can jump to it at any point in your learning process; which does in fact mean, you are not guaranteed to go through stages one or two, you might just have the luck that you find the right tutorial and started with the right project and having everything fall together or apart in just the right way that you learned how to find your mistakes among the code, and the values of different functions and techniques of organizing data, and learned the math to make cool little features that do neat stuff. For some lucky people they stumble onto this stage in development earlier rather then later, but other struggle finding it. I think I've finally figured it out, it's not really a trick but i want to share it with you all because had I been told this years ago I probably would have some games under my belt.

1. JOIN A GAME JAM. Give yourself something external to pressure yourself into keeping at whatever tutorial series you're following and something that'll limit the scope of that project to something complete-able within a few weeks. 

2. INSTEAD OF GIVING-UP, FIND WORK AROUNDS. There's more then one way to skin a cat and coding is no different. Learning what bits are interchangeable gives you insight to the logic behind the specific function bits and syntax in your specific code. This learning feature by feature goal mindset helps you visualize and cement in your mind what the specifics you see in the tutorial are doing and mean within the program, having something constant to apply the short youtube videos to helps you understand the building blocks outside of the specific use displayed. It's like how learning to use a foreign word in a sentence is more useful then just learning a phrase that uses that word. 

3.OR JUST EDIT YOUR DESIGN. Good design is decision making that incorporates all elements of the work, it's not possible to see all the elements of the work before they're formed, so don't feel bad about throwing out the original blueprint you had while you're working. If the project you have doesn't look like it'll be as strong as this thing you thought before you started, go with the newer path you see it going. Especially if this new path interests you.

4. MAKE IT SIMPLE AND INTERESTING, TO YOU. If you're not excited or interested in working on it. Drop it. Nothing great has ever come out of someone who was only half paying attention, and no one has ever learned or remembers the lessons they learned from the school project that didn't interest them, also you'll make yourself miserable; don't let your hobby be something that makes you miserable. There were plenty of times I tried to make mini-games where the idea bored me but they were the only thing I thought I could make using the "beginners" level tutorials I found. And that's deeply frustrating because you want to make something interesting, but it seems like you can't learn how to make those things without making these boring games you don't yet want to make.

5. STOP BEING BORING AND MAKE GOOD SMALL GAMES. There is no reason for small or simple to equal dull. There are hundreds of small games out there that have limited coding and minimal design, that end up being interesting. These are the kinds of games you need to study. Try to think about all these simple features, and think of them in terms of what they could also do. This is where your design and creative skills pay off. You could do something interesting story wise, you could do something interesting art wise. You could just do something that's a kinda neat little mechanic. Just find something neat and small that excites you and make it, once you get that little neat thing, and you understand how you got it and what all your code is doing, then you've made it. Congrats kidos, you're a game dev.

THE BEST WAY TO "STUDY" A TUTORIAL

I'm a massive fan of the, follow with me step by step, line by line, regularly save and test to see if the code is working, kind of learning from tutorials. But at the end of the day, when you're new to a program and you know you're going to be referencing this tutorial more then once or trying to put your own twist on the feature you're learning to code. Backups and notes are a great thing. Now you can make a physical copy of the notes, which is brilliant, easy to access and good for following along. But what I've been doing that I've found most helpful when going through tutorials and organizing my notes/code. Is using something like google documents. I have a file for my code, a file distinguishing between each game program in that, and then i have files organizing between each tutorial, and documents for each tidbit of code with hyperlinks to that time in the video. 

This has been very useful for the long winded videos that near the hour mark, you can break it up into bits, with notes next to the label like, //establishing array in room, //global variables for array, // algorithm for bullet time, ect. This lets you start breaking down the large chunks of code in your head via their function piecemeal rather then trying to remember each step in the recipe as one massive meal you can visualize it as all the small bits of prep-work that go together creating the whole, which will make it easier to dismantle and use bits later to make other features.

Secondly you can copy the code down verbatim into your document so it can be copy/past utilized later for other projects, and you'll always know where it is, and be able to access it anytime you've got a computer. Having this with the hyperlinks to the section of tutorial explaining each bit eliminates the need to search through your youtube history or sit through the majority of the video when only a few minutes pertain to what you need. It saves large amounts of time and also gives you a space to store that new code function you just figured out even though you don't have use for it in your current project. Honestly I'd rather have a dozen small word document files with lines of code in them then a dozen or so versions of the same game because I don't know if I'll want to go back to an old build, especially when most of the code is exactly the same except for a few long coded functions. That might just be me, but I'd rather my builds be stored on the cloud where I can always access and edit them rather then on a single computer, or hard drive. I have lost so.. so many jump drives, and there's nothing worse then the computer bursting into flames and loosing everything you've been working on. 

And those are my tips to learning code the fastest, I went from almost never getting anything working after years of being stuck in the first two stages, to having a working understanding and building a game with my own unique twists that I coded on my own in the span of two weeks. All because of two things, I had a small project with a similarly small (achievable)scope and time-frame to make it in, and I was excited to make it.

That being said, I didn't have any art/animations, and there was virtually no story, or levels, so those are things I'm going to need to learn to do as well. Next time I'll probably have something up on one of those. 





Sunday, February 2, 2014

2014, The Year of Pies and Fingers.

With my first class of the semester just a few hours around the corner and a few elements of my platformer working I just wanted to take this time to throw out my game plan as far as game development goes for this semester.

I've decided to aim to develop three games this semester using the respective optimal programs for their development and record my progress and lessons learned here. One platformer, one rpg, one adventure game. Each using their respective suited creations software; Construct2, Rpg maker, and Ags. Each will only be using the most basic elements of gameplay from their respected genres that I can code without too much difficulty so I can focus on the design during development and come up with the most polished product possible.

Still, this is kinda nuts -for me at least- I'm a full-time student, have my game journalism column with Kevin along with my other duties at that internship, might help write for my friend's film journalism internship group, I'm getting a second part time job, and I've joined a band. But I'm still optimistic, second job is a every-other-Friday-or-third-shift kinda deal, my classes are basically condensed to two days through the week, with a one-class-easy monday/wednesday/friday, my other job is flexible, all of my classes are interesting, plus I've found awesome communities that can point me to tutorials and so far have been more than happy to give me advice and pointers on my work. The planets have aligned as it were. 

My aim is to learn as much as I can and develop my skills so that future design ideas can be realized more efficiently. The benefit of making a number of small games when first starting with a program to making one massive one is a stark contrast. When you spend half a year making a single(conservatively saying) big game it's going to take you much longer to distance yourself from the work and be able to reflect on it's flaws and missteps. You often hear developers talking about the benefit of having gamejams and having to fit some awkward random parameter in some genre they're new too. It challenges you and makes you think about the process and medium in ways you haven't before. The same way you hear writers often tell people the best advice they could give to a fledgling author is to read books that are out of their genre or style. Short projects that let you brainstorm on something completely new then see it through to completion without the time or luxury to spend time second guessing or last minute revising help build confidence, familiarity with working the crunch, and understanding of the development process.

And so in this fashion I'm going to be tackling a puzzle platformer, a turn-based rpg, and something in ags... just kidding it's going to be a point and click adventure game. I barely have the slightest knowledge of ags scripting and I don't have any Rpg Maker sofeware as of yet. But after fuddling around with Construct for a few days I spent today.. yesterday. Sunday, working on an engine and thus far I have

1. functional wall jumping
2. invert-able gravity 
3. button mashing type flying (broken double jump)
4. self destruct button (broken dash, soon to be fixed)
5. rotatable characters (no ai to have secondary character follow you around thus far)

But that's just one day. I plan on spending a week on each engine, getting what functions and place holder graphics I need working, and anything that's glitchy/unfinished/I-don't-like will be either removed or disabled from the code and I will use whatever I have to come up with a design. The design will be scaled on my remaining time, and as I plan on fitting these out across the semester the first two at least will probably be pretty small scale. There are really only two functional elements in the platformer right now but I'm getting a good arcade feel from it. Rpg will probably be a small mystery as that's a simple way to have a concise story wrap up at the end of a puzzle/dialogue session, it'd be rad if I had time to figure out a multiple ending sort of thing. And to be honest I have no idea what to do for the Ags and that's why I'm going to schedule it for last.

I'm not going to set any publish dates or anything like that for the individual titles. I just want to have a working beta of each by the end of the semester. There is the possibility that I will fall on my face and fail halfway through. I might end up with just three somethings that play kinda like games, but regardless of the physical product what I'll have learned through the experience gained as a developer will be immeasurable. 

Other great advice is have a good programming friend who can look at what you do and give you pointers, one I've chatted with mine and get those broken bits fixed I'll put up my links to the tutorials and include my own commentary on this platformer engine I'm making. I'm thinking something end product like Wario Land but with a gun.

Til next time, goodnight everybody and good luck with your projects. 

Friday, January 31, 2014

Learning Construct2- 101

Such Basic 

Now the great thing about learning coding with Construct, is that you're not really. You are, but you're not at the same time. In a pervious post I mentioned how game making programs like Game Maker, Game Salad, MMF2, and Construct 2 support this kind of psuedo-code. In Construct 2 these are called events.

^this is what they look like

The usefulness of this pseudocode is to condense the functionality of actual code into small bite sized re-arrange-able puzzle pieces. This makes the function and logic of basic computer languages much more accessible to a wider audience. It's like Duplo for programmers.


And while this looks approachable and easy as pie (and it is), but it's not really. This is a simplified translation of computer language for human peoples, but that doesn't change the fact that pseudocode is still a computer language and structured in computer logic. Which means their will be times you think you have everything set up correctly but while testing out your double jump your character floats off into the nether. Computers are like little evil minions, they'll do what you tell them to.. exactly what you tell them to, without understanding the context of what you mean by it even if you think it's perfectly simple English.


I know this sounds really obvious, maybe even patronizing, but if you're just starting out with Construct or any game making program, or you've been toying with it for a bit but still are having weird glitches where you don't know what's wrong with your code, please read the manual. (here is C2's) I'd love to say, "I can't tell you how many times I was close to finishing a project and going back to the manual saved my game." but I can't because I'm one of those stupidly stubborn learners.

I want to be able to watch someone do something, try it myself, then look at my finished product in comparison to someone doing something harder. I want to learn by my mistakes that way, to learn through hands on exploration and observation. When I got my lego sets I'd skim the instructions but always try to finish the set by using the cover and what I already understood of building. As you can imagine I'd often make small mistakes and end up having to go back and rebuild some big thing because I used some wrong brick someplace and be one square off. Bit of an awkward simile but the issue is the same, if trying to skip steps you won't really be able to manipulate the tool the way you'll need too to. I just can't stress this enough. It's not saying you won't figure out all the small stuff inevitably through other user tutorials or asking these people, but typically it'll be something basic that is in the manual if you give the manual some love.

Trying to make a small indie game title without really studying up on the tool you using is like trying to self publish a short story you wrote without really learning grammar. It's likely to not pan out for you, and if it does it would have gone so much better if you had just taken the time to sit down and do your studying. I know it's one of the tedious parts and you just want to be making your game, but I promise you the reward is by far worth the effort. You know that great first moment when you got it to make stuff move onscreen, when you got the enemy AI to respond the way you wanted, or the animations were synced with the differing inputs correctly for the first time and the small blurs onscreen just popped to life? That will be so much rewarding if you are confident in knowing how all of those small things worked out. And secondly learning the how is not really even the tedious part, the tedious part is when you have a working demo, a well polished engine and intro level.. and then realize you have to develop the entire rest of the game. All those levels and those extra inputs and balancing the enemies and complexity curve, and plot exposition. And even more tedious after that is the 97% completed -I'm-sick-of-this-project-now- final bug fixing and edits before sending your little creature out into the world. But that's for another time. First learn your program and build that sweet sweet engine. Play test frequently and never give up. Good luck with your projects and have a good afternoon fokes.




Thursday, January 23, 2014

Gotta Walk before you can Crawl

Reverse That

So... learning pixel art and design. Code still looks like Russian to me. In what way can someone utilize and test their abilities in the design/writing/art section of game making without yet understanding the code, the very life blood of games? Well there are two possibilities, either A. you work with a team where the code is not your responsibility. This is good because you can hone your specific craft, the issue though is you are reliant on first a finished product to test your work in action and second forced to wait until a certain point of production. Games evolve as they are made and sometimes entire sets of art assets become useless if the design changes. What an artist or writer or designer wants, is to have something tangible to show their work. An actual game that functions as such to display their work, otherwise their craft isn't as well represented in portfolio (and obviously this is less the case with artists or musicians whose work can be appreciated separately) but design in interactive media needs interactivity. Even if it's just the menu buttons lighting up as your mouse hovers over them.

Option B. the artist/writer/designer can find a program that requires no code(or little) to create functional games and have at it. 

And that's sort of what we've been trying to do here. Find the easiest way to make games. Just to be clear, the truly difficult part -the area where a game becomes great or crap- is not in the tools but the creator. Card games are crated with paper and ink. Board games are cardboard, ink, and bits of plastic. The average Chess game is just made of bits of wood and cardboard, and yet that's been around for centuries. My point is the tools do not dictate the quality of the product. Someone can have the best equipment in the world for digital art and still come up with something that looks like junk. Back in the day graphic designers use pen and paper instead of illustrator and the existence of illustrator along with all of its tools have not lead to better graphic artists. 

Anyway, previously in a discussion I had heard Construct 2 mentioned. Previously I hadn't head of this program and at first glance figured it to be the same as MMF2, which dispite all of it's pros is still an expensive bit of machinery and therefor out of our running for "easiest to start making and learning about game making" contest. Ags is great and I'm loving the community, but there's still a decent amount of code required. It's inescapable. 

Or is it?

The reason I advise people use programs like MMF2 and (as far as my limited understanding) programs  like GameSalad, is because they have this sudo-code. Underneath it's the same code that makes any other game work, but it's broken down into symbols and an easily approachable interface. This teaches code logic, which if isn't later used to understand code in it's true raw form can at least bridge the gap between you and your coder when communicating in production. GameSalad is one that's free, but right now we're going to take a look at Construct 2. Or at least I am.

Here are a few games from a person I follow made using Construct 2
http://supajackle.tumblr.com/backlightbig
(personal favorite of his work)

http://gamejolt.com/games/platformer/hero-quest/16821/
(I get a bug with this one but idk, maybe it's just my computer)

http://supajackle.tumblr.com/PixelGame

http://supajackle.tumblr.com/post/45430588965/porterminus-a-spooky-rpg-by-supajackle

 Here's the link to their site where you can download the program. 

Great things one, the interface is easy to understand, it comes with it's own paint image editor which is also easy to grasp. Great things two, it starts out offering a list of templates to chose from, not just get a head start templates for making top down shooters, path-finding, physics, or platforms, but templates to make your game work on Facebook, mobile devices, ect. 

Personally I'm hesitant to jump onto another program, I'm trying to figure out two different programs at once. But really few of my designs are actually complex. Most of the ones I have now are just platforms or beat-em-ups, the big ones.. The ones that are going to take a while use Ags, and it'll probably take me the twice the amount of time to do the art then it will take learning and coding the thing. And with school and work, if I were to throw out a number of when I'd finish that game it'd be someplace in the years category, even if I weren't doing the coding. And while the payoff will be awesome until then the work will be rather slow. Not to mention this blog, besides the DeconstructionCraft notices how much can I say about a background having a bit more shading or a single line of code being added. Development on.. I'm just going to call it 'the Island' project will be slow, and I'd prefer if I can have more regular activity on here. I think I'm at a point in my "career" I just need to make games. Yes I have a group project going on and this big project of my own, but I need something consistent and easily completed. Ags would be my tool if it was more oriented for platforms or the like but it's not, and C2 is. With school coming up and other messes that require my focus irl I'm going to be posting for a while about Construct 2 with the intermittent updates on Ags and what I've learned there. Soon as I can figure out fraps(this is the kind of simple you're talking too) I'll start putting up let's draws or tutorials or speed production vids. But for now I'll just be written bits with the occasional screen-cap. 

Until then, good luck with your projects, and goodnight.