Page 2 of 3

Re: My ambitious project

Posted: Wed Jun 01, 2011 11:23 pm
by ploplyguy
I will love to see it once it's done. I would help out but I have no idea what program I would use to make myself even remotely useful HA! :8(:

Re: My ambitious project

Posted: Fri Jun 17, 2011 8:03 pm
by Scott
How's it coming along spartan? It shouldn't actually take 3 months by the way. It should take one tops. If you have a lot of other things going on I suppose it could take longer.

This and Kelevra's project has inspired me to reopen a game engine I was programming. Gunna' make it capable of running a Pong game and keep adding features until I can squeeze a top down shooter out of it.

Here's what I have so far if anyone's interested:

Code: Select all

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include <string>
#include <fstream>

const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_BPP = 32;

SDL_Surface *image = NULL;
SDL_Surface *screen = NULL;

SDL_Event event;

SDL_Surface *load_image(std::string filename)
{
    SDL_Surface *loadedImage = NULL;
    SDL_Surface *optimizedImage = NULL;

    loadedImage = IMG_Load(filename.c_str());

    if (loadedImage != NULL)
    {
        optimizedImage = SDL_DisplayFormat(loadedImage);

        SDL_FreeSurface(loadedImage);
    }

    return optimizedImage;
}

void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination )
{
    SDL_Rect offset;

    offset.x = x;
    offset.y = y;

    SDL_BlitSurface( source, NULL, destination, &offset );
}

bool init()
{
    if (SDL_Init(SDL_INIT_EVERYTHING) == -1)
    return false;

    screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE);

    if (screen == NULL)
    return false;

    SDL_WM_SetCaption("Game Engine Test", NULL);

    return true;
}

bool load_files()
{
    image = load_image("first.png");

    if (image == NULL)
    return false;

    return true;
}

void clean_up()
{
    SDL_FreeSurface(image);

    SDL_Quit();
}

int main(int argc, char* args[])
{
    std::fstream statuslog;
    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "Opening log...\n";
    statuslog.close();

    bool quit = false;

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "Beginning statuslog...\n";
    statuslog.close();

    if (init() == false)
    return 1;

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "System has been intialized\n";
    statuslog.close();

    if (load_files() == false)
    return 1;

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "Files have been loaded\n";
    statuslog.close();

    apply_surface(0, 0, image, screen);

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "Surface has been applied\n";
    statuslog.close();

    if (SDL_Flip(screen) == -1)
    return 1;

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "Screen has been flipped\n";
    statuslog.close();

    while (quit == false)
    {
        while (SDL_PollEvent(&event))
        {
            if (event.type == SDL_QUIT)
            quit = true;
        }
    }

    statuslog.open ("statuslog.txt", std::fstream::out);
    statuslog << "The process has been completed successfully\n";
    statuslog.close();

    clean_up();

    return 0;
}
Unfortunately all this does is open up a window and display one graphic (not animated). As you can see I have some work ahead of me. Luckily once the engine is done the actual designing is much easier.

EDIT:

I also have some debugging parts in there if anyone is actually looking through it.

Re: My ambitious project

Posted: Sat Jun 18, 2011 5:14 am
by spartan64
Here are one of my first games I made on GameMaker.
http://www.youtube.com/watch?v=JTm_6njHV2E
I will show you more soon.

Re: My ambitious project

Posted: Sat Jun 18, 2011 9:30 pm
by GeneralChaz9
I would help, but I wont have any clue what to do!

Have ypu guys thought about making some sort of simple Battlefront game? Even if its a top down shooter? "Star Wars Battlefront: Rogue Squadron!" xD

Re: My ambitious project

Posted: Sun Jun 19, 2011 2:51 am
by Scott
GeneralChaz9 wrote:I would help, but I wont have any clue what to do!

Have ypu guys thought about making some sort of simple Battlefront game? Even if its a top down shooter? "Star Wars Battlefront: Rogue Squadron!" xD
I'll keep that in mind when I get my engine up to snuff'.

Re: My ambitious project

Posted: Sun Jun 19, 2011 3:52 am
by Kelevra

Re: My ambitious project

Posted: Sun Jun 19, 2011 4:02 am
by Scott
Kelevra wrote:Way ahead of you.
Loading .pngs on dial-up makes me sad :(

Oh, and challenge accepted.

Re: My ambitious project

Posted: Mon Jun 20, 2011 12:35 pm
by spartan64
Ok... this is what iv'e done so far: http://i1136.photobucket.com/albums/n48 ... 97/234.png
Had to define all the routes and their positions. About 80 lines of code.

Next thing... defining regions.

Re: My ambitious project

Posted: Mon Jun 20, 2011 3:18 pm
by Scott
The .pngs!

You guys may be beating me. Here's a screen from my recent award winning title entitled, Press an Arrow.

http://i54.tinypic.com/mbk08p.jpg

228 lines of code... :8(:

I'll be throwing together my first game tonight which is Tic-Tac-Toe. After that I'll keep adding features to the engine to make various other titles till I can make games I actually want to play.

AI is the hardest to program. Maybe I'll just make it two player...

Re: My and other's ambitious projects

Posted: Wed Jun 22, 2011 3:33 pm
by spartan64
You can now tell the occupation of planets and regions whether they're neutral, player or computer.

I'm going at a pretty fast pace and I'll might finish this sooner than I originally thought.
But I still have lots.... lots to do...
235.png
235.png (455.72 KiB) Viewed 412 times
I know... the graphics look ugly... ps, I'm not an artist.

Re: My and other's ambitious projects

Posted: Thu Jun 23, 2011 3:34 pm
by Scott
spartan64 wrote:I know... the graphics look ugly... ps, I'm not an artist.
Prepare to feel better then! All my graphics and sound are just test worthy. I'd never want to have anyone see them. So here they are.

v1.0 is finished.

EDIT: Here's that .dll: zlib1.dll Just copy it into the same folder the .exe and all the other files are. Hopefully there are no more required!

Just unzip the folder and run the .exe. I didn't leave anything out. You'll see all the files including some debugging text files. If you read them you should see a list of different steps I was watching. You may find it interesting...I dunno'.

I'm undecided whether or not I'll continue on it. I probably will add a bit more. I'm going to do either Duck Hunt or Pong next (probably Pong). I've done event handling, image and sound loading, buttons, and mouse control so with Pong I plan on learning timing, motion, collision, and animation.

Re: My and other's ambitious projects

Posted: Thu Jun 23, 2011 3:50 pm
by Kelevra
Update! Courtesy of our graphics guy (Work still in progress):

Image
Rebel Academy

Image
Imperial Advanced Weapons Facility

Re: My and other's ambitious projects

Posted: Thu Jun 23, 2011 4:48 pm
by Scott
Thank you for using .jpgs!

Does he do everything from scratch or work on an existing model and build on it? They look very organic to the actual game's visuals. I commend him and am very jealous considering my non-existent artistic ability.

EDIT:

Oh, and look at my previous post for the required .dll I neglected to upload.

Re: My and other's ambitious projects

Posted: Thu Jun 23, 2011 5:40 pm
by Kelevra
Yeah, those are basically a bunch of the game's default models ripped apart and smashed together. That's how he works best, and it's great. All of the buildings I make are built from scratch.

Re: My and other's ambitious projects

Posted: Sat Jun 25, 2011 7:31 pm
by Scott
I was just thinking, how cool of a blog would this be? Three different types of game development: GameMaker (design heavy), SDL (programing heavy), and modding (graphics heavy).

Just an interesting thought. If anyone of you are actually interested it could go somewhere. Anyway, time to learn mapping and linked lists...