Jump to content

Help for programming language


Shadowblaze
 Share

Recommended Posts

Shadowblaze

I decided to try making a retro videogame, and I wanted to ask what programming language should I learn in order to make a realistic one. In case you need some information about what I aim to make, I wanted to make a 2D platformer game with collectible weapons, if that even makes sense. :P

Soooo... Any ideas?

Link to comment
Share on other sites

Something you need to understand first and foremost is that making a game is a huge commitment; regardless of if it is a hobby or a serious project, it takes a lot of time, effort and dedication to see it through the end. While it's true that you can make a game in under a day, it would mean extraordinary amounts of concentration, and you wouldn't be able to give the game the polish or testing it deserves.

If you're interested in making a game just out of boredom/a hobby, I recommend you search around, find an engine you like and then simply find YouTube tutorials to make games with that engine. They can be fun and rewarding, and you'll learn a lot in the process. If you're serious, you need to start by clearly listing what you achieve, finding an engine that has the capability to do what you want (making custom engines from scratch is difficult, as I'm sure Kirk?by is willing to attest to), and then you need to research the tools at your disposal so you can find the right method to do what you're looking for.

Something you need to get into your head early is that retro video games aren't about the art style; in fact, the commonly accepted "retro" style has nothing to do with how 80s/90s pixel-graphic games looked. The reason these games are retro are because they all live by the concept of RISK AND REWARD. This games are brazenly hard, and the idea is that the player must do everything in their power to practice over and over again so they can overcome the challenge and feel proud of themselves, which in turn makes the lessons stick, and the game can continue pushing them. Balancing the learning process between being a fun learning experience the player loves and a frustrating mess the player loathes is EXTREMELY difficult. As a game designer, I can guarantee it's not something you want to tackle right off the bat.

Your biggest issue is the lack of detail about your idea; you have some small nooks worked out, but you haven't actually thought out how the main gameplay loop works; what the player will want to achieve, what they can/can't do, what the challenge they have to overcome is, and what their reward for succeeding is. The loop is the key part of the puzzle that defines the core of your game, and will always keep you on track. Without it, your game can end up being inconsistent, and most worryingly, not fun.

Honest opinion? Your first foray into game development should be to make game clones. It sounds silly and stupid, but trust me. Getting a clone to feel EXACTLY, to the very tinniest detail, like the original game is a challenge, but it will make you far better at appreciating the game design/development process. You'll learn why developers make the decisions they do, and in the years to come you'll look back and feel proud about what you achieved, instead of regretting something that didn't quite work and wasn't fun at all.

I recommend you start with Mario. It's a 2D platformer (so on the lines with what you want to achieve), and there are many tutorials that will tell you how to accomplish it. Once your Mario clone is 100% like the original Mario (including the exact speed/mass, the transitions, health etc), you should start making changes, seeing what you can do to make the game more/less fun. If you get really good, you can start adding new features, such as the gun elements you want, alongside new graphics and audio.

The key thing I want you to take away is to LEARN first, PRACTICE second, PLAY last. Not only is this how you, the designer/developer should act, but it's also ideally how your player will experience your game and its lessons. As for you, I find that you can't really make something unless you understand HOW the tools will help you make that thing become a reality. It's always nice and great to have a creative idea, but being practical about it is what makes the best games. Good luck, and have fun with it.

  • Like 1
Link to comment
Share on other sites

Don't start with a big project. Start with really simple games like pong or tetris. You will learn a lot about structuring and organizing your code. You will also learn a lot about your programming language and libraries and realise a lot of problems that you didn't thought of before.

There are a lot of programming languages out there. It doesn't really matter which one you choose because the basic concept is nearly the same. Look at the examples and tutorials and choose one you like. You will notice that learning your second programming language is much much easier than the first one.

  • Like 1
Link to comment
Share on other sites

Alcom Isst

While McJobless and others do their glorious duty to explain the practice and perils of game design, I would like to recommend Processing. It's (usually) a variation of Java, and it's incredible for developing basic games, making prototypes or mockups, or simply experimenting with code.

Edited by Alcom1
  • Like 2
Link to comment
Share on other sites

Shadowblaze

Thank you all for the replies. I'll take note of what you have said, and give those a go. ;)

About your post, McJobless, I wanted to say that I understand my idea isn't detailed nearly enough to make something out of it. The point of it was basically just testing if the idea was feasible and enjoyable, but if it turns out to be that way, I'll pick it up again. I'll follow your advice, that way I might also start to understand the elements that make a game actually good. :P

Link to comment
Share on other sites

Shadowblaze

Okay, so, I have been using Processing until now, but I haven't managed to do anything I wanted yet. Its biggest problem is that the window can't be scaled up to look like a true retro game, or better, it can be scaled up, but it's broken, and the other ways of doing this are too tedious. Yay. I better give up this thing before I waste 2 more days into nothing.

Do you have any other languages to suggest, that maybe are built to simplify the creation of retro games (boy that sounds so stupid)?

Link to comment
Share on other sites

Alcom Isst

Okay, so, I have been using Processing until now, but I haven't managed to do anything I wanted yet. Its biggest problem is that the window can't be scaled up to look like a true retro game, or better, it can be scaled up, but it's broken, and the other ways of doing this are too tedious. Yay. I better give up this thing before I waste 2 more days into nothing.

Do you have any other languages to suggest, that maybe are built to simplify the creation of retro games (boy that sounds so stupid)?

O8UNALY.png

noSmooth() removes any antialiasing effects and allows for scaling to look pixelated.

 

PImage thingy;
int scale;
void setup()
{
    scale = 4;
    size(128 * scale, 120 * scale);
    noSmooth();
    thingy = createImage(width / scale, height / scale, RGB);
    for(int y = 0; y < thingy.height; y++)
    {
        for(int x = 0; x < thingy.width; x++)
        {
            thingy.set(
                x,
                y,
                color(
                    (int)random(0, 32) * 8,
                    (int)random(0, 32) * 8,
                    (int)random(0, 32) * 8));
        } 
    }
}
void draw()
{
    pushMatrix();
        scale(scale);
        image(thingy, 0, 0);
    popMatrix();
}
Edited by Alcom1
Link to comment
Share on other sites

Shadowblaze

​noSmooth() removes any antialiasing effects and allows for scaling to look pixelated.

-stuff-

​I already thought about that. The problems I'm talking about come when I want to make any object's movement snapped to the pixels. I can't get that to work in any way, I tried doing everything I could.

Link to comment
Share on other sites

Alcom Isst

 

​I already thought about that. The problems I'm talking about come when I want to make any object's movement snapped to the pixels. I can't get that to work in any way, I tried doing everything I could.

Works fine for me. I'd recommend avoiding anything besides PImages for retro graphics, as those are generally used for importing images/sprites anyways and everything else has issues snapping to pixels.

PImage thingy;    //Randomly colored background
PImage mouseBox;  //Box that follows mouse
PImage shiftBox;  //Box that moves independantly.
PVector shiftPos; //Shift box position
PVector shiftVel; //Shift box velocity
int scale;        //Scale of the window
//Setup
void setup()
{
    scale = 4; 
    size(128 * scale, 120 * scale);
    noSmooth();    //No antialiasing
    noCursor();    //No cursor
    
    //Instantiate and fill mouseBox
    mouseBox = createImage(10, 10, RGB);
    for(int y = 0; y < mouseBox.height; y++)
    {
        for(int x = 0; x < mouseBox.width; x++)
        {
            mouseBox.set(
                x,
                y,
                color(0, 0, 0));
        } 
    }
    
    //Instantiate and fill shiftBox
    shiftBox = createImage(20, 20, RGB);
    for(int y = 0; y < shiftBox.height; y++)
    {
        for(int x = 0; x < shiftBox.width; x++)
        {
            shiftBox.set(
                x,
                y,
                color(248, 0, 0));
        } 
    }
    
    //Instantiate shiftbox position and velocity
    shiftPos = new PVector(0, height / scale / 2 - shiftBox.height / 2);
    shiftVel = new PVector(5, 0);
    
    //Instantiate thingy and fill it with random 15-bit pixels.
    thingy = createImage(width / scale, height / scale, RGB);
    for(int y = 0; y < thingy.height; y++)
    {
        for(int x = 0; x < thingy.width; x++)
        {
            thingy.set(
                x,
                y,
                color(
                    (int)random(0, 32) * 8,
                    (int)random(0, 32) * 8,
                    (int)random(0, 32) * 8));
        } 
    }
}
//Draw
void draw()
{
    pushMatrix();
        scale(scale);    //Enlarge everything to fill the window.
        
        //Draw background
        image(thingy, 0, 0);
        
        //Draw mouseBox
        image(mouseBox, mouseX / scale - mouseBox.width / 2, mouseY / scale - mouseBox.height / 2);
        
        //Draw shiftBox
        image(shiftBox, shiftPos.x, shiftPos.y);
    popMatrix();
 
    //Move shiftBox   
    shiftPos.add(PVector.div(shiftVel, frameRate));
    if(shiftPos.x > width / scale)
        shiftPos.x = 0; 
}

 
The code without the fluff:

int scale;        //Scale of the window
//Setup
void setup()
{
    scale = 4; 
    size(128 * scale, 120 * scale);
    noSmooth();    //No antialiasing
    noCursor();    //No cursor
    /*
    * put setup code here.
    */
}
//Draw
void draw()
{
    /*
    * put per-frame logic code here.
    */
    pushMatrix();
        scale(scale);
        /*
        * put drawing code here
        */
    popMatrix();
}

Link to comment
Share on other sites

sheepandshepherd

One of the reasons making a game is so difficult is the vast number of different things you have to deal with: graphics, input, memory/resource management, physics, sound, AI, networking... and so on. Not to mention designing the actual gameplay, one of the hardest parts. Unless you're familiar with most of those concepts, I highly recommend starting out with a game engine rather than just a programming language. That'll let you learn each of those things one step at a time.

I agree with McJobless's suggestion to start by imitating an existing game. Once you know how to implement a game idea, you'll be more prepared to design your own, so learn that first by implementing Mario or something similar.

 

There are a lot of game engines. The most well-known aren't necessarily the best. I use Godot Engine, because it's very general-purpose (does all of those things that a game needs, 2D or 3D), has a visual editor, has a simple scripting language (based on Python), and is open-source. There's a wiki, if you want to see the list of official tutorials, here.

Unity is bigger and more popular. Definitely also better-documented. Plenty of tutorials around for it, even for complete beginners. This is the one I started out with, without any previous experience. But it's not open-source, and more focussed on 3D.

Definitely use something free if you're just starting out :thumbsup:

Link to comment
Share on other sites

Shadowblaze
-snip

-

​Thank you! I had to do a couple fixes to the code I already had to make it work, but it's good now. Do you mind if every now and then I ask you some help with the coding?

Thanks for your suggestions, sheepandsheperds. I'll give Unity or that other thing a try if I get sick of Processing. :thumbsup:

Link to comment
Share on other sites

I wish I'd been around to reply sooner, but it looks like you've received a lot of help already.

Speaking from experience, I'd recommend Flash to anyone who wishes to start out making games. I'm sure I'll get boo-hoo'd by the pros for suggesting that, but Flash introduced me to game development and helped me to learn other languages too. Although to be fair, learning any one programming language will make it easier to learn another, just as learning one instrument will give you better understanding of another.*

My first ever attempt at learning Flash/making a game was by following [this tutorial]1 (the link seems to be down for me though). I got confused, barely understood anything I was doing and had to download the creator's own source files multiple times as it didn't work for me, but eventually I completed the tutorial. And I was so proud! So much so that I went on to create my own assets and modify the code to incorporate them, as well as improve the game. I should point out though that if you do wish to try the tutorial out, be sure to use the newer [ActionScript 3 variant]2 as the one I used was ActionScript 2, which has since been outdated. It uses external classes which is a nightmare for a newbie, but it's very useful.

Also, you've been given lots of great advice above about starting out in game development, and they shouldn't be disregarded. However, I don't think you should concern yourself too much with the... "Seriousness" of game development. No, you shouldn't expect to make a brilliant game right off the bat, nor is it likely you'll make the next Minecraft on your own. But it's important that you do enjoy yourself in doing this, because a happy and motivated person will produce far better results than a disheartened one.

I'm rather tired at the moment so I'm losing track of what I'm writing, but... Hopefully I put down something useful in all that.

 

Links don't seem to be working for me at the moment, so here are the URLs:

1) http://www.flashgametuts.com/tutorials/advanced/how-to-create-a-platform-game-in-as2-part-1/

2) http://www.flashgametuts.com/tutorials/advanced/how-to-create-a-platform-game-in-as3-part-1/

 

*Except drums. I just don't get them.

Link to comment
Share on other sites

Nah, I've got rhythm, as a bassist you have to! It's just... With a bass/guitar/etc. you have notes, they all share the same spectrum of notes to choose from. You can learn one instrument and then easily pick up another completely different one and still have a rough idea of how to form a melody, even if you have to learn how to play the instrument and adapt to its style first. But then you come to drums... It's like an artist looking at the key functions of a programmer's code, or a programmer checking out the various tools and paints at an artist's disposal, and going... Whaaa?! At least for me it is anyway. :P

Aaand I'll drop that off-topic subject now. Uh, programming, you should totally get into it. Flash is awesome. Other suggestions are awesome too. Go hammer the keys and make something great.

Link to comment
Share on other sites

Shadowblaze

Thanks, Jimbob! I'll try Flash as well, doesn't seem to be too difficult doing what I want as I see loads of platformers made with it. :thumbsup:

I'll start practising more seriously as soon as school ends, as of now I can't do much with this stuff without feeling stressed.

Link to comment
Share on other sites

  • 2 weeks later...
Shadowblaze

I've managed to get a simple platformer working, but I want to use a csv file to tell the game what tiles should be loaded, not a table written inside the code. I can't get that to work. Actually, I don't even know how to start. Help?

Ah, and also, I can't get the music to loop from a certain point instead of from the start (like for example the Victory Road music from Pokémon RSE). Aaand making a boolean thing be true and then instantly false (I want to make that the holding the jump button makes you jump only once, not constantly).

Link to comment
Share on other sites

Which language are you using? Or is this platformer following the tutorial I suggested?

As for importing a tile map from an external file, you could probably get away with a text file depending on your programming language. If you are storing the table as an array/3D array/set of arrays, it should be possible to read a text file into the array(s). This is what I've done in the past for some of my older games.

Link to comment
Share on other sites

Shadowblaze

Which language are you using? Or is this platformer following the tutorial I suggested?

As for importing a tile map from an external file, you could probably get away with a text file depending on your programming language. If you are storing the table as an array/3D array/set of arrays, it should be possible to read a text file into the array(s). This is what I've done in the past for some of my older games.

​I'm using Processing, the one Alcom suggested earlier on. Should've said it as I was writing that post. :P

I intend to use a text file, actually there is a loadTable command, but I have no clue how to use it without causing crashes.

Link to comment
Share on other sites

I've managed to get a simple platformer working, but I want to use a csv file to tell the game what tiles should be loaded, not a table written inside the code. I can't get that to work. Actually, I don't even know how to start. Help?

You'll need to open the file to read its content, from within your code.
The csv files are comma separated and use new lines, to separate the values. So the code will need to import it, using the csv file format. There are several different formats for csv however. It might be worth looking up if loadTable, you're trying to use, is capable of loading csv files, or how it does load tables from your own text file.
Jimbo gave you a good tip, which will save you time for now in my opinion. ​

Edited by P1771S
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.