August 5 2016 build

From Skyscraper
Jump to: navigation, search
This is the article of a development build of Skyscraper Simulator.
It has been confirmed a good-faith contribution to the Skyscraper wiki.

This build is a bugfix release for the last build. I've put the last build's post below, since it's still mostly the same.

This has the fix that was made as an update to the last build, which fixes an issue where shared script variables wouldn't get reset after a script error. The shared variables are now stored in a C++ object, that is created when the script processor starts, and deleted when it exits, so the variables are always reset.

I fixed an issue that was mainly affecting maps like EG881's Andersville, where if you selected buildings with the number keys, sometimes they would bounce back and forth between child and parent engines, and the cameras would fall through the ground. This happened because the engine instance's "entry detection" code would make itself the active one, if it detected that you entered it, without checking things over first. This caused a malfunction when using parent and child engines, since when entering a child engine using the number keys, the parent would detect that you entered it too, and forcefully make itself active. The code now won't automatically switch like that (do a hostile takeover), if that engine is an ancestor (parent, grandparent, etc) of the current active engine.

I fixed and tested the Floor section's "Elevator:Car" parameter for some commands, which was failing before. The function that ps that also had some issues, which have been fixed. It now does full checks to make sure everything's valid, to prevent crashes.

The polygon intersection functions (mostly used for detecting which wall you've clicked on) which are modified CrystalSpace code (in the separately-licensed texmap.cpp) have been updated so that the polygons use a pre-computed plane instead of those functions calculating it themselves, for efficiency. I also removed a lot of extra functions that weren't used (and were impractical), and tried to remove more of those CS functions, since I'm trying to gradually eliminate them if possible.

The Cut function no longer uses the old CS "Classify" function, to test if a polygon is outside the cutting area. It now uses Ogre's AxisAlignedBox object, which is more functional. It'll also skip over the polygon if the polygon is completely inside the cut area (if it needs to be deleted), instead of running through all the cutting code and resulting in nothing, so it should make it more efficient.


-removed SegmentPlane function (C++)
-removed and replaced old Classify function with an AABB test (C++)
-Cut function now skips polygons that are completely inside the cutting area, instead of needlessly processing over them and not getting cut results
-removed old point-on-polygon/findwall code (C++)
-removed old ComputeNormal function (C++)
-intersection functions need to convert the polygon's relative plane to absolute positioning
-fixed handling of "elevator:car" parameter in Floor section, and added additional checks to translator function to properly report errors if the elevator or car is invalid
-fixed computing of stored polygon plane, and polygon intersection functions now used the stored plane instead of computing one
-engines shouldn't automatically make themselves the active engine on entry, if they're an ancestor of the active engine. This fixes issues where overlapping engines' activations would bounce back and forth, causing colliders to fall through the ground, and wrong engines being selected
-moved shared script section variables into a separate Config Handler object, mainly to fix an issue where the shared variables were never reset on script interpreter shutdown/startup
-make sure elevator's CreateElevator function returns with error if the primary car has an error

August 2 2016 build:

This build introduces a number of new features, and is an exciting release.

The "Simple - Top Box" building has been added, to demonstrate Inspection Service mode. This was posted by someone on the forum, and I had it lying around for a while.

Skyscraper's profiler has been updated, and has more performance metrics, and also shows the statistics every 10 frames, which makes it easier to read.

I've added the ChimeOnArrival elevator parameter, which has been off by default since Alpha 9 Update 2, and determines if the elevator should always chime when arriving at a floor (true), or only when responding to a hall call (false).

I did some checking and fixes to the Fire Service Phase 2 mode.

The biggest change, was the creation and eventually merge of the Double Decker branch. This adds true double-decker (multi-car) support to Skyscraper. The elevator code was split in two for this, to separate the "elevator" and "car" functionalities, resulting in a lot of needed code cleanups. Each elevator is now made up of individual cars, which is where the objects, walls and doors are placed. Car 1 is created by default, and additional cars can be created. Any number of cars can be created for a single elevator. The "Simple - Double Decker" building has been added to demonstrate this feature. I also revamped the script guide for this, and added additional information (and the Elevator Car section) to it for this.

The Sears Tower was updated for the double decker feature, since it's express elevators are supposed to be double deckers.

I found that the "ReOpen" elevator parameter was missing in the script interpreter code, but mentioned in the script guide, and added it.

When visiting a friend recently, I noticed the "Access" key switch, near the top left of the shaft doors, at his condo building's lower level floor. Since I didn't know what that was, I did research and added the resulting work as the Hoistway Access Mode. With the use of actions, key switches can now be placed at landings to be used in conjunction with Inspection Service Mode. When Inspection Service is enabled, and the shaft doors are open, the key switch will allow the elevator to move at leveling speed, at the direction that's selected on the key switch, in order to gain access to the pit or shaft top. Normally this key switch is supposed to be a constant pressure switch (so that one person holds it to "Up" for example, while the other moves the elevator), but since that's not possible with just a single person using the sim, I just made it without the constant pressure. What the feature does, is it disables the interlock check for that specific shaft door (and elevator car doors), when the elevator car movement is the same as the key switch direction. I might also try to add the shaft door "hole", to unlock the interlock, for shaft access.

I reorganized the Script Processor C++ code, into multiple files and classes, which should make it easier to manage. Before it was a single enormous file called "fileio.cpp" (with it's header file, fileio.h), and was about 9,500 lines long. Now it's "scriptprocessor.cpp" along with it's header, and related "script_*.cpp" files.

For the Hoistway Access switches, I added the "selection_position" parameter to the AddControl and AddActionControl commands, which lets you specify a starting selection position for controls. For the Hoistway Access switch, it starts in the "Off" position which is in the center, "Down" is on the left and "Up" on the right, so the starting position needed to be 2.

-added key switch textures for Hoistway Access
-added "selection_position" parameter to Control object (AddControl and AddActionControl commands), which allows you to specify the starting selection position
-added "Simple - Hoistway Access" building
-Move Object window needs to keep the SBS engine pointer current, otherwise a crash can happen when reloading a building
-split Script Processor out into multiple files and classes
-added Hoistway Access mode feature
-added missing ReOpen elevator parameter to script interpreter, and fixed script guide
-fixed an issue where nudge mode would not activate properly when an elevator in Fire Phase 2 mode was recalled to the lobby
-added top-level Ogre exception handler, which should help with error reports
-(Sears Tower) Express elevators are now real double-decker elevators
-added "Simple - Double Decker" building
-added elevator double-decker (multi-car) support
-fixed issue where an elevator in Fire Service Phase 2 mode wouldn't put doors into nudge mode, when recalled from lobby (Phase 1 mode re-enabled)
-added elevator ChimeOnArrival parameter
-make sure profiler is cleaned up when window exits
-update profiler statistics every 10 frames instead of continuously
-added more performance metrics for the Profiler
-properly group radio buttons in Elevator Editor
-CameraState should store FOV value, so that the camera's FOV will be persistent when switching engines
-added "Simple - Top Box" building

See Also