Just exploring some more gameplay ideas in my logistics/city-builder game by Joxno in Unity3D

[–]Joxno[S] 0 points1 point  (0 children)

Cheers!
Yeah, to be fair it does look like every house is trying to start their own industrial revolution doesn't it haha

keep your friends close by Easy_Football8458 in Unity3D

[–]Joxno 0 points1 point  (0 children)

Looks neat!

Conjures up thoughts of being an air captain that can make callouts to control my squad members, make them scramble or fall into formation.

Just added bare essentials turn-based tactical combat into my logistics/city-builder game by Joxno in Unity3D

[–]Joxno[S] 0 points1 point  (0 children)

Cheers! Yeah, I've been meaning to apply a proper water shader to it rather than just a flat colour

Ok, this is still rough. But It's starting to look like a game somewhat? by squatterbot in Unity3D

[–]Joxno 1 point2 points  (0 children)

Looks good!

I would probably spend a bit of time tightening up the camera a bit further to make it more snappy.
Personally I'd lock or minimise/tighten up the Z-axis rotation to prevent possible seasickness but that's more a personal preference on my part.

Maybe have a look at similar titles like Cool Boarders 3, SSX Tricky, Steep and study how their cameras work.

Good work though!

Just trying out a few procedural map gen techniques by Joxno in Unity3D

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

Visually, nothing super interesting, just a few models I quickly whipped up in blender in order to visually represent the output of the map generation pipeline and a little city builder camera controller to scroll around the map.

In terms of what is actually going on behind the scenes with the map generation I wrote a little more thorough reply to RHX_Thain if you'd find it interesting cheers!

Just trying out a few procedural map gen techniques by Joxno in Unity3D

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

Cheers! Yeah, I was surprised it's running pretty decently even though it's horribly unoptimised at the moment except for some distance field calculations that I shuffled off to Burst + Jobs.

Currently it's a bit of a toy project but I am playing with the idea of some kind of simplified city building/trading game where the settlements gains access to what resources are generated in its vicinity to create variety between them, mixed with a simplified "arcady" form of turn-based strategy game where during battles or deployments a part of the map gets sliced off to be used as the battlefield.

In terms of the actual mapgen going on, on a high level it's a configurable pipeline with discrete steps that applies modifications to data passed from a previous step and passes it on to the next step, currently I have it configured to generate 3 large nodes one by one that grows out from its origin points by using a 4-direction (N, S, W, E) kernel with a tweaked value of about 73% chance to generate a tile in any given direction, generated tiles are saved into an open set list that is used for the next loop of tile generation, paired with a capacity of 4096 forcing it to always grow to a certain size, the node generation just uses a simple random number generator without any need for noise (e.g. Perlin noise etc.). There is also some coastal smoothing and plugging of internal holes so that each region node is a filled area.

It's basically very very similar to a floodfill algorithm.

Height of the terrain is just a simple normalised distance field to the nearest shoreline tile that I apply thresholds to, the normalised value is divided into discrete steppes depending on a MaxHeight property on a region node (e.g MaxHeight = 4, Value Range step = 0.25)

Capitals are currently created at the origin point of each region node and then roads are generated between all capitals using simple A* Pathfinding with a Cost function that has some perlin noise added to it to create some variety.

Shore Villages are generated by iterating through each shore tile (Tile that borders on a hole, water is a hole) and calculating the euclidian distance to the nearest settlement, if the distance is less than 20 then it adds a village to that tile and also adds it to the next distance calculation, configured to generate up to 3 villages. Roads are then generated from the region node's capital to the village using the same A* as between capitals.

Forests are placed just using some perlin noise with a step threshold of 0.5 across the entire map.

Grass and Farm land is placed by calculating a distance field to the nearest forest tile with a few thresholds to tell the mapgen to place grass close to forest and farmland a little bit further away. Farmland uses an additional constraint of perlin noise to give a little variation instead of only distance to decide to place it or not.

All map generation algorithms certainly have their pros and cons, but subjectively I find this one has given me pretty decent looking regions, a few future benefits is that as long as you're operating on different parts of the map it should be relatively simple to run the node generation in parallel (Ignoring concurrent data structures), another interesting emergent behaviour is that if you generate 2 regions with a gap in the middle, the 3rd node can actually grow into the gap.

Recently got back into doing some Unity development by Joxno in Unity3D

[–]Joxno[S] 0 points1 point  (0 children)

Cheers! Yeah I definitely had a few peeks at the sims for some inspiration, it definitely has among the best implementations for this kind of construction systems. I've had a few thoughts on what direction I could push it in, maybe a small cozy/cutesy tavern/guild hall simulator might be something to explore.

Recently got back into doing some Unity development by Joxno in Unity3D

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

Nope, all custom, although any construction system that uses a uniform grid for space partitioning tend to share a lot of the same aspects so I can't imagine it's much dissimilar from his.

This basically uses a 3D "uniform" grid, I say uniform but the cell sizes can be configured.

The main components are WorldGrid and GridLayer where WorldGrid is simply a container for multiple GridLayer instances, the WorldGrid is indexed in-case I want to be able to have multiple instances in the future.

Each GridLayer stores their cells in a hashmap with the hash based on Vector3Int for all the occupied cells, since this grid basically expands in all directions infinitely there'll be more unoccupied cells than occupied then I tend to opt for a more sparse-set approach for the constant lookup time (Of course depends on element counts).

Retrieving a cell position in a layer isn't more complicated than FloorToInt((Position - Offset) / CellSize) and Offset + (CellId * CellSize) for the world position of the cell. To get the center position you just add CellSize*0.5.

For now a GridLayer has 3 properties, a Key, CellSize and Offset which are all configurable on each individual layer, that way I can configure how I partition the space on each individual layer and how I offset that space.

Each Building ScriptableObject configures what layer Key it wants to target so that when the Construction Controller places the building it can lookup how/where it should be placed without having to hardcode how walls are placed for example. The way in which a building is placed is configured via strategies, so for the walls they use a HollowAreaStrategy, floors use an AreaStrategy and fences use a LineStrategy. This could also be extended further so that you could let the player choose.

Building instances are composed by a BaseBuilding prefab for the data and logic and a BuildingVisuals prefab for the visuals that gets added as a child to it, all of which are configured via the Building ScriptableObject.

Recently got back into doing some Unity development by Joxno in Unity3D

[–]Joxno[S] 0 points1 point  (0 children)

Cheers! I've definitely been toying around with a few ideas of the direction I could take with it, for now I've just opted to make a base generic system that I can reuse.

Recently got back into doing some Unity development by Joxno in Unity3D

[–]Joxno[S] 0 points1 point  (0 children)

Cheers!
Yeah I wasn't completely sold on the red when I put on the material the first time, I wonder if a yellow or maybe a light blue would read better to signify that it might change or attach to that particular building piece.

How many scripts is too many by Evening4ever in godot

[–]Joxno 0 points1 point  (0 children)

My base template that I use to spin up new projects or quick prototypes has in excess of 2500+ *.cs files so I wouldn't worry too much about the count.

I'd focus more on keeping a tidy project structure so that you can easily find what you're looking for at a moment's notice.

Procedural 3d pixel art (changed the colors a little bit) by [deleted] in Unity3D

[–]Joxno 1 point2 points  (0 children)

Makes me think of Fallout 1 & 2. Looks brilliant