BEEmod / BEE2-items

Standard Items for the BEE2.4
132 stars 46 forks source link

Compiler creates game crashing map #3173

Open FierceThundr opened 4 years ago

FierceThundr commented 4 years ago

This is an issue I've had on this one map of mine both before and after I returned to map making,

Every other compile the game is crashed as the compiled level is loading. This bug even persists in uploaded copies of the map. Due to the fact that I'm admittedly not too familiar with this kind of stuff, I don't know what information or logs would be appropriate to add.

It is in the clean style. Personal testing has shown that it may be unrelated to the elements themselves because most elements were placed into a test map with no crashing issues.

Something I'm a bit wary of in terms of everything is the fact that the map that is causing issues has over 50 logic gates, although I have not yet tested if those are the problem. (The logic gate blocks btw)

FierceThundr commented 4 years ago

I just confirmed that the issue is with the logic blocks, deleting them allows the map to be built without issue

TeamSpen210 commented 4 years ago

Do you have any looping logic?

FierceThundr commented 4 years ago

Yes, I used it a bit to create persistent currents. So that's the killer? (I used both "and" and "or" gates in a loop and "or" and "or" gate loops)

FierceThundr commented 4 years ago

A just double checked making these simple loops and it doesn't cause a crash. Is it more of a cumulative issue?

TeamSpen210 commented 4 years ago

The problem potentially is that if you end up with a very long chain of items immediately triggering each other all on the same frame, you could end up overflowing the game and crashing it. Adding NOT gates in will prevent that since they have a short delay for this problem.

FierceThundr commented 4 years ago

I'll look and see if that might be it

FierceThundr commented 4 years ago

Ok, it might be the antisoftlock system built into the map. At the begging of the map it fires because the players are not in the area it can "see" them in. It activates two faithplates and two doors which are powered through "or/and" loops. Is this something that could be fixed by blocking the system during loading in? Something I'm a bit worried about is that the system gets activated by a not gate at the very beginning.

FierceThundr commented 4 years ago

I added a delayed triggering to the heart of the system and everything is working now. Thank you!

FierceThundr commented 4 years ago

It just crashed again despite my prevention that worked once

TeamSpen210 commented 4 years ago

Can you try copying just the parts that are breaking to a new map, and/or uploading a copy here so I can have a look at the setup?

FierceThundr commented 4 years ago

Yeah, I'll get on that. I'm just trying to see if I might have something connected in a faulty way first. For all I know maybe something is going haywire that I have no clue about. The system is pretty compact.

FierceThundr commented 4 years ago

I'm currently rebuilding the circuit on a site that let's you simulate circuits like this. I'm hoping to potentially see if I hooked something up wrong. I'll send it with the map file when I'm done.

FierceThundr commented 4 years ago

This is a mock up of the circuit, sorry for not responding very fast. I had to repair some issues I found with the circuit related to deleting and rebuilding the map earlier. I'm gonna fix some stuff in the map then send a copy. https://imgur.com/a/SFWnRMK [The logic in the photo is set to how it would look when a player starts the map] I'm definitely sure the issue is with the logic, but after my tweak with starting the logic late, I'm not sure. There is not much outside of this that could contribute to crashing due to stressing the game to my knowledge. (For all I know, maybe I'm not looking at everything the right way)

FierceThundr commented 4 years ago

Coop cubes 2.zip

Here's the map and a copy of the circuit chart.

TeamSpen210 commented 4 years ago

Okay, that's impressively complex. The thing I notice is the 3 loops you have. You might want to try and replace those with the SR latch item - it's designed specifically for that, and is both more efficient and less buggy than a manual loop. You can use the associated A/B items to latch it, or use it as a permanent gate by hooking a normal input to it - it'll then toggle to whatever the other state is when you power it.

FierceThundr commented 4 years ago

@TeamSpen210 I'll work on adding it in and I'll mention back if it fixes the crash or not. Unfortunately I need some sleep for now. My schedule for sleeping is messed up XD The reason I never touched the Sr latch before is that I did not have a good understanding of how it works and I was not sure it it could help in place of current circuits I used a lot.

FierceThundr commented 4 years ago

This is something I forgot to mention, but it will also crash the game every other attempt to load into the editor for the map. I'm attempting to implement the SR gates as I send this.

FierceThundr commented 4 years ago

Ok, I may have found the more exact cause. It appears it is a specific set of logic gates related to the switching mechanic in the map. I'll be doing more tests to find out what exactly is causing the crash.

FierceThundr commented 4 years ago

I'm not completely sure why this is it, but I found what the crash is about. Switcher Circuit That is the circuit that is crashing. Upon testing it by deleting certain elements and rebuilding I found that by deleting two closed solid fields from the circuit results in the build working properly. (In the circuit photo above, these are the two bottom-most outputs) I have also done a few minor tests replacing the two solid fields with other items. The ones I tested were half-panels and traditional fizzlers. These both worked on building.

FierceThundr commented 4 years ago

I replaced the solid fields with force deflection fields and the crashing is gone. It appears the crashing was because of some bug issue with the closed fields. I don't know if this needs to be closed, but since the original issue has been resolved I guess so? Feel free to unless you want to look into whatever happened with the closed fields.

TeamSpen210 commented 4 years ago

The only thing I can think of is some issue with them rapidly turning off and on. But these gates won't do that...