Skip to main content
Clarification.
Source Link

Java (Runnable): real time RTS combat implementation in strategy gamesystem

I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are fighttingfighting in small squads, but the egagements are individual (for example: 1v1, 1v2, 1v4 etc, but not 2v2, 2v3, 3v5, etc) and are taking place on whats usually considered an RPG level of detail (stats, items, scripts...).

The current rules use Java, with class Engagement implements Runnable and its run() method to simply alternatealternating the attack phases of two units until one of them is incapacitated. That was usefull for ATT/DEF equation balancing, but I'm not sure how to model the following:

  • unit's attack, block, parry/conterattack phases during the engagement (deciding when to block, for additional DEF - one simple loop or a separate thread?)
  • multiple units engaging one unit (for, say, caster/leadership takedown), where the outnumbered unit has to choose which attacker to repel/conterattack (loop or a check within aforementioned decision thread?)

Is real-time usually modelled as just a really quick loop, or a thread with interrupt and sleep/wait/join?

If needed, I can add the relevant code, but I think of this as a purely design, flow-orientedmodelling problem; simply put: What are the classes/interfaces (and their traits) I should rely on while resolving this problem?

Java (Runnable): real time combat implementation in strategy game

I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are fightting in squads, but the egagements are individual (for example: 1v1, 1v2, 1v4 etc, but not 2v2, 2v3, 3v5, etc) and on an RPG level (stats, items, scripts...).

The current rules use class Engagement implements Runnable and its run() method to simply alternate the attack phases of two units until one of them is incapacitated. That was usefull for ATT/DEF equation balancing, but I'm not sure how to model the following:

  • unit's attack, block, parry/conterattack phases during the engagement (deciding when to block, for additional DEF - one simple loop or a separate thread?)
  • multiple units engaging one unit (for, say, caster/leadership takedown), where the outnumbered unit has to choose which attacker to repel/conterattack

If needed, I can add the relevant code, but I think of this as a purely design-oriented problem; simply put: What are the classes/interfaces (and their traits) I should rely on while resolving this problem?

RTS combat system

I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are fighting in small squads, but the egagements are individual (for example: 1v1, 1v2, 1v4 etc, but not 2v2, 2v3, 3v5, etc) and are taking place on whats usually considered an RPG level of detail (stats, items, scripts...).

The current rules use Java, with class Engagement implements Runnable and its run() method simply alternating the attack phases of two units until one of them is incapacitated. That was usefull for ATT/DEF equation balancing, but I'm not sure how to model the following:

  • unit's attack, block, parry/conterattack phases during the engagement (deciding when to block, for additional DEF - one simple loop or a separate thread?)
  • multiple units engaging one unit (for, say, caster/leadership takedown), where the outnumbered unit has to choose which attacker to repel/conterattack (loop or a check within aforementioned decision thread?)

Is real-time usually modelled as just a really quick loop, or a thread with interrupt and sleep/wait/join?

If needed, I can add the relevant code, but I think of this as a purely design, flow-modelling problem; simply put: What are the classes/interfaces (and their traits) I should rely on while resolving this problem?

edited title
Link

Java (Runnable): real time combat implementation in strategy game

Source Link

Java (Runnable): real time combat implementation in strategy

I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are fightting in squads, but the egagements are individual (for example: 1v1, 1v2, 1v4 etc, but not 2v2, 2v3, 3v5, etc) and on an RPG level (stats, items, scripts...).

The current rules use class Engagement implements Runnable and its run() method to simply alternate the attack phases of two units until one of them is incapacitated. That was usefull for ATT/DEF equation balancing, but I'm not sure how to model the following:

  • unit's attack, block, parry/conterattack phases during the engagement (deciding when to block, for additional DEF - one simple loop or a separate thread?)
  • multiple units engaging one unit (for, say, caster/leadership takedown), where the outnumbered unit has to choose which attacker to repel/conterattack

If needed, I can add the relevant code, but I think of this as a purely design-oriented problem; simply put: What are the classes/interfaces (and their traits) I should rely on while resolving this problem?