Sign in to follow this  
  • entries
    51
  • comments
    51
  • views
    13701

Bits And Pieces

Sign in to follow this  
VPellen

94 views

--------------------------------------------------

VI. Unit Management

One of the major resources in the game is raw manpower, known in-game as "Civilians". Civilians are both vital and versatile. A Civilian can become anything from a city guard to a merchant to a worker.

For a Civilian to assume a role, he must be in the same location as the supplies needed by a figure of that role. For example, in order to become a knight, a civilian must have access to a set of full-plate mail, as well as a sword and shield.

Once a unit is established, it can be placed into several roles, depending on what unit it is. A knight may be placed in the castle garrison, enrolled with a mobile army, serve as extra manpower at a labour facility, etc.

All units sit in a pool. The pool can be dipped into at any time. A unit can be relieved of its duties at any time. If a unit is relieved of its duties whilst in a town, the unit returns to the Civilian pool, and his supplies (armour, weaponry, etc) go into the armoury.

--------------------------------------------------

There's a little something pulled from my design document, for anybody who cares. I'm starting to get the basics of things outlined. Sooner or later, I'll be able to start working on the math of the world - numbers and statistics. Maybe I can eventually get a prototype going. But for now, things are progressing slowly but surely. I'm still wondering about the best way to implement A* on a hexagonal grid, though. Oh well.

Back to work.
Sign in to follow this  


2 Comments


Recommended Comments

Wait, how would a hexagonal grid be represented?
 _   _   _   _

/1\_/2\_/3\_/4\_
\_/5\_/6\_/7\_/8\
/9\_/0\_/1\_/2\_/
\_/3\_/4\_/5\_/6\
/7\_/8\_/9\_/0\_/
\_/ \_/ \_/ \_/

?

So, if we examine the first '0' (I ran out of digits [sad]) its neighbors would be -


mapWidth = 4

myIndex - 2 * mapWidth
myIndex - mapWidth - 1
myIndex - mapWidth
myIndex + mapWidth
myIndex + mapWidth + 1
myIndex + 2 * mapWidth


And from there you could use that to run the algorithm (I can't see any other possible roadblocks aside from the initial nastiness of finding a tile's neighbors from an index).

Granted, this only works for my forced-rectanglar drawing. But if you have something prettier -
     _

_/ \_
_/ \_/ \_
/ \_/ \_/ \
\_/ \_/ \_/
\_/ \_/
\_/


For example, you should number them in such a way that it makes finding the indices sane. Like -

     _

_/1\_
_/4\_/2\_
/7\_/5\_/3\
\_/8\_/6\_/
\_/9\_/
\_/


Where, for the tile at index 5 the neighbors are -


mapWidth = 3

myIndex - mapWidth - 1
myIndex - mapWidth
myIndex - 1
myIndex + 1
myIndex + mapWidth
myIndex + mapWidth + 1


Though I'm not sure how nice that would be to render it you're using the painter's algorithm. I guess you could store a depth level for each tile and use that, as that would only require 1 value to store, as opposed to 6 pointers-to-neighbor tiles.

But yeah. My brain a splode.

Share this comment


Link to comment
All right, another TBS game-
I just stumbled onto this journal, and I'm looking forward to being inspired so Sir Sapo and I can really working on our own
Good Luck!- I'm hoping for screens eventually, too

-Mark the Artist

Share this comment


Link to comment

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