[WIP] TankMania - Syntax Bomb Game Competition Sept to Oct 2018

Started by Qube, September 15, 2018, 02:12:50

Previous topic - Next topic

3DzForMe

BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Qube

Quote from: Steve Elliott on September 18, 2018, 21:30:49
What did you use for modelling Qube?
Nothing :P - The tank and the maze walls were part of a £5 asset pack. As I'm just learning Unity and hope to complete something for the comp I decided to skip the whole creation of assets and concentrate on learning, coding and gameplay. There will be a few self crafted assets but I'll be keeping that side down to a minimum this time around as most of my time is research and learning.

But generally I use Cheetah3D, for example https://www.syntaxbomb.com/index.php/topic,3325.msg7762.html#msg7762 - All of that was done in Cheetah3D.

After this initial learning experience I'll be diving into PBR model creation. I'm sure that'll be fun :o
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

Boring Unity ramble warning :

I've had a wonderful few days figuring out GUI stuff like having it scaled per resolution, updating GUI elements and the biggest pain was sharing variables between game objects / scripts  >:(

Accessing variables and game object info from other game object scripts... What a pain!

Turns out the easiest way ( for me anyway ) was to create an empty object, give it a script and in there you plonk any variables, references to GUI elements and references to game objects that you need to access / make changes to from multiple scripts.

Then in the other game scripts you programatically ( not drag and drop ) add a reference to the GameManager object and voila, you can now easily access variables and make changes to GUI elements from any other script.

Unity has multiple ways of doing things and in all the tutorials I've watched all of them have never mentioned once about loosing dragged and dropped references when you make that object a prefab ( for spawning multiple of amongst other things ).

For example, you drag your enemy tank model onscreen and attach a script to it. In that script you write the line :


public Transform goal;


In the editor you click on your enemy tank model and in the inspector you see "goal" ( which is blank ). You then drag your player tank onto the "goal" and yippee, you can access your player tanks location from the enemy tanks script and code your chase routines, etc etc. Sounds cool, huh!

This is how all the tutorial videos I've watched do it. Cool beans, good to go you think.

Then you decide, well, I'm going to have loads of tanks so I'll need to spawn when needed. With that you make your enemy tank a prefab as you'll be spawning tanks from the very start and we don't want to pre-place them on the map.

Guess what happens then?... Yup, it looses it's "goal" reference and it becomes blank. Now you spawn a tank and it sits there like a dumb twat! it doesn't know where to go.

Also you can't drag your player tank into the "goal" variable when the enemy tank is a prefab. You can if your player tank is also a prefab but I'm not going down the route of making every bloomin object a prefab. I think I'll end up in hell on larger projects.

So after a lot of faffing around and even more reading I'm now the proud owner of an invisible GameManager object which has all the variables / references I need to have access to from various scripts.

Now I know, it'll be a piece of cake in future. I just wish that those making tutorials would at least say "This method is fine until you make your game object a prefab" - I guess they are just showing the easiest method of doing something.

No doubt the more experienced Unity users will be laughing at all this. I also suspect there may be an even easier way of doing it. But for now I like the idea of having a centralised method of easy access to any game elements that I need to change from any game objects scripts.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

GW

The biggest hurdle i think is in learning the 'unity way' of doing things. When you just start out you don't know what's already built in and what you need to do yourself.
2 video resources I've found really helpful are: (youtube) unity3d.college and (youtube) quill18creates.

Qube

Quote from: GW on September 20, 2018, 04:50:15
The biggest hurdle i think is in learning the 'unity way' of doing things. When you just start out you don't know what's already built in and what you need to do yourself.
Spot on, you definitely have to learn the "Unity way" of doing things. Doing things via a visual editor and attaching code is completely new to me. On top of that the Unity API is huge so you spend a long time researching every little thing to begin with just in case it's already covered. I can see why people loathe it and I was in that camp for many years of quickly playing with it. You really do have to dive in and persist until things start to gel.

Then you have the Unity "experts" and the accompanying gob shites that want to force their way of working as the only way of working. You also get those that are very familiar with Unity and just spit at newbie questions which they answered years ago. Luckily thats not the full picture and there are a good load of helpful users around.

My best advice to new users of Unity is patience, expect to find good and bad advise and work out what's best for you.

Quote from: GW on September 20, 2018, 04:50:15
2 video resources I've found really helpful are: (youtube) unity3d.college and (youtube) quill18creates.
Thanks, not come across those yet, will take a look. One resource I've viewed a lot is https://www.youtube.com/user/Brackeys/videos - He goes though things very fast and I end up rewinding quite a lot but his tutorials are pretty helpful at getting a grip on things.

The maze comp was a perfect excuse to learn something new and give myself a challenge. Not sure if I'll finish in time but I will finish the game regardless.

On the surface the game I'm doing for the comp is a simple one but it contains many elements that will be very useful for any further games. Every step has been a struggle but I'm having blast learning something new ;D
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

\o/ After a long slog I've managed to the get enemy tanks firing on the player. They only fire when there is a clear line of sight and the angle they are facing you has a chance of hitting you. Took a long time to figure this out but the code will be handy for future games.

The tanks are also a little dumb and will cause damage to each other if they are firing at the player when another enemy tank is in the way. I'm happy with that as it's a little fun and I don't want to get too serious with my first outing with Unity. Also some of the enemy tank movements are a little slippery. This can be fixed with additional code but I'll visit that last when the game is done. I also need to change the enemy tank rocket trails to another colour ( different to the main player ) but that should be straight forward.

Overall I'm enjoying my adventures in Unity. I've still masses of it to learn but this game has turned out to be a good starting point to learn some basics. I'm quite happy with how my first Unity game is shaping up. It'll be a little rough around the edges but you have to start somewhere.

For a mini stress test of the code I added 20 enemy tanks to come after me. They don't cause damage to the main player yet but that's easy enough to add in.

Off we go with another exciting 1080p 60FPS video :

Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Derron

If your plan isn't a "miniature look" (as if you play on a little toy-board with plastic tanks) then you should not use "Depth of field" in a so strong manner.
Explosions need to be a bit smaller I think.

Hud: you now say it was no real hassle to get that working (do not ask what you have to climb to make that work in Godot...) :-)


I bet it looks even better once you "pop up" the boost items (just grow them from the ground, swirl their z axis and increase scale in a "bounce interpolation"-way - so it grows a bit bigger than needed until it settles at scale 1.0).


Now back to your coding board.

bye
Ron

Steve Elliott

Lots of tanks and total mayhem, I like it!   8)

Unity really shouldn't be a long slog though, Blitz3D never was.   ::)
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

therevills


Qube

Quote from: Derron on September 21, 2018, 07:16:15
If your plan isn't a "miniature look" (as if you play on a little toy-board with plastic tanks) then you should not use "Depth of field" in a so strong manner.
Explosions need to be a bit smaller I think.
The tilt shift thing is just an effect I'm working on as part of a pickup. Not sure if they'll make it into the game but that effect is not on by default.

The explosions are over the top on purpose ;D

Quote from: Steve Elliott on September 21, 2018, 08:41:20
Lots of tanks and total mayhem, I like it!   8)

Unity really shouldn't be a long slog though, Blitz3D never was.   ::)
I think I'm having a slog of a time as I'm more used to pure code rather than a visual editor and a its game coding API. Things I've struggled with now wil be super simple in future. Also I doubt I'd of done a game like this in Blitz3D as a first outing :P
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

BasicBoy

That looks pretty spectacular!

I think learning Unity could end up on my to-do list. It will keep me occupied over the winter months.


iWasAdam

It's certainly a wake up call style wise. Defiantly a clear look and play-style. one that I both like and impressed by.


Qube

Finally happy with the look and feel :) - Now onto pickups ( both good and bad ), different levels, slowly increasing difficulty and general gameplay additions and tweaks.

I *think* I've done all the hardest coding parts so hopefully I won't struggle much while still slowly getting to grips with it all.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.