There are a variety of meta-techniques for handling large projects, dependencies, et cetera in CMake and it's true finding good information on those techniques is difficult.
user4704
But building a static library and linking it is pretty trivial; you call add_library(MyLibrary STATIC ${SourceFiles}) and then you use target_link_libraries on the sandbox .exe target, specifying MyLibrary.
We've tried to update to a version beyond 3.8, but for some reason, something did no longer work, so we kept version 3.8. Apparently, we have not been the only ones with the issue, but we haven't had time to investigate.
That's a useful tool though.
@DMGregory That's cool, have fun :D (even if you're no longer on the project!)
what do people use of frameworks/tools for gamedevelopment? i just started with unity now and Im amazed by the simplicity and features you get with it.
On my own time, I mostly work in Unity. I'm pretty impressed too by the balance it strikes between simplicity / ease of use and power / flexibility. :)
I recently asked, are there any premade outdoor worlds suitable for testing 3D graphics? The question was put on hold:
Questions asking for resources are considered too broad here, unfortunately (because they are list-of-link generators); a good place to ask if the suggestions above aren't s...
@DMGregory well said. It certainly makes the job a lot easier with so much built-in features.
@DMGregory All though, i found it weird that you need to assign the RigidBody component in the inspector to the variable in the script, but that you can declare and initialize the transform component directly in the script without assigning it as well in the inspector..
@abobakrdy They used to have built-in accessors for more common components types (like renderer & collider), but they stripped most of them out for efficiency
Transform is kind of special in that every GameObject has one, and it's almost always something you want to use. Rigidbodies are accessed much less frequently, and usually by specialized physics scripts, so it makes sense to leave that one as an explicit opt-in for the scripts that need it.
You wouldn't want a whole pile of extra Rigidbody2D references being created for no benefit when you're making a 3D project, for example. ;)
If you don't like manually wiring up the Rigidbody in the Inspector though, you can auto-populate it in Awake()Start()OnEnable() or OnValidate() instead.
That's what I mean. You can write... (bear with me a moment as I type...)
[RequireComponent(typeof(Rigidbody))]
public class MyPhysicsScript : MonoBehaviour {
[HideInInspector]
[SerializeField]
private Rigidbody body;
void OnValidate() {
if(body == null)
body = GetComponent<Rigidbody>();
}
// Rest of your script goes here
}
This will automatically add a Rigidbody to a GameObject when you attach this component in the editor if it doesn't have one already, and wire up the bodyvariable to point at it, no manual referencing in the inspector required.
If you're adding this script at runtime though, you'll want to wire that up separately (OnValidate is only called in-editor)
@DMGregory I think ill just stick to the normal routine at the moment, its almost easier to assign it in the inspector as well since you have a GUI over all the assets.
@DMGregory Your script could probaly be used in some cases where it saves time, but for my use at the moment it would take more time and effort instead of just doing it the normal way lol
@DMGregory do you buy 3d/2d graphics or do you make it yourself? im thinking of graphics for characters, tracks and so on, doesnt this take alot of time to design yourself?
user4704
If you can't make them yourself, and you can't afford to buy them, build games that don't need them.
2D graphics I'll often make myself. I'm not much of a 3D modeller or sound designer though, so when I need something specific I'll either browse asset stores or contract a friend to develop the assets.
I like making games that are asset-light, like my dominoes:
For that one, I asked a friend to model the bevelled / UV unwrapped domino shape for me, and I paid a composer/sound designer to create the music and source the sound effects.
For quick prototyping, examples, or assets to use when teaching classes, I often turn to Kenney: kenney.nl/assets
They have a wide array of stylistically-consistent assets, all free & public domain.