Grognard Posted February 19, 2012 Share Posted February 19, 2012 Hi guys, making a game with turn-based tactical combat and there is an issue I keep dithering on resolving. In X-Com your troops will manage their own firing if they have action points and get an interrupt. I kind of like that, but I am not sure how it calculates when you get one and when you don't. If anyone knows that would be great. With JA and Silent Storm you can get interrupts where possibly more than one of your soldiers gets a chance to interrupt. Again though, I have no idea what these calculations are based on. Since it's open source I figure somebody ought to know. Right now what I do is divide turns into 100 time units. When an enemy turn starts with an enemy in LOS or an enemy enters into LOS it calculates in adversarial manner a value of how many time units the enemy can act before an interrupt occurs. Then each action updates a counter for each enemy in LOS until it reaches this threshold, causing an interrupt. Right now it short circuits to always return 30, but the idea is to have it so that the value could be over 100 (meaning no interrupt) or even zero (meaning an interrupt occurs the second that an enemy enters LOS). However I'm not sure how to calculate this. Also, I liked how in the old JA and SS games you got multiple characters interrupting many times. It will feel kind of dumb to have one guy interrupt, then the next, then the next, and so on. So hopefully some of you guys know more how the others calculated this, and perhaps also some ideas on how they want it calculated. Or else maybe even a whole new way for it to work. Link to comment Share on other sites More sharing options...
FullAuto Posted February 19, 2012 Share Posted February 19, 2012 In X-Com your troops will manage their own firing if they have action points and get an interrupt. I kind of like that, but I am not sure how it calculates when you get one and when you don't. If anyone knows that would be great. The X-Com unit has to have time units left, and the probability of reaction fire is calculated using the soldier's Reaction stat, if I remember right. Some ideas:You could have it occur automatically. For instance, as soon as an enemy enters a unit's LOS, the unit fires (firing type, if variable, could be set or default to a certain type, e.g. snap shot). Range could be another factor. You could have an option to define a certain range. Outside of that, your units don't fire. If the enemy enters that range, your unit opens fire. You could also have range have an effect on accuracy e.g. a unit spotting an enemy close by will be 'startled' and will have less accurate reaction fire. You could have it work in a group fashion, if you want defensive fire to be a serious factor. Reacting units get more shots, if there are several of them with LOS to the same enemy (the reaction fire of one 'alerts' the others, etc). You could have the likelihood of reaction fire increase based on the number of enemies visible, and what they do. For instance, if one enemy appears and stops moving, the chance is low. If five enemies come into view, use items, move about etc, then the chances of reaction fire increase dramatically. Link to comment Share on other sites More sharing options...
Grognard Posted February 19, 2012 Author Share Posted February 19, 2012 Yeah I guess it makes sense to have more enemies make for more interrupts. I guess what I'm doing automatically does that but I didn't think of it. It probably does it too much though because if 4 guys are in view you get 4 times the chance to interrupt. It's very complicated. Unfortunately I'm finding a lot of the game system stuff is very complicated and takes a lot of trial and error but hopefully I can get it feeling "right" eventually. This is the biggest thing that just feels totally wrong that's left. I want to be able to set it in a game option whether it uses X-Com style or JA style, because I'm trying to make something you could use not just for one game but to be flexible for modders as well and I'm sure the first mods people would make would be for X-Com or JA given the type of combat. Too bad X-Com is not open source. I have the source for JA 2 but when I spent a day looking at it a while ago I couldn't figure out much of what the heck was going on, though that was not really what I was looking for. Link to comment Share on other sites More sharing options...
Bomb Bloke Posted February 19, 2012 Share Posted February 19, 2012 https://www.ufopaedia.org/index.php?title=Reaction_Fire In short, each trooper gets a reaction stat. How effective this is relates directly to the percentage of TUs you have in stock - for example, a trooper with a reaction score of 60 and 50% TUs left, effectively has a reaction score of 30. If a trooper wanders into alien LOF, and has a lower reaction score then the alien, then that alien gets an opportunity to shoot at him - the further he moves on his turn, the more likely he'll be shot. The exception is if that trooper spots any aliens at the exact moment any aliens spot him, which is why you can typically send a trooper through the door of a UFO and then only his next action will be fatal. Link to comment Share on other sites More sharing options...
NKF Posted February 19, 2012 Share Posted February 19, 2012 There's a number of ways you can handle the interrupts. The extremes are to go automatic like X-Com and let the game control how the unit responds, or make manual turns ala Jagged Alliance 2 where you get a set number of your saved action points and take a mini-turn. Both methods work well, but one suffers from unpredictability by way of poor response choices (reacting with a rocket launcher), the other adds speed bumps in the pacing of the enemy turn. Perhaps go down the middle? Semi-automate it with behaviour settings, such as how the unit will react when interrupting. It could be simple settings like defensive, evasive, offensive. In a Dungeons and Dragons style fantasy game for example, you might make like the unit to go on the defensive and raise a shield or use their current weapon to deflect an incoming attack. Evasive is simple enough, kneeling, going prone or stepping behind nearby cover to break line of sight, and if you are making a modern slo-mo-bullet-time action movie style game, dodge a bullet with acrobatics. Offensive is good old shooting back (and counter-attacking if you include hand to hand combat). - NKF Link to comment Share on other sites More sharing options...
Grognard Posted February 19, 2012 Author Share Posted February 19, 2012 Thanks Bomb Bloke, that will help a lot for the X-Com style interrupts. NKF - I plan to do both of the first two and make it changeable by user or mod maker. I don't like anything that requires selecting something beforehand. In games like that it just becomes a big chore IMO. Also I liked in X-Com that you had little control as it spiced things up. Link to comment Share on other sites More sharing options...
NKF Posted February 19, 2012 Share Posted February 19, 2012 Just to clarify, I was referring to something like the behaviour settings in Apocalypse that controlled the automatic behaviour of your units. Selecting a response each turn would be rather tedious. - NKF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now