Coding Task List - Before IB2 Initial Release

Discuss anything in general about the IceBlink Engine + Toolset project (or anything else) here.

Re: Coding Task List - Before IB2 Initial Release

Postby Dorateen » Tue Nov 07, 2017 2:02 pm

Hi youngneil1,

I did some more testing in build 76, and I had a couple of unhandled exceptions come up in 2 battles that never happened before. One was mid-battle, when an enemy was going to take its turn.

The other happened after a party wipe, just after the pop up message saying "the party has been defeated". I copied this one. I noticed in the first line, it says the index must be non-negative. Since this was after a party wipe, all characters were at negative hitpoints, in case this error is relevant to creatures targeting the characters. Something to look into?

Code: Select all
************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at IceBlink2.ScreenCombat.CenterScreenOnPC()
   at IceBlink2.ScreenCombat.CalculateUpperLeft()
   at IceBlink2.ScreenCombat.startPcTurn()
   at IceBlink2.ScreenCombat.turnController()
   at IceBlink2.ScreenCombat.endCreatureTurn(Creature crt)
   at IceBlink2.ScreenCombat.Update(Int32 elapsed)
   at IceBlink2.GameView.Update(Int32 elapsed)
   at IceBlink2.GameView.gameTimer_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
User avatar
Dorateen
Backer
Backer
 
Posts: 903
Joined: Mon Nov 26, 2012 2:08 pm

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Tue Nov 07, 2017 3:15 pm

Thank you for heads up, Dorateen. Such crashes are very unfortunate and it's very good to flag them as early as possible.

Hunting down the reason for such crashes without debugger info is nearly impossible, so I would need your module file (or at least parts with the battle and all necessary data) and then run it with Visual Studios debugger to find the exact code line (and a more precise error cause).

That said, can you replicate the errors in v76 (ie do they happen each time/at least often in that battle)? There are also more questions I could ask to narrow it down a bit (like: No errors with v75? New AI types used? AI spell casters involved? Large creatures involved? etc), but I think the most efficient way would be run the debugger over the affected battle on my machine and see if I can trace it directly down this way.
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby Dorateen » Tue Nov 07, 2017 3:21 pm

OK, let me see if I can reproduce the error consistently. So far it only happened twice. And I have had battles end in defeat (those witches!) without getting the exception. I'll run through some more different combat encounters, before we get into serious debugging.
User avatar
Dorateen
Backer
Backer
 
Posts: 903
Joined: Mon Nov 26, 2012 2:08 pm

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Tue Nov 07, 2017 4:22 pm

Awesome, your efforts are appreciated here.
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby slowdive » Tue Nov 07, 2017 4:37 pm

The code for centerScreenOnPc () must have something looking for an index that is out of range (based on error message). Is there something like gv.mod.playerlist[index] in there?

One way I try and avoid these is to check the variable index to see if it is in range before using it. Also good to check for null before trying to use objects for similar reasons.

I typically only remember the need for such checks after a crash reminds me :lol:
User avatar
slowdive
Site Admin
Site Admin
 
Posts: 2912
Joined: Wed Nov 21, 2012 11:58 pm

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Tue Nov 07, 2017 5:11 pm

Good thinking there :) ! Yup, gv.mod.playerList[currentPlayerIndex] is used there indeed. I will try to shield it against negative and out of range now...
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Tue Nov 07, 2017 5:46 pm

IB Beta v77 released - no warranties, no liabilities,use at your own risk:

https://www.dropbox.com/s/zs5n8n1d8qr05 ... 7.zip?dl=0

- began work on allowing more scripts to target current speaker/party leader (WIP)
- added fix for potential crash when trying to center screen on current pc in battle
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Tue Nov 07, 2017 5:49 pm

@Dorateen: Please try replicating the bugs with the new version v77 - with a bit of luck this fixes at least one of the bugs. Or introduces two more :lol: ...
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby youngneil1 » Wed Nov 08, 2017 7:36 am

While browsing through the scripts (of which almost all of them allow direct application to party leader already), I wonder if a gaCastSpell script would be cool to have in convo or on mainmap. It would connect the powerful spell system with gameplay out of combat. Likely it would need spell tag, caster level and target idicator (leader, whole party, soecific char).
User avatar
youngneil1
Backer
Backer
 
Posts: 4570
Joined: Sat Dec 08, 2012 7:51 am

Re: Coding Task List - Before IB2 Initial Release

Postby Dorateen » Wed Nov 08, 2017 2:25 pm

youngneil1 wrote:@Dorateen: Please try replicating the bugs with the new version v77 - with a bit of luck this fixes at least one of the bugs. Or introduces two more :lol: ...


Great! I downloaded version 77, and will do some more testing.

Allowing spell casting in conversation does have a lot of appeal. Will be interesting to see that as a possibility.

By the way, something I noticed starting with the last build: in the IceBlink_Beta folder, there is some sort of application or installation file called "Acer (C) - Verknupfung". Is that something that should be there? Can it be deleted, or just leave it alone?
User avatar
Dorateen
Backer
Backer
 
Posts: 903
Joined: Mon Nov 26, 2012 2:08 pm

PreviousNext

Return to General IceBlink Project Discussions

Who is online

Users browsing this forum: No registered users and 3 guests

cron