[FE7] Unit loading glitch (Loads a random amount)

I’ve hit upon an odd glitch involving loading enemy reinforcements. Depending on how I move my units on the first turn, the next turn when the enemy reinforcements are supposed to arrive only certain ones get loaded. So say I am trying to load 7 units. Sometimes the game will only load 4, other times 5, other times all of them, and sometimes none of them. Seemingly at complete random.

I don’t know if its related to the problem or not, but I’ve coded these units to only get loaded depending on a choice the player made during the beginning chapter events.

Here is the enemy unit code:

Charles_Valkyrie1:
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [19,24] [Thunder][0x00,0x00,0x00,0x00]
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [18,25] [Thunder][0x00,0x00,0x00,0x00]
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [19,25] [Thunder][0x00,0x00,0x00,0x00]
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [20,25] [Thunder][0x00,0x00,0x00,0x00]
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [18,26] [Thunder][0x00,0x00,0x00,0x00]
UNIT 0x76 Valkyrie 0x0 Level(8,Enemy,False) [19,26] [20,26] [Thunder][0x00,0x00,0x00,0x00]
UNIT

Turn2:
IFYN 0x05
CMON
LOU1 Wilhelm_Ally
ENUN
TEX1 0xA0A
REMA
LOU1 Charles_Valkyrie1
ENUN
ELSE 0x06
ENIF 0x05
CMON
LOU1 Karl_P
ENUN
TEX1 0xA0B
REMA
ENIF 0x06
ENDA

As far as I can tell my code seems to be fine. I have noticed that some glitchiness has been happening because in the Opening Chapter events I load, then reposition, then move, and ultimately DISA a bunch of civilian NPCs. Altogether 10 of them. I’ve noticed this has resulted in some problems. For instance if I load an enemy unit at the coordinates where one of the civilian NPCs was last located before I made them DISA, then the enemy unit won’t load. However, the units in the glitch I am asking about, are loaded no where near where any of the civilians ever were.

Here are some pictures to demonstrate my problem. As you can see, in each snap shot my units are located at different places, and in each one the amount of enemy Valkyries that got loaded is different:

Glitch1

Glitch2

Glitch3

EDIT: I’ve been experimenting around more. And it seems that there is a cap on the amount of enemies I can load. After a certain limit I start getting these problems of units not loading. As far as I know there isn’t a cap on how many units you can have in a chapter. Furthermore, Chapters like Cog of Destiny load way more units than I am doing in this chapter.

There is certainly a cap to how many units you can have, ram is finite.

There are several limiting factors, one of them being plainly number of units, you can’t have more than about 50 red units loaded, you can’t have more than 50ish blue units recruited (doesn’t even matter if they are loaded or not), only 10 green units can be saved even though you can load up to 20, and you can only have 5 grey units in the link arena.

You also can’t have 100 or more map sprites at the same time, this includes ballistae.

Finally, if you have too many unique sprites there won’t be enough space to hold all of the graphics and everything will get wonky.

I don’t think any of those are your issue though, first of all you are clearly not clearing the units correctly if they are still blocking spawns so look into that. It would also help if you shared a more useful image of the map, like it is now there is no way for us to know what the coords of the units are and whatnot.

1 Like

Thanks for all the info! In fact, I do think the issue has to do with the 50 unit enemy cap (which I really didn’t know about until now. Or rather, I had an idea it existed but I though it was higher than 50). I think the reason that I had different amounts spawned was effected by how many units I managed to kill on enemy phase. This is all making sense now.

However, you also accurately pointed out that my civilian units aren’t properly clearing. I think this is cause for concern since it might effect me later on. I’ll upload my map and relevant event data. But basically, I load a bunch of Civilian NPCs in the top middle portion of the map (inbetween the walled town and the podium looking area). Then when the Map is Faded out I Reposition them to be inside the walled town. Then finally I have them run off screen once enemies arrive. And once they are off screen I use the DISA function to make them all disappear. So I don’t know why they aren’t fully being cleared out.

Here is the map:

Here is my relevant event data:

Spectators:
UNIT 0x0A 0x47 0x00 Level(3,NPC,False) [15,9] [15,9] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD0 0x48 0x00 Level(3,NPC,False) [16,9] [16,9] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD1 0x47 0x00 Level(3,NPC,False) [20,9] [20,9] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD2 0x48 0x00 Level(3,NPC,False) [21,9] [21,9] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD3 0x47 0x00 Level(3,NPC,False) [12,6] [12,6] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD4 0x47 0x00 Level(3,NPC,False) [13,6] [13,6] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD5 0x47 0x00 Level(3,NPC,False) [14,6] [14,6] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xD6 0x47 0x00 Level(3,NPC,False) [22,6] [22,6] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xDA 0x47 0x00 Level(3,NPC,False) [23,6] [23,6] [0x0][0x00,0x00,0x00,0x00]
UNIT 0xDB 0x48 0x00 Level(3,NPC,False) [24,6] [24,6] [0x0][0x00,0x00,0x00,0x00]
UNIT

Opening_event:
BACG 0x59
TEX6 0x05 [0,0] 0x9F4
_ASM0x42 0x83181
FADICG 3
MUSC 0x02
BACG 0x14
CAM1 [22,15]
TEX1 0x9F6
REMA
MUEN 4
SHOWMAP
CMOF
LOU1 Levi
ENUN
CURF [22,15]
STAL 5
DISA Raven // Levi
FADICG 3
MUSC 0x42 //0x21
BACG 0x01
CAM1 [18,3]
LOU1 Citizens
ENUN
LOU1 Spectators
ENUN
TEX1 0x9F7
REMA
MUEN 4
SHOWMAP
TEX8 0x9F0 [0x00, 0x00]
STAL 150
RETB
HIDEMAP
FADI 10
BACG 0x2F
TEX1 0x9F8
FADI 10
BACG 0x14
TEX1 0x9F9
REMA
SHOWMAP
CMON
LOU1 Charles_Mont
ENUN
STAL 10
CURF [18,2]
STAL 10
TEX1 0x9FA
REMA
CURF [18,8]
STAL 5
MOVE [18,8] [18,3]
ENUN
FIGH Rebecca 0x3E Kill_Mont 0x00
MUEN 10
UNCR Rebecca 0x02
KILL 0x3E //kills Montgomery
STAL 20
CURF [19,2]
TEX1 0xA00
REMA
CAM1 [16,6]
TEX1 0xA01
REMA
CAM1 [19,2]
TEX1 0xA02
REMA
TEX6 0x5 [0,0] 0x9EF//0xB6E Old text id I used
_ASM0x42 0x83181
JUMP Route_Split
ENDA

Route_Split:
IFYN 0x05
JUMP Citizens_R
ELSE 0x06
ENUT 0x05
ENIF 0x05
JUMP Charles_R
ENIF 0x06

Citizens_R:
MUSC 0x42
CUSI Raven Ally
CUSI Rebecca Ally
CUSI Matthew Ally
CUSI Pent $A7
CUSI 0x67 $A7
CUSI 0x77 $A7
ENUN
CMOF
LOU1 Charles_E1
ENUN
MOVE [22,6] [19,11] 50
MOVE [23,6] [18,11] 50
MOVE [24,6] [20,11] 50
ENUN
REPOS [19,11] [16,18]
REPOS [18,11] [21,18]
REPOS [20,11] [18,22]
CAM1 [16,6]
LOU1 Charles_E2
ENUN
MOVE [12,6] [12,11] 50
MOVE [13,6] [13,11] 50
MOVE [14,6] [14,11] 50
ENUN
REPOS [12,11] [22,20]
REPOS [13,11] [19,22]
REPOS [14,11] [15,16]
MOVE [15,9] [20,12] 50
MOVE [16,9] [19,12] 50
MOVE [20,9] [18,12] 50
MOVE [21,9] [17,12] 50
ENUN
DISA 0xD0 //[19,12]
REPOS [20,12] [16,16]
REPOS [18,12] [21,16]
REPOS [17,12] [22,16]
CAM1 [18,4]
TEX1 0xA03
REMA
CMON
MOVE [18,2] [17,1]
MOVE Rebecca [17,0]
ENUN
DISA Rebecca
MOVE [17,1] [17,0]
ENUN
DISA [17,0]
CURF Pent
STAL 10
TEX1 0xA04
REMA
MOVE Pent [18,1]
MOVE [20,2] [19,1]
ENUN
CMON
MOVE Raven [19,14]
MOVE Matthew [18,14]
ENUN // If I don’t use ENUN then they talk while running which is also cool
TEX1 0xA05
REMA
MOVE Raven [19,17]
MOVE Matthew [18,17]
ENUN
CAM1 [19,19]
FADI 10
REPOS Raven [19,20]
REPOS Matthew [17,20]
LOU1 Citizen_Allies1
ENUN
BACG 0x2F
TEX1 0xA06
REMA
SHOWMAP
TEX1 0x9FF
REMA
CAM1 [11,20]
CMON
LOU1 Clarice
ENUN
CAM1 [19,19]
FADICG 3
CAM1 [19,17]
BACG 0x2F
TEX1 0xA08
CMOF
LOU1 Charles_Main_Enemy1
ENUN
REMA
SHOWMAP
LOU1 Assault_on_Town1
ENUN
STAL 15
CMOF
MOVE [16,18] [11,16] 45
MOVE [21,18] [27,16] 45
MOVE [18,22] [12,22] 45
MOVE [22,20] [27,22] 45
MOVE [19,22] [11,22] 45
MOVE [15,16] [12,16] 45
MOVE [16,16] [16,15]
ENUN
DISA [16,15]
MOVE [21,16] [27,16] 45
MOVE [22,16] [28,16] 45
ENUN
FADI 10
LOU1 Assault_on_Town2
ENUN
DISA 0x0A
DISA 0xD1
DISA 0xD2
DISA 0xD3
DISA 0xD4
DISA 0xD5
DISA 0xD6
DISA 0xDA
DISA 0xDB
BACG 0x2F
TEX1 0xA0D
REMA
CAM1 [18,2]
CURF Pent
STAL 5
TEX1 0xA09
REMA
CMON
LOU1 Charles_Main_Enemy3
ENUN
ENDA

I don’t do events, much less for FE7, can’t really help you with clearing the units properly.

I would suggest either joining the discord and asking the eventers or finding a vanilla chapter that does it and checking what the difference is.

Maybe try adding ENUN after your REPOS and DISA’s and see if that does anything.

1 Like

Thanks, I’ll try that once I get back home. Idk why, but I didn’t think ENUN was necessary for those commands, but its probably what Im suppose to do.