Modding Unvanquished

Release and discuss things you've made, including mods.
Post Reply
maek
Posts: 5
Joined: Mon Dec 02, 2013 7:07 pm UTC

Modding Unvanquished

Post by maek »

Hello,

I've already experimented with q3 source code (openarena) in the past and I've quickly take a look at the Unvanquished one, but..
I can't find info about creating a mod for Unvanquished, so I decided to post here my questions :smile:

My biggest doubt is: what can I do with a mod? and what can I not do with it?
Can I add new weapons/models? new movements? new gametypes?
I mean, if I recall correctly, I shouldn't be able to touch the engine (in a mod development), right?
So which are the limits?
Unfortunately I got no idea of what the engine does nor what it is not-engine..

Let's take for example OA.. how much similar can a skilled developer make Unvanquished to OA with a mod? I know it sounds crazy, but take it as an example :wink:

And last but not the least, is there an easy way to keep the mod code updated with Unvanquished development?

I know they are a lot of questions.. but I will be very thankful to anyone that can help me :thumbup:

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: Programming FAQ

Post by kangz »

Modding Unvanquished works exactly like modding OA or Q3: your mod runs in a virtual machine and can access the engine through a "small" number of syscalls. The capabilities of our mods are extremely similar to the ones of OA mods with the addition of a few things like more graphical effects :thumbup:

To answer your specific questions: you can add weapons, models, movements, gametypes, vehicules and armor if it pleases you. Making another Open Arena or Urban Terror possible. The files you need to change to do that are located in src/gamelogic. If you want the list of syscalls (an implicit list of features available) you can look at src/engine/client/cg_api.h. The current limits are that you cannot change the netcode (we hope to change that) and that some Unvanquished-specific features have crept in the engine (if any of these annoy you tell us so we can remove them).
Git can probably help you keep the code updated with regular merges.

However if you are thinking of making a mod of Unvanquished RIGHT NOW I think it is a bit early: the way mod are made will probably change heavily in the next month with the introduction of NaCl. Also the game is in its very early stages ; if you want to work on an open source game I'd suggest you to take part in the development of Unvanquished instead. Unless you already have a team of programmers and artists, you are going to take a long time to make an OA remake as an Unvanquished mod whereas if you contribute to the 'main' mod you'll push forward a game that is sure to have a 1.0 version at some point :wink:

maek
Posts: 5
Joined: Mon Dec 02, 2013 7:07 pm UTC

Re: Programming FAQ

Post by maek »

First of all thank you very much for your help kangz :thumbup:

kangz wrote:

The files you need to change to do that are located in src/gamelogic.

So, if I understand correctly, a mod (in Unvanquished) is made only of, and only only of, the files in that directory. Is it right? Then I see that botlib is inside the engine folder.. what does this mean for a mod?

kangz wrote:

The current limits are that you cannot change the netcode (we hope to change that) and that some Unvanquished-specific features have crept in the engine (if any of these annoy you tell us so we can remove them).

Can you please name two or three of them? Just to let me understand better what you mean :smile:
Then, correct me if I understand it wrong, the engine should be kind of game-agnostic?

kangz wrote:

Git can probably help you keep the code updated with regular merges.

Good, then it is what I thought.. is there any suggested way to do it?
What I would do is to fork the project on github making a branch unvanquished to track the original Unvanquished master and to merge it back (or rebase?) everytime you will tag it. Any drawback in doing like so? Or any better idea?

kangz wrote:

However if you are thinking of making a mod of Unvanquished RIGHT NOW I think it is a bit early: the way mod are made will probably change heavily in the next month with the introduction of NaCl.

I read the post in the news, and I have a question also about that: porting Unvanquished to PNaCl is one way to get rid of LCC and to have a lot of other security/performance improvements, but, does PNaCl run outside Chrome? I mean, are you planning to move Unvanquished to a browser game? something like QL? :confused: And, besides the switch to C++11, which can be other huge transformations for mods?

kangz wrote:

Also the game is in its very early stages ; if you want to work on an open source game I'd suggest you to take part in the development of Unvanquished instead. Unless you already have a team of programmers and artists, you are going to take a long time to make an OA remake as an Unvanquished mod whereas if you contribute to the 'main' mod you'll push forward a game that is sure to have a 1.0 version at some point :wink:

Oh yes, you are definitely right (we are only two, a coder and an artist).. but for now we prefer to just experiment with the game and do not have any responsibility (obviously contributing with bug reports or with minor enhancements when/if we can) :smile:

ps: can I post this kind of questions here or should I open a new thread?

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: Programming FAQ

Post by kangz »

maek wrote:

First of all thank you very much for your help kangz :thumbup:

No Problem :smile:

maek wrote:

So, if I understand correctly, a mod (in Unvanquished) is made only of, and only only of, the files in that directory. Is it right? Then I see that botlib is inside the engine folder.. what does this mean for a mod?[/botlib]

Yes, although to be exhaustive, files in src/engine/qcommon/q_* are also included in the mods.

You also have bot files in src/gamelogic/game/ I believe the one in botlib are just bot support code but not the actually "logic" of the bots. I may be wrong because I'm not very familiar with how our bots work.

maek wrote:

Can you please name two or three of them? Just to let me understand better what you mean :smile:
Then, correct me if I understand it wrong, the engine should be kind of game-agnostic?

For example you cannot add unlimited fields to be transmitted through the network and have to work with the same fields that we use. (Quake3 had that limitation too). Also we have "team binds" that explicitely reference the names "aliens" and "humans" in the engine.

maek wrote:

Good, then it is what I thought.. is there any suggested way to do it?
What I would do is to fork the project on github making a branch unvanquished to track the original Unvanquished master and to merge it back (or rebase?) everytime you will tag it. Any drawback in doing like so? Or any better idea?

That seems good, I never developed a mod separated from the engine so I don't really know. You could also try taking only the gamelogic related files and compile the engine on the side (might become unpractical).

maek wrote:

I read the post in the news, and I have a question also about that: porting Unvanquished to PNaCl is one way to get rid of LCC and to have a lot of other security/performance improvements, but, does PNaCl run outside Chrome? I mean, are you planning to move Unvanquished to a browser game? something like QL? :confused: And, besides the switch to C++11, which can be other huge transformations for mods?

PNaCl is a library used in Chrome to make sandboxes but it is just a standalone library (I don't even have Chrome on my computer :wink: ). In addition to C++11 PNaCl gives a LOT : we can rely on the standard library, do threading, include C++ libs inside the gamelogic (librocket), it'll be a huge time saver (`Ishq spent a lot of time making librocket work with a mix of C / C++).

maek wrote:
kangz wrote:

Also the game is in its very early stages ; if you want to work on an open source game I'd suggest you to take part in the development of Unvanquished instead. Unless you already have a team of programmers and artists, you are going to take a long time to make an OA remake as an Unvanquished mod whereas if you contribute to the 'main' mod you'll push forward a game that is sure to have a 1.0 version at some point :wink:

Oh yes, you are definitely right (we are only two, a coder and an artist).. but for now we prefer to just experiment with the game and do not have any responsibility (obviously contributing with bug reports or with minor enhancements when/if we can) :smile:

Ok, that's your choice although 2 people to make an FPS isn't much imho, out of curiosity, what sort of experiments will you do?

maek wrote:

ps: can I post this kind of questions here or should I open a new thread?

I asked a mod to move it to a new thread :wink:

maek
Posts: 5
Joined: Mon Dec 02, 2013 7:07 pm UTC

Re: Programming FAQ

Post by maek »

Thanks again, kangs, for your patience :thumbup:

kangz wrote:

Yes, although to be exhaustive, files in src/engine/qcommon/q_* are also included in the mods.
You also have bot files in src/gamelogic/game/ I believe the one in botlib are just bot support code but not the actually "logic" of the bots. I may be wrong because I'm not very familiar with how our bots work.

Ok, very nice.. do you at least know if bots work in the same manner as in q3? I mean, obviously they have different logic, but is it the same technology?

kangz wrote:

Also we have "team binds" that explicitely reference the names "aliens" and "humans" in the engine.

Hmm.. does this limit the number of teams or is it only a comfort layer above the classic q3 team0 & team1? Because, besides aliens and humans, in the future you may have also.. idk, predators? :wink:

kangz wrote:

That seems good, I never developed a mod separated from the engine so I don't really know. You could also try taking only the gamelogic related files and compile the engine on the side (might become unpractical).

Yup, maybe it will be better to only start with the gamelogic files as you suggested (adapting the CMakefile) and using directly the engine binary. I asked you if there are better ways to do it, 'cause idk if I can track only certain directories in git, apart using .gitignore.. anyway I will surely find how to do it properly, so let's consider this point solved :smile:

kangz wrote:

PNaCl is a library used in Chrome to make sandboxes but it is just a standalone library (I don't even have Chrome on my computer :wink: ). In addition to C++11 PNaCl gives a LOT : we can rely on the standard library, do threading, include C++ libs inside the gamelogic (librocket), it'll be a huge time saver (`Ishq spent a lot of time making librocket work with a mix of C / C++).

Very nice about the standalone, but my question was not on the advantages of PNaCl, but about your sentence "the way mod are made will probably change heavily in the next month with the introduction of NaCl.": so, besides the switch to C++11, which are the planned transformations for mods developing? Sorry for my english, but I'm not a native speaker (nor writer :grin:).

kangz wrote:

Ok, that's your choice although 2 people to make an FPS isn't much imho, out of curiosity, what sort of experiments will you do?

I want to be very honest with you 'cause you are a very kind person: I like to code about gamelogic but, as you said, I am pretty alone.. so I could join a dev team as you suggested, but I prefer to have no constraints and try to implement my own ideas, 'cause I'm not a student anymore and now with a regular job I have not so much free time.. your project is the one I chose 'cause imho is the most promising one (you are working on every aspect of the game) but unfortunately it is not the kind of FPS I'm thinking about.. my concept is something like q3 with a mix of tweaks from CPMA/QL/Xonotic/UT/etc plus obviously some new ideas.. as the game will be more mature and if I will still developing this mod (actually not even started), maybe I will find someone that can help me, if the mod will worth it, otherwise.. I will surely have had fun with it :smile:

kangz wrote:

I asked a mod to move it to a new thread :wink:

Nice :smile:

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: Programming FAQ

Post by kangz »

maek wrote:

Ok, very nice.. do you at least know if bots work in the same manner as in q3? I mean, obviously they have different logic, but is it the same technology?

I think not but I have to admit that I don't really know how the bot work. I asked the developer who made them to look at your question but he doesn't usually come in the forums. You can ask for "Fuma" on IRC.

maek wrote:

Hmm.. does this limit the number of teams or is it only a comfort layer above the classic q3 team0 & team1? Because, besides aliens and humans, in the future you may have also.. idk, predators? :wink:

It is one of the game-specific things we have in the engine that I'd like to eventually change so that Daemon, the engine is not Unv-specific.

maek wrote:

Very nice about the standalone, but my question was not on the advantages of PNaCl, but about your sentence "the way mod are made will probably change heavily in the next month with the introduction of NaCl.": so, besides the switch to C++11, which are the planned transformations for mods developing? Sorry for my english, but I'm not a native speaker (nor writer :grin:).

Np, I'm not a native speaker either :wink: Mod development will stay roughly the same except that you'll be using the PNaCl SDK to compile the gamelogic instead of the old lcc. The interface between the gamelogic and the engine will change too but we'll have compatibility wrappers for a long while so you don't have to care too much about that. All in all you get C++ and all the other advantages, for free (hopefully). I'm not sure it answers your question though.

maek wrote:

I want to be very honest with you 'cause you are a very kind person: I like to code about gamelogic but, as you said, I am pretty alone.. so I could join a dev team as you suggested, but I prefer to have no constraints and try to implement my own ideas, 'cause I'm not a student anymore and now with a regular job I have not so much free time.. your project is the one I chose 'cause imho is the most promising one (you are working on every aspect of the game) but unfortunately it is not the kind of FPS I'm thinking about.. my concept is something like q3 with a mix of tweaks from CPMA/QL/Xonotic/UT/etc plus obviously some new ideas.. as the game will be more mature and if I will still developing this mod (actually not even started), maybe I will find someone that can help me, if the mod will worth it, otherwise.. I will surely have had fun with it :smile:

I see more like an arcade FPS, I miss those too :smile: (I still have to try shootmania)

User avatar
Ishq
Project Head
Posts: 1147
Joined: Tue Mar 06, 2012 8:32 pm UTC

Re: Modding Unvanquished

Post by Ishq »

For bots: Using the same "technology" is a vague term. In a sense, they use similar technology to doom3 aas bots in that they use navmeshes for navigation as opposed to the antiquated system of waypoints, however, the underlying engine code (via the libraries detour and recast) and gamecode (through behavior trees) is entirely different.

maek
Posts: 5
Joined: Mon Dec 02, 2013 7:07 pm UTC

Re: Programming FAQ

Post by maek »

kangz wrote:

It is one of the game-specific things we have in the engine that I'd like to eventually change so that Daemon, the engine is not Unv-specific.

Oh, it will be very nice.. I mean, modular programming rocks :smile:

kangz wrote:

Np, I'm not a native speaker either :wink: Mod development will stay roughly the same except that you'll be using the PNaCl SDK to compile the gamelogic instead of the old lcc. The interface between the gamelogic and the engine will change too but we'll have compatibility wrappers for a long while so you don't have to care too much about that. All in all you get C++ and all the other advantages, for free (hopefully). I'm not sure it answers your question though.

Oh yes, it is exactly what I wanted to read :smile:
(I imagine that the PNaCl SDK compile process can be automated by using the cmake utility, so this is not a problem at all)

kangz wrote:

I see more like an arcade FPS, I miss those too :smile:

:thumbup:

Ishq wrote:

For bots: Using the same "technology" is a vague term. In a sense, they use similar technology to doom3 aas bots in that they use navmeshes for navigation as opposed to the antiquated system of waypoints, however, the underlying engine code (via the libraries detour and recast) and gamecode (through behavior trees) is entirely different.

Thank you very much too, Ishq, for your help :smile:
I definitely have to dig a lil bit more into this.. one last question: is the current bots implementation limiting (in your opinion) the development of an AI as the one needed in q3 tourney or CTF gametypes? I mean, is the current bots implementation in the engine part Unvanquished-oriented?

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: Modding Unvanquished

Post by kangz »

Bots use behavior tree so they should be good for CTF. The engine part of the bots shouldn't be tied to Unv so that should be ok. As for the build process of PNaCl gamelogic it is actually already in the CMakeLists in master.

maek
Posts: 5
Joined: Mon Dec 02, 2013 7:07 pm UTC

Re: Modding Unvanquished

Post by maek »

kangz wrote:

Bots use behavior tree so they should be good for CTF. The engine part of the bots shouldn't be tied to Unv so that should be ok. As for the build process of PNaCl gamelogic it is actually already in the CMakeLists in master.

Very very nice.. no more questions for now :grin:
Anyway FYI I should start toying with the mod during next winter holidays.. stay tuned :wink:

Post Reply