Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Adventurer, a C# Roguelike focusing on improvisation, coded by myself  (Read 10649 times)

Kalasen

  • Bay Watcher
    • View Profile
    • Adventurer

So I'm working on a project, and I'd like to share it with all my fellow Dwarf Fortress fans. It's a roguelike much in the vein of things like Nethack. But I have high hopes for it, and I'm working hard on making it better and better. See, I got this idea from the insane complexity of Dwarf Fortress. What is basically a city sim tracks individual combat and body damage better than games built around combat. Dwarf Fortress has more material info than most survivalist kind of games. So from there comes my key inspiration. What if a more standard roguelike was created with such an amazing degree of detail?

Adventurer strives to be the most detailed roguelike ever made. I want it to track physics and chemistry down to an atomic level. And even with all that, it shouldn't have much lag, considering. After all, it's not trying to process an entire city, just an adventurer and the dungeon he/she/shi/xi is in. This game will have an identity all its own, and I'm sure the most Dwarven inventors will come up with a lot to do.

The core gameplay concept is improvisation and invention with what you've found. Rock and a rope? Congrats, you just made a rudimentary flail. Potion of intelligence, potion of levitation, and a sword? Congrats, you've got a sentient flying sword. The player will use their wits to successfully dive deeper, become more skilled, and hopefully live to tell the tale.

The game as it is now has a working map and movement, as well as line of sight and fog of war. It has a proof of concept creature to fight that wanders around. I hope to move from an HP system to a more realistic damage system, once I figure out a way to make it where a lucky shot across the neck won't end your adventuring career.

The game's main page and a download can be found at code.google.com/p/adventurerroguelike and its blog can be found at adventurerroguelike.blogspot.com.

Any and all support is welcome, and greatly appreciated. Again:

Main page:
code.google.com/p/adventurerroguelike

Blog:
adventurerroguelike.blogspot.com
Logged
My Roguelike project, Adventurer, can be found at code.google.com/p/adventurerroguelike and its blog can be found at adventurerroguelike.blogspot.com

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange

Some of those ideas are very interesting.

I suppose DF adventure mode will be very similar to this eventually.

I am curious to see how this comes together.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile

Huh, chemistry? Oh...
Anyway, even with such ideas, I predict that it's going to take a separate AI-like (neural net-like) engine to fully implement inventive combining.
If support includes suggestions, I once again in this forum would like to advertise implementation of 3d6 instead of 1d20 to make extreme lucky shots rarer. This way you can spawn enemies less skillful in combat than the player on a statistical basis. You just put misses and simple swings into the middle, so that a weaker character could easily avoid/block them, and with levels, enemies would grow statistically more cunning, with RNG modifiers. Oh, and today I learned about pointers to functions, that could come in handy here.
Eh, if I could figure out how you start these drat roguelikes, I'd probably give all this rambling a chance myself.
Oh, and a lucky shot could be dealt with with a lucky improvised bandage.
Logged

Soadreqm

  • Bay Watcher
  • I'm okay with this. I'm okay with a lot of things.
    • View Profile

Adventurer strives to be the most detailed roguelike ever made. I want it to track physics and chemistry down to an atomic level. And even with all that, it shouldn't have much lag, considering. After all, it's not trying to process an entire city, just an adventurer and the dungeon he/she/shi/xi is in.
I hate to crush your dream, but this is utterly impossible without precursor technology. To give some perspective, 12 grams of carbon has about 6*10^23 atoms. That's six with 23 zeros on the end. It'd cripple a modern-day university supercomputer by just sitting there. And if you want it to burn into carbon dioxide, you are going to need twice that amount of oxygen atoms, bound into only mostly stable 02 molecules, happily colliding about in the oxygen-nitrogen dungeon atmosphere.

Or, to put it in a less mathy way, if a computer* could simulate more than its own mass at atomic level in real time, that computer could completely simulate itself, and the simulated computer could also simulate a computer, and you could have infinite layers of simulated computing with absolutely no slowdown. Thus, to simulate a dungeon, you will necessarily need a computer larger than the dungeon. Or precursor technology.

As an alternative way of doing things, I'd suggest starting with the most basic of crafting systems, the recipe-based. The one used in pointy-clicky adventure games. Fire + stick = burning stick, metal tube * 5 + wheel * 2 + chain + gear * 2 + pedal * 2 = bicycle. If adding new recipes is sufficiently easy, and you're diligent with it, you can pretty much simulate most things you'd want to do in a dungeon crawl. You can then add extra mechanics for special cases like alchemy and fire and acid.

*That is, a traditional modern computer built of atoms. Quantum computers use some nifty sub-atomic properties, and would have to simulate themselves at the quantum level. Oh, and this is all assuming that atomic simulation includes electricity and magnetism and other stuff like that.
Logged

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile

Welp, I figured "atomic level" was just a hyperbole. However, I urge you to spare some time to look at the Virtual Lab. I've been thinking for quite some time about chemistry on computer, and, although its scope is limited to inorganic solutions, the program accomplishes simulation pretty well and I think I can guess how, that is it has temperature and colour, and solubility. Bringing organics and other forms of matter is tricky, although I have some ideas (one option I can think of involves a lot of database compiling).

And making a bike out of sticks and rings all out of the blue would require some AI on the other end of the interface.
Logged

Soadreqm

  • Bay Watcher
  • I'm okay with this. I'm okay with a lot of things.
    • View Profile

And making a bike out of sticks and rings all out of the blue would require some AI on the other end of the interface.
Well, with recipe-based crafting, everything is done with the magic of hard work. You can make a bicycle out of junk metal because you have specifically specified in the code what a bicycle is and what tools and materials you need to make one. The only problem is that you have to specifically specify in the code what every item is and what tools and materials you need to make one, as well as what it can be used as when crafting other items.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

I don't know how well C# handles macros, but writing a macro for handling reactions might save you quite some work.
Logged

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile

And making a bike out of sticks and rings all out of the blue would require some AI on the other end of the interface.
Well, with recipe-based crafting, everything is done with the magic of hard work. You can make a bicycle out of junk metal because you have specifically specified in the code what a bicycle is and what tools and materials you need to make one. The only problem is that you have to specifically specify in the code what every item is and what tools and materials you need to make one, as well as what it can be used as when crafting other items.
You know, I think Spore goes somewhere there. The functions of parts are predefined, but you can stick them anywhere you want around the body, and it'll work coherently (or almost). You can do this with sticks and rings, too. A stick can have several functions or applications: it can be a static part, or a lever, for example. A ring can be... a static part, or can be attached to an axle. The remaining part is to make them work together coherently (or almost).

But to figure it out, the program with have to do a 3d simulation in the background. And it's kind of a waste of 3d, if it turns the results into the roguelike format afterwards.

I don't know how well C# handles macros, but writing a macro for handling reactions might save you quite some work.
Could you elaborate, or illustrate? I'm not much of a programmer, of course, but from what I know about macros, they are used for rather short pieces of code... No? There you're going to be dealing with several variable objects.
Logged

TomiTapio

  • Bay Watcher
  • OldGenesis since 2012
    • View Profile
    • My Flickr animal photos

The core gameplay concept is improvisation and invention with what you've found. Rock and a rope? Congrats, you just made a rudimentary flail. Potion of intelligence, potion of levitation, and a sword? Congrats, you've got a sentient flying sword. The player will use their wits to successfully dive deeper, become more skilled, and hopefully live to tell the tale.

once I figure out a way to make it where a lucky shot across the neck won't end your adventuring career.
Prevent end of career? Amulet Of Life Saving from Nethack.
Make neck armor from rock and rope! Millstone+rope = heavy-duty shield.

Better yet, millstone + Potion of Spark of Life = millstone companion.
rock+rope = big cat toy.
two rocks + rope = a bola weapon to tie enemy legs.
rock+rope = a sling for throwing smaller rocks.
leather+rope = a kite for windy location to recharge your wands of lightning.

I figure you'll have to hard-code each combination so it won't be much invention as discovering what crafting recipes have been built into the world. Have a "dust of enchantment" as a common recipe component.
Logged
==OldGenesis mod== by Deon & TomiTapio. Five wood classes, four leather classes. Nine enemy civs. So much fine-tuning.
47.05e release: http://dffd.bay12games.com/who.php?id=1538
OldGenesis screenshots: https://twitter.com/hashtag/OldGenesis?src=hashtag_click&f=image
My Finnish language file: http://dffd.bay12games.com/file.php?id=14884

Lemunde

  • Bay Watcher
    • View Profile

Sounds ambitious.  I can't wait to see what you come up with.


I figure you'll have to hard-code each combination so it won't be much invention as discovering what crafting recipes have been built into the world. Have a "dust of enchantment" as a common recipe component.

I don't think he'll necessarily need to hardcode every combination.  If you accept that each item is made of one or more base materials and each material can be used to craft an item you can have all sorts of combinations.  This way it wouldn't be too far fetched to create a piece of armor from a sword and an axe and have a couple of pieces of wood left over.

To simplify matters you could require the player to break down an item into it's individual materials before they can construct an item from it.
« Last Edit: July 05, 2010, 02:59:20 pm by Lemunde »
Logged

Kalasen

  • Bay Watcher
    • View Profile
    • Adventurer
Re: Adventurer, a C# Roguelike focusing on improvisation, coded by myself
« Reply #10 on: July 05, 2010, 06:01:35 pm »

I'm just about done with the pathfinding code for now, I'll probably do a few more quick additions, then I should have a new version up tonight.

And yes, the crafting system is going to be getting a lot of love throughout the process. Actually, I intend to implement a lot of different approaches to it at once. There's going to be a base material system; the 'components' and 'compounds' that make up an object, from an object oriented standpoint. So that you could potentially break down an axe into an "iron wedge" and a "wooden stick", which are in turn made of wood and iron, which in turn track what kind of molecules and atoms the material  is made of and how much of the stuff there is.

Then there's the crafting aspect. Suppose you had the means to get the iron's temperature hot enough, like a pool of magma. You could melt that iron wedge down, and if your character had enough metalworking skill and the right tools for it, could re-craft the lump of iron into something else, like some iron arrows. I like Lemunde's take on that.

Chemistry will come into play as well. I've taken a chemistry course, and I understand the principles of stoichiometry (calculating whether compounds react, and if so, what they form, and how much). I won't have to have the computer track if any particular molecule is reacting with any other particular molecule. It just needs to know how much baking soda has collided with how much vinegar, then the internal calculations can figure how much of what was produced. So those metal-corroding acids? It can handle that without any hard-coded reactions.

Speaking of hard-coded reactions, I don't see why not. While the chemistry and materials system will handle a lot, I can have the game import a list of items and a list of reactions, much like the Dwarf Fortress raws do already with creatures and stuff. Then, when you tell the game you want to combine a piece of cloth and a rope, it'll tell you all the different outcomes of that reaction you can go for, like making a sling. If your character is skilled enough to do it, that is. I also see different quality levels coming from this; a character may be just barely skilled enough to make that sling. In which case its stats will suck. Or maybe they're a master of crafting stuff out of rope, cloth, and skilled with slings. In which case it's likely to be an exceptionally good improvised sling.

And on another note, the Amulet of Life Saving concept was the most obvious thing that came to mind. Perhaps something like enchanted gems of life saving, that you're more likely to find the less you have, so that you're only likely to be carrying one or two at a time. That way, if the wrath of RNG hits you, it won't be another annoying unpreventable death. But on the other hand, it's just disintegrated your life gem to save you, so if you've gone into a bad situation where it's not just possible, but likely to die, you'll just get hit again with lethal damage and die.

All this is still off in the future, but I should be moving on to putting items into the game next. They'll track what material they're made of and stuff, I'll get to doing stuff like combinations later on. Thanks for all the ideas!

EDIT:
Version 0.0.0.2 is UP! The pathfinding was one of the longest continuous segments of code I've had to work on. Nearly three weeks of work. It uses A-Star with a sequential search to find the lowest F cost. In more layman's terms, it finds the best route possible with a relatively low amount of work. I first intended to use binary search, which is even faster, but it would be harder to implement and would have stretched out the pathfinding project even further. If I need more speed, I'll fix that up later.

Also, I added a nifty bit of code that I got the idea for here:
http://www.bay12forums.com/smf/index.php?topic=60464.60;topicseen

Basically, when the creature loses sight of the player, it goes to the last seen position of the player. I've played with it some, and it's a much more realistic 'chase' feel. Have Fun!

« Last Edit: July 06, 2010, 03:37:20 am by Kalasen »
Logged
My Roguelike project, Adventurer, can be found at code.google.com/p/adventurerroguelike and its blog can be found at adventurerroguelike.blogspot.com

Kalasen

  • Bay Watcher
    • View Profile
    • Adventurer
Re: Adventurer, a C# Roguelike focusing on improvisation, coded by myself
« Reply #11 on: September 14, 2010, 10:19:43 pm »

Hate to necro my own thread, but Adventurer has come a long way. I've fixed almost all the bugs that were keeping people from running it before. It no longer uses XNA, and instead uses SDL. If you can get DF to run, then you should be able to get Adventurer to run. The only two crashes that I've seen have generated crash reports, which are important for increasing stability. I've updated nine new versions since the last post, which includes multiple levels, the beginnings of item crafting, different weapons and armors, and much more.

Again, hate to doublepostnecro, but I've come a long way and a blog comment encouraged me to bump, because he couldn't find the thread looking here.

Links in my sig.
Logged
My Roguelike project, Adventurer, can be found at code.google.com/p/adventurerroguelike and its blog can be found at adventurerroguelike.blogspot.com

getter77

  • Bay Watcher
    • View Profile
Re: Adventurer, a C# Roguelike focusing on improvisation, coded by myself
« Reply #12 on: September 15, 2010, 07:47:29 am »

Sounds like some excellent progress---keep at it and maybe try to rig up some gameplay videos of the new hotness.
Logged

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: Adventurer, a C# Roguelike focusing on improvisation, coded by myself
« Reply #13 on: September 15, 2010, 11:58:58 am »

First ten minutes of play I ate my loincloth and then got some limbs torn off by a super friendly rat. Thumbs up from me.
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044

Arzgarb

  • Bay Watcher
    • View Profile
Re: Adventurer, a C# Roguelike focusing on improvisation, coded by myself
« Reply #14 on: September 15, 2010, 01:31:54 pm »

It's crashing for me when loading atoms on startup. The errorlog says LoadAtoms() (and thus System.Number.SringToNumber()) received an ill-formed string on line 2291.
Logged
Pages: [1] 2