Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Aug 1, 2004 5:38:50 GMT
Not really. I played a game where about 26 armies defeated 22 in a citadel. Under the system you propose, this would become impossible. I would have thought it easier. 26 armies with say 2000 men each: 42,000 against 2,500 defenders (x 5 bonus 12,500 defenders). The defenders would probably crumble on the first night making it street to street fighting in the citadel. Also there was talk of some limit on the size of an army at one place, which would be realistic when you take logistics into consideration. I read somewhere that the theoretical maximum army in ancient times that could survive in the field by living off the land was around 80,000 men. Given the winter conditions this would need to be much less. The size of the map doesn't really allow for distinguishing between inside and outside the citadel or having inner and outer city walls. There are no siege engines, sappers, archers, breastworks, mantraps or the option of a prolonged starvation. Makes it hard to have a realistic siege. In which case the garrison size could be reduced to a level that would be realistic. Leaving them outside the citadel. But the idea sallying forth to weaken the attackers is realistic. Another consideration is that most M/MU armies are not heterogeneous and you would be limited to the number of men of the same race as the garrison as defenders. Whatever the implementation, it needs to be simple enough that a quick look at the relative size, health and couage of each army would be enough to decide whether attacking would be a wise move.
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Aug 1, 2004 5:53:03 GMT
The following also occured to me: Say a lord is slain by a garrison, then garrison is emptied (deleted). What does slain by and victories show in that case? (supposing GML_ID no longer exists)
|
|
Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Aug 1, 2004 6:21:59 GMT
For those who are familiar with PHP: Is query result an array? Can array functions be used on it? Reset, specifically? If not, how does one return to the beginning of a query result? Or are queries uni-directional? (I'm trying to figure out an alternative battle routine) mysql_fetch_array and mysql_fetch_row both return an array, where mysql_fetch_array is an associative array, and apparently no significant extra overhead. mysql_data_seek can be used to move the row cursor to any row in the result set.
|
|
Perun
Public Area Guest
Issa (Vis) [1:76:24]
Posts: 2,506
|
Post by Perun on Aug 1, 2004 7:48:57 GMT
Programmer studio is a good allround editor. But ultimate PHP editor/debugger is PHPEd. For MySQL development/administration I recommend excellent EMS MySQL Manager
|
|
|
Post by sparrowhawk on Aug 2, 2004 7:31:47 GMT
mysql_fetch_array and mysql_fetch_row both return an array, where mysql_fetch_array is an associative array, and apparently no significant extra overhead. mysql_data_seek can be used to move the row cursor to any row in the result set. just for further clarification, they return an array of the current row only, not the whole resultset, so reset() would be of little use on such an array. But as david says, there are plenty of functions available for moving through the result set in any direction you wish, or jumping around to a particular record.
|
|
|
Post by sparrowhawk on Aug 2, 2004 8:21:05 GMT
Thanks to all for the comments. I will print these all off and when I get a few free hours one evening, I will have a stab at a revised script.
|
|
|
Post by sparrowhawk on Aug 2, 2004 11:17:43 GMT
If I may humbly butt in here. I (as you know) am working on a motor racing game and the calculation for the laptimes is pretty complex. I found it useful to mess around with the formulae in Excel, trying it many times to give me a spread of sample results. I just tinkered with the formula in Excel until I liked the outcome. Maybe that might help with this? I've adopted your idea - very helpful
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Aug 3, 2004 8:53:18 GMT
Here, in brief, is how I imagine the battles to be resolved:
Loop through battles (positions where both vassals and enemies are present)
as = attacking strength (strength of all vassals and allies, with modifiers) ds = defending strength (strength of all enemies - they could belong to different players, not neccesserily allied)
Loop through vassals
kills(vassal) = function(as(vassal), random factor, as/ds)
End loop (vassals)
causalties = Sum(kills)
Loop through enemies
if (causalties * (1 - ds(current enemy) / ds) > army(enemy)) then killed = killed + army(enemy) distribute kills proportionally among vassals (by as) army(enemy) = 0
if (lord is armyless) and (fails to survive (random)) then killed = killed + 1 determine who killed him, wighted by as(vassal)
End loop (enemies)
if (killed >= causalties) or (all enemies killed) then exit
causalties = causalties - killed
Loop through enemies
soldiers killed(enemy) = (1 - ds(enemy) / ds) * causalties distribute kills among vassals by as(vassal)
End loop (enemies)
End loop (battles)
If you think this treatment could have future, I will try to put it in PHP, and then, maybe, JY could include it as one of the game options?
N. B.: I'm thinking of special treatment for defending garrisons - before any other causalties are determined, a check is made if they get annihilated. If they do, the wall is breached and modifiers recalculated, imposing penalties instead of bonuses on the defending army.
|
|
Natmus
Morkin Admin
Fight the power!
Posts: 4,518
|
Post by Natmus on Aug 15, 2004 20:51:41 GMT
Battle casualties in the new algorithm seems rather low. Very low, actually. Too low, IMO.
|
|
Ringthane
Public Area Guest
Ardet nec Consumitur
Posts: 5,446
|
Post by Ringthane on Aug 15, 2004 21:34:43 GMT
Specially for Lords (Wise and Dragons included).
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Sept 23, 2004 7:21:40 GMT
I made a test, and it seems that mixed army causalties still aren't fixed. 3 UC lords, of very nearly same invigoration, max armies, one with riders only, one warriors only, the third with a mix: - riders only: killed 1130, lost 401
- warriors only: killed 587, lost 411
- mixed: killed 921, lost 781
|
|
Ringthane
Public Area Guest
Ardet nec Consumitur
Posts: 5,446
|
Post by Ringthane on Sept 23, 2004 7:50:02 GMT
I dread to think at who the object of that test might be
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Sept 23, 2004 8:38:57 GMT
Mads
|
|
|
Post by sparrowhawk on Oct 1, 2004 7:32:51 GMT
In view if ongoing discussions within the Ongoing Games thread, I have just halved the stronghold bonus as a test trial. (C from 0.2 to 0.1 and K form 0.1 to 0.05)
Please could you report back if the figures feel right/too high/too low.
thanks
|
|
|
Post by celebaglar on Oct 1, 2004 13:50:43 GMT
In view if ongoing discussions within the Ongoing Games thread, I have just halved the stronghold bonus as a test trial. (C from 0.2 to 0.1 and K form 0.1 to 0.05) Please could you report back if the figures feel right/too high/too low. thanks Argh! Just as my stronghold is under siege...
|
|