[Major] - Creative Session Crashes Repeatedly when perfectly valid Verse code uncommented

I am working on a UEFN project that includes a lot of verse code. Repeatedly, I’ve had the Session (Creative Mode session, from Start Session) crash suddenly when deploying changed code, after which it will continue crashing until I rollback or start over from scratch.

After extensive testing, I’ve narrowed it down a particular function that, when included in my verse code (EVEN IF NEVER CALLED!), which cause the session to crash on launch. But, it appears to me at least to be perfectly valid verse code. It builds fine, there are no code issues reported in the log or within VS Code (with verse extension enabled.) And again, just to be clear, it’s crashing EVEN IF THE FUNCTION is never called. It’s mere existence is apparently a problem.

The following is the code block in question:


IsStraight(Cards: CardSet): tuple(logic, int, ?CardSet)=
    runLengths := Cards.GetRunLengths()
    var straightRank: int = 0
    for(runLength: runLengths) :
        if(runLength(1) > 4 and straightRank < 1) :
            set straightRank = runLength(0)

    var straightCards: CardSet = CardSet{}

    ranksToFind: []int =
        for(i:= 0..4) :
            straightRank - i

    for(Rank: ranksToFind) :
        rankSet:= Cards.CardsOfRank(Rank, 1)
        set straightCards = CombineCardSets(straightCards, rankSet)

    if(straightRank > 0) :
        (true, straightRank, option{straightCards})
    else :
        var HasSmallStraight: logic = false
        five:=  Cards.CardsOfRank(5, 1)
        four:=  Cards.CardsOfRank(4, 1)
        three:= Cards.CardsOfRank(3, 1)
        two:=   Cards.CardsOfRank(2, 1)
        ace:=   Cards.CardsOfRank(14, 1)

        set straightCards = CombineCardSets(five, four)
        set straightCards = CombineCardSets(straightCards, three)
        set straightCards = CombineCardSets(straightCards, two)
        set straightCards = CombineCardSets(straightCards, ace)

        if(NumStraightCards:= straightCards.GetNumCards[], NumStraightCards >= 5) :
            set HasSmallStraight = true
        
        if(HasSmallStraight = true) :
            (true, 5, option{straightCards})
        else :
            (false, 0, false)

A few notes that may or may not be relevant:

At first I thought it might be a verse file size issue. I’ve noticed VS Code intellisense gets very very slow whenever a file gets over a couple thousand lines.

However, I also after one of the crashes completely refactored the code into a lot more smaller files. Same issue reoccurred when the above function was included again.

For reference, I have about 1.25 mb of verse classes according to UEFN although there’s not a whole lot else in the project. (Screenshot below.)

This is incredibly frustrating…I have a virtually fully working Poker level for Fortnite, but this issue is preventing me from finishing. Quite frankly, I’m amazed I was able to push verse/uefn as far as I have, since it’s clearly not intended for this sort of game yet, but I had literally all the UI, game logic, animation, mutliplayer, etc. working and was doing some fine tuning on AI logic and such when this broke everything. A few screenshots from the game are below. (Excuse the harsh background, I hadn’t bothered putting the actual casino building in yet…)

Any help would be greatly appreciated. If anyone from Epic is curious to look deeper, I’m fine with giving access to the full project.

Poker Game In Progress

(Yes, I know there’s a mismatch in the screenshot between the hole cards in the corner and what’s on the table, trust me it works, I just can’t run all the logic at present with the above issue)

Snipped of Fortnite Log file showing error when crash occurs (at least I THINK this is the relevant section, but I can’t get anything meaningful out of this…)

[2023.04.05-18.57.57:296][504]LogGarbage: GC purged 1936 objects (448174 -> 446238) in 3.191ms
[2023.04.05-18.57.57:305][504]LogUObjectHash: Compacting FUObjectHashTables data took   9.00ms
[2023.04.05-18.57.57:307][504]LogUIActionRouter: Cleaned out [0] inactive UI action bindings
[2023.04.05-18.57.57:307][504]MemoryManagingGameInstanceSubsystem: Verbose: Instance [FortGameInstance_2147482646 -> FortCosmeticsSubsystem_2147482646]: PostGarbageCollection --
[2023.04.05-18.57.58:153][530]LogWindows: Error: === Critical error: ===
[2023.04.05-18.57.58:153][530]LogWindows: Error: 
[2023.04.05-18.57.58:153][530]LogWindows: Error: Fatal error!
[2023.04.05-18.57.58:153][530]LogWindows: Error: 
[2023.04.05-18.57.58:153][530]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000010
[2023.04.05-18.57.58:153][530]LogWindows: Error: 
[2023.04.05-18.57.58:153][530]LogWindows: Error: [Callstack] 0x00007ff7e82bf4f6 FortniteClient-Win64-Shipping.exe!UnknownFunction []
[2023.04.05-18.57.58:153][530]LogWindows: Error: [Callstack] 0x00007ff7ebc190bf FortniteClient-Win64-Shipping.exe!UnknownFunction []
[2023.04.05-18.57.58:153][530]LogWindows: Error: [Callstack] 0x00007ff7e82c1372 FortniteClient-Win64-Shipping.exe!UnknownFunction []
[2023.04.05-18.57.58:153][530]LogWindows: Error: [Callstack] 0x00007ff7e83f5394 FortniteClient-Win64-Shipping.exe!UnknownFunction []
[2023.04.05-18.57.58:153][530]LogWindows: Error: [Callstack] 0x00007ff7ece2b33a FortniteClient-Win64-Shipping.exe!UnknownFunction []
1 Like

Have you tried breaking down that method even further to figure out where the issue is? I had a similar issue with the editor crashing repeatedly here 3 Verse lines that crash UEFN over and over until you remove them Took a long time to find as well

Only thing I notice is on this line below, what’s with the [] ?

        if(NumStraightCards:= straightCards.GetNumCards[], NumStraightCards >= 5) :

Hi AngularRat,

Wow that’s a pretty impressive project. Indeed that sounds super frustrating. We’ll be looking into this today.

Ok, good news / bad news time.
The good news is, it sure looks like this is a known crash whose fix will be in tomorrow’s FN release.

The bad news is, the person who did the fix isn’t around today to let me know if there’s a simple workaround you could apply.

Would you mind posting after tomorrow’s update if you’re still seeing this issue?
If you are still crashing tomorrow, please let me know and I’ll check to see if the fix missed some cases, or perhaps there was a second issue with the project hiding behind this first crash.

Nice project - I also had a few lines of Verse code that made my UEFN editor crash every time I started it. I was using the Random function, but found a workaround for now.

Good luck!

So, apparently I don’t have my notifications set up properly, because I didn’t realize there had been replies here…To give an update, I did manage to get everything working by completely refactoring the code.

I’m in testing with a private version now, and should hopefully be releasing the game/island in the next few days. I’ll post here when I do if anyone is curious.

That said…I still have no idea what the actual bug was. I can definitely report that I’ve had far fewer crashes since the .20 release.

PokerNite is finally live! Please check it out and let me know your thoughts! Feel free to share with anyone that might enjoy it.

Island Code: 0004-2034-3582

1 Like