What features would be most important to you in a roguelike library/framework?

I'm taking a stab at generalizing some of the Unity stuff I've done into a general-purpose framework for Unity RLs, and wanted to grab some early opinions from the subreddit.

If you were looking at a roguelike framework/library/template project, which features would be the highest priority for you? How would you want your workflow to be for some common things like creating new creatures/items/skills? Which things would be a deal-breaker if they didn't exist in the framework? I'm especially interested in things you'd consider non-obvious.

Thanks for taking the time to respond!

Posted Feb 14, 2019, 7:14 PM UTC

1613
verdagon•

I think most people love frameworks. Alas, I'm not one of them... I'll give my reasons and then maybe we can come up with some ideas, and then maybe your framework will be the first one that I truly like!

When I code my roguelike, I do it for fun, as an artistic expression almost. The freedom I have when making a roguelike makes it enjoyable. When using a framework, I don't have freedom; my roguelike can only do what the framework lets me do. Thats the tradeoff we knowingly make when using a framework; we get lots of functionality for free, but sacrifice freedom in the areas the framework doesn't yet support.

It also changes the way we program: when coding something from scratch, or when putting various libraries/pieces together, we're figuring out the best and most elegant way to do something we know is possible. When we use a framework, we're often hunting through obscure and arcane documentation to find a way to trick the framework into doing what we want. Some people like that way of programming, but I'm not one of them.

However, there's a big caveat here... if you can guarantee that the user will never reasonably need anything outside the capabilities you offer, then a framework won't feel so constraining. For example, if you made a Unity library that acted like a terminal, and offered the same capabilities, and the user came in knowing that that's all they get, and those are the constraints they agree to, then that's fine. In other words, their expectations are a huge factor. If you make a framework, make a well-rounded set of features, and cut away the features that might raise their expectations for the rest of the framework.

So, all that said, I'm very glad you mention libraries! I love libraries! Precisely because they (usually) don't have this problem. A library is a building block that doesn't spread its cancerous tendrils into the rest of your program. I think that's the most important feature I'd want.

Big question: You mentioned Unity, does that mean that one needs to know Unity to use your framework/library,? Or will that all be abstracted away?

Now, for specifics! I'd personally like:

  • A level generation library! I give it a few parameters like width, height, etc. and it returns to me a 2D array of booleans. The more algorithms it has, the better. If it had options for generating lairs/vaults somewhere in the level, then even better. If it could do cellular automata, with reasonably tuned defaults, then I'd jump on that! I'd also like it to return to me a list of the rooms, so that I could add whatever dungeon features I like.
  • Some sort of building blocks to help my enemies' AI with their pathfinding. My current units stop when they hit another unit. If you can find a non-intrusive way to make enemies' movements smarter, then I'm all ears!

If your framework/library is mostly a helper/abstraction over Unity, I might like:

  • Something to help with animation; it would move the units at the correct pace, stall some animations until other nearby animations are complete, tells me when all animations are done so I can do my next game loop, etc.
  • Something to handle hover/tooltip states when I hover over a unit. That'd be pretty sick.
  • Something to show some information+menu when I click on an enemy!

I happen to be making a Unity view for my already-somewhat-console-based roguelike, so I've been doing a lot of thinking in this area. I'd be happy to compare notes!

13
sparr•

level generation [...] a 2D array of booleans.

Just booleans, for passable/impassable? Nothing about terrain types, doors, room types, entry/exit points (stairs, etc)?

2
verdagon•

Sure, why not, since it's a wish list! My roguelike isn't that complex yet =)

1
KungFuHamster•

I want something where I can just pick and choose what functions I want to use. I don't want a big pot of spaghetti that's already mixed that forces me to use your framework. Sure, make a demo that brings it all together, but let all the functions work by themselves if I just want to use one part.

If I just want a map generator, let me just generate a map without needing the rest of the meal.

Edit: I guess I just want an exhaustive library or set of libraries vs. something that's going to be too rigid for me to change without a lot of rewriting. If you're going to make something that's heavily integrated, you could make a roguelike engine that has a very open and adaptable API.

10

I agree with everything you just said.

1
devilbuddy•

This! It should be non-intrusive to the rest of my code.

1
Atrium41•

This! Essentially, a Framework where you can choose what to include into it. If you want a Weather hot/cold system, it's turned on then you can edit the weather system either through preset values, or a basic view of the weather section of your code/framework where more advanced Python users could change it themselves.

1
verdagon•

A dealbreaker just occurred to me: It has to be completely deterministic. If using C#, that rules out:

  • DateTime.UtcNow (and any other way to get the current time)
  • Random class (unless it's used with a seed, that's fine!)
  • string's GetHashCode
  • Dictionary or HashSet (I might be wrong on these... perhaps they just looked nondeterministic because they were using my nondeterministic GetHashCode functions)

These are all things I discovered are nondeterministic, and nondeterminism leads to non-reproducible bugs. For me, determinism is also a hard requirement for my record/replay and timetravel features, but I don't know if anyone else has this requirement.

5
OronissHalfbreed•

Iteration over a Dictionary or HashSet is non-deterministic, but the C# standard collections library has a SortedDictionary and SortedSet. This allows deterministic iteration over those data structures, and I haven't found the performance to be significantly different.

1
MJBrune•

Honestly, nothing. I am writing a rogue-like in godot and it doesn't have anything really in a rogue-like framework. One thing I have grown fondly of is WaveFunction Collapse. It's basically an algorithm that takes an image or sample map and generates dungeons based off of the ruleset it detects from that sample map.

5

For me it's build tools. There are few things that annoy me more than dealing with build problems before I start coding. I tend to work with C++ so it can be extra annoying when depenacies are just not easily linked or found. In any other language it's a red line. If I'm using a less than native language, I want all of the benefits (ideally cross platform).

My dream toolkit would be a series of modular libraries that don't have too much interdependence, and I can import what only what I need. This would include rendering tools, pathfinding, noise generators and maybe an ecs framework.

3
akaifox•

I tend to work with C++ so it can be extra annoying when depenacies are just not easily linked or found.

Ouch that sucks. Too used to JVM languages (Scala, Java, Kotlin, etc) so that's never been an issue. Isn't there anything like Maven, Gradle, SBT, etc?

1

The problem is that there are a bunch of tools that claim to do all kinds of things.

The fragmentation is what kills it.

There is no clear central location for libraries like maven. There are a not even standard versions of the standard library across compilers

1
[deleted]•

[deleted]

1