Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Starting a game from scratch (no engine)

  • 24-04-2013 6:06pm
    #1
    Registered Users, Registered Users 2 Posts: 1,142 ✭✭✭


    So I'm a computer science student that is reasonably comfortable with object oriented programming (just java experience right now though). But as the degree is computer science, we don't look at game specific coding. So implementing graphics is a whole other ball game I have no clue about yet.

    I've started the basics of a text adventure game engine in java but really want to learn to make a 2D game over the summer.

    Can anybody tell me the best approach to starting this from scratch? No pre-made game engines. Just a language a and a graphics suite type of job if possible.

    Its more about the learning experience so I don't mind that it will take 100 times longer to finish a game that I make my own engine for.


Comments

  • Registered Users, Registered Users 2 Posts: 1,481 ✭✭✭satchmo


    The best thing you can do is dive right in, but be sure to start simple. Figure out how to load an image and display it on-screen (or just draw your own object with lines & polygons). Then write some keyboard controls to move it around, and go from there. Don't get bogged down with code cleanliness or structuring things properly at the beginning, as you'll probably throw away or rewrite most of your initial code when you have a better idea of what you're doing.

    You should have a goal in mind to keep yourself motivated, but don't be too ambitious. One of the first full games I made was an Asteroids clone, which I'd recommend. It wasn't exactly simple, but no one part of it was particularly complicated which made it achievable within a relatively short period of time. And most importantly, it was fun! If you start off trying to make something too complex, you'll get overwhelmed and disheartened with your lack of progress and will eventually abandon it.

    You're definitely going about it the right way by not using an existing engine. You'll learn so much more that way.


  • Registered Users, Registered Users 2 Posts: 1,142 ✭✭✭koHd


    satchmo wrote: »
    The best thing you can do is dive right in, but be sure to start simple. Figure out how to load an image and display it on-screen (or just draw your own object with lines & polygons). Then write some keyboard controls to move it around, and go from there. Don't get bogged down with code cleanliness or structuring things properly at the beginning, as you'll probably throw away or rewrite most of your initial code when you have a better idea of what you're doing.

    You should have a goal in mind to keep yourself motivated, but don't be too ambitious. One of the first full games I made was an Asteroids clone, which I'd recommend. It wasn't exactly simple, but no one part of it was particularly complicated which made it achievable within a relatively short period of time. And most importantly, it was fun! If you start off trying to make something too complex, you'll get overwhelmed and disheartened with your lack of progress and will eventually abandon it.

    You're definitely going about it the right way by not using an existing engine. You'll learn so much more that way.

    Yea I was considering first of all just trying to code squares in that could represent objects. A small square for a character, big on for building etc. Just to learn how to implement graphical elements at all.

    The asteroids suggestion sounds good. I followed a suggestion from here to build a basic OO game of hang man and it was really helpful and just the right amount of challenge v reward.

    Perhaps I could design a simple maze game with purely code? Again square to represent character and just straight lines to make a maze? Are there any basic guides to making such a simple game ?


  • Registered Users, Registered Users 2 Posts: 1,481 ✭✭✭satchmo


    You're probably not going to find any specific guides for a simple game like that. But figuring it out yourself is going to benefit you much more than following a guide.

    Again, break it down into simple steps. Figure out how to draw a line on the screen. Then make a game loop that clears the screen and draws a line every frame. Then change the position of the line each frame to animate it. Then use the time since the last frame to control the speed of the animation. And continue to build from there.

    I can't help you with the specifics (I haven't touched Java in years, and I doubt people still use AWT for drawing), but I'm sure someone else here can. Otherwise, StackOverflow is your friend.


  • Registered Users, Registered Users 2 Posts: 8,450 ✭✭✭RedXIV


    Are you planning to build it all in Java?


  • Registered Users, Registered Users 2 Posts: 1,142 ✭✭✭koHd


    RedXIV wrote: »
    Are you planning to build it all in Java?

    No just working in java now as it also helps grades. I'll probably try out C++ over the summer so it will more than likely be built with that.

    Kind of have the maze game sussed in my head so I'll give that a bash.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    koHd wrote: »
    .

    Can anybody tell me the best approach to starting this from scratch? No pre-made game engines.

    You think you want to do that, but you really really dont


  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    Well there are pre-made game engines and then there are frameworks that have already solved a lot of common boring problems.
    libraries that give you a better set of tools to work with, without restricting or influencing the kind of game you're going to make, so I would draw a distinction between a game engine and something like a 2d graphics library.
    One example of something a good library would give you is the ability to import a sprite sheet, chop it up into frames and give you an object with methods to play different named animations.

    It feels like a crutch at first, but when you try to make a whole game, you get a better perspective of the things that are the least of your problems.

    I'd say it's a good learning experience, but I have memories of following double-buffering tutorials, finishing it, then going "alriiight! now let's make a game!". It makes me laugh a bit now, but I think I appreciate more what frameworks are giving me as a result. Also working with these libraries gives you a better sense of how you'd go about structuring your own.


  • Closed Accounts Posts: 1,235 ✭✭✭returnNull


    KoHd I'm in the similar boat as yourself and was advised to start off with vector graphics,then work with sprites and finally move on to using a game engine.The reason was/is it will give you a better understanding whats going on under the hood with a games engine regarding the graphics.

    Strangely enough where ive seen designing your own game engines from scratch is for CS students interested in game programming and that it would look good as a project to show future employmers

    also ,i think as satchmo said in another tread,you get get to use trigonometry for a proper reason since leaving school:pac:

    as for where im at? im doin an asteroids/galaga clone.Have my ship moving left to right(a beautiful looking triangle if i might say so myself :) ) and one alien moving randomly down the screen!Have bullets firing and just need to sort out collision detection

    it looks and runs like a dog but im getting there!lol


  • Closed Accounts Posts: 3,922 ✭✭✭hooradiation


    ChRoMe wrote: »
    You think you want to do that, but you really really dont

    Incorrect.

    If he had the skills to actually make a game of some sort (prior project experience, competence a useful language, an idea for a game that isn't complete ass) then yeah, building your engine from scratch is a terribad idea.

    HOWEVER

    As a learning exercise for program structure and design, it's not a bad idea.
    Give a long term aim as well as breaking down into a series of short term goals. Starting with the bare minimum of a Windows window and message pump, to basic input, rendering, resource management and so on.

    The mistake people make when doing this for the first time is to be confused as to what their aim ought to be.
    The goal isn't to make a usable engine, the project will be an unmitigated failure and bring shame onto you and your family. But that's ok, because the aim is to teach valuable lessons on how not to do things in future.

    3rd party libraries or not, your first attempt (especially if you're pairing it with learning a new language, which you really shouldn't do) is going to be a towering testament to shitty engine design and bad code that will render the project useless.
    So it's better to make those mistakes when everything is your fault (so you can eventually learn from and fix them) rather than adding third party libraries into the mix leading to confusion as to who's to blame when everything is broken, horrible and wrong.


  • Registered Users, Registered Users 2 Posts: 1,142 ✭✭✭koHd


    Incorrect.

    If he had the skills to actually make a game of some sort (prior project experience, competence a useful language, an idea for a game that isn't complete ass) then yeah, building your engine from scratch is a terribad idea.

    HOWEVER

    As a learning exercise for program structure and design, it's not a bad idea.
    Give a long term aim as well as breaking down into a series of short term goals. Starting with the bare minimum of a Windows window and message pump, to basic input, rendering, resource management and so on.

    The mistake people make when doing this for the first time is to be confused as to what their aim ought to be.
    The goal isn't to make a usable engine, the project will be an unmitigated failure and bring shame onto you and your family. But that's ok, because the aim is to teach valuable lessons on how not to do things in future.

    3rd party libraries or not, your first attempt (especially if you're pairing it with learning a new language, which you really shouldn't do) is going to be a towering testament to shitty engine design and bad code that will render the project useless.
    So it's better to make those mistakes when everything is your fault (so you can eventually learn from and fix them) rather than adding third party libraries into the mix leading to confusion as to who's to blame when everything is broken, horrible and wrong.

    Couldn't have said it better myself.

    This is a learning experience. I don't care if the game is complete s**te as it will most likely only ever be played by me.

    The joy of simply getting a dot moving in one dimension to bounce off a line on screen should not be underestimated :D


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,182 ✭✭✭Genghiz Cohen


    Flip a coin:

    Heads, OpenGL.
    Tails, DirectX.

    Make an asteroids game from scratch.
    Make a textured asteroids game from scratch, with the lessons you learned.
    Make a networked asteroids game from scratch with the lessons you learned.
    Sell DLC.


  • Registered Users Posts: 127 ✭✭seany212121


    Have a look at stynclworks programme could be pretty useful to you


  • Banned (with Prison Access) Posts: 71 ✭✭wallyMe


    Lot of information on Android, Iphone games if you wanted to go down that route. Or web games better off with Flash. Your description is very broad


  • Registered Users, Registered Users 2 Posts: 1,299 ✭✭✭moc moc a moc


    SDL


Advertisement