Author Topic: Message queue int(3) is it necessary?  (Read 1796 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Message queue int(3) is it necessary?
I've hit this a couple of times while doing some mission debugging.  Using a message to display variable data in an every-time event quickly overloads the message queue resulting in an int(3).  Is this something that could be replaced with a warning?  Currently it's at line 2038 in mission\missionmessage.cpp. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Message queue int(3) is it necessary?
Well using it in an every-time event means that you add a lot of messages per second. No wonder it's getting overloaded. Although we could no doubt remove the Int3() I do wonder what you are actually doing that requires so many messages. It should only Int3() if you have more than 30 messages in the queue.

Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Message queue int(3) is it necessary?
Debugging.  The last time I had an every-time loop tossing out sets of random numbers and I was displaying those numbers to the screen.  Basically how I tracked down that problem with rand-multiple.   It does only seem to actually hit the int(3) in debug mode.  Running the regular build just skips messages but then you don't get the fs2_open.log. 

No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Message queue int(3) is it necessary?
Int3(), like Assert() only ever do anything in debug mode.

Int3() is basically a programmer saying "If we get to this point in the code, something is wrong." While Assert is the programmer saying "If this isn't true, something is wrong." In some of those cases what is wrong is minor enough that a release build can survive the error so the release build shouldn't say anything. A debug build however should be alerting the coder that something is wrong. Hence the Int3().
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Message queue int(3) is it necessary?
OK I understand that part but there are a lot of times that when an int3() or assert occurs the game crashes in a regular build. This isn't one of those.  So the question is it serious enough to warrant an int3() instead of just a warning that allows you to continue? 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Message queue int(3) is it necessary?
Well if you can get it as the result of a normal mission it probably doesn't warrant an Int3(). Having it print a message to the debug log would probably be enough.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Message queue int(3) is it necessary?
Saw the change in the revision history.  Thanks.   :yes: 

Should make testing looping events with random variables a lot easier. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Message queue int(3) is it necessary?
Yeah. I forgot to mention I changed it. :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]