View previous topic :: View next topic |
Author |
Message |
Bobert-Rob The guy from years ago who made one good game

Joined: 13 Jun 2010 Posts: 17
|
Posted: Wed Nov 17, 2010 3:35 am Post subject: Targetting the first hero always |
|
|
Okay, so I'm using the Counter stat for a targeting system (the only stat I could think of that'd actually be worth using in a battle). Basically, every hero starts with 0 Target, but if they use a Lure type of spell or equipment or something, the enemy will attack that player only till they die.
The problem is that if everyone's target stat is 0, it will ALWAYS target the first living hero. So they basically gang up on the first living hero always unless I give the enemy a target spell that raises a random hero's target stat, causing them to gang up on that hero instead. I'd rather not have to do this for every enemy, though, so is there a way I should be doing this instead? Could there be a feature to make the enemy choose a target randomly if all possible heroes have the same stats?
The current targetting stats for most attacks are:
Target Class: Enemy
Target Setting: Focused
Prefer Target: strongest
Weak/Strong Stat: Targetable (the target stat I keep mentioning)
Is there anything I can do to make them not gang up on hero 1 if everyone's target stat is 0? |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Nov 17, 2010 1:27 pm Post subject: |
|
|
This is probably a bug (or oversight, depending on how nice you're feeling).
Relatedly, it'd be nice to have a targeting setting that gave a bias towards the highest/lowest whatever without making it a 100% guarantee that you'd always choose the highest/lowest whatever target. _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Nov 17, 2010 1:31 pm Post subject: |
|
|
Hmmm. I never thought about this. I can see how randomly picking between ties wouldnake sense.
I also like the bias idea, but I don't know what formula to use |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Nov 17, 2010 2:49 pm Post subject: |
|
|
Give each possible target a ticket, then give each target additional tickets based on the target stat. Draw a ticket out of a hat.
This is pretty intuitive for strongest, weakest%, and strongest%, but what about weakest? One way of approaching this is to set your baseline to the minimum value. So if I have four enemies with 10 HP and one with 15 HP, then the baseline is 10, the four enemies get one ticket each, and the one enemy gets six (one plus one for each extra HP). Work it in reverse for targeting the weakest.
Optionally, don't give out the "free" ticket. I don't know which way makes more sense, but intuitively I want to say that every target should have a *chance* of being targeted. _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Nov 17, 2010 2:57 pm Post subject: |
|
|
But how many extra "tickets" should a target get for a given difference in preferred stat? |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Nov 17, 2010 3:53 pm Post subject: |
|
|
This sounds like a deceptively complicated feature. My first instinct would be to base everything on %-differences from the "baseline", as Moogle puts it. So first find the baseline, then convert all the numbers in the set to %-differences from that baseline, and then have these numbers define the number of "tickets". If you want the baseline to have a chance, give everyone one extra ticket.
Ideally this would be a bitset on an attack-by-attack basis as well. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 18, 2010 7:13 am Post subject: |
|
|
James Paige wrote: | I can see how randomly picking between ties wouldnake sense. |
Do you think it would be a bad idea to change the behaviour of Strongest/Weakest now?
Regarding biased selection, I think there should be two kinds (as Moogle implied): biased strongest/weakest by difference, and biased strongest/weakest by percentage difference.
I think both kinds would benefit from an additional argument to specify just much a certain difference should affect the chances. You'd probably need to kind of preview/chance calculator for the parameter to be meaningful.
Also, I argue that regardless of the actual formulas it's pleasing if the strongest and weakest options of each are related in the following way: if, given two enemies, when biasing for the highest value enemy 1 has S_1% chance of being chosen and enemy 2 has S_2%, then when biasing for lowest value enemy 1 should have W_1 = S_2 %-chance of being chosen and enemy 2 have W_2 = S_1. Generalizing to more than two enemies, the weighting of an enemy when biasing for low values would be the inverse of its weighting when biasing for high values.
Code: |
Example 1:
Enemy num | 1 2 3
Strong chance | 40% 40% 20%
weighting | 2 2 1
Weak chance | 25% 25% 50%
weighting | 0.5 0.5 1
Example 2:
Enemy num | 1 2 3 4
Strong chance | 10% 10% 10% 70%
weighting | 1 1 1 7
Weak chance | 32% 32% 32% 5%
weighting | 1 1 1 0.14
Example 3:
Enemy num | 1 2 3
Strong chance | 50% 30% 20%
weighting | 5 3 2
Weak chance | 19% 32% 48%
weighting | 0.2 0.33 0.5
|
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|