Author Topic: Rule libs for managing statuses & attributes?  (Read 8299 times)

dscreamer

  • Rogueliker
  • ***
  • Posts: 65
  • Karma: +0/-0
    • View Profile
Rule libs for managing statuses & attributes?
« on: October 22, 2016, 10:54:54 PM »
Hey, everyone.  I made this lib(https://github.com/derrickcreamer/Hemlock) and I've been wondering about similar projects (any lib that attempts to create relationships between simple values, I suppose.)

Have you created or used anything similar? If so, did it turn out to be useful?

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Rule libs for managing statuses & attributes?
« Reply #1 on: October 23, 2016, 08:04:03 AM »
This looks pretty nifty, thanks for sharing. I haven't done anything that complicated, but I tinkered a bit with miniKanren (wrote a little blog post about it too: https://engineersjourney.wordpress.com/2016/04/06/wishful-coding-adderall-traps-and-items/). It was much more simpler idea than yours, but could run rules to both directions (drinking this potion will slow me, does drinking this potion make me slow? what can I drink to be slowed? what does this potion do? and so on). Grand idea was to use it for AI stuff and goal finding, but I didn't quite get it to working as I wanted.
Everyone you will ever meet knows something you don't.
 - Bill Nye

dscreamer

  • Rogueliker
  • ***
  • Posts: 65
  • Karma: +0/-0
    • View Profile
Re: Rule libs for managing statuses & attributes?
« Reply #2 on: October 24, 2016, 06:03:28 PM »
This looks pretty nifty, thanks for sharing. I haven't done anything that complicated, but I tinkered a bit with miniKanren (wrote a little blog post about it too: https://engineersjourney.wordpress.com/2016/04/06/wishful-coding-adderall-traps-and-items/). It was much more simpler idea than yours, but could run rules to both directions (drinking this potion will slow me, does drinking this potion make me slow? what can I drink to be slowed? what does this potion do? and so on). Grand idea was to use it for AI stuff and goal finding, but I didn't quite get it to working as I wanted.

Ah, cool! Just what I was hoping to see -- this is definitely in the same spirit.

That AI stuff does sound challenging...very interesting.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Rule libs for managing statuses & attributes?
« Reply #3 on: October 26, 2016, 08:19:55 AM »
I haven't completely given up hope with learning miniKanren and Adderall, but I'll tinker with something else for a bit and then get back to representing some of the interactions with miniKanren. I really like the idea that I can use the same code to both implement interactions and to reason about them. And since it would be relatively generic system, adding new items wouldn't necessary mean that I have to mess around with AI code.
Everyone you will ever meet knows something you don't.
 - Bill Nye

Serin Delaunay

  • Newcomer
  • Posts: 13
  • Karma: +0/-0
  • they/them/their
    • View Profile
    • itch.io
Re: Rule libs for managing statuses & attributes?
« Reply #4 on: October 26, 2016, 10:32:45 PM »
I recently started on a prototype for a Python library that creates relationships between simple values. It was targetted more at incremental game mechanics than roguelikes, but the idea was that you could set variables and combine them into new ones, and you could later change any of them and have the new values propagate changes. Like a spreadsheet with variable names instead of a cell grid.
So you could do things like this:
Code: [Select]
Strength = Variable(18)
WeaponDamage = Variable(10)
RealDamage = Strength + WeaponDamage
print(RealDamage) #28
Strength += 1
print(Strength, RealDamage) #19, 29
I made wrappers for all the functions in the math module, a fake Boolean class that returned the correct result from the unary ~ operator (since Python boolean operators aren't compatible with this concept), and started on support for containers wrapped in this kind of Variable object.
But I couldn't figure out how I wanted iteration to work (if I wanted it at all) or what syntax I wanted to reuse groups of variables and make systems change over time. I decided to skip solving for unknown variables, since that's what SymPy is for.

The project is on the back-burner for now, because it won't be useful in my procjam or NaNoGenMo projects.
« Last Edit: October 27, 2016, 11:35:05 AM by Serin Delaunay »