Mod Hooks

Ideas for future addons and sequels

Moderators: jelco, bert_the_turtle, Chris, Icepick, Rkiver, Punisher Bass

Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Wed Nov 12, 2003 8:06 pm

I've recently recieved my DevCD, and begun work on something that I feel Uplink is sorely lacking: the ability to add functionality/data without needing to overwrite the .exe.

Why is this a problem? Mainly because it means that you can only have one Mod installed at a time - it overwrites the previous one. Even if you're just changing *sections* of the exe, there's an inherent danger that your changes will mess with someone else's mod.

So, what I've developed (and so far, it works) is a plug-in mod system. Mods are put out as DLLs (or .so, which I think is the equivalent on Linux?) and stored in a /mods/ folder in the Uplink folder; the game then loads them all and calls into them at certain points - 'hooks.'

An example of a 'hook' would be the one I added first, in the Name generator (the code which generates names for people, companies, agents, etc etc). It's now possible, with my modifications, to create a 'name library' which adds new names to Uplink without ever modifying the .dat files. You could even collect a bunch of them and put them all in that folder, and it'd load each one.

My question is this: which other sections of the game should I set up with hooks? I've got the following:

* Software - 'software libs' can add new user-runnable programs to the game
* Servers - 'server libs' can add new machines like in the FBI mod
* Er...

And that's it. Can anyone suggest any other places where this functionality would be useful?
Superpig
- Saving pigs from untimely fates
Rkiver
level5
level5
Posts: 6405
Joined: Tue Oct 01, 2002 10:39 am
Location: Dublin, Ireland

Postby Rkiver » Wed Nov 12, 2003 8:14 pm

Superpig: In short, anywhere that you are thinking of modding it could be used in. You would just need to make sure the exe has hooks included for every eventuality, and that the .dll includes all relevant server information, such as the news that would be generated, the missions, effects of the system in game etc etc etc.

Great idea, but it will need some research, but when it works, not if because it can work, it will be a life saver for the modding community.
Uplink help: Read the FAQ
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Wed Nov 12, 2003 8:48 pm

Well, as I said, I've already got 'name libraries' working... I think I've figured out how to do custom software, too, though the inheritance hierarchies cause havoc if I want to do it without exporting anything from the executable.

Oh, and a couple of extra things: You will still need the DevCD to make mod libraries with it; and it is designed to allow other core modifications to supply hooks (i.e. if you add new key gameplay you can use the mod system to write hooks into it).

As soon as Chris gets round to reading his email and granting me access to the Developer forums, I'll give some more details about how it actually works.

At the moment, though, what should I look into as priority topics for hooking like this?
Superpig

- Saving pigs from untimely fates
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Wed Nov 12, 2003 10:09 pm

Storylines and missions are the other big thing.  I have been thinking about this for some time, and came to the conclusion that doing something like what you are doing would serve most peoples needs, but managing conflicts, limitations of the original code, and more imaginative MOD would be quite diffecult.  It has been rather hard for people to just code their MOD directly without breaking all sorts of stuff, I would imagine having a modular approach like this would only make the problem worse.  However good luck, hope to see more of this when you get to the Dev Forum.  :)
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Thu Nov 13, 2003 2:23 am

I posted a similiar idea a while back, where small 'mini-games' could be added by providing dll/so interface with a pointer to a callback function for graphics, and callbacks for keyboard/mouse/timer interaction being defined in the DLL.

I'd rather the DLL be editable by people without the DevCD, but I'm biased, because I don't have one.
Maniak
level4
level4
Posts: 571
Joined: Sun Aug 24, 2003 11:14 pm
Location: Somewhere in NY
Contact:

Postby Maniak » Thu Nov 13, 2003 1:38 pm

Stormchild already made a mod which includes a little Tic Tac Toe game you can play against the computer.
Maniak hacks like crazy!
Click here to visit my favorite site! My Profile! Rate Me! Community status: Forum Maniac Newbie Guides!
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Thu Nov 13, 2003 2:23 pm

Not even related to the discussion. . .
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Thu Nov 13, 2003 7:09 pm

Quote: from Jackmn on 1:23 am on Nov. 13, 2003[br]
I'd rather the DLL be editable by people without the DevCD, but I'm biased, because I don't have one.


I think that would violate the terms of the DevCD license.

I just quite like the idea of random Uplink apps being written in, though. Imagine if you hack a fileserver, and find a copy of Pong that you can download?

Actually, there's a thought... using Google to insert random blocks of text into data files, which you can then read. Hmm...
Superpig

- Saving pigs from untimely fates
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Fri Nov 14, 2003 12:55 am

You don't need to release any of the Uplink source in order to make DLLs editable. All you have to release is the DLL specifications: what functions are exported, and how to use the callbacks passed to the dll to interact with the game. The dlls can be dynamically loaded at runtime.

(Edited by Jackmn at 11:56 pm on Nov. 13, 2003)
TheWhiteRabbit
level1
level1
Posts: 27
Joined: Sat Oct 04, 2003 6:43 pm
Contact:

Postby TheWhiteRabbit » Fri Nov 14, 2003 3:49 am

about those dll's. what about those mods that change storylines?
Follow The White Rabbit
http://www.whiterabbitlane.com
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Fri Nov 14, 2003 9:31 am

Quote: from Jackmn on 11:55 pm on Nov. 13, 2003[br]You don't need to release any of the Uplink source in order to make DLLs editable. All you have to release is the DLL specifications: what functions are exported, and how to use the callbacks passed to the dll to interact with the game. The dlls can be dynamically loaded at runtime.


True; however, you *do* need the Uplink headers if your mods are actually going to do anything worthwhile. :)
Superpig

- Saving pigs from untimely fates
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Fri Nov 14, 2003 6:19 pm

You can create a special non-proprietary dll interface on the uplink side, and create a new, non-proprietary header file for the newly created interface (for communication between the dll and uplink).

(Edited by Jackmn at 5:20 pm on Nov. 14, 2003)
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Fri Nov 14, 2003 6:45 pm

Quote: from Jackmn on 5:19 pm on Nov. 14, 2003[br]You can create a special non-proprietary dll interface on the uplink side, and create a new, non-proprietary header file for the newly created interface (for communication between the dll and uplink).


The DLL implements an interface defined in a non-proprietary header file. However, it's completely pointless to try and 'abstract' all of Uplink's internal libraries like that. What am I going to do, rename them all? There's still a load of type information - Uplink-based classes - that the DLL needs to be aware of. Abstracting the whole thing away to the point that you couldn't see any of it would kill performance, I believe.

Besides, I'm looking at the spirit of the license. If Introversion wanted people to be able to mod it without the DevCD, they would have done this work themselves (it's not been very hard - I've had the CD three days and it's already working). All I'm doing is making it easier for people who *do* have the DevCD to develop add-in functionality in a modular way. After all, any serious mods will require core code changes, there's no doubt about that.

People are going to have to quit being cheapskates and shell out £25 for the DevCD, methinks :P
Superpig

- Saving pigs from untimely fates
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Sat Nov 15, 2003 1:07 am

*shrug*, I don't lose out on anything if I don't purchase the DevCD, the community just loses a potential coder.

Not that I blame IV for selling the source, rather than releasing it. They are a company, and it is a companies job to make money.
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Sat Nov 15, 2003 11:06 am

Quote: from Jackmn on 12:07 am on Nov. 15, 2003[br]*shrug*, I don't lose out on anything if I don't purchase the DevCD, the community just loses a potential coder.

Not that I blame IV for selling the source, rather than releasing it. They are a company, and it is a companies job to make money.


Exactly. I'd like to see IV stay in business, after all... something about the idea that a bedroom coding team can become a commercial success, shall we say, appeals to me ;)
Superpig

- Saving pigs from untimely fates

Return to “The Future”

Who is online

Users browsing this forum: No registered users and 15 guests