Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Bits And Pieces

Sign in to follow this  



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  


Recommended Comments

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

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


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 -



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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!