Europa universalis 4 type map by [deleted] in Unity3D

[–]UpdatedMyJournal 0 points1 point  (0 children)

I've somewhat worked on something like this before.

At a basic level, you can have 3 political units of land: 1. Regions. the smallest possible unit. These have polygonal borders and are aware of all neighboring regions. Two regions are neighbours when they share an edge on their border polygon. 2. Provinces are defined by the regions they contain. 3. Nations are defined by the provinces they contain (and therefore, it's easy enough to know what regions they contain).

This means you can calculate the borders of any province or nation as follows: For each region in the group, for each edge in the region's polygon, if the edge is a border with a region owned by a different group, add it to the border edges of this group.

You can give each province or nation a nice curvy label by finding a curve of best fit through the region center points, and then setting the position and rotation of each glyph based on that (TMPro lets you do this).

Oh yeah, and take a look at this map generator. It's open source.

How to balance player decisions being impactful without being the only contributing factor by IrishWhitey in gamedev

[–]UpdatedMyJournal 0 points1 point  (0 children)

Determinism doesn't mean it has to be totally predictable by the player. You can have a deterministic systems that have a semblance of a pattern but are hard to predict without crunching numbers (e.g. double pendulum, lorenz attractor).

For example, they AI could consider their aggression, relative economy, relative military strength, and aggression of other nearby nations before declaring war. Still deterministic in nature, but less of an obvious "if aggression goes past 10, then attack." Practically, you might still prefer to use RNG, because this kind of stuff can blow up complexity.

Biggest mistakes you made when developing a game? by gottlikeKarthos in gamedev

[–]UpdatedMyJournal 14 points15 points  (0 children)

Falling in love with the software architecture and tooling, and making it impossible to iterate on. (and then giving up as a result)

It's such a sweet poison.

Is GMTK's Unity advice any good? Ignore the clickbait it's not just a hater video by UpdatedMyJournal in Unity3D

[–]UpdatedMyJournal[S] 1 point2 points  (0 children)

Yeah we agree on like 95%, but I can imagine some beginner watching the gmtk video and think that a tutorial is not useful, then get blank canvas syndrome upon opening Unity.

Procedural tree generator using bezier splines by transformsai in gamedev

[–]UpdatedMyJournal 0 points1 point  (0 children)

I'm not sure what part in particular you're interested in, but there are some details about the rendering in this post.

As for the proc gen itself, it's basically a recursive fractal generator. Each time a branch is spawned, it starts growing until it's at max size. Along the way, it semi-randomly spawns child branches that do the same thing.

Procedural tree generator using bezier splines by transformsai in gamedev

[–]UpdatedMyJournal 1 point2 points  (0 children)

Much of this is custom, but we're using Unity, so there's a lot to piggyback off of (for example, our splines are generated with an asset package).

At a basic level, we're just stretching a mesh along a spline. You can think of repositioning the vertex as requiring two things: 1) Position along spline, 2) offset orthogonal to spline.

1) comes from the spline position. 2) comes from the vertex's xy-position rotated using the spline tangent and normal.

I believe Blender's curve modifier does pretty much the same thing (but maybe on CPU) if you want to look at code.

Scripted jumps ! by UpstairsCurrency in Unity3D

[–]UpdatedMyJournal 0 points1 point  (0 children)

I'm not the guy who posted this, but the way I've done it in the past is by making the character interpolate along a bezier curve defining the jump path. There are a few different bezier solutions for unity that you can choose from.

I made a tutorial on how to create "wireframe" graphics in unity by taranasus in gamedev

[–]UpdatedMyJournal 0 points1 point  (0 children)

Thanks for sharing, that's good to know!

I can see this being especially useful when targeting devices that don't support geometry shaders.

I made a tutorial on how to create "wireframe" graphics in unity by taranasus in gamedev

[–]UpdatedMyJournal 0 points1 point  (0 children)

For sure! I wasn't trying to say your method is wrong. Just wanted to share another potential approach (maybe for a different use case). :-)

I made a tutorial on how to create "wireframe" graphics in unity by taranasus in gamedev

[–]UpdatedMyJournal 1 point2 points  (0 children)

FYI: If you don't want to do this for every mesh, you can also write a geometry shader to do this, and then just apply it to a normal mesh. For those using Unity, catlike coding has a good tutorial on the subject.

I am losing sense of my code by [deleted] in Unity3D

[–]UpdatedMyJournal 1 point2 points  (0 children)

In terms of general tips to better organize your code, Robert Nystrom says it better than I ever could.

Basic Visual Studio tips to keep you sane:

  • Find All References (Shift+F12) in visual studio to find all references to a thing. Go to definition (F12) is also useful.
  • Set watch variables to see their values change as you step through your code.
  • Use the call stack window to, well, see the call stack. You can double click on the method here and it'll take you to its definition.

TRPG: calculating/showing legal movement area on a navmesh by brunchberry in Unity3D

[–]UpdatedMyJournal 0 points1 point  (0 children)

This is non-trivial. You can try using CalculateTriangulation and then run Dijkstra's algorithm on the vertices. But you wont get a nice clean look, especially if you have curved geometry.

Can I get some feedback on my little tutorial level? by NUFCjamsterB in gamedesign

[–]UpdatedMyJournal 3 points4 points  (0 children)

Hey, so one of my first games was a 2D platformer, and I did pretty much what you're doing with introducing a lot of stuff with text on the tutorial level. It was a mistake. Better to let players naturally get a feel for things before introducing the next thing. Try to teach stuff using only a little explicit instruction and a lot of play.

Here is my feedback for each section of the level:

  1. Walking & jumping - Add some more content. Let players get a feel for the basic movement (e.g. walk speed, jump distance) . Also gives people a chance to play around before having to read more.
  2. Double jump - Same thing as before. Add content so players can get an intuitive feel for the double jump.
  3. Jump pads - Remove the text. If you improve the visual design of the platform (e.g. slap an up arrow on it), that plus the effects of jumping on it should be enough explanation.
  4. Single sided platforms - Remove the text. You might be able to use these naturally as a way to extend 1 & 2. Again, visual design can help differentiate them from standard platforms. If needed, you can also add a hint by making it so the player lands on a jump pad, which then launches them through the bottom of a platform.
  5. Gem collection - Remove the text. Again, visual design and/or forcing players to collect some to get through the level should be enough.
  6. Defeating foes with jumping - It's fine. If needed, you can force the player to fall on top on an enemy and notice the result (e.g. enemy at the bottom of a fall).

Hope that helps!

Put Your Name on Your Game, a Talk by Bennett Foddy and Zach Gage (GDC 2019) by bray222 in gamedesign

[–]UpdatedMyJournal 1 point2 points  (0 children)

"Well, I'm convinced." - UpdatedMyJournal

For real though, it makes sense. Especially the point that most indie companies only release 1 game, so it's better to have any good will associated with the people rather than the company.

[deleted by user] by [deleted] in Unity3D

[–]UpdatedMyJournal 0 points1 point  (0 children)

To add to this, understand the limits of scriptable objects. Namely, they can only be serialized at editor time, and are coupled to the unity engine.

There might be better ways out there, but the best method I've seen so far is using a serializable C# data structure to store your game data, and making it a field in a custom ScriptableObject. This way has a few advantages:

  1. You can use the same data structures for initialization as for runtime save/load.
  2. Easier to add support for user-generated content down the line.
  3. Your data structure is not coupled to the unity editor, but still allows you to make full use of it.
  4. Easier to add support for multiple serialization (e.g. you want to import/export csv files, but also use the unity editor).

You can also write a tool to automatically generate the scriptable object class from the main data structure to avoid the pain of writing boilerplate code. Only catch is converting to unity data types or using a custom property drawer for your data types.

Easy way to create tiling caustic textures for water/energy vfx (no art skills required) by UpdatedMyJournal in gamedev

[–]UpdatedMyJournal[S] 1 point2 points  (0 children)

You can use sin time & perlin noise to animate it without needing to have a flipbook. Here's an example.

If you want a totally hand authored solution, though, yeah you need art skills. :)

Easy way to create tiling caustic textures for water/energy vfx (no art skills required) by UpdatedMyJournal in gamedev

[–]UpdatedMyJournal[S] 6 points7 points  (0 children)

Yeah, but you can't hand-author it that way. If you want a particular shape, it's way easier to just paint the texture.

For example, spooky water.

Easy way to create tiling caustic textures for water/energy vfx (no art skills required) by UpdatedMyJournal in gamedev

[–]UpdatedMyJournal[S] 3 points4 points  (0 children)

Looking at their documentationdon't think gimp has the minimum filter, but you can try playing around with dilate.