public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Hans Ronne <hronne@comhem.se>
To: Jim Kingdon <kingdon@panix.com>
Cc: xconq7@sources.redhat.com
Subject: Re: The border between fiction and reality
Date: Thu, 19 Aug 2004 11:57:00 -0000	[thread overview]
Message-ID: <l03130300bd4a39ee36c0@[212.181.162.155]> (raw)
In-Reply-To: <200408190637.i7J6bZc03815@panix5.panix.com>

>> However, a different situation arises with move-unit commands, all of which
>> eventually end up in advance_into_cell. At this point we are committed to
>> moving, and we have to know what real units are present in the destination
>> cell.
>
>Well, to me that means there should be an advance action, so that the
>decision between overrun and move (and the other choices, like
>capture) are in the action, rather than outside it.

That makes sense. I'll look into it.

>But perhaps there is a simpler solution, or the status quo is
>technically wrong but doesn't lead to any exploits/leaks/etc.  Or even
>that advance_into_cell is tied into the user interfaces in ways which
>aren't immediately obvious to me, and thus would be hard to put into
>an action.

In fact, there is one more rather interesting complication, considering our
previous discussion about selective actions and one action defaulting into
another one. When you click in the target cell, as opposed to a do_dir
command, the interfaces actually look up the unit under the cursor. This is
something that the common interface code cannot do, since the pixel
coordinates differ between different interfaces. It is the main reason why
unit pointers are present in the tcltk/mac/x11 code.

So what is this selected unit doing in a basically non-selective action?
Well, it turns out that if the overrun fails because you don't have enough
ammo to hit all units in the stack, the action is converted into a
selective attack against the unit under the cursor. Here is the relevant
code from advance_into_cell:

rslt = check_overrun_action(unit, unit, x, y, z, 100);
if (valid(rslt)) {
    net_prep_overrun_action(unit, unit, x, y, z, 100);
    return TRUE;
}
if (reason && rslt == A_ANY_NO_AMMO)
    *reason = (HistEventType)rslt;
rslt = check_attack_action(unit, unit, other, 100);
if (valid(rslt)) {
    net_prep_attack_action(unit, unit, other, 100);
    return TRUE;
}

I don't think this happens very often in real games. At least, I was not
aware of the potential selectivity of clicking on a unit. It makes me
wonder if this selectivity could be used also in a successful overrun
action. For example, one could perhaps make the unit that was clicked on
the first one to be attacked, instead of using the normal stack order. Or
make this unit more likely than others to be hit.

Hans









  reply	other threads:[~2004-08-19 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18 15:14 Hans Ronne
2004-08-18 21:10 ` Eric McDonald
2004-08-19 11:25 ` Jim Kingdon
2004-08-19 11:57   ` Hans Ronne [this message]
2004-08-19 17:03     ` Jim Kingdon
2004-08-19 19:43       ` Hans Ronne
2004-08-19 15:46   ` Eric McDonald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='l03130300bd4a39ee36c0@[212.181.162.155]' \
    --to=hronne@comhem.se \
    --cc=kingdon@panix.com \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).