9
« on: January 09, 2023, 08:05:55 am »
In a custom Skyscrapersim building, a Skyscrapersim emulation of a real-life building, that I am currently working on, I am trying to create a curved glass entrance atrium. Before creating an actual version of the atrium, I am prototyping it out in a temporary test building to confirm that the method I'm using to create it will work.
The atrium spans five floors of the building, from the ground floor (G) up to level 4. This comes to a total ceiling height of 70.5 feet. This distance has been split into 14 glass panels, where each glass panel is around 5.036 feet tall.
I have already prototyped the atrium's front wall to a reasonable extent, but the problem lies in the left side wall, which curves inwards towards the shorter back wall. The method I'm using to simulate the curve takes a base amount, divides it by 2 a number of times and stores these divisions in increment variables numbered 1 to 10, and then to build the actual curve, adds a wall which goes from the starting Z position of the curve to that same position with the value of the smallest increment variable subtracted from it. Another wall is then created going from the end position of the previous wall to that position with the second-smallest increment variable subtracted from it. This process repeats until all 10 increment variables have been used.
When executed successfully, this code produces a curved wall made by connecting straight wall panels. I tested the code out outside of a function and it seemed to be working fine with just a few panels created, but then I realised that the code was getting very spaghetti-like and had to be compacted down. I then created a function and placed this code inside it, then tried calling the function to create the whole wall at once. I then reloaded the building and bosh, goodbye to the Skyscrapersim window and hello to my desktop. I was very confused for a moment and then I saw the crash report pop up on the screen. For some reason, the compacted version of the code crashed the sim. I tried it a few more times and did some minor messing around with the code, but it still kept crashing. I am very confused about this as this code is based off some known good code that I used to prototype a different curved wall elsewhere in this building, and is really not too different from that code apart from the addition of more increment variables.
The code I have used:
#Curved side wall function -
<Function atrium_curved_wall_create>
#Syntax - atrium_curved_wall_create(texture, sidetexture, thickness, panelwidth, panelheight, startx, startz, voffset, tw, th, curveincrement1)
Set ACW_texture = %param1%
Set ACW_sidetexture = %param2%
Set ACW_thickness = %param3%
Set ACW_panelwidth = %param4%
Set ACW_panelheight = %param5%
Set ACW_startx = %param6%
Set ACW_startz = %param7%
Set ACW_voffset = %param8%
Set ACW_tw = %param9%
Set ACW_th = %param10%
Set ACW_floor = %param11%
Set ACW_increment1 = %param12%
Set ACW_increment2 = %ACW_increment1% / 2
Set ACW_increment3 = %ACW_increment2% / 2
Set ACW_increment4 = %ACW_increment3% / 2
Set ACW_increment5 = %ACW_increment4% / 2
Set ACW_increment6 = %ACW_increment5% / 2
Set ACW_increment7 = %ACW_increment6% / 2
Set ACW_increment8 = %ACW_increment7% / 2
Set ACW_increment9 = %ACW_increment8% / 2
Set ACW_increment10 = %ACW_increment9% / 2
Set ACW_xpos1 = %ACW_startx% - %ACW_panelwidth%
Set ACW_xpos2 = %ACW_startx% + %ACW_panelwidth%
Set ACW_xpos3 = %ACW_xpos2% + (%ACW_panelwidth% * 2)
Set ACW_xpos4 = %ACW_xpos3% + (%ACW_panelwidth% * 2)
Set ACW_xpos5 = %ACW_xpos4% + (%ACW_panelwidth% * 2)
Set ACW_xpos6 = %ACW_xpos5% + (%ACW_panelwidth% * 2)
Set ACW_xpos7 = %ACW_xpos6% + (%ACW_panelwidth% * 2)
Set ACW_xpos8 = %ACW_xpos7% + (%ACW_panelwidth% * 2)
Set ACW_xpos9 = %ACW_xpos8% + (%ACW_panelwidth% * 2)
Set ACW_xpos10 = %ACW_xpos9% + (%ACW_panelwidth% * 2)
Set ACW_xpos11 = %ACW_xpos10% + (%ACW_panelwidth% * 2)
Set ACW_xpos12 = %ACW_xpos11% + (%ACW_panelwidth% * 2)
Set ACW_zpos1 = %ACW_startz% + %ACW_increment10%
Set ACW_zpos2 = %ACW_zpos1% + %ACW_increment9%
Set ACW_zpos3 = %ACW_zpos2% + %ACW_increment8%
Set ACW_zpos4 = %ACW_zpos3% + %ACW_increment7%
Set ACW_zpos5 = %ACW_zpos4% + %ACW_increment6%
Set ACW_zpos6 = %ACW_zpos5% + %ACW_increment5%
Set ACW_zpos7 = %ACW_zpos6% + %ACW_increment4%
Set ACW_zpos8 = %ACW_zpos7% + %ACW_increment3%
Set ACW_zpos9 = %ACW_zpos8% + %ACW_increment2%
Set ACW_zpos10 = %ACW_zpos9% + %ACW_increment1%
<Floor %ACW_floor%>
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos1%, %ACW_startz%, %ACW_xpos2%, %ACW_startz%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos2%, %ACW_startz%, %ACW_xpos3%, %ACW_zpos1%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos3%, %ACW_zpos1%, %ACW_xpos4%, %ACW_zpos2%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos4%, %ACW_zpos2%, %ACW_xpos5%, %ACW_zpos3%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos5%, %ACW_zpos3%, %ACW_xpos6%, %ACW_zpos4%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos6%, %ACW_zpos4%, %ACW_xpos7%, %ACW_zpos5%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos7%, %ACW_zpos5%, %ACW_xpos8%, %ACW_zpos6%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos8%, %ACW_zpos6%, %ACW_xpos9%, %ACW_zpos7%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos9%, %ACW_zpos7%, %ACW_xpos10%, %ACW_zpos8%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos10%, %ACW_zpos8%, %ACW_xpos11%, %ACW_zpos9%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
TextureOverride %ACW_texture%, %ACW_texture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%, %ACW_sidetexture%
AddWall bob, %ACW_texture%, %ACW_thickness%, %ACW_xpos11%, %ACW_zpos9%, %ACW_xpos12%, %ACW_zpos10%, %ACW_panelheight%, %ACW_panelheight%, %ACW_voffset%, %ACW_voffset%, %ACW_tw%, %ACW_th%, false
<EndFloor>
<EndFunction>
#Function call
atrium_curved_wall_create(Window, Steel, 0.25, 6.25, 70.5 / 14, -37.625, 0, (70.5 / 14) * 6, 2, 1, 0, 10)
Known good code that it is based off (this function has a bit more mathematical precision than the previous one to make a more accurate curve but I doubt that's the cause of the problem):
#Curved wall function
<Function nw_curved_wall_create>
#Syntax - nw_curved_wall_create(startX, startZ, endX, endZ, panelwidth, height, voffset, texture, tw, #th)
Set nw_startx = %param1%
Set nw_startz = %param2%
Set nw_endx = %param3%
Set nw_endz = %param4%
Set nw_panelwidth = %param5%
Set nw_height = %param6%
Set nw_voffset = %param7%
Set nw_texture = %param8%
Set nw_tw = %param9%
Set nw_th = %param10%
Set nw_increment1 = (%nw_panelwidth% / 2)
Set nw_increment2 = (%nw_panelwidth% / 4)
Set nw_increment3 = (%nw_panelwidth% / 8)
Set nw_increment4 = (%nw_panelwidth% / 16)
Set nw_increment5 = (%nw_panelwidth% / 32)
Set nw_xpos1 = (%nw_startx% - %nw_increment5%)
Set nw_zpos1 = (%nw_startz% + (%nw_panelwidth% - (%nw_increment5% / 4)))
Set nw_xpos2 = (%nw_xpos1% - %nw_increment4%)
Set nw_zpos2 = (%nw_zpos1% + (%nw_panelwidth% - (%nw_increment4% / 4)))
Set nw_xpos3 = (%nw_xpos2% - %nw_increment3%)
Set nw_zpos3 = (%nw_zpos2% + (%nw_panelwidth% - (%nw_increment3% / 4)))
Set nw_xpos4 = (%nw_xpos3% - %nw_increment2%)
Set nw_zpos4 = (%nw_zpos3% + (%nw_panelwidth% - (%nw_increment2% / 4)))
Set nw_xpos5 = (%nw_xpos4% - %nw_increment1%)
Set nw_zpos5 = (%nw_zpos4% + (%nw_panelwidth% - (%nw_increment1% / 4)))
Set nw_xpos6 = (%nw_xpos5% - (%nw_panelwidth% / 4 * 3))
Set nw_zpos6 = (%nw_zpos5% + (%nw_panelwidth% / 4 * 3))
Set nw_xpos7 = (%nw_xpos6% - (%nw_panelwidth% / 4 * 3))
Set nw_zpos7 = (%nw_zpos6% + (%nw_panelwidth% / 4 * 3))
Set nw_xpos8 = (%nw_xpos7% - (%nw_panelwidth% - (%nw_increment1% / 4)))
Set nw_zpos8 = (%nw_zpos7% + %nw_increment1%)
Set nw_xpos9 = (%nw_xpos8% - (%nw_panelwidth% - (%nw_increment2% / 4)))
Set nw_zpos9 = (%nw_zpos8% + %nw_increment2%)
Set nw_xpos10 = (%nw_xpos9% - (%nw_panelwidth% - (%nw_increment3% / 4)))
Set nw_zpos10 = (%nw_zpos9% + %nw_increment3%)
Set nw_xpos11 = (%nw_xpos10% - (%nw_panelwidth% - (%nw_increment4% / 4)))
Set nw_zpos11 = (%nw_zpos10% + %nw_increment4%)
Set nw_xpos12 = (%nw_xpos11% - (%nw_panelwidth% - (%nw_increment5% / 4)))
Set nw_zpos12 = (%nw_zpos11% + %nw_increment5%)
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_startx%, %nw_startz%, %nw_xpos1%, %nw_zpos1%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos1%, %nw_zpos1%, %nw_xpos2%, %nw_zpos2%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos2%, %nw_zpos2%, %nw_xpos3%, %nw_zpos3%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos3%, %nw_zpos3%, %nw_xpos4%, %nw_zpos4%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos4%, %nw_zpos4%, %nw_xpos5%, %nw_zpos5%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos5%, %nw_zpos5%, %nw_xpos6%, %nw_zpos6%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos6%, %nw_zpos6%, %nw_xpos7%, %nw_zpos7%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos7%, %nw_zpos7%, %nw_xpos8%, %nw_zpos8%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos8%, %nw_zpos8%, %nw_xpos9%, %nw_zpos9%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos9%, %nw_zpos9%, %nw_xpos10%, %nw_zpos10%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos10%, %nw_zpos10%, %nw_xpos11%, %nw_zpos11%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos11%, %nw_zpos11%, %nw_xpos12%, %nw_zpos12%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
TextureOverride %nw_texture%, %nw_texture%, Black, Black, Black, Black
AddWall bob, %nw_texture%, 0.1, %nw_xpos12%, %nw_zpos12%, %nw_endx%, %nw_endz%, %nw_height%, %nw_height%, %nw_voffset%, %nw_voffset%, %nw_tw%, %nw_th%, false
<EndFunction>
Skyscraper crash report:
Process: skyscraper [13107]
Path: /Users/USER/Desktop/*/skyscraper.app/Contents/MacOS/skyscraper
Identifier: com.skyscrapersim.skyscraper
Version: 1.11.0 (1.11.0)
Build Info: Skyscraper-Unknown~Unknown
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2023-01-09 12:57:24.1204 +0000
OS Version: macOS 12.6.1 (21G217)
Report Version: 12
Anonymous UUID: 94B9983D-FCF0-6674-EB09-7765F839F78B
Sleep/Wake UUID: C11B77EF-B857-4BA3-9F81-1FD22B322212
Time Awake Since Boot: 200000 seconds
Time Since Wake: 5316 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [13107]
VM Region Info: 0 is not in any region. Bytes before following region: 4294967296
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 100000000-1001e4000 [ 1936K] r-x/rwx SM=COW ...OS/skyscraper
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libstdc++.6.dylib 0x7ffb20aeb7c8 std::string::assign(std::string const&) + 14
1 skyscraper 0x10015310d 0x100000000 + 1388813
2 skyscraper 0x100151e0c 0x100000000 + 1383948
3 skyscraper 0x100154209 0x100000000 + 1393161
4 skyscraper 0x1001561b6 0x100000000 + 1401270
5 skyscraper 0x1000e246a 0x100000000 + 926826
6 skyscraper 0x1001480e1 0x100000000 + 1343713
7 skyscraper 0x10007dd87 0x100000000 + 515463
8 skyscraper 0x10016cd8e 0x100000000 + 1494414
9 skyscraper 0x10016816a 0x100000000 + 1474922
10 skyscraper 0x10008ca25 0x100000000 + 576037
11 libwx_baseu-3.0.dylib 0x1009e40f0 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 352
12 libwx_baseu-3.0.dylib 0x1009e4d1d wxEvtHandler::ProcessEventLocally(wxEvent&) + 93
13 libwx_baseu-3.0.dylib 0x1009e4c07 wxEvtHandler::ProcessEvent(wxEvent&) + 103
14 libwx_baseu-3.0.dylib 0x1009e4fdf wxEvtHandler::SafelyProcessEvent(wxEvent&) + 15
15 libwx_osx_cocoau_core-3.0.dylib 0x1019de743 wxWindowBase::SendIdleEvents(wxIdleEvent&) + 67
16 libwx_osx_cocoau_core-3.0.dylib 0x1018de946 wxAppBase::ProcessIdle() + 134
17 libwx_osx_cocoau_core-3.0.dylib 0x101851c2a wxApp::ProcessIdle() + 26
18 libwx_baseu-3.0.dylib 0x10090bc4c wxEventLoopBase::ProcessIdle() + 28
19 libwx_baseu-3.0.dylib 0x1009c1607 wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*) + 87
20 CoreFoundation 0x7ff807933520 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
21 CoreFoundation 0x7ff8079333b2 __CFRunLoopDoObservers + 543
22 CoreFoundation 0x7ff807932967 __CFRunLoopRun + 1131
23 CoreFoundation 0x7ff807931e3c CFRunLoopRunSpecific + 562
24 HIToolbox 0x7ff8105e15e6 RunCurrentEventLoopInMode + 292
25 HIToolbox 0x7ff8105e134a ReceiveNextEventCommon + 594
26 HIToolbox 0x7ff8105e10e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
27 AppKit 0x7ff80a36bfad _DPSNextEvent + 927
28 AppKit 0x7ff80a36a66a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
29 AppKit 0x7ff80a35cd19 -[NSApplication run] + 586
30 libwx_osx_cocoau_core-3.0.dylib 0x1018b9dee wxGUIEventLoop::OSXDoRun() + 110
31 libwx_baseu-3.0.dylib 0x1009c1cb4 wxCFEventLoop::DoRun() + 52
32 libwx_baseu-3.0.dylib 0x10090bb68 wxEventLoopBase::Run() + 88
33 libwx_baseu-3.0.dylib 0x1008dc790 wxAppConsoleBase::MainLoop() + 128
34 libwx_osx_cocoau_core-3.0.dylib 0x101851c7a wxApp::OnRun() + 26
35 libwx_baseu-3.0.dylib 0x10094a737 wxEntry(int&, wchar_t**) + 71
36 skyscraper 0x100160d04 0x100000000 + 1445124
37 skyscraper 0x100005e24 0x100000000 + 24100
If anyone knows how to fix this, leave a reply on this topic. Help is very much appreciated. -SL2844