I recall trying a few mods that made Kerbal Space Program programmable so you can automate your rocket (Some have used it to make SpaceX-style reusable boosters: https://www.youtube.com/watch?v=sqqQy8cIVFY), and mods that provided a domain-specific language were more convenient than mods that used an existing conventional programming language. However the kOS language was still ultimately an imperative script, and too inflexible to be a complete programming language. It got me thinking about what kind of language would best be suited for the purpose of controllers (I was also writing PID controllers at the time), and I noticed there wasn't a language for it.
I also recall a Minecraft mod called ComputerCraft where you program a "Turtle" (a la Logo) to perform automated digging actions, but the task of programming it in the easily-embedded Lua proved somewhat inconvenient for simple actions, if only for the ALGOL-style syntax. Another mod tried Forth, but get the sense that while one could be productive in Forth, it's a lot to learn.
The developers have already incorporated it in a proof of concept game: https://bobthesimplebot.github.io/, but I could imagine RTS style games or mods where you not only have to scavenge for resources, you also program your bots to do your bidding, like Dwarf Fortress with programmable drones instead of independently-minded Dwarves.
I've actually been really impressed by Shenzhen I/O (http://www.zachtronics.com/shenzhen-io/), which is a game where you have to program microcontrollers to build weird products. The built-in programming language is an ultra-simple assembly language, with either one or two registers, and about a dozen operations. Program length is limited to about 10 or 15 statements. There are external ROM and RAM modules which store about 20 values. Every challenge comes with a pre-made test suite.
Something about these extreme restrictions and the simplicity make for excellent, puzzle-style gameplay. And I think you could add a Shenzhen I/O-like "microcontroller" to a lot of automation games (like Factorio: https://www.factorio.com/) and it would work very well.
I think that one of the problems with adding traditional programming languages to games is that there are no constraints to make it challenging, and that you can write fairly large programs. But a deliberately limited and simple language could be fun.
> I could imagine RTS style games or mods where you not only have to scavenge for resources, you also program your bots to do your bidding, like Dwarf Fortress with programmable drones instead of independently-minded Dwarves.
Sounds sort of like Screeps [1]. It's an MMO game where you write scripts in JS to control different robots (so, not logic programming, but still pretty fun with lots of depth). Parts of it are also open source [2].
Logic programming and productions are a wonderful idea that I studied in undergrad back in pre-2000. These days, people seem hostile towards them. People just don't like the idea of specifying rules. I couldn't find modern intro textbooks on the topic or classes that cover it on MOOCs. I'm very surprised and confused.
The trendy way to approach the problem these days is to throw massive amounts of data at a deep learning model and let the model try to learn the rules. And my irony detector can't help but squalk out the famous minsky koan:
"What are you doing?", asked Minsky.
"I am training a randomly wired neural net to play Tic-tac-toe", Sussman replied.
"Why is the net wired randomly?", asked Minsky.
"I do not want it to have any preconceptions of how to play", Sussman said.
Minsky then shut his eyes.
"Why do you close your eyes?" Sussman asked his teacher.
"So that the room will be empty."
At that moment, Sussman was enlightened.
Machine Learning has its use cases, that's for sure, but I can't help but laugh at the person who eschews a well understood model of a well understood system by an experienced and trained expert human in favor of a magic black box that at its best might converge on the expert's understanding after enough time and data. There is no shame in building off of what is already known and understood.
Some of what logic programming represented became absorbed into "semantic web" technologies (RDF, SPARQL, OWL/OWL2), and went down with it, though I think actually OWL2 (description logic) isn't half bad and has lots of vertical use in eg. bibliography systems, taxonomic meta knowledge bases for medical and other research support systems, and backends for graph databases like OpenGraph. I remember RDF being used for metadata in Linux desktop search software, and folks hated it.
Prolog, OTOH, is as minimalistic and pragmatic as ever, with many implementations around, based on an ISO standard even. There's a slowly evolving initiative to come up with an extended standard library across Prolog implementations (eg. Prolog Commons). Though as you might know, Prolog doesn't solve hard problems in itself; rather, it gives you a Turing-complete language based on backtracking, negation-as-failure, closed-world reasoning, and extra-logical mechanisms as primitives to build more interesting reasoning or planning/optimization problems on.
I'm not hostile to them per-se, but I don't see much usefulness in systems like this one these days.
For some kinds of video game agents, traditional logic programming might be fine.
But for anything that I would consider using in the real world, I would want to use probabilistic knowledge representation and reasoning.
Even for many kinds of video games you'd want that instead. Like in a first person shooter where the agents have limited knowledge of the world state, you want to be able to reason about the other player's position and status without cheating, so that the agent can be more realistic and fair.
Computational Logic and Human Thinking: How to be Artificially Intelligent
"This earlier draft of a book of the same title, published in July 2011 by Cambridge University Press, presents the principles of Computational Logic, so that they can be applied in everyday life. I have written the main part of the book informally, both to reach a wider audience and to argue more convincingly that Computational Logic is useful for human thinking."
Very long time ago I was trying to program many matroids algorithms, let's say that matroids are a generalization of vector spaces and independence, in prolog. I could program those algorithm in many languages, for example in Lisp, but programming in Prolog was very painful. I think that prolog related programming is a useful tool when the program is similar to those solved by forward chaining but in other cases I can't not see the benefits, the dismissal of Prolog in day to day programming seems to reflect that sentiment.
At http://blog.ruleml.org/post/32629706-the-sad-state-concernin... Kowalski summarizes his theory of the classification of rules (within production logic systems) in to a triple typology, and suggests that the last of these types, which he terms reactive rules, are more fundamental, and "the driving force of life". These are rules which define a subsequent action or state from current conditions, ie. "if hungry then eat".
To fully grasp the idea it is important to understand the different natures of logic programming versus imperative/procedural programming... there is not really an if-then-else-style (ie. control flow oriented) program state. Rather, the programmer tends to throw a bunch of formal rules at a 'solver' which simply determines the result.
I've always thought that someone armed with an efficiently implemented Logic Programming Language could sweep through the first few rounds of competitions like Google Code Jam.
[+] [-] notthemessiah|9 years ago|reply
I also recall a Minecraft mod called ComputerCraft where you program a "Turtle" (a la Logo) to perform automated digging actions, but the task of programming it in the easily-embedded Lua proved somewhat inconvenient for simple actions, if only for the ALGOL-style syntax. Another mod tried Forth, but get the sense that while one could be productive in Forth, it's a lot to learn.
The developers have already incorporated it in a proof of concept game: https://bobthesimplebot.github.io/, but I could imagine RTS style games or mods where you not only have to scavenge for resources, you also program your bots to do your bidding, like Dwarf Fortress with programmable drones instead of independently-minded Dwarves.
[+] [-] ekidd|9 years ago|reply
Something about these extreme restrictions and the simplicity make for excellent, puzzle-style gameplay. And I think you could add a Shenzhen I/O-like "microcontroller" to a lot of automation games (like Factorio: https://www.factorio.com/) and it would work very well.
I think that one of the problems with adding traditional programming languages to games is that there are no constraints to make it challenging, and that you can write fairly large programs. But a deliberately limited and simple language could be fun.
[+] [-] cpdt|9 years ago|reply
Sounds sort of like Screeps [1]. It's an MMO game where you write scripts in JS to control different robots (so, not logic programming, but still pretty fun with lots of depth). Parts of it are also open source [2].
[1] https://screeps.com/
[2] https://github.com/screeps/screeps
[+] [-] jefurii|9 years ago|reply
There's also OpenComputers https://github.com/MightyPirates/OpenComputers
[+] [-] nickpsecurity|9 years ago|reply
http://blog.ruleml.org/post/32629706-the-sad-state-concernin...
[+] [-] trapperkeeper79|9 years ago|reply
[+] [-] saosebastiao|9 years ago|reply
[+] [-] tannhaeuser|9 years ago|reply
Prolog, OTOH, is as minimalistic and pragmatic as ever, with many implementations around, based on an ISO standard even. There's a slowly evolving initiative to come up with an extended standard library across Prolog implementations (eg. Prolog Commons). Though as you might know, Prolog doesn't solve hard problems in itself; rather, it gives you a Turing-complete language based on backtracking, negation-as-failure, closed-world reasoning, and extra-logical mechanisms as primitives to build more interesting reasoning or planning/optimization problems on.
[+] [-] ansible|9 years ago|reply
For some kinds of video game agents, traditional logic programming might be fine.
But for anything that I would consider using in the real world, I would want to use probabilistic knowledge representation and reasoning.
Even for many kinds of video games you'd want that instead. Like in a first person shooter where the agents have limited knowledge of the world state, you want to be able to reason about the other player's position and status without cheating, so that the agent can be more realistic and fair.
[+] [-] fspeech|9 years ago|reply
http://www.doc.ic.ac.uk/~rak/papers/newbook.pdf
Computational Logic and Human Thinking: How to be Artificially Intelligent
"This earlier draft of a book of the same title, published in July 2011 by Cambridge University Press, presents the principles of Computational Logic, so that they can be applied in everyday life. I have written the main part of the book informally, both to reach a wider audience and to argue more convincingly that Computational Logic is useful for human thinking."
[+] [-] mosqutopi|9 years ago|reply
[+] [-] andrewflnr|9 years ago|reply
[+] [-] contingencies|9 years ago|reply
To fully grasp the idea it is important to understand the different natures of logic programming versus imperative/procedural programming... there is not really an if-then-else-style (ie. control flow oriented) program state. Rather, the programmer tends to throw a bunch of formal rules at a 'solver' which simply determines the result.
[+] [-] Gormisdomai|9 years ago|reply
http://lpsdemo.interprolog.com/example/lpsExamples.swinb
I've always thought that someone armed with an efficiently implemented Logic Programming Language could sweep through the first few rounds of competitions like Google Code Jam.
[+] [-] hbk1966|9 years ago|reply
[+] [-] someone79879|9 years ago|reply
[deleted]