bubble

Announcement - New Name

Sep 24, 2020

The game has been renamed to 'Threat of the Trinity'

Long in the works, and more in line with the content and plot, the game has been renamed to ‘Threat of the Trinity’

This has actually happened more than a year ago. And in fact, was the original title I was going to go with. For various reasons, however, I ended up settling on Advent of the Trinity. However, once development reached a certain point, the logic of original title, the connection to the new quests and ‘plot’ lines, became more apparent. So I changed the name back to the original ‘Threat of the Trinity’.

As you can see the website has been updated with relative graphics here and there. The game has long been using this title, so no change there. I suppose this change will mess up links to this site, and make the game even harder to find via the web. Oh well, it was already obscure enough. Now people really have to work to ever find it!

Threat of the Trinity Development Blog
The new fancy logo!

22 Comments

Alex

It looks to be worth searching for! I am so excited to see this! I began playing Ultima IV in 1984 on my brothers C64. What great memories. I hope you make this widely available; I can’t wait to play it!

Let me know if you need any more testers. Happy to help in any way…

Cambragol

Maybe you found it in the nick of time, as I haven’t changed the URL yet. Being a C64 Ultima IV fan, I assume the new graphics mode doesn’t hurt your eyes. You might also want to check out Ultima IV Remastered, which is the ultimate version for C64, or so I have heard.

I am still on the fence about when and how to distribute, but I may eventually need to get some real Beta Testers. Currently I am just sitting on the finished game, preparing to hit it with some beta-testing by myself.

Alex

I love the traditional C64 graphics. In fact, I was kind of let down in Ultima V when they added more color and detail. Something about the simplicity of Ultima IV will always be the standard.

I am super excited by your game. I’ll keep watching for updates. Thanks for sharing your process!

Cambragol

Yeah, I was the same way. Though, that was only when comparing the Dos Ultima V. The transition from Apple ][ Ultima IV to Apple ][ Ultima V was much smoother. The color scheme remained, the overall feel was the same, but just added more detail, which was nice I thought.

I almost modded in the full Ultima V tileset, but in the end it would have meant sacrificing a lot of content, for mere graphics, something that didn’t seem a good trade-off to me.

Stay tuned certainly, but updates might be a little slower now. Beta Bug-hunting will be a quiet affair, most likely.

Glad to hear you are super excited, as I am actually excited about it too. I always wanted to have something like this for Ultima IV, and I assumed others did too. I won’t really be able to enjoy it, as I created it, but perhaps others can have the enjoyment from it that I always wished for.

Alex

Have you thought of sharing your code so that others could create similar mods? Might be someone will create one for you to enjoy for a change…

I’m not a coder, but I’ve always wanted to do a project like this. Not sure where to start, but your blog inspired me to maybe look into it again

Cambragol

I started this project as ‘open source’, but moved away from that for a couple of reasons. Mainly absolutely no interest from anyone in collaborating, and people mucking about and critiquing the game when it was unreleased. Further, to achieve some of the mystery of the original (especially the Apple ][ version) I didn’t want the code to be accessible. I made a considerable effort to add ‘virtue’ trackers and obfuscate existing ones, as not understanding how they work adds to the mystery and point of the game-play.

I have thought of making ‘hooks’ into the game to allow modders to add towns, random encounters, etc. But…realistically…I doubt anyone will take advantage of it. One of the tools I use was made by George Stepan, who rebuilt Ultima IV in Dark Basic years ago. He made actual editors for the world map, the towns, and the dungeons. But no one took advantage of them, as far as I can tell. (Well….I did, so perhaps my point fails).

I am not a coder myself, and in fact this is the first time I have actually coded anything. (prior to this my only experience was scripting in two ‘game’ languages as part of mods I made). I wasn’t sure where to start myself, but I just pushed into it and didn’t give up. This project took hundreds and hundreds of hours, so if you have the determination, and free time, you could likely pull something off. I’m glad I have inspired you!

I’ll think about releasing the code, or maybe some ‘moddable’ version of what I have built so far. However, it might be easier to just start with the code I started from, which is the decompiled source code, found here:

Ultima IV Decompiled Source

I have even thought of doing a second project with this code, which would be to Ultima V the whole of Ultima IV, adding the complete Ultima 5 tileset and rebuilding towns and maps with it, doubling all the dialogue, day and night cycles and NPC schedules etc. It would be tricky, but could certainly add a lot of life to the original game.

If you do start moving down the path of making your own project, don’t hesitate to ask me for help.

Alex

Thanks for sharing! I don’t know where to begin wtih this, but I’ll poke around. I’ll keep you posted if I make any progress…

I remember 20 years ago or so a guy who went by the name Litmus Dragon had created a program called Dragon Engine that allowed you to build an Ultima IV type game. Very cool, but eventually he abandoned it. You can still download his last version:

http://reconstruction.voyd.net/index.php?event=project&typeKeyword=engines

cambragol

Hmm..checked that Dragon Engine out, but it wouldn’t work on windows. I’m even running XP, still didn’t work. It’s too bad, both that it doesn’t work, and that it was abandoned. It seems very close to complete!

Though, having done both the coding and content building for a game, I would say that the content addition is easily as hard as, or harder than, the content portion. Which means just having an ‘engine’ might not be enough to end up with anything. It is the first step though.

I’d really love to be able to get into the Ultima V code and modify that. As much as I loved Ultima IV, the Ultima V ‘engine’ was certainly my favorite.

That makes this project very interesting.

Alex

Just downloaded the decompiled U4. Even without being a coder, you can see a lot of the structure and processes! Very exciting to see behind the scenes how it works. Was only Avatar.exe decompiled? I note that the remaining files for each town .ult and .tlk are not included, so I am assuming those were never compiled into the whole. Did you just go in an edit those? I also took a look around to see where stuff was stored; spells, dungeons, items, etc. I did not find monsters or weapons/armor. Not sure where that stuff lives.

Looks like I’ll have a big distraction for the foreseeable future!

Cambragol

Title.exe was also decompiled, and the CGA driver. The .ult and .tlk files are read by Avatar.exe.

I edited those, and made new files for Trinity. I used a customized town editor that I built using George Stepan’s original version he built for Ultima IV the Shrine of Humility, a remake of Ultima IV using Dark Basic. Mostly though, I used a hex editor for all the .ult, .tlk, .con, and .dng files. It is the quickest and easiest, and in several cases, the only practical way to build and edit the files.

Monsters, weapons and armor are all handled in the exe. Just takes a little searching.

If you really want to get going, try this link. This is the last version of Trinity before I ‘closed sourced’ it. It includes a build environment (which is quite difficult to setup) that is ready to go. It also includes a whole bunch of editor files which could be of use to you.

Old Trinity

Fenyx4

Holy moly! I haven’t been keeping up on your blog! Yay feature complete!

If you want a beta tester I volunteer too! I even just got a PCjr up and running and would love to try out the game on it. :)

I’m glad you did have it open source at one point since, as you know, your old project is the only way I was able to get u4-decompiled working.

And look at u4-decompiled! It was 4 years before I was able to start using it but now I’m using all over it. I’m also using https://github.com/jtauber/ultima4 6 years after it was written.

Glee! I’m so excited to see Threat of the Trinity!

Fenyx4

P.S. I just read through the full new feature list (I feel silly I hadn’t clicked the “About” yet) and you have some really nice quality of life fixes. I’d planned to add active player as an option to my project and already added Ultima V style mixing. But now I’m thinking I should add diagonal attacking too… Hrm…

I’m really curious if we implemented Ultima V style of mixing the same way I did. https://github.com/Fenyx4/U4DosRandomizer/blob/master/u4_decompile/SRC/U4_MIX.C#L69

And would love any input you have on how you have active player working. I need to figure out a clean enough way to get it working that I can easily turn on and off with a flag in the randomizer. https://github.com/Fenyx4/U4DosRandomizer/issues/29

Cambragol

Yeah, lots of stuff on here recently. Glad you are getting updated. The ‘About’ page definitely has a good chunk of info there.

As for Beta testing, I may have to take your offer up eventually, as my internal Beta testing is stopped right now. He’s six years old, so it may take him awhile to get through it, and give it an honest shakedown. If I go with external Beta testers, which I likely will have too, I will need testers who can really tackle the job. That is a lot to call on for volunteers, so I hesitate to take the step.

I’m glad my effort to get the decompiled is helping you get creative. I was just so pumped when I saw that it had been decompiled (I had been working on modifying XU4, but was giving up on it) that I set to work figuring out how to get it compiled with a passion. There were some issues, but now that it works, others can get to it easier. I had a pull er..request ready to go to set people up with the complete compile package, but I just never pulled the trigger on it. You did, so all is good.

I looked at the mixing code, and it is similar, minus the on/off flag code. However, I think my logic for handling insufficient quantities of reagents is different. Here it is in action:

Reagent Mixing

Also, I’m mixing while riding a dragon. Hah!

Cambragol

I’ll also take a look at my ‘active player’ code. I can’t recall my exact implementation. However, there were lots of finicky, potential bugs/pitfalls. I took two stabs at it, and the second time it came out very nice. I tried to make it work as close to the Ultima V style as possible.

Cambragol

Looking at your reagent mixing codes, I found a bug in my own that is now fixed. So thanks! (Reagents weren’t being restored correctly when mixing with insufficient quantities of one reagent). Unfortunately I had to lose my slightly more verbose approach, which differentiated between ‘none left’ and ‘not enough’. Just ran out of code space again. literally can fit one more line to fix any more encountered bugs. So I made need to go through this code again and see if I can’t streamline it further.

Fenyx4

Re: Beta Testing Well, I seem to be spending all my spare time on Ultima 4 or Ultima 4 related stuff… So wouldn’t mind adding another thing to the list. So if you do need a beta tester I would be honored to help out. :)

Re: Active player I’m planning on tracking down the code that checks for there only being one person in the group and then adding to that logic. Not sure what to do about combat. Maybe add in an auto-pass?

Re: Mixing Thanks! Glad our solutions match. Yay bug fixing! Glad I kinda helped.

Man it is crazy that you are riding right on the edge of that limit. It is memory related, right? I am a spoiled modern programmer who hasn’t had to worry about how much code is in a program. How do you troubleshoot the problem? Maybe I could help out. Maybe you’ve already done this but perhaps I could offload LB’s text to a file https://github.com/ergonomy-joe/u4-decompiled/blob/c2c2108fa3bb346bcd1d8c207c526f33a4c8f5ef/SRC/U4_LB.C Would have been annoying to have loading from diskette when talking to LB back in the day but on modern hardware/DOSBox it wouldn’t even be noticed. No 100% sure it would actually help as I don’t fully understand the limitation yet.

Cambragol

I’ll keep you in mind for Beta testing for certain! Thanks for the offer. I will definitely need dedicated fans of Ultima IV to pull it off, as I will need full play throughs, and considering Trinity already doubles the difficulty level of an already difficult game, that is nothing to sneeze at.

I’m no experienced programmer (this is my first real foray into it so I have never ‘discussed it’ nor do I really know the terminology), but I’ll outline my approach for Active Player. I made a ‘global’ variable, Active, then added a ‘goto’ at the bottom of the com_Main function. I then made an ‘Active_player’ function that takes keystrokes from 1-8 and 0. Active player then sets Active, and also sets the activeChara variable to whoever. When com_Main gets near the end of its routine, it makes a check for Active. If ‘on’ it goes to the ‘goto’ at the top of the function. Otherwise it goes to the next step which sets the next character in the party to activeChara, then goes to the top of the function (normal behaviour)

That’s about it. Mind you Active player only works for combat. I am not using it outside of combat.

As for running out of memory, or hitting the limit, yes, it is crazy. I have been coding all of Trinity under this restriction for most of the past two years. Adding a line of code means streamlining a line of code elsewhere. There is room, probably, to add the functions you are planning to in U4DosRandomizer, but you will hit the limit at some point.

I spent about 3 months trying to solve this early in development, but there is no easy solution. The code is filling up the ‘segment’ and the only thing to do is reduce the code, or find a way to split the code over two ‘segments’. Which would mostly mean rewriting everything. The text, such as in LB is held on a different segment, the TEXT segment, so it is not connected. But I have hit THAT limit as well. Because I pushed a lot of the code into the TEXT segment to free up code in the code (DATA?) segment. So actually, pushing it into a separate file would help a little. A solution I had thought to try. Yet, the code to read from a new LB file would be extravagant, and hardly worth the payoff it would free up for the TEXT segment only. Unless…the code for read .tlk files and an LB.tlk file could be combined.

Still, it would be useful to have LBs tlk in a separate file. It would allow for more quest exposition, as currently I was limited by the TEXT segment filling up.

However, I don’t fully understand all this old DOS stuff, and there maybe a limit that is shared between the two in some way. Not sure.

Fenyx4

I might have something for you on the 64k limit. But I’m having problems testing it as I don’t have enough code. (I’ve been trying to add a bunch of copy/pasted text but am having problems recreating it still.)

TL;DR is add some “far” keywords to a few functions you don’t mind being a bit slower. Example; https://github.com/ergonomy-joe/u4-decompiled/blob/c2c2108fa3bb346bcd1d8c207c526f33a4c8f5ef/SRC-TITLE/FILE.C#L28 That should move it up to use some extended memory space.

You can read more about it here https://stackoverflow.com/questions/3575592/what-are-near-far-and-huge-pointers Or here which is where I first read about it https://winworldpc.com/product/microsoft-c-c/40 Download manuals. Open ms-c-4.0-uguide-1986.pdf and go to page 179.

If none of that works maybe read section 3.13 on page 92. It talks more about it.

Cambragol

I’ll give this a look, however, I went through that manual back to front, and tried every trick I could squeeze out of it, to no avail (The manual is actually already in the old Trinity ‘tools’ directory!) I did some possibility with converting it to a huge or large model program, but it was going to be a lot of work and might not have been possible because of a lack of access to the driver’s code (I think…I forget everything I tried. as once I was done, I just forgot it all. Too esoteric)

Though, looking at that page reference again, I do recall trying this approach. Unfortunately it did not work. Or at least, I couldn’t get it to work.

If you could figure it out, that would be great! There are a good chunk of code blocks I have turned off, as I just had to prioritize what to include within the limit.

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...