End round at end of combat

Unstructured ideas, requests and suggestions for the development of the game.
User avatar
Duvalon
Posts: 62
Joined: Wed Oct 19, 2016 1:34 am
android_version: 6.0
Location: Canada

Re: End round at end of combat

Post by Duvalon » Fri Nov 04, 2016 3:01 am

rijackson741 wrote:It sounds to me like a bug if it does not work if you kill the enemy in the first round. I assume it's triggered at the end of the round, both within combat and without. But entering combat within the 6 seconds or exiting combat by killing your enemy ends the round prematurely, so the conditions are not triggered. IMO, they should be triggered regardless of how the round is terminated.
Yes, that was my point exactly. I didn't do a great job explaining it.

If you don't mind, I'd like to take a look at the code and see if I can find a solution myself. A sort of baptism if you wish. Gotta start somewhere.

User avatar
Zukero
Lead Developer
Posts: 1332
Joined: Thu Jul 21, 2011 9:56 am
android_version: 7.1

Re: End round at end of combat

Post by Zukero » Fri Nov 04, 2016 6:54 am

Duvalon wrote: If you don't mind, I'd like to take a look at the code and see if I can find a solution myself. A sort of baptism if you wish. Gotta start somewhere.
That's what the GPL license is all about. Don't like something? Hack it and change it. If yours is better than mine, either I take it or the users take yours.
Lvl: 78, XP: 8622632, Gold: 271542, RoLS: 1, ElyR: -, RoL: -, ChaR: 1, GoLF: 1, ShaF: 1, SRoV: 1, VSH: 1, WMC: 1, GoW: 1
HP: 71, AC: 301%, AD: 38-47, AP: 3, ECC: 50%, CM: 3.75, BC: 101%, DR: 2

User avatar
Nut
Posts: 115
Joined: Mon Oct 27, 2014 12:14 pm
android_version: 4.4

Re: End round at end of combat

Post by Nut » Fri Nov 04, 2016 8:10 am

I prefer regenerating with meat to potions, because I can use it before starting combat, and it refills my health slowly but steadily. Drinking in combat needs AP, and you have a hit less.
And meat you get on your way, snake meat tastes best :D
When it is poisoned, I just wait in safe distance to monster until I feel better again and eat another meat.

And don't forget: bonemeal potion is illegal!
Nut
_____
Nut: Lvl 61, HP 103, AC 273%, AD 32-41, CHS 67, BC 159% WA 3, Do 5, BS MC 1, CS 2, IF 1, Reg 1, WP 1, S 1, AP L 1, RoLS
Anwyn: Lvl 52, HP 126, AC 221%, AD 28-36, CHS 27, BC 119% Do 4, CS 2, IF 3, Ev 2, Reg 1, Ta 1, RoLS

Usirim
Posts: 138
Joined: Tue May 01, 2012 10:33 am
android_version: 6.0

Re: End round at end of combat

Post by Usirim » Sat Nov 05, 2016 1:02 pm

Lol...
I say, if anyone has trouble with strong monsters, play AT in easier areas, level up, geht some new skills. Than come back and rock the area.
;)
Usirim (v2.2):
Lvl: 200
XP: 145.569.369
Gold: 5.8M
RoLS: 17
ElyR: 9
RoL: 6
ChaR: 9
GoLF: 2
ShaF: 7
SRoV: 15
VSH: 7
WMC: 12
GoW: 6

Base values
HP: 1000
AC: 280
AD: 90
max AP: 10 (12)
BC: 180%
DR: 0
(Jun 2017)

User avatar
Voom
Posts: 405
Joined: Sat Dec 19, 2015 5:24 pm
android_version: 4.4
Location: Fort Lauderdale, FL

Re: End round at end of combat

Post by Voom » Sat Nov 05, 2016 8:00 pm

Nut wrote:When it is poisoned, I just wait in safe distance to monster until I feel better again and eat another meat.
I always save before I eat meat and reload when there is food poisoning. Is that cheating? If it is, then I'm definitely paying a price for it b/c it is pretty damn annoying to save and reload.

I agree, a round should be terminated when combat is terminated. Like boxing, you know? A K.O. finishes a round and the match altogether. However, we have to consider the fact that we have a skill called Corpse Eater that performs exactly this function. If you are one that wants meat to give you 2 hp at the end of combat, maybe you should consider placing a few skill points in this skill.

There is no reason to fix combat's final round dilemma b/c it is actually helpful as far other actor conditions are concerned that will not dissipate once combat is over. Yes, you are probably met with more negative actor conditions than positive ones, but hey, that's life. Toughen up!

Simply put, Corpse Eater takes care of the sustenance dilemma.
Voomster Lvl 23 |HP 52 |AC 173% |AD 17-52 |ECC 20% |CM 3.0 |BC 61% |DR 2 Build 2/5321/0

Voomboy Retired at 41 and is reading The Fey of Feygard
Voom Retired at 46 and took up translating

User avatar
Duvalon
Posts: 62
Joined: Wed Oct 19, 2016 1:34 am
android_version: 6.0
Location: Canada

Re: End round at end of combat

Post by Duvalon » Mon Dec 05, 2016 3:59 am

@Voom, saying "toughen up" or "get corpse eater" isn't much of an argument. It's not just about positive status effect like regen or sustenance, but also negative effects like poison, bleeding wound and chaos grip. And as I just found, time doesn't pass as it should (more below).

I finally got around to digging around the code and found where the problem was. ActorStatsController.applyConditionsToPlayer() (and the monsters equivalent applyConditionsToMonsters) is only called in two places:

Code: Select all

GameRoundController.java:
	public void onNewFullRound() {
		controllers.mapController.resetMapsNotRecentlyVisited();
		controllers.actorStatsController.applyConditionsToMonsters(world.model.currentMap, true);
		controllers.actorStatsController.applyConditionsToPlayer(world.model.player, true);
		gameRoundListeners.onNewFullRound();
	}
	public void onNewPlayerRound() {
		world.model.worldData.tickWorldTime();
		controllers.actorStatsController.applyConditionsToPlayer(world.model.player, false);
		controllers.actorStatsController.applySkillEffectsForNewRound(world.model.player, world.model.currentMap);
		controllers.mapController.handleMapEvents(world.model.currentMap, world.model.player.position, MapObject.MapObjectEvaluationType.afterEveryRound);
	}
It doesn't get called in the CombatController's

Code: Select all

	public void exitCombat(boolean pickupLootBags) {
		setCombatSelection(null, null);
		world.model.uiSelections.isInCombat = false;
		combatTurnListeners.onCombatEnded();
		world.model.uiSelections.selectedPosition = null;
		world.model.uiSelections.selectedMonster = null;
		controllers.gameRoundController.resetRoundTimers();
		if (pickupLootBags && totalExpThisFight > 0) {
			controllers.itemController.lootMonsterBags(killedMonsterBags, totalExpThisFight);
		} else {
			controllers.gameRoundController.resume();
		}
		resetCombatState();
	}
Also, notice how exitCombat() calls the gameRoundController.resetRoundTimers(). This reset has two effects: as mentioned in my original post, if you go from monster to monster quickly and kill them in the first round of combat, the status effects never apply because the 6s round gets reset before an end of round is processed. The other effect that I had noticed but wasn't sure is that time passes more slowly when fighting quickly and monsters don't respawn as fast as if you're just standing still in a corner.

Finally, I traced this change to version 0.7.0 and a commit from Oskar. Based on the comment of this commit, it seems the effect of combat on rounds was perhaps unnoticed and quite possibly unwanted.

So, in light of all this, I propose the following: remove the resetRoundTimers() call from exitFromCombat(). This will just continue the time wherever the round timer is at. Moreover, I think we should replace it with a call to a new function. Here I'm putting what I think should go in it. If you thing something doesn't belong or something else should, please let me know.

Code: Select all

	public void onNewEndOfCombatRound() {
		world.model.worldData.tickWorldTime();
		controllers.actorStatsController.applyConditionsToPlayer(world.model.player, false);
		controllers.actorStatsController.applyConditionsToMonsters(world.model.currentMap, true);
	}
I'm new to both Git and Android development so bear with me while I learn the ropes. I might be a little slow, but I will test it as soon as I learn how to build and install on my phone, and then send a pull request to Zukero.

User avatar
Zukero
Lead Developer
Posts: 1332
Joined: Thu Jul 21, 2011 9:56 am
android_version: 7.1

Re: End round at end of combat

Post by Zukero » Mon Dec 05, 2016 12:25 pm

Good analysis, but, at a first glance, I'd look into simply changing CombatController.

Try to replace this:

Code: Select all

	private void newPlayerTurn(boolean isFirstRound) {
		if (canExitCombat()) {
			exitCombat(true);
			return;
		}
		controllers.actorStatsController.setActorMaxAP(world.model.player);
		if (!isFirstRound) controllers.gameRoundController.onNewPlayerRound();
		world.model.uiSelections.isPlayersCombatTurn = true;
		combatTurnListeners.onNewPlayerTurn();
	}
by this:

Code: Select all

	private void newPlayerTurn(boolean isFirstRound) {
		controllers.actorStatsController.setActorMaxAP(world.model.player);
		if (!isFirstRound) controllers.gameRoundController.onNewPlayerRound();
		world.model.uiSelections.isPlayersCombatTurn = true;
		combatTurnListeners.onNewPlayerTurn();
		if (canExitCombat()) {
			exitCombat(true);
			return;
		}
	}
Gotta check the side effects though.
Last edited by Zukero on Mon Dec 05, 2016 12:27 pm, edited 1 time in total.
Reason: Fixed indentation
Lvl: 78, XP: 8622632, Gold: 271542, RoLS: 1, ElyR: -, RoL: -, ChaR: 1, GoLF: 1, ShaF: 1, SRoV: 1, VSH: 1, WMC: 1, GoW: 1
HP: 71, AC: 301%, AD: 38-47, AP: 3, ECC: 50%, CM: 3.75, BC: 101%, DR: 2

User avatar
Voom
Posts: 405
Joined: Sat Dec 19, 2015 5:24 pm
android_version: 4.4
Location: Fort Lauderdale, FL

Re: End round at end of combat

Post by Voom » Wed Dec 21, 2016 5:41 am

So this was unintentional, a mistake? Then why does Corpse Eater apply but not something like Regen w/o fixing the error? Honestly thought this was completely intentional. It helped me prolong my sustenance b/w combat w/in 6 seconds, sometimes to my detriment actually.

@Duvalon If it affects both positive and negative status effects (which I mentioned), then I don't see a counterargument. What would be the purpose of Corpse Eater when Regen can do the same at the end of combat? Please, explain if I'm missing something.
Voomster Lvl 23 |HP 52 |AC 173% |AD 17-52 |ECC 20% |CM 3.0 |BC 61% |DR 2 Build 2/5321/0

Voomboy Retired at 41 and is reading The Fey of Feygard
Voom Retired at 46 and took up translating

User avatar
rijackson741
Posts: 1423
Joined: Tue Aug 20, 2013 2:04 am
android_version: 6.0
Location: Somewhere in Dhayavar

Re: End round at end of combat

Post by rijackson741 » Wed Dec 21, 2016 12:54 pm

If you are being mobbed then corpse eater will give you HP on every kill, even though combat has not ended.
Level: 64, XP: 4734786, HP: 196, AC: 246%, AD: 49-59, AP: 3, ECC: 25%, CM: 3, BC: 127%, DR: 2
Gold: 232355 | RoLS: 1, RoL: 1, GoW: 1
HH: 1, CS: 2, IF: 4, Ev: 3, Re: 2, WP:DA: 1, WP:1S: 1, AP:L: 1, FS:DW: 2, S:DW: 1
SR

User avatar
Zukero
Lead Developer
Posts: 1332
Joined: Thu Jul 21, 2011 9:56 am
android_version: 7.1

Re: End round at end of combat

Post by Zukero » Wed Dec 21, 2016 1:19 pm

And you can combine both !
I love Corpse Eater, especially when you can swat two or three flies in the same round :twisted:
Lvl: 78, XP: 8622632, Gold: 271542, RoLS: 1, ElyR: -, RoL: -, ChaR: 1, GoLF: 1, ShaF: 1, SRoV: 1, VSH: 1, WMC: 1, GoW: 1
HP: 71, AC: 301%, AD: 38-47, AP: 3, ECC: 50%, CM: 3.75, BC: 101%, DR: 2

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests