Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: more complex unit and battle system
Home

[Freeciv-Dev] Re: more complex unit and battle system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Dalibor Perković <pdalibor@xxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: more complex unit and battle system
From: Marco Colombo <marco@xxxxxx>
Date: Fri, 1 Sep 2000 15:10:26 +0200 (CEST)

On Fri, 1 Sep 2000, Dalibor Perkovi[ISO-8859-2] æ wrote:

> 
> 
> Ok, I think you're mixing two basically different questions:
> 1. Gaining XP ("from your HP lost" vs. "from enemy stats")
> 2. Keeping XP while upgrading ("yes" vs. "some").
> They are somewhat connected, but should be completely separated for gamesystem
> purposes.
> 
> >Again, mine is just an approximation, (...). Much easier to 
> >implement (right now, I'm preparing to play my first
> >game with xp. The patch is way too rude to be submitted, so it 
> >won't take any public life. I'm not a developer. I've patched 
> >the game in a blind way. I don't even know if xp are going to 
> >be saved in save files. And at the same time, I've broken the 
> >protocol so you need a patched client: mine already show XP: 
> >instead of '(veteran)', but the patch was really
> >quick and dirty. No server options.)

BTW, the patch is buggy. I'll need to read a bit more...

> Well, you *could* count me in, but the (1st) problem is I'm new to all this,
> and haven't even figured out how to utilise patches (not that I tried very 
> much,
> though, but there'll come a day...). The 2nd problem is I'm doing all this at
> Win95, which may be a cause for the 1st problem too.
> (Let me guess, I should at least have a C compiler, right?) Well, don't look
> at me at taht tone of voice, I'm doing all this at my workplace, not at home.
> Not that I can influence the hardware or software configuration)

Oh, I can't help with Windows. I complile on a RedHat Linux system,
with no problems at all (but the bugs I introduced, of course).

> >We can discuss forever since we have different meaning 
> >of 'experience'. You still see it as a kind of skill. 
> 
> But... Expirience *is* a practical knowledge whose sole purpose of existence
> is to utilise it as a skill...

That's the whole point. Believe me, I follow your reasoning, but 
I don't agree with the above. Experience is a state of your mind and
maybe of your heart, not a pratical knowledge. One argument for all,
you can't teach it to someone. That's not the difference between theory and
pratice you seem to refer to. Battle experience is not just pratical
exercise...

> >I agree there are skills you can learn only in battlefield. 
> >But I think they are 10% of what you get. The remaining 90% is 
> >something hard to describe: it's 'being in troubles
> >and managing to get out of it'.  Next time you'll be in 
> >troubles again, you'll act better. 
> 
> Yes, because of the skill you gained the previous time - the expirience. Now,
> your example with warriors vs. mech.inf. is a good one. But, it is a so small
> possibility that in the first approximation it's lost. However, there is 
> something
> to what you're saying that expirience should be gained depending on how much
> trouble you got out of. You just convinced me that the amount of HP lost 
> chould
> be calculated into the expirience. I'm just not sure how much. Therefore, 
> another
> example:
> Again, mech.inf. vs. warriors :) The mech.inf. does something really stupid
> and *almost* gets killed. But it manages somehow to kill the warriors, but 
> loses
> 90% HP in the process. Now, how much XP do they get? Your system, a lot. My
> system, a little or none. Now, let's barter :)

B-) I see. But think of a veteran warrior unit on a mountain inside a
fortress... in defending they are quite a good match for attacking Mech.Inf.
How can the game tell the difference?
And most of all, I do believe you get XP when you do something stupid...
at least a strong commitment in not doing it again...

> Both these events are "lowly probable", but mine is a bit more probable (mech
> wins). So, as a suggestion, suppose a unit gains 1/3 XP from HP loss, and 2/3
> from enemy stats, defeated or retreated from.

In your math, I hope you mean 2/3 from enemy *relative* stats... that's
defeated power/winner power. But, guess what? HP you loose in a battle
are just (on average) defeated power/winner power. So you end up in

1/3 * (lost HP)
+ 2/3 * k * (defeated power/winner power)

(k being the xp factor)

or

1/3 * k2 * (defeated power/winner power)
+ 2/3 * k * (defeated power/winner power)

some maths games on constans and you have:

K * (defeated power/winner power)

or (other little game):

K1 * (lost HP)

which is exactly what i mean.
lost HP already count unit relative power, all modifiers counted...

> >And it applies almost to *any* kind of troubles. It doen't 
> >really depend on what weapon you are holding (or the enemy is).
> 
> Now we go to the "do upgraded units keep their XP". I say yes, 1/3 to 2/3, but
> maybe more, depending on what the upgrade is.
> 
> >I've been trained to use a rifle. But (luckily) I've never 
> >been in the battlefield. This means that no matter how good I 
> >am at firing, or moving on different terrains, or whatever, 
> >I'll never know how good I am in a real battle. (Not that I 
> >want to know...) I can't even imagine how it would be. It 
> >could be panic, or fury, who knows?
> >Think of that. Being able to kill a man is something 
> >completely different from being able to use your weapon. It's 
> >something completely orthogonal to the kind of weapon or 
> >battle tactic...
> 
> Yes, that is why I think that you should keep at least 1/3 XP when upgrading
> from phalanx to musketeers. Otherwise, there'd be no reason at all. But, your
> reasonong is good so we can argue over ratios :)

So, a tunable parameter is what we need... B-)

> 
> >You can't simulate (in FreeCiv) all details of a battle. While 
> >computing experience, you should count terrain, relative
> >power of unit types and of particular units involved (a nearly 
> >dead unit my be easy to kill even for weak units), and a lot 
> >of other factors.
> >My approximation is: all factors sum together, and make one 
> >single parameter: how difficult for you the battle has been. 
> >In the game, there is almost direct way to map that parameter: 
> >the damage you took during the battle... which leads to the 
> >hp==xp formula. Easy and quite accurate, for the level of 
> >details we already have.
> 
> There is another direct way - the computed strength itself (what I was 
> refering
> to as "stats"): basic_strength*HP*terrain of an enemy unit. But again, I agree
> you should put your own HP loss into it.

It seems you're not familiar with the math of FreeCiv battles. I think the
exact formula isn't easy, but basicly it's close to yours... 

lost HP = (enemy power * terrain) * enemy HP /
                                        (your power * terrain) * your HP

with a lot of details (for example, the combat happens in turns, like
D&D I believe, units have different attack/defence powers, some have
more firepower, may be behind city walls, or have a 'vs. mounted bonus'
and the like). If you can read C, have a look at the source, they are
clear and quite selfdocumenting.

> This way you don't have a long chain "stats->lost_HP->XP". XP *should* depend
> on the outcom of combat, but it already does - if the unit is killed, it gets
> no XP :) My idea is that both the XP and imidiate HP loss depend on stats.
> 
> >Well, I think these are, pardon me, 'technical details', 
> >suitable for a real combat simulator game. (...)
> >I do agree with you, in RL. I just think FreeCiv should hide such details.
> 
> 
> I don't think this is too detailed. It's only *one* more feture and only *one*
> more equation.
> 
> Greetings.
>       ?
>      /|\                           Izitpajn
>     /?|\?                       pdalibor@xxxxxx
>       |
> 
> --
> Besplatni e-mail - http://www.iskon.hr/mail/
> 

.TM.
-- 
      ____/  ____/   /
     /      /       /                   Marco Colombo
    ___/  ___  /   /                  Technical Manager
   /          /   /                      ESI s.r.l.
 _____/ _____/  _/                     Colombo@xxxxxx




[Prev in Thread] Current Thread [Next in Thread]