Jump to content

The Game Development Thread


Recommended Posts

4 minutes ago, robdood said:

Settings screen now does stuff! The hardest bit was finding some code showing me an example of how to set up a listener on the toggle ui elements!

 

Next! Saving settings to a file. And figuring out a way to make the rain on/off setting apply to each hole (rain is included in the hole prefabs) 

For settings you probably just want to use Unity's PlayerPrefs. It stores them in the registry (or equivalent), so it's local to the machine it's running on, and is a doddle to use. Game save data is something you'd want file-based so you can stick it in the cloud, and let the user take it between devices. (The FileBasedPrefs thing I posted a while back works almost exactly the same way, so once you're familiar with Unity's PlayerPrefs for settings, doing save games is just as easy. 

Link to post
Share on other sites

Yeah I did some reading/watching on Unity's manual / youtube last night to start getting my head around things. 

 

Was too tired to do any dev by that point, so ended up reading a whole bunch of stuff. 

 

Why didn't I learn about static classes/methods/members sooner? Sheesh. :facepalm: Now I want to go and rework everything! :lol:

 

Link to post
Share on other sites
On 04/02/2021 at 09:44, robdood said:

Yeah I did some reading/watching on Unity's manual / youtube last night to start getting my head around things. 

 

Was too tired to do any dev by that point, so ended up reading a whole bunch of stuff. 

 

Why didn't I learn about static classes/methods/members sooner? Sheesh. :facepalm: Now I want to go and rework everything! :lol:

 

 

This may happen a lot :) 

It might be worth reading a bit about Design Patterns if you havent already.

This link seems to sumarise some common ones (I just scanned it quickly mind you)

https://www.patrykgalach.com/2019/05/06/design-patterns-in-unity/

You might find the concept of Singletons interesting if you are just discovering the static keyword.

Edit: This one covers a few more https://github.com/Habrador/Unity-Programming-Patterns

Link to post
Share on other sites

I'm trying to make a game to fit into my sim.  I had the general idea of doing Super Monkey Ball with having you fly a quad into a ball and get it to the goal.  I've spend a few days working on the general structure to set this up so I can go off and make about 5 levels for people to test.

 

I did notice it's not quite as simple as saying "looks it's super monkey ball, it's great"  The dynamic of flying something around the ball is quite a different feeling, and I'm not sure if it's too challenging for new players - especially in terms of you having to hit the ball.  My alternative idea is to have the quad repel the ball like the reverse polarity of a magnet so that it's not necessary to get super close.

 

I also needed an idea to keep the ball from easily dropping off the edge whilst not restricting where the quad can fly, so came up with the idea of invisible walls which would quickly appear and fade out of the ball hits them.  I do need to go and signpost this on the edge textures in some way... mainly as there will be places in later levels where the ball can fall out.

 

Reasonably pleased so far, going to go and make some more levels and decide how to transition between them.

 

 

Link to post
Share on other sites

Spent a satisfying couple of hours nailing a decent transition between courses.  Dabbled with fading to black but it was too awkward to get camera panning to wait until fade had completed etc.  I really like this solution, looks neat :D

 

 

Link to post
Share on other sites

Progress feels a bit slow this weekend even though I put a ton of time in! Ah well, ended up in a downward spiral of never ending issues as I struggled to get aspect ratio working properly. I couldn't get it perfect, so ended up spawning another 'in between' stages prefab at the other side of the hole, so at least there's scenery if you can see 'too far' to the left or right. It's very close to good enough :D

 

Also did a ton of ui updates in between to save my sanity with not maths activities :)

 

 

 

Have just put it on my phone again, is so awesome that I made this in only a few weeks. 

 

Some weird quirks though, like the logic fir cancelling the shot by moving aim inside the circle doesn't work. Guess I've used something specific to mouse on that one! 

Link to post
Share on other sites
16 hours ago, robdood said:

Progress feels a bit slow this weekend even though I put a ton of time in! Ah well, ended up in a downward spiral of never ending issues as I struggled to get aspect ratio working properly. I couldn't get it perfect, so ended up spawning another 'in between' stages prefab at the other side of the hole, so at least there's scenery if you can see 'too far' to the left or right. It's very close to good enough :D

 

Always worth quoting the Ninety-ninety rule again:

 

Quote

The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.

 

Things like aspect ratio are such a pain to have to consider when you just want to be doing the fun stuff, and often take much longer to get working. When I worked as a game designer I used to use the phrase "good enough isn't good enough" as a design principle. That's when I didn't have to deal with shit like implementing aspect ratios. Now (occasionally, at least) it seems good enough actually is good enough.

Link to post
Share on other sites
7 hours ago, Padaxes said:

Looking pretty slick! I bet it feels nice to play on the touchscreen.

 

You should probably take "Rubbish" out of the name now :) 

It's only 'rubbish' because literally playing golf in the rain would be rubbish :P

 

Link to post
Share on other sites
4 hours ago, robdood said:

It's only 'rubbish' because literally playing golf in the rain would be rubbish :P

 

 

I know Im only joking :)  Just saying its coming along very nicely.

Link to post
Share on other sites

Update taim!

 

So hmmm what have I done? Added quite a bit of stuff, and added some polish.  So much so I've put the build up and am posting it to mates etc. 

 

So here's the link - Android and Windows.

 

Any feedback appreciated!  Try and break it if you feel so inclined. 

 

PS the Depth of Field really ruins the Android framerate, unless you have a beast of a phone, presumably (mines okish - a Realme 6 8GB) 

 

Might post it in discussion to humble brag / encourage people to dabble.  It was a lot more straightforward than I'd anticipated.  Though obviously a right pain sometimes!

Link to post
Share on other sites

My God this took ages to set up but it worked almost first time (pesky copy pasted and forgot to change something, that was the only bug!) and it looks pretty great.

 

Screenshot_2021-02-13-00-14-39-11_b74f82f765af83d24ce09e5fd02d930f.thumb.jpg.289bf6d822f67949d2b923915a5b5811.jpg

 

Also added a ffwd button, for the painful slow rolls down long slopes. :D

IMG-20210211-WA0007.jpg.d5cf7a72faf6490217216685056aa872.jpg

 

Link to post
Share on other sites

Ever feel like you've bitten off more than you can chew? That's where I am at the moment.  Want to make something I want to play.  I always wanted a roguelike Godhand / Streets of Rage type thing.  This gonna be looooong.  :D

 

 

image.thumb.png.87d25ce4c7e7a9b0ffe81099638ecbb8.png

Link to post
Share on other sites
6 hours ago, robdood said:

Ever feel like you've bitten off more than you can chew? That's where I am at the moment.  Want to make something I want to play.  I always wanted a roguelike Godhand / Streets of Rage type thing.  This gonna be looooong.  :D

 

 

image.thumb.png.87d25ce4c7e7a9b0ffe81099638ecbb8.png

Well, that escalated quickly! Good luck with it!

 

Link to post
Share on other sites

I’m currently ploughing through Unity tutorials and also downloaded Blender and am doing similar with that too.

 

It’s really nice to be doing something/anything creative again and think my first proper goal after these tutorials etc will be to make a top down vertical shooter. Whether I go off piste like @robdood and start making Elder Scrolls 8 next week is anyone’s guess but at the moment I’m thoroughly enjoying myself :) 

Link to post
Share on other sites

Good grief I need to find some proper tutorials, this is very fiddly / weird, but I still managed to make something that looks OK on the surface, at least! :D

 

 

 

PS walking animation is legit the most incomprehensibly difficult thing. 

Link to post
Share on other sites

The interesting business of things going wrong.  Today I wrote some code to have moving platforms.  I was quite pleased with how it went, as I wrote script called PlatformMover that has an array you can configure from the inspector and fill it with MoveRecord classes.  Each one of these contains a command that has a code 1 - means move, 2 means pause.  and then a sub-command for speed of move or duration of pause, and then a vector 3 that tells it where it's moving to.  I was blown away this worked first time, but I was only half done with congratulating myself when I noticed that stuff I put on the platforms just slid off again.

 

So it's bad to stick a rigidbody onto a transform and just move that around willy-nilly.  I tried rigidbodying the platforms, but movement of the objects on there was jerky.  So then I come on the idea of setting the parent of the objects that are on the platform to the platform, and then removing the relationship once they move.  I tried this on the quad, worked - great, then I tried it on the ball I knock around - and this was good.... until I tried to move it forward.

 

 

I'm still not utterly sure what's happening here - the fact that the ball is now a child of the platform shouldn't stop movement itself!?  Or perhaps it should.  I have no idea how the quad seemed to get dragged into the chaos and become all distorted itself.  After some time (read several hours) I worked out a way of adding movement to the ball when it's on the platform, which took so long due to the fact that I used a container object for the platform where the position is at 0,0,0 but these are actual real coordinates, so attempting to move the ball to the same place as the platform meant the ball whizzed off in the wrong direction until I applied a correction to it!

 

I've done 8 levels of this game now, another 2 and I'll add it to the Steam distro as a Open beta and really hope people like it.  I came up with a 1 minute trailer-type-thingy for instagram - complete with typos.

 

 

Link to post
Share on other sites
On 17/02/2021 at 21:06, CurryKitten said:

 

I'm still not utterly sure what's happening here - the fact that the ball is now a child of the platform shouldn't stop movement itself!?  Or perhaps it should.  I have no idea how the quad seemed to get dragged into the chaos and become all distorted itself.  After some time (read several hours) I worked out a way of adding movement to the ball when it's on the platform, which took so long due to the fact that I used a container object for the platform where the position is at 0,0,0 but these are actual real coordinates, so attempting to move the ball to the same place as the platform meant the ball whizzed off in the wrong direction until I applied a correction to it!

 

 

I'm guessing at what's going on here, because I don't know how you've implemented anything. However, if you attach an object as a child to another then it will inherit its parent's position in the world every update cycle, before you then apply whatever movement you need to based on player input. I'm guessing your ball is using physics, which means that its position is updated purely based on it's velocity, not in offsetting it from a position in the world, so it's constantly being respotted to the platform, and then trying to move away from it by a small amount each update. Not a scooby about the scaling though.

 

I've dabbled with similar things and have had similar problems. My approach now would be to try to make everything physics-based. Move the platforms with physics, rather than changing their positions (assuming that's what you're doing). This should make them interact better with a physics-based ball. Then you might want to look at physicMaterials to see if you can get the ball to stick to the platform better. IIRC there are also some physics settings that will help things play nicely together, but I forget what they are right now. (I'm not saying that's the right approach, it's just what I'd try if I were going to have another pop at it).

Link to post
Share on other sites
25 minutes ago, MarkN said:

I'm guessing at what's going on here, because I don't know how you've implemented anything. However, if you attach an object as a child to another then it will inherit its parent's position in the world every update cycle, before you then apply whatever movement you need to based on player input. I'm guessing your ball is using physics, which means that its position is updated purely based on it's velocity, not in offsetting it from a position in the world, so it's constantly being respotted to the platform, and then trying to move away from it by a small amount each update. Not a scooby about the scaling though.

 

I've dabbled with similar things and have had similar problems. My approach now would be to try to make everything physics-based. Move the platforms with physics, rather than changing their positions (assuming that's what you're doing). This should make them interact better with a physics-based ball. Then you might want to look at physicMaterials to see if you can get the ball to stick to the platform better. IIRC there are also some physics settings that will help things play nicely together, but I forget what they are right now. (I'm not saying that's the right approach, it's just what I'd try if I were going to have another pop at it).

It was certainly a weird one - in my mind I could still have individual movement on the ball rigidbody while it was still parented to the other container and thus inherit the general position whilst moving around.  Later testing found I was getting weird scaling issues on the quad as well, so it got rewritten so anything that is within it's collider gets a recalculated Vector3.MoveTowards call which seems to work well, and the physics have no issues reacting within this setting.  I did go down the idea of making the platforms proper physics objects - it was slightly hilarious, as all the individual tiles that make up the platform (i designed smaller tile prefabs so I could construct levels) all rubbed against each other and started moving at different rates and descended into worse chaos :)

 

This is probably down to lack of knowledge from me - I tend to work things out as I go... like most of us I guess, but I've always found physics based objects weird.  I tried for an age to build a big tower out of physical blocks just so I could knock it over and say "oooooh, physics" I can't find the clip for it, but I use something similar for my games intro sequence

 

 

 

After a few rows of blocks - even when everything is arranged perfectly so each block sits directly on the other and there's no gaps - as soon as you say run, and the physics kick in, there's a buckle.  If I didn't smash a quad through that wall, it would fall down on it's own!

Link to post
Share on other sites

To get multiple physics platforms to behave better you could probably use collision layers to ensure they don't interact with each other. But, yes, physics is fraught with issues. If you want to have nicely-synchronised platforms it can be a pain, because the ball will slow the platform it is on down a little, just through friction. You'd probably want to make the platforms enormously heavy, so that the ball can't affect them too much for starters.

 

As I said, this is all guesswork. I've tried googling for solutions to this in the past, and there's so much conflicting info it's an absolute chore to wade through (and much of it is out of date, to boot).

Link to post
Share on other sites

Yes, physics are wonderful to play with, but can seemingly be a bit of a curse just because they do their own thing based on their simulation.  An example that took me several goes to fix it was some rotating wind turbine blades (fun to fly around)

 

1617416717_Screenshot2021-02-19at20_24_19.thumb.jpg.e220efba12fffc6e096cb74e3456a0d1.jpg

 

Although the script associated with the blades just told them that they didn't have to respond to gravity and they should just revolve in one axis.  A few hours and getting hit by quads and rotating away, and they started to drift.  Even by using the ridigbody constraints and freeing the non-used rotation and positions, they still wondered off.  Although it felt very much like a dodgy hack, the eventual fix was to have an extra line in the script that essentially says "if it moves, put it back again" 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Use of this website is subject to our Privacy Policy, Terms of Use, and Guidelines.