1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Technology and Random Event popups close instantly

Discussion in 'Bugs and Crashes' started by stp52x, Dec 19, 2019.

  1. stp52x

    stp52x Chieftain

    Dec 20, 2009
    I'm sorry if this has been asked before, but I haven't been able to find an answer to this question, perhaps because I'm not searching for the right terms. Roughly half the time the completed research popups and other messages close by themselves. They'll appear for a split second and close. This is getting pretty damn annoying and I'm not sure if I'm missing important random events because of this.

    Any help to resolve this issue would be greatly appreciated.
  2. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    Maybe you are pressing "enter" key to end turn?
    Upload save.
  3. Blazenclaw

    Blazenclaw Chieftain

    Sep 19, 2010
    I see versions of this happening when the popup (with 'minimize popup until end of turn' option enabled) is no longer relevant due to actions during the turn. I.E. city X has produced something so there's a hammer popup at the side indicating I need to choose what to build; if during the turn I tell the city what to build, the popup will flash at end of turn for a frame or two. Similar things for tech, civic, etc
  4. Galadrion

    Galadrion Warlord

    Apr 9, 2007
    I've noticed that in my games, occasionally something will cause the 'Enter' key in the letters block of the keyboard to have this effect, while the 'Enter' key on the 10-key pad behaves normally. Usually, once this kicks in (no idea what triggers it), the condition remains for the rest of my current play, but will be untriggered the next time I start the game. I haven't managed to isolate what triggers this behavior - it appears to be intermittent and very infrequent, maybe 35-ish hours of game time between instances? With a fairly wide variance, at that. I'm sorry, it just hasn't happened often enough for me to notice any particular commonalities to the circumstances.

    EDITED TO ADD: The behavior of the system appears to be something similar to the letter-block 'Enter' key acting as if it's been double-pushed, while the 10-key 'Enter' key is unchanged. I don't know if that'll provide any clues, but if it helps...
  5. jatkinson

    jatkinson Chieftain

    Sep 10, 2008
    I've seen this behaviour as well, the problem is that it will not happen consistently so it's impossible to debug with a savegame as it will not behave in the same way. I often first see the issue on a top 8 civs popup and then it will consistantly do this until I exit the game and it reverts back to normal behaviour. Interestingly when this happens I can no longer press Enter (from the letterblock) to end turn and instead switches to the Spacebar to end the turn. For now I'm going to try using numpad Enter and see if that stops the issue from happening.
  6. MattCA

    MattCA Warlord

    Jan 25, 2019
    Sounds like the enter key code isn't being stopped if it triggers end turn. In theory, if the turn is triggered by a python key event it will be like a tree a code with 100 branches and hundreds of branches off those, but when it's all done it will be back to where it all started - the python kbd event. If the kbd event is not stopped it may in theory, continue to close the popups. (popups would be part of the "tree" in the middle of the kbd)
  7. Toffer90

    Toffer90 C2C Modder

    Oct 16, 2011
    It's not a python key event, it's xml defined and handled by the dll. the keyboard (kbd) python event doesn't handle enter, and the branching you're talking about is not in the hundreds but closer to a dozen branches.

    The problem seems to be that the screen handleInput call from exe to python is called after the dll handles the enter keypress, and also after the dll tells python that you gained a tech during this end turn. python then goes ahead and creates the tech splash screen, and then the exe tells the tech splash screen through the screen handle input event that enter was pressed.

    There may be two ways of fixing this:
    1. We could add a short timer in the techsplash screen code that makes it ignore, or even consume all, keypress events in its handle input routine during the first couple of miliseconds after the screen is created.
    2. Or possibly the handleInput for the enter keypress is first sent to the main interface screen (before the techsplash screen is created), which does not consume it, so the exe might try to send the input to the techsplash screen when it is created in case the key press was meant for the new screen and not the old one. If that is the case we could make the main interface consume enter press in the handle input routine.
    By consume I mean that if the screen returns True or 1 in its handle input routine to the exe it means that the exe will consider the keypress handled, if it returns false or none or 0 it will tell the exe that this keypress meant nothing to me and might be handled elsewhere.

    The dll does not consume any keypress events, not even those it handle, I don't think it's capable of consuming them even.
    search for CONTROL_ENDTURN in our cpp files to find where the dll handles keypress.
    These controls are defined in CIV4ControlInfos.xml
    Last edited: Jan 7, 2020

Share This Page