Announcement: Be excellent to each other.


Caravel Forum : Other Boards : Crystal Shard Games : Leylines Combat Mechanics
New Topic New Poll Post Reply
Poster Message
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Leylines Combat Mechanics (0)  
I'm just curious as to how the combat mechanics in Leylines were done, from a programming perspective. In particular, how a unit can gain an arbitrary number of buffs on them from other units, and then how the combat formula takes that into account when adding bonuses together.

Would anyone be able to shed any light on this for me? :)

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place
07-27-2009 at 07:57 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Radiant
Level: Moderator
Avatar
Rank Points: 142
Registered: 02-05-2003
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Sure. Hm, remind me to update that game again soon :)

Essentially, all buffs are put in a bitfield, then we have functions to check that.

So the combat engine does stuff like "if (attacker.is (U_Cavalry) && defender.is (U_BreakCharge)) defense += 4;" and many of the spells only do something like "target.set (U_FireAura)".

Does that answer your question?

____________________________
= Radiant =
07-28-2009 at 07:06 AM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Actually, it does. Quite well, too! :D

So, just to confirm, each buff sets a state on a unit, being whether that unit has the buff or not, and if so, it taken into account during combat (if relevant). Furthermore, I assume that some states prevent others from occuring (like being undead would prevent a particular buff state from happening).

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place

[Last edited by Danjen02 at 07-28-2009 07:47 AM]
07-28-2009 at 07:41 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Radiant
Level: Moderator
Avatar
Rank Points: 142
Registered: 02-05-2003
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Danjen02 wrote:
So, just to confirm, each buff sets a state on a unit, being whether that unit has the buff or not, and if so, it taken into account during combat (if relevant).
Yes, although off the top of my head a few buffs are exceptions to this rule (e.g. Storm Run merely increases target.movement by a lot).

Furthermore, I assume that some states prevent others from occuring (like being undead would prevent a particular buff state from happening).
Yes. Before a spell takes effect, there's a function that determines valid targets for a spell. For instance, bulky units are not valid targets for flight (off the top of my head)

____________________________
= Radiant =
07-28-2009 at 08:55 AM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
wonkyth
Level: Goblin
Rank Points: 15
Registered: 06-18-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Radiant wrote:
Sure. Hm, remind me to update that game again soon :)
Update that game. :P
Seriously though, I'd really like to see that happen eventually.
There are very few free strategy games around that are also worthwhile.
The only ones that come to mind are FreeCiv and the Battle for Wesnoth, and they're both very large open-source games.

Also, Danjen I'm curios about why you asked this question.
Is it just a random wondering, or do you have Plans? :cool

____________________________
"Satire denounces the world;
Wit penetrates it;
Humour accepts it;
But Nonsense Transforms it"
- Cedric Whitman
w.r.t. Aristophanes
07-28-2009 at 11:46 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Wonkyth wrote: Also, Danjen I'm curios about why you asked this question.
Is it just a random wondering, or do you have Plans? :cool
I was just wondering, since I have a little project I'm working on. Nothing fancy, just a FF/Tactics style of game, as an homage to the glorious 8-bit era of gaming. (that, and Radiant is the only person I have access to who has written really solid games, and knows his stuff, and is willing to share. :))

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place
07-28-2009 at 08:12 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
wonkyth
Level: Goblin
Rank Points: 15
Registered: 06-18-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Well, if it ever comes to something, do tell. :)
I have a few projects of my own currently snailing their way along, and seeing something new would always be welcome! ;)

____________________________
"Satire denounces the world;
Wit penetrates it;
Humour accepts it;
But Nonsense Transforms it"
- Cedric Whitman
w.r.t. Aristophanes
07-29-2009 at 12:29 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Well if you're interested in reading some updates as they come along, the site is right here. There's not much there at the moment, though, but this is the site where I post anything related to it.

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place
07-29-2009 at 08:50 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Radiant wrote:
Essentially, all buffs are put in a bitfield, then we have functions to check that.
Sorry, just to clarify: is a bitfield like an array of boolean values?

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place
08-06-2009 at 11:45 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
The Mystic
Level: Goblin
Rank Points: 18
Registered: 09-20-2006
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Radiant wrote:
Hm, remind me to update that game again soon :)
When you do, please make it a bit more vista-friendly. After updating to service pack 2, the game freezes up after about ten to twenty turns.

____________________________
Either I'm crazy, or everybody else is nuts. And I know I'm not crazy because the little man who lives on my shoulder told me so.
If people don't think there's something wrong with you, there's something wrong with you.
Oh well. Another day, another dementia.
Click here to view the secret text

08-06-2009 at 02:44 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Radiant
Level: Moderator
Avatar
Rank Points: 142
Registered: 02-05-2003
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Danjen02 wrote:
Sorry, just to clarify: is a bitfield like an array of boolean values?
Kind of, only more efficient. http://en.wikipedia.org/wiki/Bitfield

The Mystic wrote:
When you do, please make it a bit more vista-friendly.
That's going to be tricky since I don't use vista, but I'll give it a shot.

____________________________
= Radiant =
08-10-2009 at 02:38 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
The Mystic
Level: Goblin
Rank Points: 18
Registered: 09-20-2006
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Radiant wrote:
The Mystic wrote:
When you do, please make it a bit more vista-friendly.
That's going to be tricky since I don't use vista, but I'll give it a shot.
If you can do it or not, that's fine; vista is a really funky and finicky OS, and in my opinion it's one of the worst Microsoft ever made. I'm hoping I just need to redownload the game.

In any case, I'll see if I can get Leylines (and ST1 & ST2, just to try) to run in VirtualBox, which I've been using to emulate WinXP on my vista system.

____________________________
Either I'm crazy, or everybody else is nuts. And I know I'm not crazy because the little man who lives on my shoulder told me so.
If people don't think there's something wrong with you, there's something wrong with you.
Oh well. Another day, another dementia.
Click here to view the secret text

08-11-2009 at 07:07 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
wonkyth
Level: Goblin
Rank Points: 15
Registered: 06-18-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
OOh, VirtualBox sounds interesting!
I've been using DOSBox for a while now, but never new there were things like that for XP...

____________________________
"Satire denounces the world;
Wit penetrates it;
Humour accepts it;
But Nonsense Transforms it"
- Cedric Whitman
w.r.t. Aristophanes
08-12-2009 at 03:25 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Danjen02
Level: Roachling
Avatar
Rank Points: 11
Registered: 11-08-2007
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
The Mystic wrote:
In any case, I'll see if I can get Leylines (and ST1 & ST2, just to try) to run in VirtualBox, which I've been using to emulate WinXP on my vista system.
So I guess I have to have an ISO or physical copies of the discs to actually use this thing, huh?

____________________________
SubTerra
- Ultimate rank
- 2009 level design contest, 2nd place
08-12-2009 at 08:45 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
The Mystic
Level: Goblin
Rank Points: 18
Registered: 09-20-2006
IP: Logged
icon Re: Leylines Combat Mechanics (0)  
Yes, you need a copy of the OS you want to emulate. I don't think you can emulate an OS that's newer than the one on your host system, though. In other words, you can emulate XP on a vista machine, but (I think) not vice versa.
wonkyth wrote:
I've been using DOSBox for a while now, but never new there were things like that for XP...
I tried DOSBox once, and could never get it to work. Then again, I don't really know my way around a DOS environment.

Radiant - So far, Leylines works pretty good with WinXP emulated in VirtualBox, except that the game crashes if the screen resolution is less than 1024x768. I think it was vista sp2 that was giving me grief earlier, because I reinstalled the game and still had problems.

____________________________
Either I'm crazy, or everybody else is nuts. And I know I'm not crazy because the little man who lives on my shoulder told me so.
If people don't think there's something wrong with you, there's something wrong with you.
Oh well. Another day, another dementia.
Click here to view the secret text


[Last edited by The Mystic at 08-13-2009 02:32 AM]
08-13-2009 at 02:30 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Other Boards : Crystal Shard Games : Leylines Combat Mechanics
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.