'bad allocation' errors

Report core bugs regarding the Ultima Online Emulator Core release (version 097). You can attach your Core Dump. One bug per post.

Moderator: POL Developer

coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

log.cfg

Code: Select all

[01/30 22:18:12] error in create_thread: 12 8 "Not enough space" "Not enough space" 61 5617968 SocketClientThread 5605552 0 1532280504
[01/30 22:18:17] Unable to read script 'pkg/skills/healing/main/healing.ecl'
Expected packet hook function for msg d6 but was null!
[01/30 22:18:21] Expected packet hook function for msg d6 but was null!
[01/30 22:18:24] error in create_thread: 12 8 "Not enough space" "Not enough space" 62 5617968 SocketClientThread 5605552 0 2032988472
[01/30 22:18:28] Unable to read script 'pkg/skills/healing/main/healing.ecl'
[01/30 22:18:36] Unable to read script 'pkg/skills/healing/main/healing.ecl'
Unable to read script 'pkg/skills/healing/main/healing.ecl'
[01/30 22:18:42] Expected packet hook function for msg d6 but was null!
Unable to read script 'pkg/skills/healing/main/healing.ecl'
[01/30 22:18:46] error in create_thread: 12 8 "Not enough space" "Not enough space" 63 5617968 SocketClientThread 5605552 0 1710154384
Expected packet hook function for msg d6 but was null!
[01/30 22:18:47] Unable to read script 'pkg/skills/healing/main/healing.ecl'
[01/30 22:18:48] Expected packet hook function for msg d6 but was null!
[01/30 22:18:51] Expected packet hook function for msg d6 but was null!
[01/30 22:18:52] error in create_thread: 12 8 "Not enough space" "Not enough space" 64 5617968 SocketClientThread 5605552 0 680295392
.
.
.
[01/30 22:32:13] error in create_thread: 12 8 "Not enough space" "Not enough space" 93 5617968 SocketClientThread 5605552 0 1532744136
[01/30 22:32:15] Expected packet hook function for msg d6 but was null!
Client#303: Switching to queued data mode (1, 18 bytes)
Client#303: Leaving queued mode (1263 bytes xmitted)
[01/30 22:32:54] Client#306 (85.14.84.242): disconnected (account x)
Client#303 (83.30.181.63): disconnected (account x)
Client#308 (89.228.205.177): disconnected (account x)
Client#300 (62.69.194.63): disconnected (account x)
Client#308: Disconnecting client due to send() error (1): 10038
Client#303: Disconnecting client due to send() error (1): 10038
Client#306: Disconnecting client due to send() error (1): 10038
Client#310 (83.11.79.112): disconnected (account x)
Client#304 (217.98.242.135): disconnected (account x)
Client#304: Disconnecting client due to send() error (1): 10038
Client#300: Disconnecting client due to send() error (1): 10038
Client#310: Disconnecting client due to send() error (1): 10038
*Thread Info*
Semaphore PID: 0
Scripts Thread Checkpoint: 52
Last Script: scripts/misc/logoff.ecl PC: 1390
Escript Instruction Cycles: 3230282015
Tasks Thread Checkpoint: 9
Active Client Thread Checkpoint: 116
Current Threads:
1848 - Main
2868 - ThreadStatus
*Thread Info*
Semaphore PID: 0
Scripts Thread Checkpoint: 52
Last Script: scripts/misc/logoff.ecl PC: 1390
Escript Instruction Cycles: 3230282015
Tasks Thread Checkpoint: 9
Active Client Thread Checkpoint: 116
Current Threads:
1848 - Main
2868 - ThreadStatus
*Thread Info*
Semaphore PID: 0
Scripts Thread Checkpoint: 52
Last Script: scripts/misc/logoff.ecl PC: 1390
Escript Instruction Cycles: 3230282015
Tasks Thread Checkpoint: 9
Active Client Thread Checkpoint: 116
Current Threads:
1848 - Main
2868 - ThreadStatus
*Thread Info*
Semaphore PID: 0
Scripts Thread Checkpoint: 52
Last Script: scripts/misc/logoff.ecl PC: 1390
Escript Instruction Cycles: 3230282015
Tasks Thread Checkpoint: 9
Active Client Thread Checkpoint: 116
Current Threads:
1848 - Main
2868 - ThreadStatus
*Thread Info*
Semaphore PID: 0
Scripts Thread Checkpoint: 52
Last Script: scripts/misc/logoff.ecl PC: 1390
Escript Instruction Cycles: 3230282015
Tasks Thread Checkpoint: 9
Active Client Thread Checkpoint: 116
Current Threads:
1848 - Main
2868 - ThreadStatus
and a restart without any dmp

memory usage grows magnificiently (I was mistaking in the earlier post)
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

coltain, and ANY OTHERS HAVING CRASHES:

For now, please change POL.CFG::MiniDumpType=small to MiniDumpType=large

These dmp files give us MUCH more information, and can lead to much faster fixes (as it reports all the variable data back with it also).
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

What are this childthreads... are this scripts running???

Is there possibility to show the names of the running scripts???

I`m trying to fix every script with a loop... Every runaway scritp etc.

This info should be very helpfull! :grouphug:
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: 'bad allocation' errors

Post by Nando »

"Child threads" is what POL calls every thread it spawns: http, aux, clients, ...

It SHOULD show all of them when reporting the threads that are still there to exit: main and others. It's strange why it doesn't do...
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

Also, check logofftest.src and logoff.src please.

I mention these two, because the childs could be the wait etc triggered in one of these for the client and all to time out and log the character officially out. If you continue to have this, and can reproduce it EVERY SHUTDOWN, try setting those to allow instant logout, and see if that stops it. If it does, it is either something in those scripts (logofftest more so), or something in the core's handling of those orphaned characters waiting to log out during shutdown.
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

ok, another question (I think I found a reason of this error)

What is happening when I put a float value when a int is needed for a function??

For example: Randomint( x);

Well, I checked how many of different scripts were running. It came up that one script was not ending (but it should). The code in it is simple but... I seach for a reason why...
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: 'bad allocation' errors

Post by CWO »

If you put a float value in there, it will probably return error "Invalid Parameter" and log it in debug.log... (Or it should)
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

Yes... If nothing else....

Another one:

Let a player use stealth and some stealthsteps are set:
who.stealthsteps := 10; //first

the player uses stealth again and stealthsteps are set again:
who.stealthsteps := 10; //second

How is it handled by a core... First stealth mode is being destroyed and second one is used???
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: 'bad allocation' errors

Post by CWO »

As far as I've known it, there is no stealth "mode". Basically when you set stealthsteps, instead of revealing you when you walk a step, it keeps decrementing this number until it reaches 0. If you set it higher during the process, it will automatically be adjusted to the second time since it still only cares about if the number is 0 (reveal) or not.
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

pol.log

no dumpfile

Code: Select all

*Thread Info*
Semaphore PID: 3220
Scripts Thread Checkpoint: 112
Last Script: pkg/systems/evspawner/main/spawnuj.ecl PC: 2231
Escript Instruction Cycles: 1096249735
Tasks Thread Checkpoint: 1
Active Client Thread Checkpoint: 116
Current Threads:
432 - SocketClientThread
444 - SocketClientThread
476 - SocketClientThread
568 - ThreadStatus
748 - http_conn_thread:1256
816 - SocketClientThread
884 - SocketClientThread
1336 - SocketClientThread
1364 - SocketClientThread
1436 - http_conn_thread:856
1532 - UO Client Listener Port 8822
1764 - Main
1812 - Reap
1852 - SocketClientThread
1944 - SocketClientThread
2244 - UO Client Listener Port 8833
2300 - SocketClientThread
2308 - SocketClientThread
2344 - SocketClientThread
2424 - SocketClientThread
2452 - SocketClientThread
2552 - http_conn_thread:1552
2592 - SocketClientThread
2640 - SocketClientThread
2696 - SocketClientThread
2728 - SocketClientThread
2928 - DbgListn
3064 - SocketClientThread
3088 - http_conn_thread:908
3140 - SocketClientThread
3156 - SocketClientThread
3168 - Decay_britannia
3184 - SocketClientThread
3200 - SocketClientThread
3220 - Scripts
3580 - SocketClientThread
3660 - SocketClientThread
3716 - Tasks
3720 - SocketClientThread
3740 - SocketClientThread
3776 - http_conn_thread:940
3784 - SocketClientThread
3856 - http_conn_thread:1088
3908 - AuxService
4020 - HTTP
4036 - http_conn_thread:836
4048 - Decay_ilshenar
At logofftest script I only have return 300; or return 0; (depending on multi)

At logoff scritp I only have adding gametime to a onlinetimer cprop and writing some data to accounts_data file.

Where to search??? HELP!
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: 'bad allocation' errors

Post by Nando »

Well, as it was with taxman, the problem is possibly with memory being full. How much memory is POL using, and how much is free on your server? Windows core?

Try disabling unused realms, or settings them to "file" instead of "memory" (on realms.cfg). See if that helps. Report back. :)
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

I use 2 realms, pol uses 1,5-2 GB of ram, server has 3 GB ram, Windows,

Some dump files generated...
Attachments
POL097.3-2009-02-16 Coregina-20090319133050-0.dmp
(1.83 MiB) Downloaded 318 times
POL097.3-2009-02-16 Coregina-20090319110446-0.dmp
(1.82 MiB) Downloaded 338 times
POL097.3-2009-02-16 Coregina-20090319105304-0.dmp
(1.83 MiB) Downloaded 325 times
POL097.3-2009-02-16 Coregina-20090319025713-0.dmp
(1.85 MiB) Downloaded 334 times
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

more:
Attachments
POL097.3-2009-02-16 Coregina-20090319140201-0.dmp
(1.83 MiB) Downloaded 329 times
POL097.3-2009-02-16 Coregina-20090319135226-0.dmp
(1.83 MiB) Downloaded 324 times
POL097.3-2009-02-16 Coregina-20090319134245-0.dmp
(1.83 MiB) Downloaded 334 times
POL097.3-2009-02-16 Coregina-20090319133050-0.dmp
(1.83 MiB) Downloaded 299 times
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

and two more:
Attachments
POL097.3-2009-02-16 Coregina-20090319142001-0.dmp
(1.83 MiB) Downloaded 333 times
POL097.3-2009-02-16 Coregina-20090319141120-0.dmp
(1.83 MiB) Downloaded 314 times
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

One crash isolated at shutdown (and it was caused by a previous crash that prevented a script (the previous crash) to not get removed from the executor's list of running scripts. That crash has been fixed (even though should never happen).

Now, in your pol.log you should have a few exceptions around the crashes (this is from your first post of 4 crashes so you know the timeframe).

Script X crashes, later during shutdown POL Crashes again and makes another dmp file due to Script X crashing and not being removed from the list of script instances running (crash is in the leftover objects reporting).
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

pol.log

Code: Select all

[pkg/systems/City/start.ecl]: Zakonczono sprawdzanie ustawien kart do glosowania
[pkg/systems/evspawner/start.ecl]: [Spawner][Status][<appobj:ScriptExRef>]
[pkg/systems/mypoli/start.ecl]: Moving backup mods to characters
[03/19 18:21:34] [pkg/systems/mypoli/start.ecl]: zakonczono
[pkg/systems/myquests/start.ecl]: Proces watcher`a dla myquests wystartowano
[pkg/systems/mytarget/start.ecl]: TargetSerwer Ready!
[pkg/systems/OreSerwer/start.ecl]: OreSerwer [britannia] Ready!
[pkg/systems/OreSerwer/start.ecl]: OreSerwer [ilshenar] Ready!
[pkg/systems/OreSerwer/start.ecl]: OreCalculator Ready!
[pkg/systems/save/start.ecl]: sejwy nastepuja co 31 minut
[pkg/systems/timer/start.ecl]: Startuje system temperatur dla : britannia
[pkg/systems/timer/start.ecl]: Startuje system temperatur dla : ilshenar
[pkg/utils/autorestart/start.ecl]: Czas auto restartu ustawiono na 4 rano
Game is active.
[pkg/systems/evspawner/procesor.ecl]: [EVSPAWNER-PROCESOR-ON]
[03/19 18:21:38] [pkg/systems/housing/wyn/testcfg.ecl]: WHousing Count : 14
[03/19 18:21:39] [pkg/utils/autorestart/main/autorestart.ecl]: Czas auto restartu ustawiono na: 28800s
[03/19 18:23:02] [pkg/systems/news_system/main/newswatcher.ecl]: NEWS WATCHER ENABLED
[03/19 18:23:07] [pkg/foundations/commandlog/main/nasluch.ecl]: COMMAND-LOG-SYSTEM ON
[03/19 18:24:01] Exception in: scripts/ai/animal.ecl ťR: bad allocation
 PC < nLines: (śR3603:  3603: init{}
3604:  3604: local #4
3605:  3605: init{}
3606:  3606: Func(2,5): ReadGameClock
3607:  3607: init{}
3608:  3608: Func(3,2): SetProperty
3609: >3609: #
3610:  3610: leave block(1)
3611:  3611: leave block(2)
3612:  3612: goto3617
3613:  3613: "#events"
Exception in: scripts/ai/animal.ecl ťR: bad allocation
 PC < nLines: (śR3603:  3603: init{}
3604:  3604: local #4
3605:  3605: init{}
3606:  3606: Func(2,5): ReadGameClock
3607:  3607: init{}
3608:  3608: Func(3,2): SetProperty
3609: >3609: #
3610:  3610: leave block(1)
3611:  3611: leave block(2)
3612:  3612: goto3617
3613:  3613: "#events"
Exception in: scripts/ai/animal.ecl ťR: bad allocation
 PC < nLines: (śR3603:  3603: init{}
3604:  3604: local #4
3605:  3605: init{}
3606:  3606: Func(2,5): ReadGameClock
3607:  3607: init{}
3608:  3608: Func(3,2): SetProperty
3609: >3609: #
3610:  3610: leave block(1)
3611:  3611: leave block(2)
3612:  3612: goto3617
3613:  3613: "#events"
Exception in: pkg/npcs/combat_ai/ai_default_zolnierz.eclatch against a ': bad allocation
 PC < nLines: (matched ']' in expression. (Trying to match against a 'nteger, real, or string2764:  2764: local #2
2765:  2765: Call Method id size (#48, 0 params)
2766:  2766: if false goto 2771
2767:  2767: "#onhit_events"
2768:  2768: local #2
2769:  2769: Func(4,0): 
2770: >2770: #
[03/19 18:24:23] Unhandled Exception! Writing Minidump file. 
This file with explanation and last lines from log files should be given to the development team.
Saved dump file to 'POL097.3-2009-02-16 Coregina-20090319181612-0.dmp'
Last Script: pkg/npcs/combat_ai/ai_default_zolnierz.ecl PC: 2769
Server just don`t start... it happened... well just happened. Without any reason.
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

I found the reason...

Why didn`t nobody tell me that while ecompiling scripts all .inc files are added (AI scripts)...

and all functions from it....

that why AI scripts were so big :(
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

I'm also seeing a crash in adding to an array. Could be the left side (the array itself) was having a problem, or similar issue.

Those scripts that crashed, can you post the src so I can look over it?
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

Worse case scenario if I can't find anything, might need a zip of the scriptbase itself to try to reproduce the crash on startup. But, first we'll worry about those scripts causing the crash and go from there.
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

ok, why including this file:

Code: Select all

var ip_access           := {"84.40.225.12","127.0.0.1","193.168.0.20","82.160.54.1","217.96.84.1","82.210.190.86"};


const TIME_ZONE         := 3600;

const _MAIN_COMBAT_SPEED_     := 80000.0;


const BASE_STAMINA_REGRATE := 900;
const BASE_MANA_REGRATE := 600;
const BASE_LIFE_REGRATE := 800;

const FIRE_RESIST     := 0x1;
const COLD_RESIST     := 0x2;
const POIS_RESIST     := 0x3;
const ENER_RESIST     := 0x4;
const BLACK_RESIST    := 0x5;
const PHYS_RESIST     := 0x6;

const NECRO_GUILD_ID    := 1;
const NECRO_BOOK_ID     := 0x6102;
const NECRO_STONE_ID    := 13982;           

const CONST_STATCAP     := 225;
const CONST_MAX_STAT    := 100;
const CONST_SKILLCAP    := 7000;
const MAXSKILL          := 1000;
const MAX_NATURAL_RES   := 2500;
const RACE_SKILLSYSTEM  := 1;
const PRIM_SKILL        := 1.3;
const PRIM_SKILLCAP     := 1.1;
const SECO_SKILL        := 1.2;
const SECO_SKILLCAP     := 1.05;

const DEFAULT_SETTING_SKILL_ALWAYS_GAIN_UNTIL := 35.0;
const DEFAULT_SETTING_SKILL_CHECK_MAX_CHANCE  := 100;
const DEFAULT_SETTING_SKILL_CHECK_MIN_CHANCE  := 0;

var always_gain_until := Cint(Cdbl(DEFAULT_SETTING_SKILL_ALWAYS_GAIN_UNTIL) * 10);
var min_chance        := Cint(Cint(DEFAULT_SETTING_SKILL_CHECK_MIN_CHANCE) * 10);
var max_chance        := Cint(Cint(DEFAULT_SETTING_SKILL_CHECK_MAX_CHANCE) * 10);

var skillgr           := {0x190,0x191,605,606};

var tool_layers       := {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0a,0x0c,0x0d,0x0e,0x11,0x12,0x13,0x14,0x16,0x17,0x18};

var _priv_array_ := {"moveany","renameany","invul","seehidden","seeghosts","hearghosts","seeinvisitems","dblclickany","losany","ignoredoors","freemove","all"};
const MOVEITEM_FORCELOCATION := 0x40000000;
const MOVECHAR_FORCELOCATION := 0x40000000;
const CFGFILESPEC_SKILLSDEF             := ":*:skills";
const CFGFILESPEC_NEWSKILLSDEF          := ":*:newskills";
const CORE_SETTINGS_MIN_ATTRIBUTE       := 0;
const CORE_SETTINGS_MAX_ATTRIBUTE       := 60000;
const CORE_SETTINGS_MIN_VITAL           := 100;
const CORE_SETTINGS_MAX_VITAL           := 10000000;
const CORE_SETTINGS_MIN_REGEN_RATE      := -30000;
const CORE_SETTINGS_MAX_REGEN_RATE      := 30000;
const CPROP_NAME_PREFIX_REGEN_RATE      := "NewRegenRateFor";
const ATTRIBUTEID_ALCHEMY               := "alchemy";
const ATTRIBUTEID_ANATOMY               := "anatomy";
const ATTRIBUTEID_ANIMALLORE            := "animallore";
const ATTRIBUTEID_ARCHERY               := "archery";
const ATTRIBUTEID_ARMSLORE              := "armslore";
const ATTRIBUTEID_BEGGING               := "begging";
const ATTRIBUTEID_BLACKSMITHY           := "blacksmithy";
const ATTRIBUTEID_BOWCRAFT              := "bowcraft";
const ATTRIBUTEID_CAMPING               := "camping";
const ATTRIBUTEID_CARPENTRY             := "carpentry";
const ATTRIBUTEID_CARTOGRAPHY           := "cartography";
const ATTRIBUTEID_COOKING               := "cooking";
const ATTRIBUTEID_DETECTINGHIDDEN       := "detectinghidden";
const ATTRIBUTEID_DETECTINGHIDDENALIAS  := "detecthidden";
const ATTRIBUTEID_ENTICEMENT            := "enticement";
const ATTRIBUTEID_EVALINT    	        := "evaluatingintelligence";
const ATTRIBUTEID_EVALINTALIAS1         := "evaluatingint";
const ATTRIBUTEID_EVALINTALIAS2         := "evalint";
const ATTRIBUTEID_FENCING               := "fencing";
const ATTRIBUTEID_FISHING               := "fishing";
const ATTRIBUTEID_FORENSICS             := "forensicevaluation";
const ATTRIBUTEID_FORENSICSALIAS1       := "forensiceval";
const ATTRIBUTEID_FORENSICSALIAS2       := "forensics";
const ATTRIBUTEID_HEALING               := "healing";
const ATTRIBUTEID_HERDING               := "herding";
const ATTRIBUTEID_HIDING                := "hiding";
const ATTRIBUTEID_INSCRIPTION           := "inscription";
const ATTRIBUTEID_ITEMID                := "itemid";
const ATTRIBUTEID_LOCKPICKING           := "lockpicking";
const ATTRIBUTEID_LUMBERJACKING         := "lumberjacking";
const ATTRIBUTEID_MACEFIGHTING          := "macefighting";
const ATTRIBUTEID_MACEFIGHTINGALIAS     := "mace";
const ATTRIBUTEID_MAGERY                := "magery";
const ATTRIBUTEID_MAGICRESISTANCE       := "magicresistance";
const ATTRIBUTEID_MAGICRESISTANCEALIAS1 := "magicresist";
const ATTRIBUTEID_MAGICRESISTANCEALIAS2 := "resistingspells";
const ATTRIBUTEID_MAGICRESISTANCEALIAS3 := "resist";
const ATTRIBUTEID_MEDITATION            := "meditation";
const ATTRIBUTEID_MINING                := "mining";
const ATTRIBUTEID_MUSICIANSHIP          := "musicianship";
const ATTRIBUTEID_PARRY                 := "parry";
const ATTRIBUTEID_PEACEMAKING           := "peacemaking";
const ATTRIBUTEID_POISONING             := "poisoning";
const ATTRIBUTEID_PROVOCATION           := "provocation";
const ATTRIBUTEID_REMOVETRAP            := "removetrap";
const ATTRIBUTEID_SNOOPING              := "snooping";
const ATTRIBUTEID_SPIRITSPEAK           := "spiritspeak";
const ATTRIBUTEID_STEALING              := "stealing";
const ATTRIBUTEID_STEALTH               := "stealth";
const ATTRIBUTEID_SWORDSMANSHIP         := "swordsmanship";
const ATTRIBUTEID_SWORDSMANSHIPALIAS    := "swords";
const ATTRIBUTEID_TACTICS               := "tactics";
const ATTRIBUTEID_TAILORING             := "tailoring";
const ATTRIBUTEID_TAMING                := "animaltaming";
const ATTRIBUTEID_TASTEID               := "tasteidentification";
const ATTRIBUTEID_TINKERING             := "tinkering";
const ATTRIBUTEID_TRACKING              := "tracking";
const ATTRIBUTEID_VETERINARY            := "veterinary";
const ATTRIBUTEID_WRESTLING             := "wrestling";
const ATTRIBUTEID_NEKROMANCJA           := "nekromancja";
const ATTRIBUTEID_ROLNICTWO             := "rolnictwo";
const ATTRIBUTEID_ZIELARSTWO            := "zielarstwo";
const ATTRIBUTEID_STONECRAFTING         := "stonecrafting";
const ATTRIBUTEID_MAGIADRUIDYCZNA       := "magiadruidyczna";
const ATTRIBUTEID_WAMPIRYZM             := "wampiryzm";
const ATTRIBUTEID_PALADIN               := "paladin";
const ATTRIBUTEID_GLASSBLOWING          := "glassblowing";
const ATTRIBUTEID_DEXTERITY             := "dexterity";
const ATTRIBUTEID_INTELLIGENCE          := "intelligence";
const ATTRIBUTEID_STRENGTH              := "strength";
const VITALID_LIFE                      := "Life";
const VITALID_MANA                      := "Mana";
const VITALID_STAMINA                   := "Stamina";

const SKILLID_ALCHEMY           := 0;
const SKILLID_ANATOMY           := 1;
const SKILLID_ANIMALLORE        := 2;
const SKILLID_ITEMID            := 3;
const SKILLID_ARMSLORE          := 4;
const SKILLID_PARRY             := 5;
const SKILLID_BEGGING           := 6;
const SKILLID_BLACKSMITHY       := 7;
const SKILLID_BOWCRAFT          := 8;
const SKILLID_PEACEMAKING       := 9;
const SKILLID_CAMPING           := 10;
const SKILLID_CARPENTRY         := 11;
const SKILLID_CARTOGRAPHY       := 12;
const SKILLID_COOKING           := 13;
const SKILLID_DETECTINGHIDDEN   := 14;
const SKILLID_ENTICEMENT        := 15;
const SKILLID_EVALINT           := 16;
const SKILLID_HEALING           := 17;
const SKILLID_FISHING           := 18;
const SKILLID_FORENSICS         := 19;
const SKILLID_HERDING           := 20;
const SKILLID_HIDING            := 21;
const SKILLID_PROVOCATION       := 22;
const SKILLID_INSCRIPTION       := 23;
const SKILLID_LOCKPICKING       := 24;
const SKILLID_MAGERY            := 25;
const SKILLID_MAGICRESISTANCE   := 26;
const SKILLID_TACTICS           := 27;
const SKILLID_SNOOPING          := 28;
const SKILLID_MUSICIANSHIP      := 29;
const SKILLID_POISONING         := 30;
const SKILLID_ARCHERY           := 31;
const SKILLID_SPIRITSPEAK       := 32;
const SKILLID_STEALING          := 33;
const SKILLID_TAILORING         := 34;
const SKILLID_TAMING            := 35;
const SKILLID_TASTEID           := 36;
const SKILLID_TINKERING         := 37;
const SKILLID_TRACKING          := 38;
const SKILLID_VETERINARY        := 39;
const SKILLID_SWORDSMANSHIP     := 40;
const SKILLID_MACEFIGHTING      := 41;
const SKILLID_FENCING           := 42;
const SKILLID_WRESTLING         := 43;
const SKILLID_LUMBERJACKING     := 44;
const SKILLID_MINING            := 45;
const SKILLID_MEDITATION        := 46;
const SKILLID_STEALTH           := 47;
const SKILLID_REMOVETRAP        := 48;
const SKILLID_ZIELARSTWO        := 49;
const SKILLID_ROLNICTWO         := 50;
const SKILLID_NEKROMANCJA       := 51;
const SKILLID_STONECRAFTING     := 52;
const SKILLID_MAGIADRUIDYCZNA   := 53;
const SKILLID_WAMPIRYZM         := 54;
const SKILLID_PALADIN           := 55;
const SKILLID_GLASSBLOWING      := 56;
const SKILLID__HIGHEST          := 56;

var MAIN_SKILL_ARRAY := {
    SKILLID_ALCHEMY,
    SKILLID_ANATOMY,
    SKILLID_ANIMALLORE,
    SKILLID_ITEMID,
    SKILLID_ARMSLORE,
    SKILLID_PARRY,
    SKILLID_BEGGING,
    SKILLID_BLACKSMITHY,
    SKILLID_BOWCRAFT,
    SKILLID_PEACEMAKING,
    SKILLID_CAMPING,
    SKILLID_CARPENTRY,
    SKILLID_CARTOGRAPHY,
    SKILLID_COOKING,
    SKILLID_DETECTINGHIDDEN,
    SKILLID_ENTICEMENT,
    SKILLID_EVALINT,
    SKILLID_HEALING,
    SKILLID_FISHING,
    SKILLID_FORENSICS,
    SKILLID_HERDING,
    SKILLID_HIDING,
    SKILLID_PROVOCATION,
    SKILLID_INSCRIPTION,
    SKILLID_LOCKPICKING,
    SKILLID_MAGERY,
    SKILLID_MAGICRESISTANCE,
    SKILLID_TACTICS,
    SKILLID_SNOOPING,
    SKILLID_MUSICIANSHIP,
    SKILLID_POISONING,
    SKILLID_ARCHERY,
    SKILLID_SPIRITSPEAK,
    SKILLID_STEALING,
    SKILLID_TAILORING,
    SKILLID_TAMING,
    SKILLID_TASTEID,
    SKILLID_TINKERING,
    SKILLID_TRACKING,
    SKILLID_VETERINARY,
    SKILLID_SWORDSMANSHIP,
    SKILLID_MACEFIGHTING,
    SKILLID_FENCING,
    SKILLID_WRESTLING,
    SKILLID_LUMBERJACKING,
    SKILLID_MINING,
    SKILLID_MEDITATION,
    SKILLID_STEALTH,
    SKILLID_REMOVETRAP,
    SKILLID_NEKROMANCJA,
    SKILLID_ROLNICTWO,
    SKILLID_ZIELARSTWO,
    SKILLID_STONECRAFTING,
    SKILLID_MAGIADRUIDYCZNA,
    SKILLID_WAMPIRYZM,
    SKILLID_PALADIN,
    SKILLID_GLASSBLOWING
};



var outskillcapskills := {SKILLID_STONECRAFTING,SKILLID_GLASSBLOWING};

//======================== items & misc ==============================

const UOBJ_PARAFIELD_NS         := 0x6055;
const UOBJ_PARAFIELD_EW         := 0x6056;

const UOBJ_POISONFIELD_NS       := 0x6053;
const UOBJ_POISONFIELD_EW       := 0x6054;

const UOBJ_EFIELD_NS            := 0x6057;
const UOBJ_EFIELD_EW            := 0x6058;

const UOBJ_FIREFIELD_NS         := 0x6048;
const UOBJ_FIREFIELD_EW         := 0x6047;


const TRAVEL_COST               := 500;
const BARBER_HAIR_COST          := 200;
const BARBER_COLOR_POD          := 100;
const BARBER_COLOR_EXT          := 1000;
const COLOR_EXT_TIMER           := 432000;
const UOBJ_GOLDCOIN             := 0x0eed;
const UOBJ_BLUE_MOONGATE        := 0x0f6c;
const UOBJ_DUNG_TELE            := 0x6200;

const UOBJ_COPPER_KEY           := 0x100e;
const UOBJ_GOLD_KEY             := 0x100f;
const UOBJ_IRON_KEY             := 0x1010;
const UOBJ_KEY_RING             := 0x1011;
const UOBJ_MAGIC_KEY            := 0x1012;
const UOBJ_RUSTY_IRON_KEY       := 0x1013;

var _key_types_ := {UOBJ_COPPER_KEY,UOBJ_GOLD_KEY,UOBJ_IRON_KEY,UOBJ_MAGIC_KEY,UOBJ_RUSTY_IRON_KEY};

const UOBJ_CORPSE               := 0x2006;
const UOBJ_GOLD_COIN	        := 0x0eed;

const STARTHAIR                 := 0x2030;
const ENDHAIR                   := 0x2060;

const UOBJECT_TENT_CHEST        := 0xe43;
const UOBJECT_BRASS_SIGN        := 0xbd2;
const UOBJECT_WOOD_SIGN         := 0xbd0;
const UOBJECT_WOOD_SIGNTWO      := 0xbd1;
const UOBJECT_DOORS_START       := 0x675;
const UOBJECT_DOORS_END         := 0x6f4;

const DIR_N                     :=  0x00;
const DIR_NE                    :=  0x01;
const DIR_E                     :=  0x02;
const DIR_SE                    :=  0x03;
const DIR_S                     :=  0x04;
const DIR_SW                    :=  0x05;
const DIR_W                     :=  0x06;
const DIR_NW                    :=  0x07;

const _DEF_NIB                  := 473;
const _DEF_RIB                  := 543;
var   _DEF_COLLORS              := {90,83,899,441,611};

const MAX_MAGIC_DISTANCE        := 13;

const LOOT_DELAY                := 2000;//1500;
const LONG_COUNT_DECAY_TIME     := 86400;
const SAVE_DELAY                := 1900;
const MESSAGE_TIME              := 604800;
const UOBJ_BANKBOX              := 0x0E7C; 
const EXTINCREASE               := 500;
const MIN_BULK_GOLD             := 50;

const AUC_MAX_ITEMS             := 6;
const GLOBALAUC_MAX_ITEMS       := 56;

const _MURDER_COUNT_            := 2;

const IRC_ACCESS                := 0;
const TIME_TO_UP                := 240;//120;
//===========================TIME====================================
const DM                        := 5.0;    //minuta
const DH                        := 300.0;  //godzina 
const DL                        := 7200.0; //dzien
//==========================nature====================================
const LATO                      := 1;
const JESIEN                    := 2;
const ZIMA                      := 3;
const WIOSNA                    := 5;
const EVIL                      := 4;
const DAYTIME_BRIGHTNESS        := 0;
const NIGHTTIME_BRIGHTNESS      := 19;
const DESZCZ                    := 1;
const SNIEG                     := 2;
const DESZCZYK                  := 0;
//======================== anim ======================================

const ANIM_WALK_UNARMED         :=  0x0000; // Walk unarmed.
const ANIM_WALK_ARMED           :=  0x0001; // Walk armed.
const ANIM_RUN_UNARMED          :=  0x0002; // Run unarmed.
const ANIM_RUN_ARMED            :=  0x0003; // Run armed.
const ANIM_STAND                :=  0x0004; // Stand.
const ANIM_FIDGET_1             :=  0x0005; // Twist a little (look around?).
const ANIM_FIDGET_2             :=  0x0006; // Look down.
const ANIM_STAND_1HAND          :=  0x0007; // Stand 1 handed attack.
const ANIM_STAND_2HAND          :=  0x0008; // Stand 2 handed attack.
const ANIM_ATTACK_1HAND_WIDE    :=  0x0009; // Attack 1 handed wide (sword/any).
const ANIM_ATTACK_1HAND_JAB     :=  0x000a; // Attack 1 handed jab (fencing).
const ANIM_ATTACK_1HAND_DOWN    :=  0x000b; // Attack 1 handed down (mace).
const ANIM_ATTACK_2HAND_DOWN    :=  0x000c; // Attack 2 handed jab (mace).
const ANIM_ATTACK_2HAND_WIDE    :=  0x000d; // Attack 2 handed wide.
const ANIM_ATTACK_2HAND_JAB     :=  0x000e; // Attack 2 handed jab (spear).
const ANIM_ATTACK_BOW           :=  0x0012; // Attack bow.
const ANIM_ATTACK_XBOW          :=  0x0013; // Attack xbow.
const ANIM_WALK_WARMODE         :=  0x000f; // Walk in warmode.
const ANIM_CAST_DIR             :=  0x0010; // Spellcasting direction.
const ANIM_CAST_AREA            :=  0x0011; // Spellcasting area.
const ANIM_HIT                  :=  0x0014; // Get hit.
const ANIM_DIE_BACK             :=  0x0015; // Die backward.
const ANIM_DIE_FOR              :=  0x0016; // Die forward.
const ANIM_BOW                  :=  0x0020; // Bow.
const ANIM_SALUTE               :=  0x0021; // Salute.
const ANIM_EAT                  :=  0x0022; // Eat.



//======================== LAYERS ===========================================
const LAYER_NONE                :=  0x00;   // Not used?
const LAYER_HAND1               :=  0x01;   // One handed weapon.
const LAYER_HAND2               :=  0x02;   // Two handed weapon, shield or misc.
const LAYER_SHOES               :=  0x03;   // Shoes.
const LAYER_PANTS               :=  0x04;   // Pants.
const LAYER_SHIRT               :=  0x05;   // Shirt.
const LAYER_HELM                :=  0x06;   // Helm or Hat.
const LAYER_GLOVES              :=  0x07;   // Gloves.
const LAYER_RING                :=  0x08;   // Ring.
const LAYER_UNUSED9             :=  0x09;   // Unused.
const LAYER_NECK                :=  0x0a;   // Neck.
const LAYER_HAIR                :=  0x0b;   // Hair
const LAYER_WAIST               :=  0x0c;   // Waist (half apron).
const LAYER_CHEST               :=  0x0d;   // Torso (inner) (chest armor).
const LAYER_WRIST               :=  0x0e;   // Bracelet.
const LAYER_PACK2               :=  0x0f;   // Unused (backpack, but ord. bp is 0x15).
const LAYER_BEARD               :=  0x10;   // Facial hair.
const LAYER_TUNIC               :=  0x11;   // Torso (middle) (tunic, sash etc.).
const LAYER_EARS                :=  0x12;   // Earrings.
const LAYER_ARMS                :=  0x13;   // Arms.
const LAYER_CAPE                :=  0x14;   // Back (cloak).
const LAYER_PACK                :=  0x15;   // Backpack
const LAYER_ROBE                :=  0x16;   // Torso (outer) (robe)
const LAYER_SKIRT               :=  0x17;   // Legs (outer) (skirt/robe).
const LAYER_LEGS                :=  0x18;   // Legs (inner) (leg armor).
const LAYER_MOUNT               :=  0x19;   // Mount (horse, ostard etc.).
const LAYER_VENDORSTOCK         :=  0x1a;   // This vendor will sell and restock.
const LAYER_VENDOREXTRA         :=  0x1b;   // This vendor will resell to players but not restock.
const LAYER_VENDORBUY           :=  0x1c;   // This vendor can buy from players but does not stock.
const LAYER_BANKBOX             :=  0x1d;   // Contents of bankbox
const LAYER_TRADE               :=  0x1e;   // Can be multiple of these, do not use directly.


//========================KOLORY====================================================

const COLOR_DEFAULT             := 0x0000;
const COLOR_BLACK               := 0x0001;
const COLOR_INDIGO_DARK         := 0x0007;
const COLOR_INDIGO              := 0x0008;
const COLOR_INDIGO_LIGHT        := 0x0009;
const COLOR_VIOLET_DARK         := 0x000c;
const COLOR_VIOLET              := 0x000d;
const COLOR_VIOLET_LIGHT        := 0x000e;
const COLOR_MAGENTA_DARK        := 0x0011;
const COLOR_MAGENTA             := 0x0012;
const COLOR_MAGENTA_LIGHT       := 0x0013;
const COLOR_RED_DARK            := 0x0020;
const COLOR_RED                 := 0x0022;
const COLOR_RED_LIGHT           := 0x0023;
const COLOR_ORANGE_DARK         := 0x002a;
const COLOR_ORANGE              := 0x002b;
const COLOR_ORANGE_LIGHT        := 0x002c;
const COLOR_YELLOW_DARK         := 0x0034;
const COLOR_YELLOW              := 0x0035;
const COLOR_YELLOW_LIGHT        := 0x0036;
const COLOR_GREEN_DARK          := 0x003e;
const COLOR_GREEN               := 0x003f;
const COLOR_GREEN_LIGHT         := 0x0040;
const COLOR_CYAN_DARK           := 0x0057;
const COLOR_CYAN                := 0x0058;
const COLOR_CYAN_LIGHT          := 0x0059;
const COLOR_BLUE_DARK           := 0x0061;
const COLOR_BLUE                := 0x0062;
const COLOR_BLUE_LIGHT          := 0x0063;
const COLOR_GRAY_DARK           := 0x0386;
const COLOR_GRAY                := 0x0387;
const COLOR_GRAY_LIGHT          := 0x0388;
const COLOR_BLACKMETAL          := 0x044e;
const COLOR_GOLDMETAL           := 0x046e;
const COLOR_BSHIMMER            := 0x0480;
const COLOR_WHITE               := 0x0481;
const COLOR_STONE               := 0x0482;
const COLOR_SPECTRAL            := 0x4631;
const COLOR_TRANSLUCENT         := 0x7cf8;

const ETH_CLR                   := 0x4001;


//=============================LISTEX================================================================

const LIST_NORMAL               := 0x01;
const LIST_HIDDEN               := 0x02;
const LIST_GHOST                := 0x04;

//============================VIRTUES================================================================

const COMPASSION    := 105;
const HONESTY       := 106;
const HONOR         := 107;
const HUMILITY      := 108;
const JUSTICE       := 109;
const SACRAFICE     := 110;
const SPIRIT        := 111;
const VALOR         := 112;
const CHAOS         := 120;

//=============================ARMOR CLASS==============================================================

const ARMOR_PLATE   := 5;
const ARMOR_CHAIN   := 3;
const ARMOR_RING    := 2;
const ARMOR_BONE    := 1;
const ARMOR_LEATH   := 0;
const ARMOR_NONE    := 0;

//=================================WEAPONS=======================================================================

var _bows_:={13979,13980,0x13B2,0x0f4f,0x13fd,9932,9933,0x27A5,11562,11563,10154};
var _kije_:={0x13f9,0x0e8a,0x0e81,11569,0x27A8,0x13b3,0x0df0,10147,13981,10233,13986};  
var _blacksword_:={0x0F60,0x0F5E,0x1440,0x27A2,0x13B5,0x13B9,0x0F47,0x0F4B,0x0F45,0x13FA,0x1442,
                    0x0F49,0x0F4E,0x143E,0x0F43,9934,9914,9917,9921,0x27A4,0x27A9,0x13fe,
                    11560,11573,11571,11570,9925}; //0x27AB - szpony
var _blackmace_:={0x143C,0x0F5C,0x143A,0x1438,0x1406,9916,0x13AF,0x27A6,11568};
var _blackfence_ := {0x0E87,0x1402,0x0F63,0x1404,0x0F51,0x1401,9918,9920,11565,11564,10151,11566,10159,11567,9919};
var _blackweapon_:={0x0F60,0x0F5E,0x1440,0x27A2,0x13B5,0x13B9,0x0F47,0x0F4B,0x0F45,0x13FA,0x1442,
                    0x0F49,0x0F4E,0x143E,0x0F43,9934,9914,9917,9921,0x27AB,0x27A4,0x27A9,0x13fe,
                    11560,11573,11571,11570,9925,0x143C,0x0F5C,0x143A,0x1438,0x1406,9916,0x13AF,0x27A6,11568,
                    0x0E87,0x1402,0x0F63,0x1404,0x0F51,0x1401,9918,9920,11565,11564,10151,11566,10159,11567,9919};
var _blackzbroja_:={0x1408,0x140A,0x140C,0x140E,0x1412,11118,11120,11119,0x1C04,0x1415,0x1410,0x1411,0x1414,
                    0x1413,9793,9795,9797,9799,9815,0xeff5,0x13BB,0x13BE,0x13BF,0x13EC,0x13EE,0x13F0,
                    0x13F2,0x1B72,0x1B73,0x1B74,0x1B76,0x1B7B,0x1BC4,0x1BC3};
var _instrumenty_:={10245,0x0eb1,0x0eb2,0x0eb3,0x0eb4,0x0e9c,0x0e9d,0x0e9e};
var _stolarz_zbroja_:={0xafff,0xaffd,0xaffb,0xaff9,0xaff7,0xaff5,0xaff3,0xaf9d,11121,11122,11123,11116,11111,
                        11114,11113,11115};
var _stolarz_tarcza_:={0x1B7A,0x1B78};
var _stolarz_zbroja_tarcza_:={0xafff,0xaffd,0xaffb,0xaff9,0xaff7,0xaff5,0xaff3,0xaf9d,11121,11122,11123,11116,11111,
                        11114,11113,11115,0x1B7A,0x1B78};
var _bizuteria_:={4230,4231,4229,4233,4232,4234};
var _kolczany1_ :={13988,12215};
var _tailorzbroje_:={0x2B75,0x2B76,0x2B78,0x2B77,0x2B74,0x13D5,0x13D6,0x13DA,0x13D4,
                0x13DB,0xaf47,0xaf46,0xaf45,0xaf44,0xaf43,0xaf42,0x1DB9,0x13C6,
                0x13C7,0x13CB,0x13CD,0x13D3,0x1C06,0x1C0A,0x1C00,0x1C08,0x1C02,
                0x1C0C,0x144f,0x144e,0x1450,0x1451,0x1452,0x36A0,5450,5451,
                5445,5447,5147};
var latwe:={"dog","cat","chicken","bird","frog","eagle","GiantRat","Goat","Gorilla",
            "JackRabbit","mountaigoat","Rabbit","Rat","SewerRat","TimberWolf","Szynszyla",
            "SkitteringHopper","fretka"};
var srednie:={"cowa","cowb","bulla","bullb","sheep","pig","horse","horse2","horse3","horse4",
            "parrot","alligator","cougar","GreyWolf","bear","Hind","GreatHart","llama",
            "Panther","Snake","SnowLeopard","SnowLeopardb","Squirrel","Walrus","DeathwathBeetle",
            "Mongbat","Scorpion","golab","blackbear","bagiennymouglin","snieznymouglin",
            "pustynnymouglin","borsuk"};
var trudne:={"ptaksep","azzarmalvado","azzarfuego","azzaraire","azzartierra","zinaber","SwampDragon",
            "desertostard","forestostard","frenziedostard","gaman","GiantIceWorm","GiantToad",
            "GrizzlyBear","PolarBear","CaveBear","Ridgeback","SavageRidgeback","GiantSpider",
            "OlderMongbat","FrostSpider","dzikirzadki","ptakdodo","kagok1","kagok2","shadeon",
            "shadeon1","taigok","chigok","smoksniezny","pustynnysmok","pustynnykon","gelder","morskimouglin",
            "skalnymouglin","kagor"};
var btrudne:={"direwolf","TamCuSidhe","Dragon","Drake","FireSteed","GiantBeetle","HellHound",
            "Hellcat","TamHiryu","LavaLizard","Nightmare","TamReptalon","RuneBeetle","Unicorn",
            "SatanHorse","WhiteWyrm","armok1","armok2","armok3","IceWyvern","Wyvern"};
var plciowe:={"dog","cat","chicken","bird","frog","eagle","GiantRat","Goat","Gorilla",
            "JackRabbit","mountaigoat","Rabbit","Rat","SewerRat","TimberWolf","Szynszyla",
            "SkitteringHopper","fretka","cowa","cowb","bulla","bullb","sheep","pig","horse","horse2","horse3","horse4",
            "parrot","alligator","cougar","GreyWolf","bear","Hind","GreatHart","llama",
            "Panther","Snake","SnowLeopard","SnowLeopardb","Squirrel","Walrus","DeathwathBeetle",
            "Mongbat","Scorpion","golab","blackbear","bagiennymouglin","snieznymouglin",
            "pustynnymouglin","borsuk","ptaksep","azzarmalvado","azzarfuego","azzaraire","azzartierra","zinaber","SwampDragon",
            "desertostard","forestostard","frenziedostard","gaman","GiantIceWorm","GiantToad",
            "GrizzlyBear","PolarBear","CaveBear","Ridgeback","SavageRidgeback","GiantSpider",
            "OlderMongbat","FrostSpider","dzikirzadki","ptakdodo","kagok1","kagok2","shadeon",
            "shadeon1","taigok","chigok","smoksniezny","pustynnysmok","pustynnykon","gelder","morskimouglin",
            "skalnymouglin","kagor","direwolf","TamCuSidhe","Dragon","Drake","FireSteed","GiantBeetle","HellHound",
            "Hellcat","TamHiryu","LavaLizard","Nightmare","TamReptalon","RuneBeetle","Unicorn",
            "SatanHorse","WhiteWyrm","armok1","armok2","armok3","IceWyvern","Wyvern"};
to an AI script makes it use more memory...? much more...
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: 'bad allocation' errors

Post by Turley »

Oh my god and this include is in your ai's ???
Of cause this uses much more memory (except the few const's), dozen of arrays oh my god

Whats the varsize of running a running ai, 100000?
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: 'bad allocation' errors

Post by MuadDib »

What one crash appeared like is this scenario:

AI, loading, it goes to add the ReadGameClock() into an Array, and boom crash.
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am
Location: Poland

Re: 'bad allocation' errors

Post by coltain »

As I said... I thought that compiler uses needed function... not all file...

if this arrays are added to AI script (without any need) than... i have to change AI scripts not to use any .inc file
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: 'bad allocation' errors

Post by Turley »

the compiler only adds functions needed, but he places every global var into the ecl.

I think the www interface of the distro needs more advertising. If i remember correctly you can view running scripts and get detailed info about the scripts like
scriptref.globals & scriptref.var_size <---- the 2 important members when it comes to ai development
Locked