Unity - test example

Started by Matty, November 15, 2020, 19:51:03

Previous topic - Next topic

Matty

Good Morning.

I spent two days last week learning Unity as a part of moving towards employment with a company that uses Unity in my local area.

I put together this little example in a couple of days:

https://mattiesgames.com/tst3d/tst3d/

It is simply a space combat scene with a few ships spawning and flying around shooting at each other.

Unity is definitely no click together system

The only 'clicking together' I did was the following:

Placing a single instance of each ship/object in the 'scene' and setting their shaders.

From these single instances all game code handles the creation/spawning/movement/firing of everything in the scene.

Derron

Yes - if it is like "Godot" then it is more a kind of "visual setup / arrangement" tool. You load in assets so they internally create a specific object type for it. Then you can attach stuff - similar to components or event systems.

But most of this stuff of course could be done via "traditional" coding (or scripting) too.

What differs to "traditional approaches" is the way of doing things - behaviours, files per "unit" instead of a global single file mess some produced in the past. Think you need to get "used to it" but then it works for many kind of games.
Just do not think it is "click-e-ti-click" - if you follow tutorials doing so, you won't do good for you.


bye
Ron

Xerra

People have this idea that gamemaker is a click thing too when it's mostly not at all. I think it's been labelled that way mainly because it does have an option to create games using its Drag N Drop system built in and people who don't know any better assume that's the only way it works. Personally I have never actually used it and I think it's probably the same with 90% of other users as well. I think if you're implementing a system like that to try and encourage people to create games without raw coding then you're probably asking to be labelled, I guess.

When you use Gamemaker in it's normal environment then a game works at the very basic level with a room/object system. You create objects such as a game controller and drag them onto the room so the code within them is executed when the room is launched. This object has numerous different event controls but the predominant ones you'd be using would be the create event, for stuff that runs when the object is first launched, the step event for the stuff that runs as many times in a second as your frame rate and the draw event. You do have controls for seperate keyboard input and loads of others but most people prefer to code their own keyboard reading straight into the step event anyway.

Most games I've written with the system use one room for the whole game and I'll use a game state handler within a controller object so it processes stuff for title/main game/game over stuff all in that to keep things manageable. There's a huge amount of other ways to do it but this is keeping it at a very simple to manage system.

TLDR, it works pretty much the same kind of way as Unity, and Godot, by the sounds of it, and yet there are people who assume that if you're using it to write games then you aren't "actually coding" at all. I have a distinct memory of someone questioning wether I should be allowed to submit my first competition game here at all because it was done in Gamemaker 2. But the crux of it is, this is the way development is actually heading towards now.

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Qube

Quote from: Matty on November 15, 2020, 19:51:03
Unity is definitely no click together system

The only 'clicking together' I did was the following:

Placing a single instance of each ship/object in the 'scene' and setting their shaders.

From these single instances all game code handles the creation/spawning/movement/firing of everything in the scene.
Nice work :)

As others have said, Unity is definitely not a drag & drop, click click, game done thing.

I've only done one game in Unity which was done as a learning experience / game comp entry. The game is not optimised in anyway ( big textures ) and needs a half decent GPU + the game is kinda simple.

Quote from: Xerra on November 15, 2020, 21:33:40
I have a distinct memory of someone questioning wether I should be allowed to submit my first competition game here at all because it was done in Gamemaker 2.
I would say that Gamemaker probably has a worse reputation than Unity of just being a drag and drop easy peasy game maker.
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.

Steve Elliott

#4
Quote
As others have said, Unity is definitely not a drag & drop, click click, game done thing.

I think Unity gets a bad rap because some people sell their 'game frameworks' and assets, so you're essentially buying ready made solutions rather than doing your own coding.
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 November 16, 2020, 10:14:05
I think Unity gets a bad rap because some people sell their 'game frameworks' and assets, so you're essentially buying ready made solutions rather than doing your own coding.
This is very true and one of my pet peeves is when they then turn around and say "Look what I've done"  ::)
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.

Steve Elliott

#6
Quote
This is very true and one of my pet peeves is when they then turn around and say "Look what I've done"  ::)

I agree I find very annoying, you are boasting about no more than tweaking somebody else's work.  Plus it really undermines the software industry when people who have actually done some work and are looking to sell their software.  When that sort of person thinks it takes no effort so is worthless or over-priced - because they can do similar themselves.
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