Elevator Saga: Elevator programming game
play.elevatorsaga.com
play.elevatorsaga.com
The elevators were controlled by cabinets of relays, and there was a schematic of the elevator controller, which was pretty straightforward to follow and not too complicated. You could trigger the elevator into going to different floors by toggling the relay corresponding to the call button with a pencil.
On one of the cabinets full of relays that controlled the elevators was taped a piece of paper with the phone numbers of all the emergency phones in every elevator. It was like discovering the holy grail!
Since the elevators at SciFi cons were a bottleneck and always crowded, it took a long time to wait for one and get to the lobby or the floor of the party you wanted to attend.
So whenever I was in a hotel room and wanted to go somewhere else, I would call up an elevator: "Ring!" Somebody would answer and I'd say "Hello!". They'd invariably say "Hey, WTF, this is an elevator!" I'd say "What floor are you on?" They'd tell me something like "12.", and I'd ask "Are you going up or down?" If they were going the right direction, then I'd then ask them "Please press 27, I'll be waiting for you!"
And sometimes I'd prank call the elevators: "Ring!" "Hello, this is Dominos Pizza!" "Hey, WTF, this is an elevator!" "What floor are you on?" "12." "Please press Ground, I'm in the lobby with your pizza. I'll be waiting for you!"
Fond memories of all 90s Maxis games!
Was it... setting the price high then low, then high again? It was something like that.
All offices in SimTower had a time-limit on their usage. Once they've been occupied for a few years, no one likes the office and you need to manually refresh them by setting prices through some price ritual (delete? Change prices? I forget).
----------
Alternatively, set the bottom 20 floors to hotels, and the basement floors to a great parking lot + shopping center in support of those hotels.
// Whenever the elevator is idle (has no more queued destinations) ...
I don't get it. The first challenge is to fix the fact that the idle loop never sends the elevator to floor 2, fair enough.But generally when I run the simulation a person appears and calls the elevator on floor 2, plus people get into the elevator on floor 0 and don't get out on floor 1 (presumably because they dream of going to floor 2). So how are their inputs not queued?
This might work better as an IDE that had a watch variable window showing the queue. As it is I feel I'm experiencing a simulation of badly documented code rather than a badly programmed elevator.
The loop for challenge 1 is:
q: []
idle -> enqueue 0, 1, 2 --- q: [0, 1, 2]
go to floor 0; (noop@floor0)q: [1, 2]
go to floor 1; q: [2]
go to floor 2; q: []
idle -> enqueue 0, 1, 2 --- q: [0, 1, 2]
go to floor 0; q: [1, 2]
...
It doesn't matter if anyone wants to go to that floor who is in the elevator or wants to get on the elevator at that floor.https://play.elevatorsaga.com/documentation.html
And then you get into the events... something like this would likely be interesting/chaotic.
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum, true);
})I know you can program them to "idle" on different floors depending on time of day, and prioritize certain floors (e.g., try to always have one ready to go on the ground floor).
I wouldn't be surprised if you could find systems that integrate with hotel doors, and when a hotel door is opened and the light turned off on floor ten, it works to get an elevator sent to floor ten.
https://news.ycombinator.com/from?site=elevatorsaga.com
In 2015, it had 105 comments https://news.ycombinator.com/item?id=8929314
In 2021, it had 99 comments https://news.ycombinator.com/item?id=27487111
(it was posted many other times, but didn't get any traction)
I only found on my last day there a handicap accessible button panel that had all the floors as actual physical buttons.
what is the return signature of getPressedFloors? how do you add stuff to the destination queue? can i swap out the DQ with a priority queue? how do i store state between runs? can i run/deploy an ML model in this? so many questions
To answer your first question: https://github.com/magwo/elevatorsaga/blob/master/elevator.j...
Be aware that it's just `eval(textarea.value)` so you can `console.log` or (presumably) `debugger;` in your code to inspect whatever you want. The developer tools likely will allow you to set breakpoints in the framework's code, too
I was sad the `thing.on("some_event", () => { this. <-- isn't "thing"`, I had to `.bind(thing)` manually
thing.on("some_event", function() {
// `this` is `thing`
})
Arrow functions close over `this` from their outer scope.Basically, each elevator has a queue of the floors where it's going next. The elevator will always try to move to the floor at the front of the queue. When it stops at the destination floor, it removes that floor from the front of the queue. Whenever the queue is empty, the idle event triggers.
elevator.goToFloor(floorNumber); // Adds floorNumber to the end of the queue
elevator.goToFloor(floorNumber, true); // Adds floorNumber to the front of the queue (changing the destination immediately)
elevator.stop(); // Clears the queue (stopping the elevator immediately)
I suppose you can use your own queue data structure instead and keep at most one element in the built-in queue just to control the current direction of the elevator.I’m terribly unimpressed by people programming real elevators.
The programming may seem haphazard, and it might actually be, I've never been there in person, but the elevator aren't bad for lack of trying. The new elevator system where you tell it the floor and it tells you which elevator to go to is part of the programming optimization.
{
init: function(elevators, floors) {
world.transportedCounter = 500
},
update: function(dt, elevators, floors) {
// We normally don't need to do anything here
}
}https://jaredkrinke.itch.io/sic-1
Edit: very much inspired by TIS-100.
It’s an idle game at its core so it feels like Factorio whereby you try to automate as much as you can as efficiently as you can.