Map Database  •  FAQ  •  RSS  •  Login

Avoid a bug

<<

Andronikos

Peasant

Posts: 3

Joined: 17 Jan 2010, 23:00

Location: Slovakia

Post 18 Jan 2010, 12:26

Avoid a bug

Sometimes the AI players troops running around the map and they ignore their AI positions. How can I avoid this bug, when I creating a mission? :?
<<

Thunderwolf

User avatar

Crossbowman

Posts: 233

Joined: 22 Jan 2008, 23:00

Website: http://thunderwolf.freehost10.com/KaMMissionBuilder/index.php

Location: Netherlands

Post 18 Jan 2010, 15:32

By having less that 256 units (including animals, serfs etc.) in total, something like that at least.
~old sig
MissionBuilder v0.9f2 UPDATED!!
Defend The Outer Colony. fight for your king and uncover the secrets of this land.
Temporary version at
http://thunderwolf.x10hosting.com/index.php
"You can't defeat me, I've played Knights and Merchants"
<<

Andronikos

Peasant

Posts: 3

Joined: 17 Jan 2010, 23:00

Location: Slovakia

Post 19 Jan 2010, 09:08

By having less that 256 units (including animals, serfs etc.) in total, something like that at least.
"By having less that 256 units" - including soldiers too? And what about AI defendig positions - are there any limits? In the first minutes I haven`t any problems, but later, after about 20 minutes, one of my enemy`s soldiers get crazy. I changed the AI def. positions, the map etc., but it don`t works - so the only think I should do is to put less units in the map?
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 19 Jan 2010, 12:47

Yes, this bug is unofficially known as "Drunk Soldiers", because the units run around like they are intoxicated. :D We don't actually know if the unit count is per team or over the whole game. We also don't know if 256 is the number, but it seems likely. AI defence positions are different, but THEY TOO HAVE A LIMIT. (keep reading) Soldiers going crazy basically has to be drunk soldiers, going over the AI defence limit just means excess ones are ignored.

Are you using my mission editor? (latest version 0.9 required for these instructions to work properly) If so then I suggest you click Help -> Help on the menu, then go to Appendix -> Game Bugs and also Command Limits. Game bugs explains some of the errors that are relevant to mission making, and the Command Limits page shows the the limits available for some commands (I think AI Defence Positions is 20 per team) You really should read these two pages as I think they will give you a better understand of the bugs and limits you need to know about for scripting.

Hope this helps, let me know if you want more information or have more questions.
Lewin.
<<

Xmasjos

Farmer

Posts: 21

Joined: 29 Dec 2009, 23:00

Location: Netherlands

Post 20 Jan 2010, 09:51

I think it is 255, because that's the maximum for an int in assembly. If you go to 256, you'll get -1 (or -255, I'm not sure of that). That's the problem at the maximum producing with the weapons.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 20 Jan 2010, 14:10

256 overflows to 0
255 = -1 (no overflow, it's just equal)
254 = -2 (proof, see blow)
(etc, up until 128 = -128, which means that 128 has the odd property of being nonzero but being its own negative anyway)
The last two depend on whether you treat the numbers as signed or not

254 = 11111110 (binary)
Lets take an arbitrary x, say 23 aka 00010111
00010111
11111110
----------- + (8bit binary addition)
00010101 (with overflow, but let's ignore that)
which is 1 + 4 + 16 = 21
Solve: 23 + y = 21 for y -> y = -2
Therefore, 254 equals -2, in 8bit arithmetic.
QED

Return to “General Talk”

Who is online

Users browsing this forum: No registered users and 11 guests