.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   rules question: turn resolution (http://forum.shrapnelgames.com/showthread.php?t=47591)

Pyrrhic July 15th, 2011 11:12 PM

rules question: turn resolution
 
i've got this here situation and need an expert:

- i want to nail a unit with seeking arrows
- i suspect the unit is going to teleport
- the unit has a lower ID than any of my casters

do the seeking arrows arrive in the unit's current province before the teleport takes effect?

the teleport will presumably be to an unfriendly province and cause a magic battle -> after the ritual phase. dunno if that matters.

at any rate, the question is: where is the unit when i cast my rituals?

thank you very much for your help.

thejeff July 16th, 2011 08:38 AM

Re: rules question: turn resolution
 
Ritual happen in either id order or reverse id order.

So, you can't tell. It's essentially random.

JonBrave July 16th, 2011 09:49 AM

Re: rules question: turn resolution
 
Excuse me for saying the bleedin' obvious, then, but if Mr (or Ms) Pyrrhic could find just one caster with a lower ID than the opponent he could be sure to "surround" him?

As for "It's essentially random.", randomness is a bit of a hobby of mine, here the overall order is not at all random, though I suppose it is for the purpose of which direction it goes :) Assuming that thejeff is correct (and I would not doubt it!), if that is the definition of the manual's "in a random order", I wouldn't go basing an encryption algorithm on it :D

Pyrrhic July 16th, 2011 02:25 PM

Re: rules question: turn resolution
 
Quote:

Originally Posted by JonBrave (Post 780366)
Excuse me for saying the bleedin' obvious, then, but if Mr (or Ms) Pyrrhic could find just one caster with a lower ID than the opponent he could be sure to "surround" him?

No can do. The target in question is a bunch of Benim with ID 106. As I said in the OP, lower than any of my casters.

Quote:

Originally Posted by JonBrave (Post 780366)
As for "It's essentially random.", randomness is a bit of a hobby of mine, here the overall order is not at all random, though I suppose it is for the purpose of which direction it goes :) Assuming that thejeff is correct (and I would not doubt it!), if that is the definition of the manual's "in a random order", I wouldn't go basing an encryption algorithm on it :D

I think the fine point here is the difference between in random order and in a random order. And what do you have against 1-bit encryption? :p

thejeff July 16th, 2011 06:58 PM

Re: rules question: turn resolution
 
Yes, you have it exactly right.
All I meant by 'random' is that which order (high-to-low or low-to-high) it goes in is chosen randomly. Or pseudo randomly, if you want to be precise.
Obviously not encryption algorithm worthy, but I think it's a clever trick. It really covers about 95% of what you'd get out of completely randomizing action order, at a much lower cost. There are a handful of edge cases where you can abuse it, like using high and low id casters, but mostly all that's important is that you don't know who's going first. Not doing more work than you have to is elegant.

However, I think you may be confused, Pyrrhic. It uses unit ID, which as far as I know isn't displayed, not Monster Number, which I think is what you're referring to. Units are displayed in the main window or the Army Orders screen in ID order. That's the only way I know to determine relative order. Monster Number is shown with <shift-i>.
So if you use casters at the top and bottom of your screen, you'll most likely hit him with some of them. Of course, you have to use twice as many casters and gems, so it's not always worth it.

Deathblob July 16th, 2011 08:34 PM

Re: rules question: turn resolution
 
The unit ID numbers (friendly and enemy) are displayed in the debug output of battles.

thejeff July 16th, 2011 10:39 PM

Re: rules question: turn resolution
 
True enough. I should have remembered that.

JonBrave July 17th, 2011 05:05 PM

Re: rules question: turn resolution
 
Quote:

Originally Posted by Pyrrhic (Post 780379)
And what do you have against 1-bit encryption? :p

Limited applicability :D

JonBrave July 17th, 2011 05:12 PM

Re: rules question: turn resolution
 
Quote:

Originally Posted by thejeff (Post 780392)
Yes, you have it exactly right.
All I meant by 'random' is that which order (high-to-low or low-to-high) it goes in is chosen randomly. Or pseudo randomly, if you want to be precise.
Obviously not encryption algorithm worthy, but I think it's a clever trick. It really covers about 95% of what you'd get out of completely randomizing action order, at a much lower cost. There are a handful of edge cases where you can abuse it, like using high and low id casters, but mostly all that's important is that you don't know who's going first. Not doing more work than you have to is elegant.

I'm completely bemused by this explanation. :confused: This is all in order to draw a single random number (bit) rather than a bunch of random numbers to mix the order??? fgs, randomize the order. We don't need a "clever trick" to be "elegant", be really daring and use an extra CPU cycle :)

thejeff July 17th, 2011 06:00 PM

Re: rules question: turn resolution
 
Why?
What does it gain you?

It's potentially thousands* of units that have to be put in a random order. And then you have to iterate over them. Which probably requires a new structure to hold the order that has to be created every time. Sure, you could do it. It probably wouldn't even take that much longer. There's a lot going on in each turn. Still, large games already take a long time to process.

Maybe I've just been working with slow, low memory chips too long.

*The way it's set up now, it's probably 10s of thousands since each unit commander or not, has a unit id. If you were going to do this, you'd probably want to treat troops and commanders separately to simplify the sort.


All times are GMT -4. The time now is 08:00 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.