Jump to content

Unhandled Exceptions


Kelandon

Recommended Posts

What are the things that can cause an Unhandled Exception in BoA? I'm hoping to make a list to store somewhere to help designers and also possibly to send to Jeff so that he might be able to modify BoA so that these simply pop up an error message rather than killing BoA outright.

 

I know two already:

 

* Using a terrain or floor graphic that doesn't exist. This is a problem with wallsets that are not complete, for example: if you place a wall with a door from a wallset that doesn't include a door (ie, cave wall), this causes an unhandled exception.

 

* Setting a creature facing a direction greater than 7 -- ie, set_character_facing(6,8).

 

These both seem to fall under the category of using a graphic that doesn't exist. What are other known sources of an unhandled exception in BoA?

 

EDIT: Found another one.

 

* Over-running the string limit. I got an unhandled exception in Vasskolis when I tried to display a message from the text buffer that was longer than 256 characters. I'm not sure if over-running the text buffer itself was the problem or if trying to display it was the problem, but either way, the over-long string didn't give the over-long string error like it does on a Mac.

Link to comment
Share on other sites

I may be able to help in this matter by looking at the editor's code, but since I'm not a scenario designer I would need to know what BoA does give an error for. For example, if you specify a location that is invalid, like (2000,4000), does it crash BoA or give an error?

 

EDIT: For clarity: by "crash BoA" I meant the program gives an Unhandled Exception, and by "give an error" BoA actually says what the error is.

Link to comment
Share on other sites

Quote:
I'm not too sure, but wasn't there a problem if you tried to reference a town locations that did not exist? I.e, in a medium town, (63, 63).
As KK12 suggested above, this can indeed cause a crash. Jeff's aware of it and freely admits that BoA's exception handling is, if you'll pardon the pun, less than exceptional.
Link to comment
Share on other sites

Come to think of it these errors should not be fixed by Jeff. This would require the game checking every time for a possible error, even if the error isn't there. This might seriously slow the game. We should, however, ask Jeff to create a debug version of the game that does check for things like this. This should take just as long as fixing the App.

 

As for errors, these come to mind:

 

- Over indexing an item/creature/floor/terrain

- Using a string that is over 256 chars

- Using a string over 30 chars in setting an item's full_name

- Using a string over 14 chars in setting a scripts name

- Using a string over 20 chars in setting an object's (floor/terrain/creature/item) name

 

These are only possible errors. I have no idea if they actually crash BoA. Also, this is a very small list, compared to all the things that could in theory crash BoA. I'd rather not put them all down until I have a better idea of what is handled in BoA.

Link to comment
Share on other sites

Most of those string errors are handled properly by BoA's compiler. I think if you over-load the text buffer on Windows, that isn't, but the others are.

 

I'm not talking about the error messages that BoA normally gives, like the ones that happen if you mis-spell a call or don't declare a variable or something like that. I'm talking about the ones that pop up an Unhandled Exception error and then cause BoA to quit.

 

Also, if Alint can check a script in well under a second, I think it shouldn't be a problem in BoA.

Link to comment
Share on other sites

Yeah I guess I overstressed the detriment to game speed, but the fact that some scripts are only run once every some turns, implies that BoA's scripting engine is generally slow. The editor's code implies that BoA does not go the traditional route of converting scripts to byte code before running them, which slows script execution. Of course, this is all speculation.

 

EDIT:

 

Just read your post, Kelandon.

 

Alint checks one script. BoA simultaneously reads several scripts, relates them to game's actual state, updates the game state, and then actually runs the game. The added checks probably wouldn't do much to game speed, but as a programmer I guess I've been sort of indoctrinated to think in terms of efficiency.

Link to comment
Share on other sites

  • 3 months later...

Most of what is being discussed here seems to do with overlong strings or missing graphics. I however, have encountered this error (unhandled exception) when moving between towns (plus I figured out that if you move diagonally toward a one square thick strip of a special encounter trying to move you to another town, it will instead transport you outside) and when killing an NPC.

Link to comment
Share on other sites

Quote:
Originally written by Dahak:
I'm not too sure, but wasn't there a problem if you tried to reference a town locations that did not exist? I.e, in a medium town, (63, 63).

I believe it gave an error. Or was this fixed by Jeff?
This had much more fun consequences in Blades of Exile. Such as turning townspeople into crazy superbeasts. I kid you not.
Link to comment
Share on other sites

Quote:
If the custom graphics sheet is the wrong size for this creature, when it dies it calls this sort of error!

(As in Xerche'De)

- Archmagi Micael
No, if a graphic is the wrong size, it will give error messages about the graphic when it first sees it, not when the character dies (unless, of course, the problem lies in the dying graphics). In any case, it has not been my experience that this crashes the game, it merely impedes progress by many errors. I have had that problem a few times, but it is not nearly as severe as an unhandled exception.

I have been able to track down and fix this particular error, however, as I explain here:
Unhandled Exception
Link to comment
Share on other sites

I have encountered two more unhandled exceptions:

 

1. I used the relocate_character on a Drake Lord character in my scenario to put him on a chair. As soon as my party is in visual range, the error occurs. I fixed this by not putting him on the chair.

 

2. In "A Large Rebellion", I tried to speak to some NPCs in the largest town (forget name) and when I speak with ones that do not have dialog scripts, I receive the error. I did not investigate as to the cause of this error because that scenario hurt my head too much.

Link to comment
Share on other sites

No, it was set to the right template, 1. However, I have used the wrong template setting before and it does not give an unhandled exception. Rather, it gives a graphical error, drastically slows the game, and displays a corrupted image. At least that has been my experience.

 

Anyways, the point is moot as I have a work-around for the problem. But I suppose it might be helpful in further diagnosing this dilema.

 

I was wondering why this topic was started in the BoA editor forum? It seems to me the problem is with BoA itself, not the editor.

Link to comment
Share on other sites

Quote:
Originally written by Venom:
I was wondering why this topic was started in the BoA editor forum? It seems to me the problem is with BoA itself, not the editor.
Any questions related to scenario design are meant to go in the Editor forum. So if a problem you're having is occurring in a scenario you're designing, you probably want the Editor forum.

(Actually, it's probably a good idea to put technical questions in general in the Editor forum, and save the BoA forum for gameplay questions.)
Link to comment
Share on other sites

An unhandled exception basically means that an error occurred, that the application itself didn't respond to the error, and so Windows stepped in to shut the application down. In these cases, the unhandled exception errors are probably mostly attempts to access illegal locations in memory.

Link to comment
Share on other sites

Although I'm a mac user, I think that happened already quite often with the editor. Macinstosh didn't shut the program down (Thank god, otherwise i would have to do all that work again!), but an error of the program itself showed up, saying it didn'r have enough memory, or the graphic the program wanted to acces wasn't there (but it was there). But this isn't a unhandeled exception, is it.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...