Jump to content

How to mod a Unity3D game (KSP)


blar

Recommended Posts

Hi!

I'm a game developer/programmer. I would consider myself a fairly advanced Unity3d dev.

I'm just been idly wondering recently how does one mod a unity game? Or what is a good way to allow a unity game your developing to be easy to mod.

I love KSP and I thought this would be a great place to ask as KSP is a unity game and its been heavily modded.

I have no experience modding any games ever! I dont know why but for some reason I always much prefer the idea of making my own games.

So how exactly does one make a mod for KSP? What form does a mod take and how is it merged with the vanilla release? Have the KSP devs open sourced their whole project (allowing you to edit it as they do in the unity editor) or have they gone to great lengths building their own modding tools for the community? How are scripts compiled or interpreted for the game and what language do you use?

I know I could find out a lot of this by trawling the forums so just ignore this thread if you dissaprove of my methods, and if not thanks!

Link to comment
Share on other sites

Don't think of it as modding a Unity game, really it's not. Modding in parts in KSP is done by assembling assets and processing them through PartTools into a format and configuration that KSP understands; adding functionality to parts is done via PartModules, which is a derivative class of MonoBehaviors but KSP sets a lot of context and adds more events and such; You can also make Monobehavior classes directly but they lose out on the context and some events, and cause them to be executed by the KSPAddon attribute.

The things that Unity adds to the table are very much critical to modding with KSP, but KSP defines how you do these things, Unity is then usually the tools with which to do them.

If you're developing your own game and want to make it modable; be very careful with learning from KSP, because KSP is generally really bad at it. You may want to seek out Majiir and SirCmpWin, they should be able to give you some good ideas for how to implement such a system better

Link to comment
Share on other sites

Unlike some other games, modding for KSP does not really require decompiling/recompiling source code to add new features (in fact, it's against the EULA).

There are two general schools of add-on authoring in KSP:

Parts for rockets and spaceplanes are modelled and textured in Blender, exported to .MU file format using the Unity editor and KSP PartTools, before finally being added to the game via CFG part definition files

Plugins that change certain aspects of gameplay are coded in C# using Visual Studio and MonoDevelop, compiled into DLLs that KSP loads into the game during startup.

This thread contains a comprehensive list of resources to help you understand and get started with add-on authoring:

http://forum.kerbalspaceprogram.com/threads/94638-New-Mod-Development-Links-Compilation

Mods please move thread to Space Labs

Ambiguous wording notwithstanding, the context of the OP's question is indeed add-on authoring specifically for KSP, so the Add-on Development subforums is already the right place for this thread.

Edited by sumghai
Consolidated consecutive replies by the same poster
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...