Wednesday, June 29, 2011

Older Highgen Generator

As per request, I'm posting an older version of my Highgen Generator script up here.

This one is much slower and sloppier, but as I mentioned before, the purpose of the script was to create highgens as fast as possible, and that meant sacrificing any interest in the actual creatures. Older versions of the script actually spliced creatures with themselves or parents/siblings instead of a random first-gen genome, which allowed for mutations to carry down the line. However, it came with a whole lot of problems, the most prominent of which being that since creatures didn't have to be alive to be spliced (and culling stillborns slowed down the process of getting highgens), I ended up with thousands of creatures that were not only dead, but mutated to ridiculous extremes.

I basically had a few choices-- I could be content with dead norns, I could set the mutation rate to zero and have the creatures never change through the generations, or I could splice them with first-gens instead of themselves. I found the latter to be the most interesting option I could choose without sacrificing speed, so that is what the current script does.

However, for those of you that care less about highgens and more about interesting creatures, I will provide this older version. It includes a check that culls stillborns, creates three creatures at a time instead of one (to provide as backups in case of stillborns), and exports about every hundreth creature instead of every thousandth (but instead of only exporting creatures that end in "00" it basically gives every creature a 1% chance to be exported, so the actual generations that are exported are random).

Keep in mind that creatures resulting from this script are still very likely to suffer a lot of handicaps, since they still don't need to be able to move, eat, sleep, breed, etc in order to be spliced. So you are still pretty likely to end up with sliders, creatures stuck in certain ages, creatures unable to perform basic functions, and so on. But hey, at least they'll be alive.

You can download the old script here. As always, use at your own risk. This version hasn't been tested very well at all.

Be sure to post some of your highgens and other interesting creatures to TCR and show them off! I'd be interested in seeing what creatures you guys are producing.

Monday, June 27, 2011

Project Underground UI

I'm still really bored.

Even though I don't see myself ever getting anywhere even slightly close to ever making any real progress on Albia's Underground, and it's more or less just another one of those insane dreams, I have sort of been entertaining delusions of progress by working on the UI for it, at least-- you'll have to click the thumbnail to see:



So I started with an LNA-esque status window, only coded about a thousand times better.
There are buttons to scroll up and down, shift-clicking takes you to the bottom or top of the log, ctrl+clicking makes the window bigger/smaller so you can adjust it how you like it, and shift+ctrl clicking lets you adjust the transparency of the window however you like it. The X lets you clear the window(more specifically, it prompts you to shift+click it after clicking it once normally to prevent accidental clearing) if it gets too long for your liking or starts to slow down the world, but old logfiles are saved in the journal folder.

It logs whenever the world is opened, saved, and closed, and makes a note when a world is opened after a crash. If I ever get far enough to write the scripts to support actual creatures, it will log the same stuff LNA does, when creatures are born, breed, die, and other world-specific events like tunnels collapsing.

I find myself a little stuck on developing the rest of the UI because I'm still not sure how I want to handle how and which creatures get tracked. If you read my long ramble about this world, you'll know that in this world there will be your own, tame, trackable creatures and then "wild" creatures that can't be selected, but I have yet to work out who is and isn't selectable and why, and how a creature becomes selectable, but I haven't quite found a solution that quite fits what I am wanting out of this world.

I want wild creatures to inspire feelings of curiosity, mystery, and caution. I don't want you to be able to select them once you discover them-- that would defeat the point. I would like to have some system that allows you to eventually select them, but I don't want to have to implement some sort of mundane activity that you repeat in order to try to win their trust or something. I may just end up finding some way to track how much a wild creature interacts with your tame creatures and then allow wild creatures to become selectable after some period of time.

At the same time, I want to avoid a "collector" mentality. I want to get attached to the creatures I do have, ideally enough that I don't feel the need to tame every strange creature I come across. I have thought of implementing a hard limit of creatures you can track at one time, but some part of me just doesn't like setting hard boundaries like that. Another idea would be to just have some sort of penalty, something that makes the game more difficult the more creatures you are tracking. Perhaps if you don't spend enough time with a tame creature, it has the chance to turn wild and become unselectable.

I like that idea in theory, but I don't want to feel like, "oh I better tab over and tickle this creature so it doesn't run away." I want the play experience to be an immersive one, where I can go about caring for my creatures without having to be conscious of the scripts in the background.

But maybe if I can script it reasonably enough, the flow of selectable creatures will be fairly natural-- the creatures I grow attached to and enjoy watching will become trackable, and the creatures that I really don't find that interesting will become wild, and it won't really feel like a huge loss anyway.

I don't know why, but I take a lot an awful lot of joy in working out concepts for things, even if I know they are unlikely to ever actually be put into action.

Sunday, June 19, 2011

Highgen Generator

The DS server is down, and I am bored to death.

So I've gone and written another script. Many of my scripts exist to accomplish a certain purpose as fast as possible, and this one is no different! This one just exists to generate high-generation creatures.

When you inject it, it starts by emptying your world of most objects so that it can spend most of its resources generating creatures instead of worrying about other scripts-- this includes removing elevators and doors, so you'll want to start a new world specifically for this purpose before injecting it.

The script will then check your world for the youngest creature. If there are no creatures in your world, it will attempt to import the last creature that was exported. If there are no creatures to import, it will pick a random genome from your genetics folder and make one.

The script will then either kill or export all other creatures in the world. It's set to only export creatures of generations in multiples of 1000, and kill the rest. Otherwise, the script would be generating thousands of export files, which can really take of space, not to mention just clutter things. Exporting every 1000th creature provides a bit of a save point in case the world crashes or your creatures get autokilled, and allows you, if you wish, to track the changes over time.

Once only one creature is in the world, the script splices the creature's genetics with a random genome in your genetics folder at an average mutation rate to create a creature of the next generation. That new creature is now targeted, and the script repeats itself indefinitely, creating higher and higher generations of creatures.

On my computer, in fast ticks, it generates a thousand generations about every 6-7 minutes. Of course, this will vary according to your computer's speed.

Keep in mind that worlds running this script tend to take up a bit of space since hundreds of genetic files are being generated every minute. If you run the script for say, days at a time, you may find your world's folder bloated to a gigabyte and beyond, so if hard drive space is an issue for you, keep that in mind and delete/recreate the world every so often. The script will pick right up from the last exported creature.

What did I do this? I don't really know. Part of me wondered if the generation counter would break at a certain number, I guess. Part of me just likes to see numbers go up. But mostly, I was just really, really bored.

Anyway, if you want to join me in this relatively pointless boredom-induced number generating, get your copy of the cosfile here (right click, save as). As always, use at your own risk!

Saturday, June 4, 2011

In which I ramble forever about more things I will never do.

When I look through all my notes and ideas and wishes for changes to DS, sometimes I seriously want to just rewrite DS from near-scratch, using only the engine, the graphics, and perhaps the CFE genome (though it would have to be heavily edited still. I have learned a lot about the inner workings of Creatures, but the creatures' brain is the one thing that remains such a mystery to me that I know I'm best off leaving to the experts) and making DS just the way I would like it.

I know I don't have the time or skill to do such a thing, but I like to dream about it anyway, and sometimes, write up an ideal scenario of what the game would be like if I did. I just... really want creatures to be an adventure again. I want to recapture those feelings I got when I first started playing, the feelings of adventuring into the new and unknown, of closely nurturing creatures to both protect them from the dangers of the world and teach them to avoid them for themselves.

So just for fun, here is a backstory and yet more weird ideas that I will never be able to fulfill:

***

Albia is not what it used to be, and the Shee are to blame.

Thousands of years after the Shee had well-established themselves on their spherical planet, a few reckless Shee decided to break laws and ordinances that forbade them from going back, and did just that. With absolutely no respect or care for the planet's balance or the well-being of the creatures that inhabited it, the rebellious Shee treated the fragile world as a mere playground, making repairs to the old splicer, rounding up the norns, ettins, and grendels to splice, clone, genetically modify, and splice again, creating hideous creatures of absolutely no distinguishable species purely for their own amusement. The Shee also brought in genetic samples from their home and let loose new life on Albia; terrible beasts and toxic plants that had adapted to a much harsher (and larger) world than than this one, and had no problems thriving, completely infesting the world, ripping apart the native plants and animals to claim the tiny planet as their own, devouring both the careless Shee and the majority of their experiments.

Luckily, a hundred or so of the spliced creatures managed to flee underground-- the only place safe from the monsters that had complete dominance of the surface. There they banded together, for there was no difference between them anymore; they were all mixed freaks now, and neither had more norn, ettin, or grendel blood in them than the others. But there were so very few of them, and they quickly realized that as the only survivors, they had to repopulate in order to keep as least some semblance of their kind alive. But their genetics worked against them, and it appeared that only three of the females in the entire group were fertile. So it was that every creature descended from one of three mothers: Glias, Lyth, or Kir.

Though the creatures began their new lives as one united species, it sadly did not continue that way. Perhaps a drive to claim one's own kind as genetically superior just runs far too deeply in the hearts of all the Shee's creations, for it wasn't long until the once allied creatures divided themselves according to their heritage. Though the bloodlines were still visually completely indistinguishable from each other, they nonetheless grouped into their own clans and fought amongst themselves to claim territories and food sources in the large networks of underground tunnels they had once created together.

As the horrifying beasts above continued to rampage, the creatures learned to avoid Albia's surface at all costs. The earthquakes created by the monsters quite often damaged and caved in many of their underground hollows, and the creatures struggled to both defend their territories and keep them intact.

You, the all-seeing hand wandering these tunnels, discover an abandoned nest that has been cut off from the rest of the tunnels by one of these quakes. The two orphan eggs remaining could hold creatures of any descent. Perhaps if you care for them, watch them carefully, and follow them, you will learn more about the strange tribal culture that has evolved in Albia's Underground.

***

The first thing I would do is get rid of the breed/species distinctions. There would be no norns/ettins/grendels, instead those genus slots would be used to distinguish between the three tribes, which would be genetically identical other than being outwardly hostile towards creatures not of their tribe. Technically, they would still be able to befriend each other and interbreed, but would certainly not do so naturally.

Your initial two creatures would have their tribe picked at random, and be generated semi-SERU-style, basically picking from 16 genomes of that tribe, all of which would be genetically identical except for their sprite assignments, and mashing them together with at zero (or rather small) mutation chance. So basically, the creatures would be born genetically stable, but completely random appearance-wise.

You would start out in a tiny cave, a single metaroom with the basic supplies to teach, feed, entertain, and raise your first two creatures. However, when your creatures get on their feet, learn the basics, and start getting restless, they start -digging-.

There's quite a bit of a random element in this ideal-world. I guess that is because, to me, keeping things new and constantly changing is what keeps things interesting. As an added bonus, generating things randomly means I have less to design, and personally, the aesthetics of the game is much less important to me than the inner-workings. But stepping back a bit to explain:

The world map would basically consist of a series of ideally 50 or more tiny, single-level metarooms. These would likely be 5-10 basic rooms that are just repeated (like a basic small cave, a large cave, a narrow tunnel, an underground pond, a (very dangerous) surface area, etc etc). However, when the world is created, each room would pick randomly from several backgrounds, foregrounds, plants, and wildlife to make each area unique. Every world would be different.

But back to where I was, when you start out, you would only have one room. Eventually, your creatures would dig a tunnel that would essentially be a door to another random room. Creatures would dig when they are crowded or scared or territorial. More than one tunnel could be dug from most rooms, so there would be multiple branches. Theoretically, eventually, creatures would dig through the the entire system of rooms, but occasionally earthquakes would destroy the tunnels, so the pathways would be relatively dynamic. Furthermore, occasionally rooms that had been completely cut off from the rest of the tunnels would re-randomize themselves to create the illusion of infinite areas to discover. You would only be able to visit rooms that your creatures would be able to access.

But your creatures wouldn't be the only ones digging. There would be other creatures, wild creatures that you couldn't initially select, that are off in their own tunnels, digging, breeding, and carrying out their lives. These would also be of randomized tribes.

I am toying with a few ideas for how I would handle the "wild creatures" aspect. My initial idea was to just allow you to select them as soon as you saw them, but that would completely take all the excitement out of an encounter with a stranger, and that's something I really want to maintain. Another option is to have some process you have to go through to befriend or tame a creature in order to be able to select it, but I feel like that might eventually become a nuisance. Currently I'm stuck on the idea of having a limit of creatures you could track at a time, eight or so maybe, so while it would be easy to start tracking a stranger, it would require losing track of another creature, so you would have to play favorites and choose carefully. But even that sort of pigeonholes me into a role I may or may not want to take all the time. So I'm still thinking about that.

I don't want to restrict who is selectable based on tribe. I think that even though the basic instincts of the tribes are to hate and fight each other, the idea of raising a mixed group that lives together (relatively) comfortably should still remain an option. Though ideally, the player would grow a bit of a natural attachment to their starter tribe.

Home smells and territory would play a role in this whole tribal clashing thing. The longer an area is inhabited by a certain tribe, the more that area would start to smell like that tribe's home. Creatures would generally feel more comfortable in their own home and want to stay in those areas when they are not feeling well. Meanwhile, strong, healthy, and territorial creatures may explicitly seek out other areas to claim for their tribe.

Territoriality is a strange sort of "sympathy drive" I want to introduce. It's a drive maintained by an external script that assesses the general comfort of the local tribe population based on their average anger/fear/crowded/etc drive levels and then silently adjusts the territorial drive of each creature to match. Thus, the drive won't actually go down until the tribe as a whole is happier, but creatures could reduce the drive for themselves temporarily by doing things that might help their tribemates feel comfortable, like digging tunnels, approaching enemy territory, hitting enemies, and so on. I'm thinking about two of these if I have the slots, one for tribal discomfort and one for tribal hunger.

Food, I want to be a resource that has to be maintained to an extent. I don't want it to be impossible to come by, but I don't want it to be plentiful and everywhere. Food is something that creatures would actually have to forage for. Digging in shallow soil or pushing a plant may yield something edible-- sort of like a chance-based vendor. Since creatures would be instinct-less based, they won't have the half-strength instinct trick to properly use vendors. Instead, the tribal hunger drive would be what drives a creature to forage.

Since I mentioned instinctless creatures I feel that I should elaborate a bit on that. Creatures would have no genetic instincts. The wild, unselectable creatures that are generated however, would have some scripts kickstart basic instincts into them just so they are viable. But the creatures that you raise would have to be taught everything. They would find out on their own that eating reduces hunger, pushing toys reduces boredom, hitting enemies reduces tribal discomfort and so on, but only if they try it-- and they are unlikely to try it unless the hand tells them to. Your creatures essentially won't be able to survive without guidance, and creatures would act quite differently depending on what they were taught as younglings. The lack of genetic instinct also means it would be entirely possible to raise peaceful cohabiting tribes if you did so from non-feral creatures, because you could teach them peaceful ways to reduce their anger and territoriality. Handling angry feral invaders would still be a problem, however.

But creatures would have other things to set them apart from others aside from their upbringing. The action scripts and genetics would be written in such a way that a creature's reaction to a certain action wouldn't be entirely hard-coded into their genetics. Upon birth, each creature would be assigned a unique set of characteristics-- some hereditary and some random, that would act as filters on how they see the world.

These characteristics come in the form of percentages. A creature with a "pushing toys reduces boredom" characteristic of 100% would receive the normal amount of boredom reduction when they push a toy. But a creature might have a filter of 50%, meaning they simply don't find toys very interesting, and would only receive half the boredom reduction from them. Most creatures would have fairly average percentages-- between 75~125%, but a few of them would stretch further. These characteristics should ensure that no two creatures are really the same.

Creatures would have randomly generated quirks, too. These are along the same lines as characteristics, but instead of being more or less percentages of average things, they would be additional and somewhat strange things, like a creature that gets a boredom decrease in addition to a hunger decrease from eating food, or a creature that gets a fear increase from pushing creatures. These quirks shouldn't be too crippling to a creature's well-being, but should serve the same purpose as characteristics-- to give individual creatures a little bit more personality.

Since these are all done through action scripts instead of genetics, they also have the potential to change over time, though I'm not sure the average creature lives long enough to warrant that.

Really, I want to make a lot of things script-based to cover flaws in genetics. For example, genetics would not determine (as much as I can help) when a creature dies. A sort of reaper script would monitor creatures for low levels of certain critical chemicals, high levels of others, and so on. The script would decide when a creature dies (or passes out, C2-style, something else I would bring back), not genetics, so it would be extremely difficult or hopefully impossible for creatures to mutate into immortals.

Wow. Okay so I've thought way, waaaay too much into this, considering it's something I'll never have the time or energy to actually pull off. But I guess it's just really nice to daydream. A world like this... I think.. I -hope- would be something I could get attached to, that would keep my interest.

What about you guys? If you were to rewrite DS within the limitations of the engine, what would your ideal version be like?