Saturday, March 29, 2014

Creatures 3 In Docking Station

After a really long hiatus and after running around in circles to fix a really strange error with my DS, I think I'm ready to go back to playing Creatures. And lo and behold, I have something that isn't a release that I think is worth posting about!

The above picture looks fairly normal at first glance (apart from being maximized on my computer's crazy huge resolution). However, look a little closer. Where'd all the favorite place icons go? Why is the DS welcome screen showing up in C3?

Well, in my usual insanity, I decided to see if Docking Station could load an undocked Shee Ark, as an extension of an old project to get C3 to load with DS's engine. In the past, such an endeavor was attempted by replacing C3's engine.exe file with Docking Station's, which was woefully unsuccessful (the result was an unpassable catalogue-related error).

For this approach, I decided to mess around with .cos files instead of .exe files. So I ripped a completely unmodified "001 World" folder from my Creatures Trilogy CD (for those of you who don't know, that's the folder that holds all the files for the agents of a C3 standalone world at startup). Then I did the following things:
1. Applied Vampess's fixes to it.
2. Compared it to the "010 Docking Station" (DS's equivalent to the "001 World" folder). Any C3 .cos file that had an equivalent in DS (for example, "creatureBreeding.cos" and "DS creatureBreeding.cos") got deleted and replaced with the DS counterpart.
3. DS also had a few improved scripts for C3 agents (such as the Creator) for use in docked worlds. I took these scripts and replaced the originals in the C3 .cos files with them.
4. Made some alterations to DS's Welcoming Screen to account for the differences between C3 and DS.
5. Finally, I renamed the altered "001 World" folder to "010 Docking Station," replaced the original "010 Docking Station" folder with it, and made a new DS world.

Unbelieveably, instead of some error complaining about invalid map positions or catalogue errors, the result was a completely functional C3 world using the DS engine. All the C3 agents work as they do in C3 standalone. Even the bioenergy feature works.

However, adding new agents to this world isn't quite as easy. As can be expected, the C3 Creator looks for C3 agents, not DS agents. Even though this is technically Docking Station, the stuff that shows up in the Creator are C3 agents. This isn't a big problem, but trying to inject one of these agents can cause problems if it has a separate .catalogue file for both C3 and DS (for example, the Grendel Upgrade) and the DS version of the agent was previously injected into a DS only world.

So the Creator also needed to be modified to look for DS agents instead, and that proved to be another surprisingly simple task. When reading agents, the C3 creator looks for the PRAY chunk "AGNT," which indicates a C3 standalone agent. DS agents, meanwhile, are indicated by the PRAY chunk "DSAG." Getting the Creator to read DS agents was a matter of replacing all mentions of "AGNT" with "DSAG" in its .cos file.

And just like that, the Creator loads DS agents.

There's further complications involved in this process, however. Apparently, the animation routine some DS agents use is different from C3 agents. When the Creator tries to read one of these agents, the result is this:

Considering the Agent Injector can read these .agents files just fine, I think fixing this is possible; just look at how the Agent Injector handled it and fix the Creator likewise.

Even after that, there's still a few things here that make this whole affair awesome, but impractical in the long run:

1. Most agents (including my own) that are compatible with both C3 standalone and DS use the "gnam" command when determining where to place an agent. In Docking Station, this usually means placing the agent in one of the DS areas (like the Meso). This world, while only having C3 areas, is still a DS world. So the "gnam" command interprets it as a DS world and tries moving the agent into a nonexistent DS area. You can probably guess what happens afterwards.
Unfortunately, fixing this means fixing loads upon loads of agents to determine placement through other means, and ultimately I don't think it's worth the effort.

2. C3 standalone, obviously, has no online functionality. The same is true of this world. While I could move some things concerning the online functionality over without causing issues, most of DS's online is focused in the Comms Room and Workshop. Trying to find a place to put online stuff onto the Shee Ark is again more trouble than its worth (since it involves extra spritework, among other things), and copying it over whole-cloth creates "invalid map position" errors. So worlds created in this manner cannot get online, or at least not completely. Granted, this doesn't matter so much now with the lack of a functioning DS server, but if one of those projects to bring DS back online ever succeeds, it will matter then.

3. This probably goes without saying, but making docked worlds with the new Bootstrap folder in place is a seriously bad idea. If the result isn't outright errors, it's at least going to create loads and loads of duplicates. Granted, this is just guessing; I actually haven't tried to do this since changing the folders, but I certainly don't want to.

This was a fun little experiment, though; I'm probably going to make a few proper worlds in this manner. I might even share the new bootstrap folder if I manage to fix the Creator error mentioned above (and change a few things around with the DS welcome screen so that the other options work properly).

Before anyone asks, I have no intentions of trying to do this the other way around (that is, trying to get C3 standalone to load the Capillata). DS can run anything C3 has coded just fine; however, C3 cannot just run any DS agent just fine as DS has a lot of CAOs commands that are exclusive to it, and these need to be replaced with a C3-friendly equivalent for use in C3 standalone. Furthermore, I just don't see the point - the Meso is really the only area that might be useful in C3 standalone; the Comms and Workshop are completely useless thanks to C3's lack of online functionality. It'd just be a lot of work for too little reward.