Jump to content
IGNORED

"His Dark Majesty"


ilmenit

Recommended Posts

"His Dark Majesty" is a game written in C (CC65+asm). It is a turn-based tactics video game inspired by "Advance Wars" and "Reign of Swords" (Iphone). All the AI "engine" and battle system is already done. Now I'm working on the GUI and the gfx side.

 

A little demo is available here: http://www.alamak0ta.republika.pl/hdm_demo1.zip

In the Atari version you can watch two computer players fighting each other.

Currently it's totally unoptimized, but premature optimization is the root of all evil :)

Run it rather in 'Full Speed' emulator.

 

Because of C language I was able to compile a Windows version easily with a basic map editor.

It's included in the archive. It also allows you to play against computer or other player and to create new maps.

 

I'm looking for help with this project. The list of wishes for help is a long one :)

- programming (C or asm)

- graphics

- sounds (I have no idea about Pokey programming)

- music

- plot/campaign/story

- language (I'm not a native English speaker)

- maps (interesting maps are a must! Try the editor to make one!)

- ideas for "economy" and resources - how to buy units and improve your army (outside the battle field).

 

I'm aiming for the standard 8bit Atari witk 64KB memory (max. 128KB)

 

regards,

Jakub

Edited by ilmenit
Link to comment
Share on other sites

  • 2 weeks later...

It's what I call a "diamond shaped" pathfinding, which works quite well on a short distance and no diagonal movement.

 

I draw a diamond shaped spiral using 4 lines for each distance.

Starting from 'S' the drawn points look like on the picture:

 

   9
 A38
B4S27
 C16F
  5E
  D

 

The currently drawn line is a north-east line (DEF). With each direction I have linked the direction to look for the previous cost.

For north-east line the direction cost is at north and west (f.e. for 'E' the cost is lower value of '5' and '6' - min(prev1,prev2)).

 

For each cell I calculate a destination cost as a sum of current cost and min(prev1, prev2).

Example:

Cost table of terrain (we are going from 'S'tart to 'E'nd):

S311
1111
2111
2111
2111
 E

As a result we get the diamond shaped calculation of movement cost:

S345
1234
3345
5456
 E

 

The best path is described by decreasing values starting from 'E'.

 

If you are interested in in FOV forblocking cells only, without pathfinding, then take a look at algorithm from my other game:

void ViewSegment(signed char dx,signed char dy)
{
       register unsigned char p,r;
       register unsigned char x,y;
       register unsigned char start;

       // 1. Horizontal
       start=player_x;
       for (p=0;p<FOV_RANGE;++p)
       {
               x=start;
               y=player_y;
               start+=dx;
               if (MapGetCell(x,y)==CELL_WALL)
               {
                       ShowFovCell(x,y);
                       break;
               }
               for (r=p;r<FOV_RANGE;++r)
               {
                       ShowFovCell(x,y);
                       if (MapGetCell(x,y)==CELL_WALL)
                               break;
                       x+=dx;
                       y+=dy;
               }
       }
       // 2. Vertical
       start=player_y;
       for (p=0;p<FOV_RANGE;++p)
       {
               y=start;
               x=player_x;
               start+=dy;
               if (MapGetCell(x,y)==CELL_WALL)
               {
                       ShowFovCell(x,y);
                       break;
               }
               for (r=p;r<FOV_RANGE;++r)
               {
                       ShowFovCell(x,y);
                       if (MapGetCell(x,y)==CELL_WALL)
                               break;
                       x+=dx;
                       y+=dy;
               }
       }

}

void PlayerFov()
{
       ViewSegment(1,1);
       ViewSegment(1,-1);
       ViewSegment(-1,-1);
       ViewSegment(-1,1);

}

 

FOV Demo (Windows)

 

The Atari version (very slow and unoptimized): link

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...