Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
26
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/PomegranateFew7896 on 2024-10-18 19:12:46+00:00.

27
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/RaccoonFormality on 2024-10-18 18:34:51+00:00.

28
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/zeetu on 2024-10-18 16:55:18+00:00.


This post a few days ago about C++ vs GDScript inspired me to create a more realistic benchmark:

That benchmark did a prime number search which is all well and good but games don't really do that.

My benchmark:

The benchmark simulates two common operations in a grid-based inventory system:

  • Finding an available space for a 2x2 item in a 10x10 grid inventory.
  • Sorting the inventory by moving all items to the top-left corner in order.

These are common in games and do a better job of highlighting the difference between C# and GDScript.

All the code and results are on GitHub if you want to play with it.

TLDR is that C# is faster but it doesn't matter. Games rarely do thousands of iterations on an inventory and a player won't notice the difference between C# and GD. The sort of the inventory for example: GDScript time: 0.000075 seconds C# time: 0.000014

In the off chance you do need the speed you can easily port the expensive operation to C# or C++

29
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/DEEP_ANUS on 2024-10-18 20:34:03+00:00.

30
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/X_keiga_X on 2024-10-18 18:27:07+00:00.

31
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Kristoff_Red on 2024-10-18 16:08:56+00:00.

32
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/XRuKeNX on 2024-10-18 15:52:18+00:00.

33
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/RoughEdgeBarb on 2024-10-18 14:59:26+00:00.


I'm assuming you already know the basics of blender, if not there are plenty of general tutorials available, The Blender Fundamentals playlist is still a good start for learning the UI. Blender is a fairly hotkey based engine so some of the basics take getting used to.

Preface - Why Blender?

While it's entirely possible to make levels in Godot it fundamentally lacks the kind of poly-modelling tools that a dedicated level editor like Valve's Hammer has, even tools like Unity's ProBuilder are never going to be as fully featured as dedicated software, this limits you to modular or kit based construction in-engine, and if that's enough for your needs then there are addons like Snappy and AssetPlacer to help with that.

A common option for retro games are old BSP style editors like TrenchBroom, but they're a lot less applicable to modern games, Valve switched to mesh-based for Source 2 for instance.

The alternative is what you might call "Valve Style" level editors, which give you a lot more control over geometry and texturing, which is great for making diverse economical environments, an important part of this approach is that we make the entire level in one program, and I'll get to how later. While you could go for a hybrid approach of making geometry in Blender then adding assets in Godot or blocking out levels with CSG then arting over them in Blender, this split approach breaks flow(having to switch between programs) and is inflexible(having to manually update one when you change the other). We also get a benefit for free here, which is that it's potentially very easy to support User Generated Content, since we don't need to produce any custom level editor tools or distributing source code, and we can safely import GLTF files at runtime without having to worry about running unsafe code. This approach also has the advantage that a level designer can learn it as a dedicated tool(like they would with Hammer), but a generalist or artist can still leverage their experience with Blender.

There’s definitely more to explore with level design in Blender, including using Geometry Nodes to build tools, vertex blending for more complex texturing, and physics and baking animations, but this is more of a start.

Technical Stuff

As a quick aside it's worth understanding that in order for a level to go from Blender to Godot it has to pass through a few different hands, Blender and it's GLTF exporter, the GLTF standard, and Godot and it's GLTF importer. In order for a material for example to be converted from Blender to Godot it must go through this narrowing conversion though the GLTF standard. You can read up more about each step at the following

Blender GTLF export

GLTF Standard

Godot Docs, Importing 3D scenes

Blend file import vs. GLTF import:

With the above in mind you can realize that Blend file import is just a regular GLTF import where Godot using Blender to handle the conversion to GLTF automatically. Whether you use Blend import or GLTF import therefore is a matter of taste, Blend file imports will re-import every time you save the file, and GLTF can be slower from a workflow perspective, but gives you more control over exactly what you export(you could have the entire world be one blend file, then export each level to a different gltf file for instance). This choice matter may more if you are working with multiple people or depending on what version control you use.

It's also worth noting some important settings in Blender's Export:

Format - Binary(glb) vs Text Embedded(gltf) vs Text Separate(gltf + bin + textures) - Binary is one file, smallest size but worse for version control, Text embedded is one file, larger but convenient, Text Separate uses a text file for the scene and one for binary data like meshes, with support for external textures, generally the worst of both worlds IMO. Text Embedded is good for levels, since one file is more convenient and the file will still be small enough if you don't include textures.

The important settings to include are Apply Modifiers, Include Custom Properties, and set materials to Images - None (we want to replace textures and materials with ones in our Godot project since it would bloat file size otherwise, although you could set it up so the materials to reference the textures in your Godot project)

Setting up the workspace

Blender is a very customizable software, and it obviously wasn't designed with Level Design in mind, so some small edits will make it a better experience. We can keep the Layout tab as it is, just changing the Timeline for the Asset Library, then make a new workspace for modelling, and make the following adjustments:

  • Remove the bottom window and add wireframe orthographic windows as you see fit(see the tools section for the Lock View Rotation option)
  • Enable Measurement - Edge Length
  • Change the camera focal length to ~30mm from the default 50, this will make interior spaces much easier to work in, but will create more perspective warping
  • Under Viewport Shading in the dropdown box for shading options enable Backface Culling (I would also recommend enabling backface culling on any materials you use)
  • Under Viewport Overlays enable Wireframe
  • I would also recommend disabling Viewport Denoising in the Eevee render settings, and for Cycle settings turning them to the absolute minimum you can get away with and enabling GPU rendering

Once you're happy with the changes you can save the file as your default Blender startup file, or just copy-paste the file for each new project.

Praise the Grid!

The key thing that ties everything together is modelling on a grid, it saves time, lets you easily follow level design metrics, has huge benefits for UV'ing. To enable grid snapping in Blender in the top center enable snapping, then Increment and Global Grid Snapping

When working on a grid it's best to start at a high level, then work at lower levels as you refine it. For this I'd recommend using powers of 2 based around the meter, by doubling or halving your grid size you can work at different scales, start at 1m increments, then 1/4m, and so on, this ties into UV'ing and other aspects as well discussed below. If you imagine the smallest unit as 1/32 of a meter then you can quickly build out models using consistent metrics without having to get into small decimal numbers.

Standards:

Setting standard level design metrics is important for making sure assets like doors fit and for texturing, consistent gameplay standards like how high the player can jump, and for quickly laying down properly scaled environments when prototyping.

Some example standards for a first person game would be:

Ceilings 3m tall

Doors 1.25m wide, 2.25m tall

Crouching ~1m high, Jumping ~1m high

Walls and floors 0.25m thick

Stairs with a 2:1 ratio, with 0.125m x 0.25m, or go with 5 or 6 unit height stairs at the same ratio

Embrace the N-gons:

Common advice given to people learning 3D modelling is to avoid n-gons, faces with more than 5 vertices. This is bad advice in our case. For planar faces(i.e. most environment modelling) which do not deform it does not matter. This is an area where advice from CG artists who focus on different things is actively harmful, having edge loops running all over your geometry is not necessary and will constrain you, it is more optimized and more flexible to simply dissolve the edges(x or del, then dissolve edge).

Building out a basic interior, knife the walls to create the opening, snap the verts to the grid, then extrude as necessary and dissolve the unwanted edges

Windows can be made similarly by using the knife to cut out the silhouette then using Bridge Edge Loops to join the faces. Or you can use booleans to semi-automate them, but they can create topology issues like if they lie directly on an edge, which makes them bad for doors.

Also note that parts do not have to be merged in order to be seamless as long as the edges are snapped to the same position, so you can for instance split up the interior and exterior of the house or different rooms for culling/performance reasons.

UV'ing and Texturing

UV'ing is a process where having this grid alignment is very useful, for instance if we have a texture of tiles with 8 tile per meter and our walls are snapping to 1/8m increments our edges will line up nicely, seams in textures will be hidden in these natural gaps, and it will be quicker to set a consistent texture scale.

DreamUV is an excellent addon for this, it provides useful UV tools directly in edit mode, taking inspiration from Source tools.

Set the move snap to a value like 1/8 to quickly adjust texture alignment, again this works best when your textures use consistent increments.

Move to edge lets you quickly align an entire face, nudging it to make the edges line up, this sort of precise thing is very awkward with Blender's default tools

The extend tool is super useful for quickly UV'ing an entire area, just start with one area that you have properly UV'ed and ex...


Content cut off. Read original on https://old.reddit.com/r/godot/comments/1g6k38h/sourcestyle_level_design_in_blender_tutorial/

34
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/pineapple_works on 2024-10-18 14:30:29+00:00.

35
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/dtelad11 on 2024-10-18 13:51:34+00:00.

36
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Memebigbo on 2024-10-18 12:08:14+00:00.

37
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/FiremageStudios on 2024-10-18 10:53:23+00:00.

38
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/RainbowLotusStudio on 2024-10-18 10:07:31+00:00.

39
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/programmingwithdan on 2024-10-18 08:42:52+00:00.

40
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/oli4king on 2024-10-18 08:36:32+00:00.


Working on a 4X Game in Godot.

Not really playable yet, but I would like some feedback on the general aesthetic and visuals.

Thx for watching :)

41
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/pineapple_works on 2024-10-18 08:10:27+00:00.

42
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/asadityas67 on 2024-10-18 07:42:36+00:00.

43
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/bilboteaparty on 2024-10-18 05:09:48+00:00.

44
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/raikori on 2024-10-18 00:05:55+00:00.

45
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Schwender_exe on 2024-10-18 00:48:25+00:00.

46
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/4procrast1nator on 2024-10-17 19:27:47+00:00.

47
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/breakk on 2024-10-17 18:51:47+00:00.

48
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/XandaPanda42 on 2024-10-17 00:36:41+00:00.


I know other code editors have this, but the ability to type a single bracket or quotation mark, and have the other one created at the same time is such a useful feature that I'm missing it in other parts of my life.

I want that on everything. Email, text messages, web searches.

NB: can we PLEASE get a "Discussion" flair for this sub? Pretty please.

49
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/theSilentSmile_ on 2024-10-17 13:03:26+00:00.

50
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/SnooAvocados857 on 2024-10-17 19:10:42+00:00.

view more: ‹ prev next ›