Temple of The Roguelike Forums

Development => Programming => Topic started by: dscreamer on October 22, 2016, 10:54:54 PM

Title: Rule libs for managing statuses & attributes?
Post by: dscreamer on October 22, 2016, 10:54:54 PM
Hey, everyone.  I made this lib(https://github.com/derrickcreamer/Hemlock (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?
Title: Re: Rule libs for managing statuses & attributes?
Post by: tuturto 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/ (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.
Title: Re: Rule libs for managing statuses & attributes?
Post by: dscreamer 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/ (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.
Title: Re: Rule libs for managing statuses & attributes?
Post by: tuturto 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.
Title: Re: Rule libs for managing statuses & attributes?
Post by: Serin Delaunay 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.