• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Levelling: Missing Ships and Crashes on Encounter Reload from Worldmap to Sea

I have the same error log after a crash last night:(
 

Attachments

  • error.zip
    210 bytes · Views: 120
I have the same error log after a crash last night:(
Do you have a compile.log as well by any chance?
The error log only has this:
Code:
RUNTIME ERROR - file: seadogs.c; line: 824
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 824
Save - ARef to non existing attributes branch
But that is just stock game save errors that don't seem to do any harm. Nothing crash-worthy there.
 
Later to night I will try to find a save or replicate the crash. It is in my testgame somewhere,
not in the game I use for playing, which is the one I focus on now.
 
I have multiple saves i'll upload the last one i played now.
Did a couple of tests with your save.
First couple of times I reload from the worldmap to a sea encounter, only to find no ships there.
And indeed a crash after encountering a group of merchants.
Something very odd is definitely going on!

Out of curiosity, did you ever perform a Reinit (F11) on your game?
 
@Pieter Boelen Yes once when i was stuck on a boarding deck, I accidently pressed F11 but I wanted to press F12 to continue to the next boarding deck.
Note: But you asked if I pressed F11 and I did accidently, F11 caused this problem you think?
 
Last edited:
@ANSEL So.. I should press F11 and it should fix it?
Still not very quite clear for me, but if it fix it iam happy :yes
 
I have got no clue whether Reinit helps with the issue, harms it or has nothing to do with it.
Since there have been some changes to the initialization code recently, I wondered if that may have been the culprit.
A quick test by myself did not confirm that relation though. So still a mystery....
 
Later to night I will try to find a save or replicate the crash.
I found the savegame and I have a crash second time I run into some ships. No error log.
 

Attachments

  • -=Player=- Open Sea August 17th, 1682.zip
    779.9 KB · Views: 111
  • compile.zip
    2.1 KB · Views: 98
  • system.zip
    884 bytes · Views: 93
Forgot to tell also no error log for me.
 

Attachments

  • .log and savegame.zip
    731.7 KB · Views: 111
The game crashes here in PROGRAM\SEA_AI\sea.c:
Code:
        case AITASK_MOVE:
           trace("SEA: !bLoadSavedGame AITASK_MOVE");
           DumpAttributes(rGroup);
           if (CheckAttribute(rGroup, "Task.Target.Pos"))
           {
             Trace("sGroupID = " + sGroupID);
             Group_SetTaskMove(sGroupID, stf(rGroup.Task.Target.Pos.x), stf(rGroup.Task.Target.Pos.z));
           }
           else
           {
             Trace("sGroupID = " + sGroupID);
             x = 10000.0 * sin(stf(rGroup.Pos.ay));
             z = 10000.0 * cos(stf(rGroup.Pos.ay));
            Group_SetTaskMove(sGroupID, x, z);
           }
           trace("SEA: Done");
         break;
It never gets to "SEA: Done".

I managed to track it all the way down here:
Code:
void Ship_SetTaskMove(int iTaskPriority, int iCharacterIndex, float x, float z)
{
   trace("Ship_SetTaskMove: iTaskPriority = " + iTaskPriority + ", iCharacterIndex = " + iCharacterIndex + ", x = " + x + ", z = " + z);
   ref rCharacter = GetCharacter(iCharacterIndex);
   if (CheckAttribute(rCharacter, "surrendered") == true && sti(rCharacter.surrendered) == 1) return; // LDH
   rCharacter.SeaAI.Task = AITASK_MOVE;
   rCharacter.SeaAI.Task.Target = "";
   rCharacter.SeaAI.Task.Pos.x = x;
   rCharacter.SeaAI.Task.Pos.z = z;
   DumpAttributes(rCharacter);
   Trace("Before SendMessage");
   SendMessage(&AISea, "lllaff", AI_MESSAGE_SHIP_SET_TASK, AITASK_MOVE, iTaskPriority, &Characters[iCharacterIndex], x, z);
   Trace("After SendMessage");
}
It crashes on the SendMessage line.

Here's a complete return of the resulting compile.log entries:
Code:
SEA: !bLoadSavedGame AITASK_MOVE
id = egroup__4
task = 7
  target =
  lock = 0
type = trade
maincharacter = fenc_2000
pos =
  x = -207.6431732
  z = 246.5685730
  ay = -0.7236410
delatend = 1
quest =
  id_2000 = fenc_2000
  index = 2000
  id_2001 = fenc_2001
  index = 2001
  id_2002 = fenc_2002
  index = 2002
sGroupID = egroup__4
Group_SetTaskMove: sGroupID = egroup__4
id = egroup__4
task = 7
  target =
  pos =
  x = -6621.1757813
  y = 0.0000000
  z = 7493.9995117
  lock = 0
type = trade
maincharacter = fenc_2000
pos =
  x = -207.6431732
  z = 246.5685730
  ay = -0.7236410
delatend = 1
quest =
  id_2000 = fenc_2000
  index = 2000
  id_2001 = fenc_2001
  index = 2001
  id_2002 = fenc_2002
  index = 2002
iIndex = 1, iCharacterIndex = 2000, x = -6621.2, z = 7494.
Ship_SetTaskMove: iTaskPriority = 1, iCharacterIndex = 2000, x = -6621.2, z = 7494.
id = fenc_2000
index = 2000
name = Heitor
old =
  name = Gonçalvo
  lastname = Serpa
  chr_ai =
  hp = 40.0000000
  hp_max = 40.0000000
  type = stay
  dialog =
  currentnode = First time
  tempnode = First time
  items =
  merchantsblade = 1
  pistol1-2 = 1
  blade = MerchantsBlade
  gun = pistol1-2
lastname = Meireles
sex = man
model = corsair1_1
  entity = NPCharacter
  animation = man
  height = 1.8000000
location = none
  group =
  locator =
  from_sea =
  stime = 6.0000000
  etime = 21.9833298
ship =
  type = Schooner1
  idx = 7
  mode = trade
  cannons =
  charge =
  type = 2
  type = 1
  speedv0 = 103.8679428
  fireangmax = 1.0000000
  fireangmin = 1.0000000
  borts =
  cannonf =
  qty = 2
  cannonb =
  qty = 2
  cannonl =
  qty = 5
  cannonr =
  qty = 5
  tune =
  cplates =
  on = 0
  bcannons =
  on = 0
  gchasers =
  on = 0
  nsails =
  on = 0
  speedrate = 0.2928628
  sails = 0.0205512
  ltopmasts =
  on = 0
  speedrate = 0.6748911
  sailcrit = 4
  stays =
  on = 0
  rhull =
  on = 0
  hp = 366.8414001
  incaliber = 1
  flushed =
  on = 0
  speedrate = 1.0903711
  turnrate = 7.3414717
  hp = -79.0500031
  capacity = 134.4715424
  tack = 0
  tackmod = 0
  name = Serpente de Mar
  crew =
  quantity = 75
  morale = 37
  minratio = 1.0000000
  sp = 200
  hp = 991
  pos =
  x = -3420.05
  z = 6736.3
  mode = 0
  y = 1.53796
  ang =
  y = -13.1528
  x = -0.00557477
  z = 0.0332235
  cargo =
  load = 402
  goods =
  ration = 0
  rum = 0
  balls = 290
  grapes = 270
  knippels = 135
  bombs = 0
  gunpowder = 3421
  sailcloth = 4
  planks = 5
  gold = 0
  silver = 15
  cinnamon = 5
  chocolate = 0
  coffee = 0
  wheat = 0
  medicines = 0
  paprika = 0
  wine = 0
  sandal = 0
  ebony = 0
  mahogany = 0
  sugar = 0
  tobacco = 0
  ale = 0
  silk = 0
  linen = 0
  fruits = 0
  clothes = 0
  bricks = 0
  oil = 0
  cotton = 5
  copra = 0
  leather = 0
  recalculatecargoload = 1
  impulse =
  rotate =
  x = 0.0000000
  y = 0.0000000
  z = 0.0000000
  speed =
  x = 0.0000000
  y = 0.0000000
  z = 0.0000000
  lastballcharacter = 0
  speed =
  z = 0.4948
  y = -0.0401447
  x = 0.0238387
  strand = 0
  sndid = 0
  stopped = 0
  maxspeedz = 26.7321987
  maxspeedy = 0.0503805
  correctimmersion = 0.1585401
  immersion = 0.1585401
  boxsize =
  x = 13.2932
  y = 29.8282
  z = 48.863
  lasttgt = 0
  plunder =
  plunder0 = 53
  plunder1 = 35
  plunder2 = 290
  plunder3 = 270
  plunder4 = 135
  plunder6 = 3421
  plunder7 = 4
  plunder8 = 5
  plunder10 = 15
  plunder11 = 5
  plunder30 = 5
  maxcaliber = 32
  stats =
  nation = 5
  weight = 4294
  capacity = 1475
  maxcrew = 92
  mincrew = 17
  speedrate = 16.1297741
  turnrate = 50.6352959
  price = 47312
  hp = 1192
  sails =
  gerald = 0
dialog =
  currentnode = First time
  tempnode = First time
quest = True
  meeting = 0
  officertype = merchant captain
  officerprice = 3812
nation = 5
  name = 5
  known = -2
skill =
  freeskill = 0
  sneak =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 3
  sailing = 1
  modifier = 0
  party = 1
  shipclass = 3
  fleetsize = 1
  importance = 120
  ship = 1
  leadership = 1
  modifier = 0
  party = 1
  shipclass = 6
  fleetsize = 1
  importance = 5
  ship = 1
  commerce =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 7
  defence =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 2
  grappling =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 320
  repair =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 13
  fencing =
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 400
  accuracy = 2
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 120
  cannons = 1
  modifier = 0
  party = 1
  ship = 1
  shipclass = 5
  fleetsize = 1
  importance = 200
rank = 2
reputation = 45
headmodel = h_corsair1_1
chr_ai =
  hp = 0.0000000
  hp_max = 62.0000000
  type = stay
  tmpl = stay
  login = 0
  group = corpses
abordagemode = 1
issoldier = 0
seaai =
  group =
  name = egroup__4
  task = 7
  target =
  pos =
  x = -6621.1757813
  z = 7493.9995117
shiptype = Schooner1
fantomtype = trade
points = 0.7299801
faceid = 11
items =
  merchantsblade = 2
  pistol1-2 = 1
  merchantsdagger = 1
  pistol2-2 = 1
  gunpowder = 4
  pistolbullets = 7
  blade4 = 1
  blade1-1 = 1
  pistol1-1 = 1
  blade1+1 = 1
  blade2+1 = 1
equip =
  blade = blade2+1
  gun = pistol1-1
shipmoney = 6
flags =
  pirate = 3
  texture = 3
features =
  geraldsails = 0
tmpperks =
  turn = 0
  basicdefence = 0
  advanceddefence = 0
  toughness = 0
  criticalhit = 0
  swordplayprofessional = 0
  rush = 0
  gunman = 0
  improveaiming = 0
  gunprofessional = 0
  gunfighter = 0
  improvepotions = 0
  defendpoison = 0
  shipturnrateup = 0
  shipspeedup = 0
  turn180 = 0
  sandbankmaneuver = 0
  stormprofessional = 0
  sailingprofessional = 0
  basicbattlestate = 0
  advancedbattlestate = 0
  shipdefenceprofessional = 0
  fastreload = 0
  immediatereload = 0
  hulldamageup = 0
  sailsdamageup = 0
  crewdamageup = 0
  criticalshoot = 0
  longrangeshoot = 0
  cannonprofessional = 0
  longrangegrappling = 0
  musketsshoot = 0
  grapplingprofessional = 0
  instantboarding = 0
  troopers = 0
  lightrepair = 0
  instantrepair = 0
  cooking = 0
  highstakes = 0
  improvesmuggling = 0
  advancesmuggling = 0
  basiccommerce = 0
  advancedcommerce = 0
  trustworthy = 0
  basiclandowner = 0
  sharedexperience = 0
  ironwill = 0
  brander = 0
  leadership = 0
  sneak = 0
lastsailstate = 2
tmpskill =
  commerce = 0.1000000
  leadership = 0.1000000
  sneak = 0.1000000
  defence = 0.1000000
  grappling = 0.1000000
  sailing = 0.1000000
  repair = 0.1000000
  fencing = 0.1000000
  accuracy = 0.1000000
  cannons = 0.1000000
seatime =
  lasthit = 502
  basecrewmorale = 52
  basecrewquantity = 149
  timesincelast = 1
  tempmorale = 41.4664421
  lastfired = 502
experience = 4479
  leadership = 0
  fencing = 0
  sailing = 594
  accuracy = 1459
  cannons = 1080
  grappling = 0
  repair = 0
  defence = 0
  commerce = 0
  sneak = 0
skillimportancetotal = 1190
skillsetup = pirate captain
perks =
  list =
  shipturnrateup = 1
  freepoints = 0
canfiretime = 1.6556901
perktypes = 29
  combat = 6
  sailing = 10
  sea combat = 8
  boarding = 0
  merchant = 0
  daring = 0
  party = 0
  misc = 5
  highest = 1
contriblist =
  sharedexperience = 0
  instantrepair = 0
  lightrepair = 0
  musketsshoot = 0
status = dead
position = captive
fight = 0
fakelevels = 0
deathx = 13.8888855
deathy = 86.1111145
deathz = -3430.1000977
deathay = 6758.6601563
storedattributes = 1
actions =
  idle =
  i1 = idle_1
  i2 = idle_2
  i3 = idle_3
  i4 = idle_4
  i5 = idle_5
  i6 = idle_6
  i7 = idle_7
  i8 = idle_8
  i9 = idle_9
  i10 = idle_10
  walk = walk
  backwalk = back walk
  run = run
  backrun = back run
  stsup = stairs up
  stsuprun = run stairs up
  stsdown = stairs down
  stsdownrun = run stairs down
  stsupback = back stairs up
  stsdownback = back stairs down
  stsuprunback = back run stairs up
  stsdownrunback = back run stairs down
  turnleft = turn left
  turnright = turn right
  swim = swim
  hit = face_hit
  h1 = hit_1
  h2 = hit_2
  h3 = hit_3
  sidestep_left_on = skip
  sidestep_right_on = skip
  fightwalk = fight walk
  fightbackwalk = fight back walk
  fightrun = fight run
  fightbackrun = fight back run
  attack =
  a1 = attack_1
  a2 = attack_2
  a3 = attack_3
  a4 = attack_4
  a5 = attack_5
  a6 = attack_6
  a7 = attack_7
  a8 = attack_8
  attacktl =
  a1 = attack_left_1
  attacktr =
  a1 = attack_right_1
  block = block
  blockhit = block_hit
  recoil = Recoil
  shot = Shot
  fightsidestep_left_on = skip
  fightsidestep_right_on = skip
  fightdead =
  d1 = death_0
  d2 = death_1
  d3 = death_2
  d4 = death_3
  fightidle =
  i1 = fight stand_1
  i2 = fight stand_2
  i3 = fight stand_3
  i4 = fight stand_4
  dead =
  d1 = death_citizen_1
  d2 = death_citizen_2
money = 0
killer =
  index = 0
  status = 2
isfantom = 1
needsaildmg = 24.0000000
Before SendMessage

As far as I can tell, it is a perfectly valid character in a perfectly valid Sea AI group.
But there ARE no ships actually being generated in the encounter, so I suspect the underlying cause is actually earlier at the spot where the ships should be loaded, but aren't.

Will have to continue tomorrow night. Bed time now....
 
Dont know what most of the codes mean, I know a thing or two about scripting but this is above my knowledge, I'll be glad te help in anyway I can. :)
 
Dont know what most of the codes mean, I know a thing or two about scripting but this is above my knowledge, I'll be glad te help in anyway I can. :)
No worries. I'm posting it mainly for @Levis' attention, hoping that it rings any bells for him.
Your savegame is already a big help.

If you do still want to do something to help us figure this one out, the main thing I would like to know is how to trigger this bugged behaviour on a new game.
Because when I start a new game, everything behaves fine. But then weird stuff happens later on.
This report by @ANSEL even suggests that stranger and worse stuff keeps happening the longer you go, which is quite concerning.
I'd like to know if there is anything in specific that breaks things or if it is a "gradually getting worse" situation without obvious reason.

My suspicion was that it may have to do with the rewritten initialization code, but I have no evidence of that and therefore also have no clue if I'm on the right track with that thought or now.
 
Well about the huge performance drop there were some things I noticed.
I'll explain, I was playing freeplay storymode and I encountered 2 Dutch ships near Jamaica I boarded one and took it, the second one was far away so I could save the game, I quick sailed to the next one and boarded it, and after a few decks I was on the captains deck but then it crashed, and every time my game crashes I delete the .options file, and then I opened my game and in the intro there was already lag, and there was lag in the menu just basically every where.
But my lag just dont appear like nothing when iam playing, it mostly shows up after I deleted the .options file and starts the game again.

Note: About the merchant crash its very simple for me just attack a Dutch or French merchant fleet and my game crashes, about the lag.. well it happens after random crashed for example: Merchants fleets and boarding and deleting the .options file.

Update: I tried to replicate the crash and then lag, but im afraid it didnt work.
everything was normal.

Update 2: I started a new game and the crash with the French merchant fleet seems fixed though i dont know about the lag.
 
Last edited:
That is what I seem to have observed as well: There are no problems at the start of a New Game.
But then at some point apparently, things DO get bugged. How, when or why is still a mystery though. :facepalm
 
@Pieter Boelen Look like you where right, just encountered a French merchant fleet and attacked it and then immediately a crash.
Do you want the error, compile and system.log from my latest crash or is my and ANSEL's enough?
 
Back
Top