Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
40oz

Programming for Dummies.

Recommended Posts

Alright. I hope I'm not goin way over my head, but I kinda have an ambitious idea for a PC game that I want to make real.

I desire to make a PC version of the game Contra. (Gryzor in Europe. or Probotector worldwide) I want it to play nearly identically to it. A simple side scrolling game. You die in one hit of any attack. You can run left and right, jump, and aim in eight different directions. W to jump, S to go in prone, A to move left, D to move right, Arrow keys to aim, Spacebar to shoot. Those are the only controls.

I want to create a personal map format that at first is very basic, starting with a black background that is void area, and allowing to place white tiles that are solid. After designing the terrain, place images (stored in a scenery folder) over top of the black and white terrain to decorate the map and make it look less basic than it really is. Preferably with a multiple layer system like Photoshop. Some layers in the background scroll slower than others with the camera to give maps more depth.

I want to create a variety of enemies that have fatal one hit kills, but have predictable moving and attack patterns to place in maps. You should be able to easily determine that they are taking damage (by flashing different colors) and they should make explosions all over the place when they die.

I want to create an editor that's easy to use, so users can create their own custom contra maps.

Contra, next to Doom, is my definite favorite game. Particularly Contra III, and Contra Hard Corps. The problem with Contra is that the game is extremely hard, which is what gives it its insurmountable replay value. Though once being aware of what the maps have in store, the game is very easy to be prepared for. My intention is to allow users to create their own Contra maps for infinite playability.

I'm willing to do the work that's required to make such a thing. I even got to work on a sprite sheet

My only hurtle right now is that I've never done any programming before and not really sure where i should begin. What programming language should I invest my time in to take on this project? Am I being too ambitious for someone who hasn't had any practice programming yet?

Share this post


Link to post

If you wanted to give it an authentic feel, I would imagine you would have to pay close attention to how the 'physics' works in the original. [goes out and starts the emulator for a few minutes]
There appears to be only one movement speed in the first one, and there is no sliding or anything. If you jump while moving in a direction, the hero keeps on jumping in that direction until you push the other direction in which case the hero changes the movement direction (horizontal) while keeping falling.

I've seen many people try to recreate Super Mario Brothers, and different 'physics' really sets me off. They just don't _feel_ right.

Share this post


Link to post

If all you want is to make a Contra clone, you might get along more easily with a game creation system like Game Maker or Multimedia Fusion.

Share this post


Link to post

Actionscript 2 may be useful. I tried for my final flash project to make a fully working Mario clone with Duke Nukem. I made it work to a limit. Sadly my skills just weren't enough to make this happen so quickly. But there are allot of side scrolled tutorials out there and once you learn the ins and outs of actionscript you can then use the theory to your own needs.

It is at all possible to make a fully working Contra game using flash. You will just need time and patients. Sadly for me, it's just not a talent I was born with.

Share this post


Link to post

If I were you and felt really strongly about making these garage kinda games, I'd definitely learn C# and go for XNA. A huge amount of people have gone that way and paved the road for you. Additionally, you would be able to deploy your project for PC, XBOX360 and Zune without making groundbreaking changes.
C# and XNA is probably a good deal more complex than the "game maker" "click and play" kinda applications, but the benefit would be huge.

Share this post


Link to post

Just this week I decided to learn C++ so I can both understand the Doom source and make a Roguelike.

My eyes usually glaze over when I read programming guides, so currently I've got a grasp of variables, condition statements, functions, and a little bit of loops.

I can write you a mean program that plots the area of a shape (essentially finding mathematical products), but I am a long way off even having anything close to a game.

Depends how patient you are I guess.

Share this post


Link to post

Here is a 2D game engine that I was reading about today, it's called the "Brick Engine" and has some features you mentioned (tiles, layers).

http://rs.tc/br/doku.php

I suggest you check that out, and try and get the sample game to compile and then try adding your own things to it.

There are surely many other 2D engine out there, for example this one uses Lua (same language that Oblige uses), but seems to be still in development:

http://love2d.org

Hope that helps.

Share this post


Link to post

There are a lot of different ways to get into programming. You could do it the easy way and just use a game maker, but that limits your creative abilities and usually locks you into a specific platform. You could learn C or C++ and SDL, but if you've never programmed before then the learning curve is going to be steep. You could try something like FreeBASIC, which is an extremely advanced BASIC compiler so the syntax is pretty easy and lenient, but then people will probably yell at you for using BASIC. So there's ups and downs to every option.

Share this post


Link to post
Eponasoft said:

but then people will probably yell at you for using BASIC

If they do, tell them to get fucked. I've seen some incredible things in FreeBASIC. If I was looking to implement a unique OpenGL game FB would be one of my first stopping points.

Share this post


Link to post

Be aware it can take quite some time just to learn the basics of programming(regardless of language). Even then your programs will likely have some terrible design flaws.

I'm not trying to discourage you. It's just that making your ideal game as your very first project isn't that great an idea, but at least it isn't a damn WoW clone.

If you decide to continue I would suggest picking a language that has an easy to use compilation model, like C# or Python. Also for 2D map editing I would highly recommend TileStudio, as you can make pretty much all your maps/images/animations in that one program. If you need any help with it ask me, I've written several map loaders for it.

Share this post


Link to post
doom2day said:

If you wanted to give it an authentic feel, I would imagine you would have to pay close attention to how the 'physics' works in the original. [goes out and starts the emulator for a few minutes]
There appears to be only one movement speed in the first one, and there is no sliding or anything. If you jump while moving in a direction, the hero keeps on jumping in that direction until you push the other direction in which case the hero changes the movement direction (horizontal) while keeping falling.

I've seen many people try to recreate Super Mario Brothers, and different 'physics' really sets me off. They just don't _feel_ right.


I understand exactly what you mean. I intend to make it play as closely to contra as virtually possible. The physics in Contra don't seem very fancy, it "appears" to be relatively easy to create.

WildWeasel said:

If all you want is to make a Contra clone, you might get along more easily with a game creation system like Game Maker or Multimedia Fusion.


I was thinking about that, to skip the 'learning everything from scratch' phase. But I don't think I'd get to create my own map format with that. But then;

Scet said:

If you decide to continue I would suggest picking a language that has an easy to use compilation model, like C# or Python. Also for 2D map editing I would highly recommend TileStudio, as you can make pretty much all your maps/images/animations in that one program. If you need any help with it ask me, I've written several map loaders for it.


This could be extremely handy

andrewj said:

Here is a 2D game engine that I was reading about today, it's called the "Brick Engine" and has some features you mentioned (tiles, layers).

http://rs.tc/br/doku.php

I suggest you check that out, and try and get the sample game to compile and then try adding your own things to it.

There are surely many other 2D engine out there, for example this one uses Lua (same language that Oblige uses), but seems to be still in development:

http://love2d.org

Hope that helps.


As well as this. Thanks a ton guys!

Where do I start? As so far all I have is a dream, very accurate knowledge of the gameplay of Contra, and some player sprites.

Share this post


Link to post

If you'd rather write your own engine instead of using something ready-made, I'd recommend .NET/C# (or Mono). It's easier to learn than C/C++ and is "fun" to code with. Besides, DB 2 was made with C#, what more can you ask for? :P

This is a pretty good and not too hard to understand C# tutorial. Also, as far as actual C# programming is concerned, do not use any flavor of Visual Studio. SharpDevelop is much, much better.

Share this post


Link to post
Jodwin said:

C# pimping


No way! Java is much...argrhh bleargh borgh gabooorth.....

[converts to C#]

C# is the p4wn 4nd t3h h4x you fux0r, so STFU or 1'll r43p j00r @$$ wiT|-| 4 r4z0r |)1l|)o!

Share this post


Link to post

LMAO

Jokes apart, I actually converted to C# from Delphi as a means to develop Windows applications. While Delphi works well, has C-like performance and has an IDE and a RAD environment that's far superior to VS and any Java IDE available, it becomes finicky when you start doing crazy things with the memory or want to multithread (there's no automated garbage collection etc. so you're pretty much on the C/C++ level of complexity).

As for Java, if it was something meant to run on desktop hardware and have a GUI, I'd choose C# again because of the better development tools, better threading tools, predictable performance, and better integration with Windows' native libraries (and now even Linux's, with Mono). Only for browser-based stuff and for specialized server applications I'd choose Java over C#. The ability of C# to use unsafe types is also priceless, whereas with Java you'd have to come up with clunky workarounds.

Share this post


Link to post

Random aside, I think the stigma BASIC has is a little silly these days. I mean, as I recall, the biggest problem was its lack of structure, which often led to sloppy code. However, most modern dialects of BASIC allow for structure, so really it's a moot point, in my opinion. Heck, even the argument that it gets people into bad programming habits is a little ridiculous to me, because I started off on unstructured BASIC, but I had no problem adjusting when I moved on to more advanced languages.

Share this post


Link to post

Visual Basic is also responsible for a share of BASIC's bad rep as a whole, and also the fact that even when compiled it could not match the execution speed of a C program. But yeah, I agree that there are (and were) far better dialects of BASIC out there, however even if the language has aged well, it hasn't won the bet of time (except in the form of VB).

Share this post


Link to post

If you want to stick with C++ and learn SDL, but don't necessarily want to start from scratch, which is a much larger task than you probably think it is (I know my first attempt at a programming project was going to be a sidescroller, and I thought it would be something simple.. oh boy...), then you might want to check out this:

http://mancubus.net/svn/halif/trunk/

Halif Engine is a generic game engine framework primarily targetted at 2D games. Unfortunately it's a software engine. If I had time to start over on it, I would do it in OpenGL with a "2D" projection, like most modern sidescrollers work.

This one has the bonus of not being finished. The tile scrolling engine is there, but there's no clipping, sprites are basically not even started, and plus you'd need to rip out all of the demo code for the CVC project and replace it with your own game.

Share this post


Link to post

Whatever language you use, I would recommend sharing your code. If you've never done algorithm analysis, chances are you'll do things inefficiently. Although the code may work just fine, it would be a shame to not get it running as well as it could be.

Share this post


Link to post
Super Jamie said:

If they do, tell them to get fucked. I've seen some incredible things in FreeBASIC. If I was looking to implement a unique OpenGL game FB would be one of my first stopping points.

I totally agree. I was there at FreeBASIC's inception, and although I don't like the direction it's gone in recently, it's still one of, if not THE, most powerful BASIC implementation available today. VB.net and PowerBASIC are its only competitors, and neither of them can do some of the things FB can do. There's a new BASIC compiler in heavy development these days too, it's called QB64...it's basically a QBASIC clone for modern computers. It runs in Windows and Linux and uses SDL. It's still a bit primitive but so far it looks pretty powerful and always has room to grow. But out of all of these, only FreeBASIC is able to go toe-to-toe with gcc in terms of both code generation and execution speed. While a well-written program in C compiled in gcc is still going to have the advantage over an equally well-written FB program, it's close enough to consider them just about equal, which isn't bad for BASIC. :)

Share this post


Link to post

Whatever language you go with in the end, start simple and work up. Just for laughs(?) I've been teaching myself x86 assembly, and I've managed to create a serviceable if primitive Zork ripoff; before it became an actual game, I developed and optimised routines to display text, get user input and find matching strings.

Assembly may be simplistic and laborious, but it'll teach you a lot about how the computer actually works and the most efficient way to achieve a given result.

Share this post


Link to post

Before I even knew how to program loops, I had dreams of programming an awesome sidescroller. I now look back and laugh at how naive and ignorant I was. There are so many things that can go so badly wrong, it's unbelievable. You have to have an extremely logical, analytical mind and have a complete appreciation of how much babying and micromanaging a computer program requires. You must also be very motivated and have a way sustain that motivation.

Share this post


Link to post

Go for it, don't be scared by it. I have to be honest, you are certain to fail, but very much like life itself, any hobby or art you pursue ultimately ends exactly the same way: no matter how you live your life, you end up dying; no matter how much you hone and shape your arts through hard work, optimism and sheer force of will; your body of work will be left incomplete and with room for improvement.

You'll bang your head and crash into walls to the point of retreat, or perhaps, the acquirement of a disdain for all things related to code. But the truth is, the next time the creative juices start flowing and your mind and hand itch for a project, you'll be an order of magnitude better prepared.

Over time as you code your way through personal projects or work-related endeavors you get this knack for figuring out what can be done and a rough idea of how to do it, but the truth is no one can effectively anticipate the hundreds of twists and unexpected complications even the most 'basic' of systems can present beforehand. Truth is, the real, day to day progress killers are things you stumble upon two lines before coding the actual deed. These things come from nowhere: even if your code is elegant, generic, error-aware, modular and well-structured, some tasks are inherently dozens of times more complex than what a preliminary assertion at the design phase could possibly reveal.

A game, even an engine, is a work of art that could always be improved or expanded. It is never perfect, it is never really complete. People find it very disheartening for their projects to not even compile correctly or show a mouse cursor on screen. But once you accept things are never over, you see all code turns into either reusable bits, understanding of architectures, programming knowledge, or even better, a talent for attacking tasks as logical problems rather than coding exercises.

You seek an ambitions project, but who am I to discourage you? I tackle things I've never done before for work and I depend on those monthly checks to survive. The unknown is a lifelong partner when it comes to programming. When I was a kid I could not finish my text adventures, just as I am sure you will not finish this project in this 'generation'; that being this first attempt, the way you currently envision this idea. Were my primitive gotos and prints better than learning about loading bitmaps and arrays and graphic library functions? I honestly don't know. I know it can't hurt to try.

Share this post


Link to post

Well, I too once wanted to code Galaga in BASIC. On a PB-110, no less.

Share this post


Link to post

I first tried c++, then python, then actionscript 3, then back to python.. and I probably couldn't make contra with any of them, heh heh (I'd love to make a super-punch-out or streetfighter type 'map/character editor' myself). But at least I can do some super simple little experimental things like make an animated tree fractal or something (finally after years of gradually forcing myself to endure a pile of cryptic hurdles).. I just have to think for hours to make them work in a likely inefficient way..
Man I hate object oriented programming.. if only for the huge newbie hurdle it provides.. especially in actionscript.. its a pain to find any good tutorials/examples for n00bs then when you finally find one.. oh sorry that one is for actionscript 2, not 3, or that one is for object oriented programming, not procedural. So basically 1/4 tutorials are useful (but maybe I just had a bad experience because back then as3 was just released so perhaps there weren't many tutorials yet). I still can't use any confusing object oriented programming..
Python is my favorite. It simplifies code so you don't have to worry about some of the more cryptic stuff such as in c++ (ALL programming is cryptic.. I just mean the MORE cryptic stuff) and seems more newbie-friendly. However python is quite a bit slower than c++ probably. If you use python I recommend pygame (I'm kinda a n00b so my recommendation isn't worth much), and also using drpython instead of idle (because idle screws with your firewall too much).
Definitely go to a forum regarding your chosen language regularly.. there are some freakin smart people out there to learn from and knock down your hurdles faster (and in the beginning there's a hurdle for every tiny pathetic thing).
Tons of people seem to be able to make flash/actionscript games (just look at all the new games at kongregate.com). I think flash has vector graphics at its heart so not sure how more pixely raster graphics work well for it.
I'm jealous of people who can code doom/doombuilder/oblige/etc. Its kinda insane that anyone can make anything that complex work.

Share this post


Link to post

You could try to look at pygame togther with python. It is based on SDL, it supports opengl plus it has a really nice simple syntrax.

Edit: really nice spritesheet. :D

Share this post


Link to post

OR, if you're totally new to programming and you're good at gfx (I concur with Torn on the quality of the sprite sheet you linked to), you could consider pairing up with an experienced coder.

Share this post


Link to post
gggmork said:

Man I hate object oriented programming.. if only for the huge newbie hurdle it provides..

Huh...I always found object oriented much easier than non-object oriented programming. It's just so much easier when you have reasonable ways to organize and encapsulate stuff. :/

Well, I guess Python could be a good beginner language too. It gets rid of "those fucking annoying semicolons" and adds dynamic typing to name a few things which make it more "noob friendly." Personally though I hate both getting rid of semicolons and, especially, dynamic typing. But maybe it works for you...

Share this post


Link to post

C++ is largely just a formalization of what is already best practice in C. The actual expressiveness of the language is only slightly higher (automation of constructor/destructor calls, operator overloading, and templates account for most of what can't be done naturally (or at least simply) in C).

Given that fact, you can write C-style code in C++, or C++-style code in C, and I find neither language to have a huge advantage over the other when the programmer writing in them is sufficiently determined to create clean, encapsulated code.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×