• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Pufixas

Oh my glorious code!

21 posts in this topic

I don't have any code from when I was that age, as around the age of 14 or so, an HDD crash had wiped out everything I had before this point (this was in the days when CD-R burners for PCs didn't really exist yet, and computers typically only had a single HDD, *1).

 

*1: many case+MOBO designs in the 90s were a mess (only really space for a single HDD in the case, ISA cards and CPU/RAM on riser-cards, pushrod-operated PSUs, ...), though at least ATX mostly fixed this up, apart from the years of the evil heat-sink braces... (vs the plastic hook-based holders of older heatsinks, or the latter addition of levers).

 

however, code from back when I was between 15 and 17 was still pretty horrid...

it seems it wasn't until I was in my 20s that my coding skills actually started to get sort of worthwhile...

Edited by cr88192
0

Share this post


Link to post
Share on other sites
when i was 14, i only knew(and knew is a very long stretch) actionscript. so be proud of atleast knowing c at such a young age.
0

Share this post


Link to post
Share on other sites

The feeling of finding old code is awesome. Last week I found my old naruto(cuz there are sprites biggrin.png) arena game in Visual Basic. Hah I wrote it when I was 13 or 14. Srsly I had multiplayer and 2 characters biggrin.png, though I didn't know what function is and everything was in one large, really large function(automatically generated from a timer I think, I had found that if I double click it shows me editor and I can start typing smile.png )

 

PS. I used the deprecated direct draw for drawing... tongue.png. My greatest achievement was the moving camera that is following the character. Ohh also I found a vid of my game: http://youtu.be/gYePr5AMBJE hope you like it biggrin.png

Edited by Nickie
0

Share this post


Link to post
Share on other sites

when i was 14, i only knew(and knew is a very long stretch) actionscript. so be proud of atleast knowing c at such a young age.

Actually this is C++. But at that time I didn't even know what a class or an object was. All I knew was basic functions, variables. So there's nothing really to be proud of. 

0

Share this post


Link to post
Share on other sites

The feeling of finding old code is awesome. Last week I found my old naruto(cuz there are sprites biggrin.png) arena game in Visual Basic. Hah I wrote it when I was 13 or 14. Srsly I had multiplayer and 2 characters biggrin.png, though I didn't know what function is and everything was in one large, really large function(automatically generated from a timer I think, I had found that if I double click it shows me editor and I can start typing smile.png )

 

PS. I used the deprecated direct draw for drawing... tongue.png. My greatest achievement was the moving camera that is following the character. Ohh also I found a vid of my game: http://youtu.be/gYePr5AMBJE hope you like it biggrin.png

Haha, It's great! 

0

Share this post


Link to post
Share on other sites

 

when i was 14, i only knew(and knew is a very long stretch) actionscript. so be proud of atleast knowing c at such a young age.

Actually this is C++. But at that time I didn't even know what a class or an object was. All I knew was basic functions, variables. So there's nothing really to be proud of. 

 

 AT least you knew how to use goto. ph34r.png 

0

Share this post


Link to post
Share on other sites

 

 

when i was 14, i only knew(and knew is a very long stretch) actionscript. so be proud of atleast knowing c at such a young age.

Actually this is C++. But at that time I didn't even know what a class or an object was. All I knew was basic functions, variables. So there's nothing really to be proud of. 

 

 AT least you knew how to use goto. ph34r.png

 

Yeah biggrin.png

In the way I wrote that code, it looks more like BASIC, than C++

Edited by Edvinas Kilbauskas
0

Share this post


Link to post
Share on other sites

When I was 12 I only knew how to put discs on my Playstation :D Later I learnt to put discs on my PC and the rest is history :P

 

Did you had automatic formatting or you wrote it just like that?

0

Share this post


Link to post
Share on other sites

When I was 12 I only knew how to put discs on my Playstation biggrin.png Later I learnt to put discs on my PC and the rest is history tongue.png

 

Did you had automatic formatting or you wrote it just like that?

Yes, I had automatic formatting enabled.

0

Share this post


Link to post
Share on other sites

Ahhh, at 12 I was hacking the Half-Life SDK. Added ricochets (if the reflection angle was sufficiently shallow) and bullets that could go through walls. And made the UI green tongue.png

 

My first encounter with the horrors that are/were Visual C++ 6 and systems hungarian notation.

Edited by l0calh05t
0

Share this post


Link to post
Share on other sites


I don't have any code from when I was that age, as around the age of 14 or so, an HDD crash had wiped out everything I had before this point

 

Same, only my HDD was random girly-pop cassette tapes I "found" somewhere in the vicinity of my sister's tape player...

1

Share this post


Link to post
Share on other sites

If stdout supports ANSI escape codes (e.g. the terminals on *nix or DOS with ANSI.SYS) you could use the escape codes for even more interesting stuff without moving away from the standard library. Colors everywhere!

0

Share this post


Link to post
Share on other sites

If stdout supports ANSI escape codes (e.g. the terminals on *nix or DOS with ANSI.SYS) you could use the escape codes for even more interesting stuff without moving away from the standard library. Colors everywhere!

 

I've been having so much fun with those lately, they are really easy to use as well. Shame they aren't 100% portable, though. I know there's ncurses (and its Windows counterpart PDCurses) but sometimes you just want colors here and there without engineering a complete user interface solution.

0

Share this post


Link to post
Share on other sites

 

If stdout supports ANSI escape codes (e.g. the terminals on *nix or DOS with ANSI.SYS) you could use the escape codes for even more interesting stuff without moving away from the standard library. Colors everywhere!

 

I've been having so much fun with those lately, they are really easy to use as well. Shame they aren't 100% portable, though. I know there's ncurses (and its Windows counterpart PDCurses) but sometimes you just want colors here and there without engineering a complete user interface solution.

 

Dude, ncurses is as easy as or even easier than standart cout in C++. You don't need to engineer complete UI interface or nothing.

Some guy on youtube was interested in this game, and said I should rewrite it in ncurses, so I began working on it.

Look my simple graphics class, which works very well, you can use it too, if you want to.

// GraphicsSystem.h


#ifndef GRAPHICSSYSTEM_H
#define GRAPHICSSYSTEM_H


class GraphicsSystem
{
private:
    static const int SCREEN_WIDTH = 79;
    static const int SCREEN_HEIGHT = 24;
    char m_frameBuffer[SCREEN_WIDTH][SCREEN_HEIGHT];

    void renderBuffer();
public:
    GraphicsSystem();
    ~GraphicsSystem();

    void clearFramebuffer();
    void renderPixel(int x, int y, char ch);
    void render();
    int getScreenWidth();
    int getScreenHeight();
};

#endif // GRAPHICSSYSTEM_H


//--------------------------------------------------------------
//GraphicsSystem.cpp


#include <curses.h>
#include "GraphicsSystem.h"

GraphicsSystem::GraphicsSystem()
{
	clearFramebuffer();
	initscr();
	cbreak();
	timeout(50);
	keypad(stdscr, TRUE);
}

GraphicsSystem::~GraphicsSystem()
{
    endwin();
}

void GraphicsSystem::render()
{
    wclear(stdscr);
    renderBuffer();
    clearFramebuffer();
    wrefresh(stdscr);
}

int GraphicsSystem::getScreenWidth(){
    return SCREEN_WIDTH;
}

int GraphicsSystem::getScreenHeight(){
    return SCREEN_HEIGHT;
}

void GraphicsSystem::renderPixel(int x, int y, char ch)
{
    m_frameBuffer[x][y] = ch;
}

void GraphicsSystem::renderBuffer()
{
    for(int y = 0; y < SCREEN_HEIGHT; y++)
        for(int x = 0; x < SCREEN_WIDTH; x++)
        {
            mvwaddch(stdscr, y, x, m_frameBuffer[x][y]);
        }
}

void GraphicsSystem::clearFramebuffer()
{
    for(int y = 0; y < SCREEN_HEIGHT; y++)
        for(int x = 0; x < SCREEN_WIDTH; x++)
        {
            m_frameBuffer[x][y] = ' ';
        }
}



And you can draw stuff with ease just like this:

#include <curses.h>
#include <cstdlib>
#include <cmath>
#include "GraphicsSystem.h"

GraphicsSystem graphicsSystem;

int main()
{
    while(true){
        for(int x = 0; x < graphicsSystem.getScreenWidth(); x++)
        {
            for(int y = 0; y < graphicsSystem.getScreenHeight(); y++)
            {
                graphicsSystem.renderPixel(x,y,'x'); // render char 'x', or "pixel" on the screen
            }
        }
        graphicsSystem.render(); //clears screen, and displays all chars
    }
	return 0;
}

Edited by Edvinas Kilbauskas
0

Share this post


Link to post
Share on other sites

I think he meant he just wanted to add colors to the terminal as-is and nothing else. Honestly though, if one starts adding things like that one may as well end up just taking over the entire console, which is what ncurses does, pretty much.

0

Share this post


Link to post
Share on other sites

I think he meant he just wanted to add colors to the terminal as-is and nothing else. Honestly though, if one starts adding things like that one may as well end up just taking over the entire console, which is what ncurses does, pretty much.

 

Not necessarily. What I meant was doing some minimal coloring of whatever you're outputting, without taking over the entire console, where simply wrapping up a string constant in an ANSI escape sequence is much easier than working with ncurses when the extra flexibility (menu helpers, borders, and so on) are not needed. Different solutions to different problems, really. ncurses is a nifty little library, and is great for making roguelikes and other games which lend themselves well to a 2D ASCII representation, as well as creating complete console interfaces, but that doesn't mean you need to use it every time you need to push a few colors to a terminal... sometimes a script is just a script wink.png

1

Share this post


Link to post
Share on other sites

Not necessarily. What I meant was doing some minimal coloring of whatever you're outputting, without taking over the entire console

 

That's exactly what I meant... =P

0

Share this post


Link to post
Share on other sites

If stdout supports ANSI escape codes (e.g. the terminals on *nix or DOS with ANSI.SYS) you could use the escape codes for even more interesting stuff without moving away from the standard library. Colors everywhere!

 

ANSI codes are nifty...

 

FWIW, the console in my engine also supports them to some extent, though not to the level that allows a full UI (this currently requires hooking console events and drawing directly into the console buffer), thus leading to the funkiness of doing a DOS-style UI inside of a 3D engine (I actually have an in-engine text editor with a vaguely similar color scheme and style to QBasic and MS Edit, though actually a little worse as it partly handles most non-trivial commands VI-style...).

 

as-is, it would require some tweaks to the console, and probably something analogous to stdout/stdin, such as to allow "programs" the ability to receive user-input (beyond generally being one-off console commands). at that rate, it would almost be worthwhile to throw together a little logic to allow console-commands to trigger loading/executing self-contained script files.

 

say something like:

function main(argv:string[]):void
{
    var s:string;
    var a:string[];
    stdout.printf("Greets!\n");
    while(!stdin.feof())
    {
        s=stdin.gets();
        a=s.split();
        if(a[0]=="north")
            { ... }
        ...
    }
}

I once considered possibly supporting render-to-texture with consoles, say to allow consoles to be textured onto in-game objects, but never did much with this.

Edited by cr88192
0

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0