abandoned pengines
Anne Ogborn <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
My application is a map based game. Basically I'll be moving around markers on the map. My plan is to have the main page start a timer loop for each type of marker. When the timer fires it'll create a pengine , iterate through the data until it fails, and destroy the engine. Is this a reasonable method? What happens with pengines that are abandoned? Could I instead have the calls within the pengine (Presumably some public API on the server) block waiting for more data? This would allow me to push data. If so, I have a relatively complex job of thread handling that seems contrary to the spirit. Am I missing something that would allow me to do this more simply? To make the discussion concrete, take as an example player position. In our game every player sees the other players as markers on their map. Each player's javascript will report their position whenever they move more than some constant number of meters. This information needs broadcast to all the other playrs So, my naive implementation is create a pengine that calls a public API on server, (marked safe, obviously), that waits for input, handles, and repeats in an infinite TCO recursion. create a second pengine that gives an infinite series of solutions, each of which is a new player position, blocking until it has a new position. javascript timer reads the GPS location. If we've moved far enough, does a pengine_input with the data. On the server side,***a miracle occurs*** probably involving the cryptic comment " * A dynamic clause database, private to the pengine, into which other processes may assert clauses. These clauses reside in the module pengine_sandbox. That passes the data to all the 'second pengine's and lets them unblock and send a new position.