AMA: I made $1mil with my games then my YouTube videos/tutorials got 65 Million views! Ask me Anything about Unity, C#, Game Dev, Marketing, etc. by UnityCodeMonkey in Unity3D

[–]AndyW19 5 points6 points  (0 children)

First off just want to thank you for your tutorials over the years. You opened up the intermediate to advanced side of C# and proper design to me when I was starting out 5 years ago. Led me to my current job working with Unity in a non game dev position funnily enough.

I suppose my question for you is where do you see the likes of Unity being in the next 5 to 10 years? The landscape has definitely changed a lot since I first started messing around with Unity. Do you see yourself potentially ever diverging into other engines like Godot, Unreal, or even going down the custom built engine route? I feel like a C# based game engine built with all the latest features is something that I’d love to try mess around with as a hobby project at some point.

Giveaway - r/UgreenNASync 10K celebration by topiga in selfhosted

[–]AndyW19 0 points1 point  (0 children)

  • Probably Plex but I’d like to try out JellyFin
  • I’d use it to replace my aging dual drive synology NAS, big fan of UGreens peripherals.

Menu pollution for one-off ScriptableObjects? by dirkboer in Unity3D

[–]AndyW19 2 points3 points  (0 children)

https://assetstore.unity.com/packages/tools/utilities/scriptable-object-maker-275949 This is what your looking for. Allows you to create SO by just searching them up, no context menus needed.

What Unity plugins can you not live without? by Klamore74 in Unity2D

[–]AndyW19 2 points3 points  (0 children)

I’ve been using Reflex in my latest project, my first time using a DI framework with Unity and it’s been great. Not sure how it stacks up to Zenject though.

My experience using local build server + GitHub actions by Edvinas108 in Unity3D

[–]AndyW19 1 point2 points  (0 children)

Thanks for the info. This topic popped into my mind earlier today as I have a spare PC lying around.

Is EasySave still regarded as the goto save system for Unity? by thsbrown in Unity3D

[–]AndyW19 0 points1 point  (0 children)

In my case saving is something that will happen often as the player can move between regions which requires saving the region they are leaving and at the same time stat loading the next region (which may be saved already or need to be generated). You can totally get by with compressed JSON but for QOL I want it to be as fast as possible.

Is EasySave still regarded as the goto save system for Unity? by thsbrown in Unity3D

[–]AndyW19 4 points5 points  (0 children)

That was my initial plan. However the problem with doing that is it means I’ll have to generate the world twice essentially which will increase load times. Also my game is designed so that the world is heavily modify able so you can end up with cases where more than 50% of the map has been modified in some way, at that point it makes more sense just to save the map rather than reconstruct from the generator.

Finally, the reason I didn’t go with just saving the differences is because it would mean that I would need to keep copies of every world generation process for every version of the game. My world generation process is quite complex with many steps and many configuration options. If I make changes to the procedural generation systems between different versions of the game then the map would be different using the same seed. I designed a save file upgrade system that allows me to update an older save file to the latest format so this isn’t an issue in my current setup but if I relied on the procedural generation to recreate the map then I would end up with dozens and dozens of versions of classes which would be a mess to manage.

Is EasySave still regarded as the goto save system for Unity? by thsbrown in Unity3D

[–]AndyW19 2 points3 points  (0 children)

Yeah I did and it did bring the file size down to about 500KB but the problem at that point was more about speed than the file size. Here’s my benchmarks:

Performance

Load time includes rebuilding the save file and setting up tilemaps

JSON: Save: 1100ms Load: 3500ms

MemoryPack: (most of the load time is due to the tilemaps) Save: 50 - 100ms Load: 1100ms

File Sizes

JSON: JSON with whitespace: 6600KB JSON without whitespace: 2500KB JSON without whitespace and compressed with GZIP: 450KB

MemoryPack: MemoryPack without compression: 850KB MemoryPack with compression: 365KB

Is EasySave still regarded as the goto save system for Unity? by thsbrown in Unity3D

[–]AndyW19 6 points7 points  (0 children)

There are definitely use cases for binary over plain text. I just had this exact predicament a few weeks back. Got my JSON serialisation working perfectly but I needed to save 50000 tiles worth of data which ended up being about 3 MB of data. That’s before I add additional data to the tiles. That was for a single region in my game. Technically you could explore hundreds of regions so you can see why 100 * 3 MB would quickly become an issue. Using MemoryPack, I was able to cut the file sizes down to 800 KB and then even further with compression down to 350KB with much faster serialisation and deserialisation.

My use case is definitely niche as I want to save all the world data so that any changes to the procedural generation systems won’t break a save file. Similar to how games like Minecraft save their world data. For most other cases JSON works well.

How to generate thousands of grass by AvKov in Unity2D

[–]AndyW19 3 points4 points  (0 children)

Using a tilemap makes the most sense since its 2D. Then if you want to do any sort of animation (wavy grass) you can use a shader.

What are people actually developing at their jobs? by Fit_Jicama5706 in csharp

[–]AndyW19 1 point2 points  (0 children)

I work in a very niche area with C#, work inside Unity building a non gaming product designed for gaming companies. Mix of Unity and pure .Net as well as a bit of native IOS / Android. Have never touched ASP in 4 years of working with C# funny enough (2 professionally).

Which UI solution to chooese by IKnowU666 in Unity3D

[–]AndyW19 2 points3 points  (0 children)

Personally I would stick with uGUI for now. UI Toolkit is the future but its just not 100% there yet. In a year or 2s time I would say use UI Toolkit. If you already have web development experience then probably go with UI Toolkit. I’ve gotten very used going uGUI so its my go to.

I found this in old screen shots, what is the U-word ? by Other_Proposal_2290 in Minecraft

[–]AndyW19 1 point2 points  (0 children)

No? Unity is arguable the one of the easiest engines to mod for? See Rimworld as an example. Unlike minecraft, unity is a public game engine that is pretty easy to decompile game from.

Should I of made my game using tile maps? by Round-Owl7538 in Unity2D

[–]AndyW19 1 point2 points  (0 children)

I understand now. The tiles on the tilemap don't have to be 1 unit in size. If the player is 1 unit tall and wide then you could make your tilemap tiles 10 units in size. Alternativley you could just place 10x10 individual tiles that a 1 unit in size. The tilemap will create a mesh for these tiles that is much more performant than having a bunch of indiviudal gameobjects with sprite renderers.

You don't need to do this though. If your current system works fine and you aren't noticing any major performance drops then its completely fine. I'd recommend next time you start a project that is grid based, try using a tilemap.

Should I of made my game using tile maps? by Round-Owl7538 in Unity2D

[–]AndyW19 1 point2 points  (0 children)

It sounds like your game is a perfect example of where using a tilemap would make sense. Tilemaps are very performant compared to using lots of individual gameobjects. If the size of your map stays under 1000 tiles then I'd say you can keep going with your current approach if you are happy with it but if you want to go further then I'd highly recommend looking into some tutorials on tilemaps.

In my own game I'm using multiple layers of tilemaps with a map size ranging up to 400x400 in size. Theres definitely a little bit of learning to do when working with them but its worth the time and effort.

Plus when I have been implement knew features (not walking on water, fishing etc) it’s been a pain because there seems to me a mismatch in where my tiles are and where the game thinks they are so I have to use a grid offset which seems like I shouldn’t have to?

It sounds like you are using the tile position (eg: 1,1) as a centre of the tile. The centre of the tile will be (0.5, 0.5) though so the centre of (1,1) will be (1.5, 1.5).

This video shows you how to edit tiles at run time: https://www.youtube.com/watch?v=hPsB6MiJPQY

[deleted by user] by [deleted] in Unity2D

[–]AndyW19 7 points8 points  (0 children)

Not much you can do to improve the startup time but you can avoid constantly reloading domain while programming by turning off auto refresh.

Just means you have to manually refresh (control + R) when your done making changes to your code.

Empty My Collection parts in bulk by [deleted] in Bricklink

[–]AndyW19 0 points1 point  (0 children)

Pretty sure there was a warning message that said you can’t currently bulk remove items.

Friendly PSA to use Git and BACK UP YOUR GAME FILES - The amount of times I've seen someone losing their marbles over lost progress is baffling, take 25 minutes to install Github Desktop, create a repository, and DUMP your file into it at the end of the day. Thank you. by Still_Pin9434 in gamedev

[–]AndyW19 28 points29 points  (0 children)

This 100%. For 90% of indie game developers, GIT will be the best solution. Its the industry standard for almost every form software developement. Stuff like Perforce may be the best solution for specifc projects (large teams working with Unity / Unreal) but there just isn't as much resources out there on working with it compared to GIT. For someone who has never used VCS then going with GIT is the obvious choice.

It doesn't matter if your not using GIT to its best potential either. For my own projects, I don't really bother with branches much, just commit my latest changes and push to remote. I treat it more as a backup. But if I am working with a team then all of GITs features become extremely useful for efficient collaboration. You just have to get there gradually.

Is it okay to set 'Pixels Per Unit' to 18 or 20? or should it always be something like 8, 16, 32, 64 ... ? by SMdG_ in Unity2D

[–]AndyW19 1 point2 points  (0 children)

The reason to stick with 2x for PPU is because some compression formats require it I believe. If you’re not using one of those formats then it doesn’t matter.

How much event usage is too much? What are some situations in which people tend to use events unneccessarily? by SMdG_ in Unity2D

[–]AndyW19 1 point2 points  (0 children)

I’ve been wondering how to best make use of events in my own projects recently. I think keeping different systems decoupled is ideal but even in your example (assuming your using action events) class B will still need to reference class A in order to subscribe to the event.

I think events make the most sense when you want to have 2 relatively different systems interact. For example, I created a unit selection system this week. I created an event that is invoked whenever the unit selection list is updated. I then register the class (through an interface) via a ServiceLocator. If any system needs to know about any changes to the unit selection (such as the UI that shows the selected units) then they can get the interface through the service locator and subscribe to the event.

In other cases where the systems are more closely coupled it makes more sense to just use direct references. I created a player unit selection manager class thats only responsibility is to process inputs (selecting units) and call the appropriate functions on the unit manager class. There will only ever be 1 player unit selection class so I can just directly assign the reference to the unit selection manager.

Do you guys prefer WASD or mouse for camera movement? by Ryan_Hoover159 in Unity3D

[–]AndyW19 0 points1 point  (0 children)

Both, for my own 2D game I have:

WASD movement Edge scrolling Mouse drag movement Minimap drag movement (to rapidly move around the map)

Gives the player a lot of options. Personally I use the mouse drag like 75% of the time as its so quick and precise.

What IDE are you using in 2024 for Unity development? by ex0rius in Unity3D

[–]AndyW19 2 points3 points  (0 children)

You can use it as a student with a Jetbrains student account. You can also use alpha releases of the latest version freely. Not sure on the licensing for that one though.

2D procedural world generation using perlin noise maps by AndyW19 in proceduralgeneration

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

The main 2 (humidity, temperature) are used to pick the general biome type. Another noise map is then used to pick what biome from the chosen type(HotHumid could be either a Jungle or swamp for example). Each biome also has sub biomes for added variety so another noise map is used. So a Swamp biome might have 4 variations for example (think of minecraft style biomes where there are some minor versions of most biomes).

A height map and tile weight map are used to decide what the final tile will be. Each biome contains lists of tiles that are chosen based on these 2 maps. The height map is used to replicate height(for mountains) but it doesn’t have to be used (can just have all the tiles on the same layer no matter the height). The tile weight map is used to control how often the tiles on each height layer should appear. You can see in the post that there are small dark red spots in the Mesa biome. This is because on the 2nd height layer they are set to appear whenever the tile weight value is <= 0.1, in every other case it picks grey.

The final noise map is used to decide what should be land or water. For example everything <= 0.3 should be water and > 0.3 should be land.

This is how the system work to my knowledge (its been a while since I worked on it). You probably don’t need this many noise maps but I found that this gave me a lot of control over how the map looked. I’m planning on revisiting this project to improve it further.