Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: New Start

  1. #11
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    New Start

    A game engine is anything from a set of libraries to pre-compiled game code that you can use to make a game out of. The some or most of the basic gameplay is already made up for you, you just have to finish it off. The idea is that it does most of the basic stuff for you to be able to get to the more advanced things in your games.


    I'm going to contradict Jason and Jeremy now. It's not that they are wrong, but they are speaking from the perspective of someone who has been making games and game tools for a while now. Unfortunately you have to crawl a bit before you can first walk.

    At your level you should not be playing with pre-made game engines and design docs just yet. Later on definitely, but not now.

    For now learn the BASICS. You need to understand all those basic things that an engine will do for you. Otherwise you'll be so dependent on the engines to do it all for you, you wont know how to do something if it's not in the engine. Plus it not only helps, but it is essential that you know what these things are so you can properly make a game so your not always poking around blindly and wasting your own time.

    Documentation would be a waste of your time as well. With what you have to learn it's not worth it. And you are doing this for the pure benefit of learning. You won't be making anything worthy of a polished commercial or shareware/freeware release. Not yet... Docs are meant to help you keep on track of your project's plans and stay on task. A simple pong game to learn the ability of basic collision detection and object movement is hardly the kind of task that needs a design doc.


    I was pondering if I should write a couple of quick and dirty beginners/entry level tutorials on these things. It helps to have material to learn from at the beginning of course, yet there is so little for Pascal programmers. And the older stuff always seems to disappear over time. Maybe others can chip in too. It would basically involve all the simple things us more novice to advanced guys usually take for granted.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #12

    New Start

    I suppose all of this apparently confilcting advice is very confusing and may make you think that we don't know what we're doing...

    But it's not like that at all, we've all been coding (not just games) for so long and suffered the torment of learning the small stuff that we want to nurture you along, guiding you through the minefield so you can make progress without making the same mistakes as we did.. (as we do for everyone starting out, irrespective of how it may appear at first) but that on it's own has a problem. Knowledge comes from study and understanding, but wisdom comes from trying and making mistakes through lack of knowledge and wisdom.. You can't do anything without wisdom, study helps to minimise the mistakes, but true wisdom only really sinks in when you make a really big balls up and learn from it.

    I think, basically, you have to accept that you're gonna make some real klangers along the way and you have to find your own way through the mine field.. but at least now you know there is amine field there and you're not thinking you're taking a nice stroll through the prairy only to meet with a very unexpected and unpleasant suprise.

    I still make mistakes... daily... some are huge.

    One day, perhaps, I'll reach the coding nirvana where I know it all and can do anything.. then, they'll bloody go and change everything so I'll just know everything about something no-one uses anymore :lol:

    This blurb is sponsored by Grolsch, the beer of champions

  3. #13

    New Start

    Jason, please don't drink and surf
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  4. #14

    New Start

    Quote Originally Posted by Demonkid43
    thank you for the advice and...lighten up a bit
    You're welcome.

    See, the thing is, I realized there were two ways I could give you the advice not to start with what you were planning.
    I could do A) what we always do and write down why you shouldn't create zelda.
    This has however been done time and time again, and people take it for granted, write down their thanks and continue to do it anyway and you often never hear from them again.

    So instead, I thought I'd try B)
    Make a scene first, maybe get you on your nerves a little, but still enough to keep you interested. Then add a fictional discussion of typical questions asked so often here, and add answers that many of us here write down daily. Mix a whole bunch of these together so they not only relate, but also tell a (familiar) story and maybe it will get the point across. (Which I hope it did)


    I realize B is not something I should make a habit of doing more often. It could potentially tick new people off, to never visit PGD again. But then again, sometimes you need to try something else, and see what it does.

    I this case, I'd like to think it worked out well.

  5. #15

    New Start

    bahaha ok i would fist like to start with will
    yess indeed a tutorial of all the basic things would be usfull as (now dont hold it against me here).
    but there was a time when i was trying to learn the basics of i guess you could say hacking
    and all i could find was that there were a whole bunch of information on things i didnt understand and didnt know even words like for instance "game engine" that i had no clue what they were.
    it was indeed a new tutorial simpley called the basics yes..."The Basics".

    That tutorial told me everything i needed to know about all the other files and what they actually ment and what they did in which progressed my knowladge and got me started however my intrests grew more so off the computer than on and now i have returned to my old friend to learn somthing new...Pascal/Delphi.

    The poit is that a basic beginers tutorial is almost an essential thing as it can describe some new things that other tutorials that simply teach coading do not.

    now Jasonf baha this part makes me laugh

    "I think, basically, you have to accept that you're gonna make some real klangers along the way and you have to find your own way through the mine field.. but at least now you know there is amine field there and you're not thinking you're taking a nice stroll through the prairy only to meet with a very unexpected and unpleasant suprise."

    imagin that literaly walking through the plains wistling when...BANG bahaha sorry i know it isnt related to the post but i though it was kinda funny .

    and for Traveler
    well you see being arrogant somtimes does have its advantages and on alot of people your right it would totaly have turned them off this site.

    but i have that screw you all attitude if nobody wants to help, i will learn myself as when i was learning to hack all the other hackers i could comunicate with seen me as a noob and aparantly nobody helps noobs in that kind of society, unless you really know how to speak to them....i dont.
    haha.
    So although a little discouradged that i didnt see any resaults i wanted i was patient enough to wait for the ones that were needed.
    thank you.

    now i think that about covers it so i know,
    i know how to make an object move however,
    i dont know how ot make it move in anyspecific direction wihtout having to push a buttion or make it bounce...and i assume that mite be essential for pong.
    Ayone know a good pong tutorial haha i meen a programing one cuz if you need one to actually play pong you shouldnt be playing it lol.

  6. #16
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    New Start

    Well I'm glad to have the 'stick with it no matter what' attitude. At times you may need that. There will be times when coding something becomes 'un-fun' or you just get stuck. Happens to everyone at all skill levels.

    Though I'm sure that you won't need to tell anyone here to screw anything. [size=9px]Unless you have some joint hardware project in mind. )[/size] You'll find that we are all generally friendly and helpful. Dom and I didn't tolerate poor behaviors early on so it seems to be sticking. That and we got lucky and most of those that hang out in these forums are generally good people with kind hearts.

    That and I think the average age range has something to do with it. Lets face it the older you get, so the nicer you are... generally. Probably having something to do with the fact that we are all that much closer to death. :lol: I'm kidding there of course, but we are of good intentions and do want to help where we can.

    So don't be discouraged, just adjust your strategy for the better. It will happen a lot.


    Now to answer you more specific question; How do I make an object move independent of holding down a key?

    Well the best way to do that is to have variables that hold the direction/speed of your object. Then you can have your input controls adjust these two values the way you want.

    You will also have a separate block of code that handles movement alone. Generally a game's main game loop will look something like this:

    [pascal]begin
    Init_Game;
    Reset_Game_Clock;
    while(Quit_Flag = False) do
    begin
    Read_Player_Controls;

    Move_Player;
    Move_Objects;

    { ...other functions, etc... }

    Clear_Screen;
    Draw_Background;
    Draw_Environment_or_Map;
    Draw_Player;
    Draw_Objects;

    if (Check_for_GameOver_Conditions = true) then
    Quit_Flag := True;
    end;
    Deinit_Game;
    end.[/pascal]

    Now this is just an example you may have enemies, or your 'player' might be moved using the same function to move other objects too. It all depends on the type of game you are making.

    In the way of pong it's a bit more like this...

    [pascal]var
    BallCount : Integer = 5;
    begin
    Init_Game;
    while(Quit_Flag = False) do
    begin
    Read_Player_Controls;

    Move_Paddle;
    Move_Ball;

    Do_Ball_Collision; // involves block/wall/paddle detection, ball reaction, block removal, etc...

    Clear_Screen;
    Draw_Walls
    Draw_Blocks;
    Draw_Ball;
    Draw_Paddle;

    if (Ball_Went_Off_Screen(BallObject) = true) then
    begin
    dec(BallCount);
    if (BallCount <= 0) then
    Quit_Flag := True;
    end;
    end;
    Deinit_Game;
    end.[/pascal]

    Your ball object would have, at least, these variables...

    [pascal]var
    BallX, BallY: Integer; // The location of your ball on the screen
    BallVelX, BallVelY: Integer; // The Speed of your ball along X and Y axis[/pascal]

    Now the ball would move on it's own using random speed/direction. You'll want to have a VelX and VelY for the ball. This is the simple 'Velocity' values for your X and Y axis movement. Each 'frame' of movement your ball will move 1 value of VelX along the X axis and 1 value of VelY along the Y axis. Do this once each time through the loop so that it is done independently.

    [pascal]BallX := BallX + BallVelX;
    BallY := BallY + BallVelY;[/pascal]

    Now you are probably wondering "well now it just flies off the screen! What good is that?". That my friend is why you need to add wall detection.

    To do this is very simple. You check your BallX and BallY values against the sides of your screen. Which would be (0,0) for your top left and (ScreenWidth,ScreenHeight) for the bottom right.

    [pascal]if (BallX <= 0) then // your ball has hit the left wall
    BallVelX := BallVelX * -1;// so reverse the direction by switching the sign of it.[/pascal]

    See how that works? Now just do it for all 4 walls and you have a bouncing ball program with a simple movement. To turn it into pong all you have to do is add blocks and the paddle and remove the wall which you will add the paddle to. Not very far away at all.

    Work with this and see what you can get going. If you have trouble or get stuck just ask and we'll do our best to help. Once you've gotten this working I can elaborate more on how to get it into a pong game. In fact, I might have that tutorial typed up by then.

    Oh and if you are using JEDI-SDL have a look in the SDL/Pas folder inside sdl_utils.pas for some handy drawing functions. Namely the circle, rect and line functions. Very similar to what I had when I first learned game programming so you're in luck.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #17
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    New Start

    I added my very old pacman project to the tutorials page for beginners to learn from. If you can improve it, do it plz.

    anyway here's the link: http://www.pascalgamedevelopment.com...?p=38130#38130


    EDIT: I quickly checked the code and noticed: "while(Quit_Flag = False)". Please use a timer. This way you don't block windows messages. "Application.ProcessMessages" (Delphi) is a bad way to invoke messages. And in the meanwhile you learn how to use a timer in your game!!
    NecroSOFT - End of line -

  8. #18
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    New Start

    Myself, I don't use timers. Besides when I was first learning I never had any of the Windows features. In fact I think that if he is still learning to make pong, threaded applications are the least of his problems. Too much new ground to cover there, let alone application messages.

    Simple stuff first, more complex stuff later.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #19

    New Start

    thanks for my next project maby i will make a packman but for now i still have to find lazarus again haha

  10. #20

    New Start

    alright got lazarus but my computer freezes and it wont compile i can end the compiler proccesse and lazarus is back to normal but it wont compile...anyone ever had this problem before

    :twisted: i finaly got home so i have fast internet not crappy dial up and i cant even start :twisted:

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •