Advertisement

multi-modding Unreal style

Started by May 13, 2002 06:00 PM
2 comments, last by Krylloan 22 years, 6 months ago
Hi I''m thinking of making my game modable. My requirements are: ------------------- - I want all mods to be written in C / C++. - I want to be able to run any number of mods at the same time. (like Unreal / UT) - Mods must run on Windows (preferable Linux as well, since rest of game is dual-platform) - Mods must be able to call certain in-game functions ------------------- My preferance would be to use dynamic linking. An example of the problem I forsee is: -------------------------------------- Mod 1 contains bazooka. Mod 2 contains laser. Both have the function "fire(params)"; The game must be able to specify which fire(params) to call, depending on which weapon fired it. -------------------------------------- Does anyone know if this is/ain''t possible with dynamic linking, or, if not, have any other ideas as to how I could achieve this? Idea: would I be able to do something like this? --------------------------- virtual class WeaponFuncs { virtual init(params); vitrual exit(params); virtual spawn(params); virtual remove(params); virtual select(params); virtual fire(params); ... etc } --------------------------- and have dynamically linked files derive this class? Thanks for all assistance Simon Hill
Well couldn''t you just make your own scripting language? Then your program would have full control over what''s happening. That''s the was UT does it. Just don''t allow two modes that ask your game to use two weapons. Or make the two weapons switchable. Good luck

Horny Farmer (Jolly Rancher)
Advertisement
the way your thinking is make the engine and exe and mod dll. you run into problems.

make the game server exe. make the engine dll. so the part that is released as modable code is the part that makes the exe.

the mod part is the executable the engine core game is dll.

this is how the quake2 dealt with the problems you mentioned of having the "two fires".

so a mod would have a fire but since it is the exe it doesnt look for another fire.

flip your thinking round =). im not sure how q3 did it cause i was pretty done by then. but back in the day i hammered through q2 code. and im sure thats how it went.





I really want to avoid scripting languages - I haven''t a clue how to do it (make my game use them), and don''t really like them anyway (personal preferance), speed issues etc...

As for making the engine a dll, this doesn''t really enable more than one mod to be operational at a time.

In Unreal Tournament you could add a combination of "mutators" to the game

Eg:
Explosive Ammo (Made the ammo packages explode when shot)
+
Grenade Launcher (A weapon)
+
Proxy Launcher (Another weapon)


These 3 mods were able to run simultaneous in a level. UT managed this by scripting (UScript, an interpreted OO C++ish language). Yet each was a completely separate file, written by completely different people with (probably) little or no knowledge of the other mods.


aside: There is the possibility of conflicts - eg if you had 2 mods that changed jumping, one made you backflip, another made you spin 180, then enabling them both will possibly screw things, but that''s up to the engine or user to prevent.




I''m wondering - would this work:

virtual class WeaponFuncs {
virtual void init();
virtual void fire();
... exit(), spawn(), remove(), select() etc...
}

allowing dll''s to extend WeaponFuncs.




Thanks for the replies. I realise I may have posted a tricky one. Oh well.

This topic is closed to new replies.

Advertisement