Castles & Trees


Here you can see Castles & Trees now in the game (although the AI doesn’t use them yet..) I know the magic wood trees are a bit flat, but at least they are in there for now.

I had to expand the engine a bit to support trees and castles.. A piece can now have a chance between 0 and 100 of disappearing each turn prior to movement. Associated with these are flags for only disappearing if a creature is riding on it (i.e. a wizard in a magic wood tree), an effect name say that we can make castles explode, but magic wood trees just disappear. Also an associated number of bonus spells value for if a piece disappears so we can implement magic woods.



# Group details are used to stop trees being cast adjacent to each other.

(The config files used by PTK don’t handle spaces very well, hence the use of underscore characters..)

I also had to alter the movement code to do a check to stop shadow wood trees moving over bodies if they kill a creature. Changes have been made as well as deal with defences of 0 (invulnerable) and attacks of 0 (can’t attack).

To make it so that trees are not able to be cast next to each other I’ve implemented a group name that each piece can have, as well as a flag to say if a piece can be positioned adjacent to someone in the same group. This lets me call both Magic Woods and Shadow Woods as being part of the Tree group and not being able to be next to each other. This was a bit more coding, and I have to pass the group name as text string around a few functions. However, this lets us have other uses for groups, say to let a mutation spell know to only pick from creatures in one group.. and it also stops us hard-coding something just for trees. A silly example is that we might want new spells of a Cat and a Dog, but not want them to be next to each other..

Well, all this was a bit of work and I still need to make the AI use these spells, and I also need to tidy up some parts of the code which are getting a bit difficult to follow. I don’t think I’ll get much more done today, but enjoy the pic and progress report! 🙂

3 Responses to “Castles & Trees”

  1. Gaz Says:

    This is one thing I’ve never understood about chaos. Why can’t trees be cast adjacent to each other? What problem would that introduce?

  2. happymonster Says:

    I think it’s more of a design decision. So that a wizard going into a magic wood would normally be unable to move directly into another tree unless he had wings or shadow form.

    Also, it stops shadow trees being used to wall someone into a corner and not letting them escape easily.

  3. Gaz Says:

    I see your point with the magic trees, bit of an unfair advantage if you’re never out in the open.

    Like the idea of trapping a wizard in a dangerous forest though!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: