Author Topic: The Atomic Knight Beta 3.0  (Read 12254 times)

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
The Atomic Knight Beta 3.0
« on: February 11, 2010, 08:25:58 AM »
Hello all! this is my first public release of a game, The Atomic Knight. It's ASCII and I coded it in C++ from scratch a few weeks ago. I didn't know about curses at the time, but I'm hoping to implement that in a future release.

Unlike most roguelikes, there are not a lot of stats or simulation. The game is primarily a strategy/arcade/adventure game, but I the presentation is definitely similar to roguetypes.

The environment, like a roguelike, is randomly generated. On top of that, I give the player control over some of the creation functions which allows for extreme pinpoint customization on the style of game played.

You are the Atomic Knight (A) and you shoot projectiles at the Trolls (T) which have a decent enough AI, avoid shots, and can be very effective at killing the player.

In addition, there are 3 power ups to use 8,4,X, which have different effects that I'll let you discover. Keep in mind this is a Beta release, and I'm planning more updates. Once the game is improved I'll be releasing the source code as well.

Finally, you can customize the colors of the text and background to suit your mood. A small feature, but I think it's a nice little touch.

The game tracks High Score, Highest Level reached, and most kills.

It's a 32-Bit Windows application right now. Enjoy! I'd love to hear and feedback, comments, or questions about the game.

The Link: http://8bitcity.blogspot.com/2010/02/atomic-knight-beta-30-release.html

I'll post updates to the game on 8bitcity.blogspot.com in the future!





Skeletor

  • Rogueliker
  • ***
  • Posts: 580
  • Karma: +0/-0
  • villains ftw
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #1 on: February 11, 2010, 03:03:37 PM »
The download link at filesdrop doesn't seems to work!
What I enjoy the most in roguelikes: Anti-Farming and Mac Givering my way out. Kind of what I also enjoy in life.

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #2 on: February 11, 2010, 05:09:55 PM »
Thanks for the heads up! I re-uploaded the file as a temp solution but I'll move it to a permanent place when I get the chance.

I included the source in this upload on accident, so enjoy!

Skeletor

  • Rogueliker
  • ***
  • Posts: 580
  • Karma: +0/-0
  • villains ftw
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #3 on: February 12, 2010, 02:57:20 AM »
No problem.. but the links still redirects to the empty page.

Please fix this, I want to try your game! :)

What I enjoy the most in roguelikes: Anti-Farming and Mac Givering my way out. Kind of what I also enjoy in life.

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #4 on: February 14, 2010, 01:14:59 AM »
Okay, forget about filedropper.

http://sites.google.com/site/postmodernsoftware/

Google sites is much more reliable. Enjoy! I included the source but I didn't clean it up.

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1203
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #5 on: February 15, 2010, 12:37:09 AM »
I played around with it a bit, after dying 3 or 4 times due to general disorientation :P

The full refresh is really killing it, but it is still playable

I like the semirealtimeness of the bullets. gotta add some color to distinguish atomic knights, trolls, prizes

got 5154152, 186 dead trolls!

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #6 on: February 17, 2010, 12:55:44 AM »
Thanks for the feedback! I have a few updates planned for the game:

First, implement the curses library and therefore fix the refresh bug. I know it sucks, but I hope that it doesn't stop one from enjoying the game now. On a faster computer (also, it would seem, on windows xp) the console can actually run really quickly and the refresh is barely noticable. However, on the machine I programmed the game on (a toshiba nb205 netbook running win7starter) the console runs much slower.

I didn't know how to program individual colors for different parts of the output in C++ and I still don't. Hopefully I can learn how to do this and give the player the option of customizing each object in the game.

However, if you look at the source, the game doesn't even use objects. The graphic determines how the program reacts. Still, assigning individual colors seems perfectly reasonable and should satisfy everyone.

That said, I don't really feel like that is a priority. The game already allows 256 color combinations, and the color menu is the easiest and menu to access. The color menu can be accessed at startup, or at death, allowing for the player to easily experiment with different ways of viewing the game. For example, running in the traditional colors makes the game seem like a roguelike, but inverting the colors creates the illusion of a notepad, or "world of text"-type arena. You can even play in pink and neon green to match your pink and green laptop. On a philosophical level, it allows the player to set the mood of the experience. My direct influence on this would be REZ, Lumines, and many other modern games, which offered a multitude of color options and skins, but still don't allow the complete color customization of most operating systems. I think this level of user control is essential to the increasing the success of any piece of software, particularly artistic and recreational software.

Consciously, the motivation behind the color setting was inspired by Microsoft's windows 7 starter os, which does not allow the user any easy access to the desktop wallpaper and several other graphics settings.

Anyway, I encourage everyone to play around with the settings, you will DEFINITELY enjoy the game more!

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #7 on: February 18, 2010, 07:29:25 PM »
Hi, I kind of ported your game to linux :) (Although the exe ran fine with Wine too). All you need to do is to include the following short file instead of conio.h and windows.h (it shouldn't break anything as conio is included here if in windows and I don't think you used windows.h for anything, but if you did, you can add an #ifdef WIN32):
Code: [Select]
/// This file provides a getch() function
/// which gets character from stdin in a
/// non-blocking way.
/// In Windows, conio.h is used, but in
/// Linux, a custom function is needed.

#include <iostream>

#ifdef WIN32
#include <conio.h>
#else
#include <cstdio>
#include <termios.h>
#include <unistd.h>
int getch() {
struct termios oldt, newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}
bool kbhit() {
return true;
}
#endif
Colors didn't work though, and I didn't bother to look into it. :( Anyway, I didn't have problems with screen refresh.

As for the game, the player character is hard to spot and I think the default settings have way too many trolls, but it is a nice start and the projectiles moving turn-by-turn is rarely seen and as such, refreshing.

Hi

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 154
  • Karma: +0/-0
    • View Profile
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #8 on: February 19, 2010, 12:37:40 AM »
It's a fun game.
there are just two habits I'm uncertain of the reason for.
Why do you declare the control variable of the for loop outside of the loop?
Did you write out the code to move the missiles 4 times, because you prefer it that way or because you didn't think of a way to use the same code for each direction? If it's the latter I can show you an easier way.
« Last Edit: February 19, 2010, 03:21:56 PM by Hi »

5v3nd0ttg

  • Newcomer
  • Posts: 42
  • Karma: +0/-0
  • Nate
    • MSN Messenger - p03tic5ickn355@msn.com
    • AOL Instant Messenger - p03tic5ickn355
    • Yahoo Instant Messenger - p03tic5ickn355
    • View Profile
    • The Other Experiment Studio
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #9 on: February 20, 2010, 12:52:34 AM »
Fun game, cool idea.

I agree completely with the color change idea submitted by Slash.

COLOR FOR LINUX:
Code: [Select]
printf("\033[22;31mHello, world!");
/* this will print hello world in red
     other colors:
\033[22;30m - black
\033[22;31m - red
\033[22;32m - green
\033[22;33m - brown
\033[22;34m - blue
\033[22;35m - magenta
\033[22;36m - cyan
\033[22;37m - gray
\033[01;30m - dark gray
\033[01;31m - light red
\033[01;32m - light green
\033[01;33m - yellow
\033[01;34m - light blue
\033[01;35m - light magenta
\033[01;36m - light cyan
\033[01;37m - white */
COLOR FOR WINDOWS:
Further Information: http://msdn.microsoft.com/en-us/library/ms686047%28VS.85%29.aspx
Code: [Select]
#include <windows.h>

int main()
{
   HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
 
   // change color
   SetConsoleTextAttribute(hConsole, color);
}
// colors:
//0 = Black  8 = Gray
//1 = Blue 9 = Light Blue
//2 = Green a = Light Green
//3 = Aqua b = Light Aqua
//4 = Red c = Light Red
//5 = Purple d = Light Purple
//6 = Yellow e = Light Yellow
//7 = White f = Bright White

clear screen is a killer, kinda irritating, thankfully not TOO distracting from gameplay.

Thanks for the fun!
« Last Edit: February 20, 2010, 01:23:14 AM by 5v3nd0ttg »
Check out my artwork, photography, and video game projects at www.theoestudio.com.

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #10 on: February 24, 2010, 05:31:11 PM »
Wow! Thanks everyone, I'll definitely get to work on porting the game to Linux.

As for the code, I'm embarrassed by it and it will be cleaned up over time. Everything I did was "quick and dirty" and I've avoided condensing the code because I'm thinking about reworking the entire system to use actual objects instead of just characters.

Anyway, I did this a few days ago, but beta 4.0 is released. I didn't think to check this topic so I didn't have any of the feedback since my last post but I think this version is more enjoyable.

[link]http://8bitcity.blogspot.com/2010/02/atomic-knight-beta-40.html[/link]

It now runs in DOS, no windows, which should make it easier for nix users right now (but the Linux port is forthcoming, thanks again aave!)

-8laser greatly improved
-default settings changed (less trolls, less powerups, less buildings)
-ENDING added (or cheat and look in the source code)

If you don't want to just look in the source for the ending, you need to do one of the following:

1. Kill 1000 Trolls
2. Reach level 100
3. Achieve 100000000 points.


Hi: I don't know why I declare the variable outside of the for loop. I was taught that way in high school and it stuck I suppose. As to your question about move missiles, THANKS for spotting a bug! Right now it's a series of if statements and it checks each square for times, I see the problem with that for sure.  I meant to make it a series of if-elses so that it would break after one true case.  I can think of a few ways to make it more streamlined, but my thought was that movemissiles wasn't broken so...

There are a bunch of simple functions I would have realized I needed (for example, a simple inBounds(int j, int k) function, etc.

Hi

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 154
  • Karma: +0/-0
    • View Profile
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #11 on: February 25, 2010, 02:34:05 AM »
It's not bad code, I just really enjoy reading other people's code because they think differently than me and as I was reading yours I was also trying to fit as much on the screen at once as possible.  My solution isn't the best solution it's just the one that I came up with.

int moveMissiles()
{
   char tempGrid[20][80];
   char missle;
   int newj;
   int newk;
   for(int j=0; j<20; j++)
   {
      for(int k=0; k<80; k++)
      { 
         tempGrid[j][k]=' ';
      }
   }
   for(int j=0; j<20; j++)
   {
      for(int k=0; k<80; k++)
      {
         newj=j;
         newk=k;
         missle = theGrid[j][k];
         if (missle=='^') //up missile
            newj = j-1;
         else if (missle=='v') //down missile
            newj = j+1;
         else if (missle=='>') //right missile
            newk = k+1;
         else if (missle=='<') //left missile
            newk = k-1;
         else
            continue;
         if (newj >= 0 && newj < 20 && newk >= 0 && newk < 80)
         {
            tempGrid[newj][newk]=missle;
            if (theGrid[newj][newk]=='T') // a hit!
            {
               score += 1000 + rand()%100000; //wtf lol!
               kills++;
               tempGrid[newj][newk]=' ';
            }
            else if(theGrid[newj][newk]=='#' || theGrid[newj][newk]=='4' || theGrid[newj][newk]=='8' || theGrid[newj][newk]=='X')
               tempGrid[newj][newk]=' ';
         }
         theGrid[j][k]=' ';
      }
   }
   for(int j=0; j<20; j++)
   {
      for(int k=0; k<80; k++)
      {
         if (tempGrid[j][k] != ' ')
            theGrid[j][k] = tempGrid[j][k];
      }
   }
}

Robot

  • Newcomer
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: The Atomic Knight Beta 3.0
« Reply #12 on: February 25, 2010, 06:03:36 AM »
That's an elegant solution, I like it. I think you


one line should read

else if(theGrid[newj][newk]=='#' || theGrid[newj][newk]=='4' || theGrid[newj][newk]=='8' || theGrid[newj][newk]=='X' || theGrid[newj][newk]=='A')

but yea, thanks for that code, I remember using something similar years ago in a game of life program.

.... I can think of many applications :)
« Last Edit: February 25, 2010, 03:36:10 PM by Robot »

Hi

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 154
  • Karma: +0/-0
    • View Profile
    • Email
Re: The Atomic Knight Beta 3.0
« Reply #13 on: February 25, 2010, 05:25:19 PM »
woops, I forgot that I changed how projectiles work, if you want them to work the same as before take out any line that says
theGrid[newj][newk]=' '