Jump to content
IGNORED

The Game Development Thread


A nice cup of tea
 Share

Recommended Posts

Made some decent progress this evening, got most of the menu stuff working and can pick a course and load into a hole. Loads of bugs along the way but squishing them was satisfying. 

 

So much code spaghetti though. It's gonna take some serious effort to tidy it all up and make sense. Lots of spurious Find Object and Get Component calls that are screwing things up and hard to pin down. But all in an evenings work!

 

Ended the day on a bit of a bum note, got completely sidetracked in trying to get post processing working right, and although at a surface level I succeeded, I wanted to do a bit more but it just seemed to not give me the result I wanted at all. Just wrote a massive post on unity forums for help! 

 

https://forum.unity.com/threads/using-multiple-cameras-for-layer-post-processing.1046182/

 

And maaaan, visual studio just told me my licence expires in 15 days! Whut! I though community edition was free? Need to investigate. Edit - aha I just need to register it! Phew. 

Link to comment
Share on other sites

Argh hit an annoying issue where Visual Studio's 'Attach to unity' debugging is basically unusable.  It used ot take a second to attach and go into debugging mode, now it locks up for anywhere between 5 - 15 mins!! What the hell.  

 

Trying a reinstall.  Frustrated. 

 

Link to comment
Share on other sites

4 hours ago, robdood said:

Argh hit an annoying issue where Visual Studio's 'Attach to unity' debugging is basically unusable.  It used ot take a second to attach and go into debugging mode, now it locks up for anywhere between 5 - 15 mins!! What the hell.  

 

Trying a reinstall.  Frustrated. 

 


I'd suggest closing everything. Then delete all the Visual Studio files from your project root. The Solution files , csproj files etc

Restart Unity, then Assets->Open C# Project

Link to comment
Share on other sites

1 hour ago, Padaxes said:


I'd suggest closing everything. Then delete all the Visual Studio files from your project root. The Solution files , csproj files etc

Restart Unity, then Assets->Open C# Project

Thanks, shortly after that post I just uninstalled and reinstalled VS and it worked fine!  Didn't need to remove any files.  I have a feeling it was the Android SDK stuff, that the most recent 'change' I'd made that could have affected VS, but god knows.  I t works again now anyway. 

 

So! Some more progress!  A fairly big milestone for me, this was a fairly big job, but now I can get round to fixing all the little things :)

 

And then I can design the actual game, lol!

 

 

 

Link to comment
Share on other sites

OH MY GOD I HATE THIS SOMETIMES. 

 

To make new course, I pull in a prefab I've made and don't modify ANYTHING except the control points on a SpriteShape, which is like a 2D polygon that lets me make any shape I want. 

 

However. Sometimes, despite literally being at the exact same world coordinates and everything, the rain particles just fall through instead of hitting the collider of the spriteshape.  It's baffling.  The collision clearly works because my ball still interacts with it. 

 

MADDENING. 

Link to comment
Share on other sites

Argh now my golfball seems to have a ghost collider circle that is bigger than it shows in the editor and it's totally borked. I haven't changed anything to do with this part of the game! WTF is going on.  Jeez.  Demoralising. 

 

Edit - ok ok calming myself. It's because of the stupid way unity does weird things to positions when you parent/child them., and then it's really hard ot tell what are 'true' positions of things.  It's probably done that way for a good reason, but sheesh it seems more complicated than it needs to be :D

 

Link to comment
Share on other sites

Ah nuts, I'm going have to look into using Instantiate, the way I'm doing this means its either that or creating loads of code/variables to resent positions of things properly. 

 

Every minor victory reveals 3 new issues.. :D 

 

But ultimately, these are all good lessons that are going ot help me plan my next project a bit better.  :)

 

 

Link to comment
Share on other sites

I stuck a trailer up yesterday for a new release of my quad sim.  I can't take much credit for the weather effects, I'd picked up an Asset called UniStorm in a Humble Bundle last year... although I did have to spend some time fixed several methods in that code which didn't function properly as well as coding a whole clean shutdown/startup thing for it.  I can't draw for toffee, so putting in those pretty shader effects do manage to lift the graphics up a bit.

 

In the next release, I'm planning to have a single player gaming experience essentially making a Super Monkey Ball style thing but wher eyou have to hit the ball around with your quad.

 

 

Link to comment
Share on other sites

2 hours ago, robdood said:

Argh now my golfball seems to have a ghost collider circle that is bigger than it shows in the editor and it's totally borked. I haven't changed anything to do with this part of the game! WTF is going on.  Jeez.  Demoralising. 

 

Edit - ok ok calming myself. It's because of the stupid way unity does weird things to positions when you parent/child them., and then it's really hard ot tell what are 'true' positions of things.  It's probably done that way for a good reason, but sheesh it seems more complicated than it needs to be :D

 

If you're dealing with the position or rotation of the child of another object directly you often want to work with it's local transformations relative to is parent. So you often want to be accessing its transform's "localPosition" and "localRotation" variables (rather than it's "position" and "rotation" variables which are based on world space). It seems a pain when you first come up against it, but it's exactly what you want an awful lot of the time. If you want to move or rotate a child of a parent that's also moving or rotating you just want to offset it from the parent, not work out where and how the parent is orientated in the world and then offset it from that.

 

As a (hopefully) simple example, if you imagine a simple flat floor object that you want to place a child 1 unit perpendicular above it and 2 units to the right, it's easy to do if the floor object is at zero rotation. But rotate the floor by, say, 60 degrees, and now try to put the child in the same relative position to the floor. With the "position" variable if you move it by 1 up and 2 right it'll now be below the rotated floor, because it's moving along the world's axes, which are still all zero. But with localPosition, you're working with the inherited positions and rotation axes, so it's still just 1 unit of the child's "up" and 2 of its "right" away from the parent because it's all relative.

 

Confusingly when you're new to it, the inspector shows the localPosition and localRotation of a child object, not the "position" and "rotation". It's hard to spot if you're using good practice, because often you're working with a parent at 0, 0, 0 in the world, so a child will be offset by exactly what you think it should be from the world. But if you move or rotate a parent object, you'll see that the child's position and rotation in the inspector stay exactly the same, because they are just offsets from the parent, not from the world. 

 

I'm more than a tad drunk, but hopefully that makes sense.

Link to comment
Share on other sites

10 hours ago, robdood said:

Ah nuts, I'm going have to look into using Instantiate, the way I'm doing this means its either that or creating loads of code/variables to resent positions of things properly. 

 

Every minor victory reveals 3 new issues.. :D 

 

But ultimately, these are all good lessons that are going ot help me plan my next project a bit better.  :)

 

 

 

You are obviously learning a lot. There is an argument for rebuilding your project from the ground up with an improved architecture incorporating these lessons :) 

Unitys heirachy is really useful as Mark has said. 

But I would be considering why your ball is parented to something thats scale / position is changing though ? 


To use a simple example, I would have a manager on an empty gameObject at the top of the heirachy for my level. I think you said your not using scene loads. The manager would instatiate my chosen level prefab  and the player / ball prefab and parent them independently to the manager game oject which would never move or scale.

 

 

Link to comment
Share on other sites

Thanks both - though the issue I was experiencing wasn't due to the ball being parented (it isnt!), it was due to a mismatch of Z values on the Hole / Stage objects and related children (e.g terrain, tee, hole, flag) - the way unity makes adjustments to the parent's centre point when the child items are of different Z values was throwing me, and I hadn't realised they were out of whack on the Z axis because of it.  Did too much work in the 2D scene view!! :lol:

 

Ultimately it mean even though I put the parent stage object's Z axis to 0 (the same as the ball), the terrain was off a bit, so the 'ghost collision' was actually just an illusion caused by perspective. 

 

2.5D headaches, man.

 

And yeah, I'm going to have to rework the way stages are shown/hidden, because I'm currently fucking about with SetActive(true/false) and it's causing loads of weird headaches.  

 

It definitely is tempting to start it from scratch, and get the game management side, the instantiate/destruction of stages working first, before then bringing in the physics/controls. 

 

Found a nice tool the other day called coggle which I'm going to use to plan out my game management :)

 

Link to comment
Share on other sites

Well, considering I've spent most of the evening on this, it's funny how 'slow' it feels, considering my editor still looks like this:

image.thumb.png.9a9d7556d66c33a14c44d103a368b4fa.png

 

Hehe.  But a lot has happened! Made lots of classes, got the initialisation of the courses/holes done, and I've just managed to get my first instantiate and subsequent destroy working! 

 

So next, code the logic for starting a course, then completing each hole, loading and destroying prefabs as we go.  I mean each course is just a sprite at this stage, and I'll be completing holes by just pressing a key on the keyboard, but still! It's the logic what counts :D

 

My Mrs asked why I was starting over, I came up with a good analogy.  My first attempt was like I was building a house, except I started by building a swish looking living room, but then as I tried to build the house around it I realised I didn't have room for the wiring and plumbing.  Let alone other rooms!!  And as I tried to hook things up, they just didn't work and it was increasingly getting harder to know why.  She thought that made a lot of sense!

 

The guides etc on youtube I watched don't really help in that regard!  They're all about getting to a result pretty quickly, none seem to emphasise the planning required to get something that's not going to fall over and become impossible to debug down the line. 

 

But anyway. Onward!

Link to comment
Share on other sites

4 minutes ago, Padaxes said:

I always get triggered by other peoples unity layouts though lol 

Ha, is that a dig at mine? It's just the default, I gave up on changing it as it seems to corrupt/lose my settings frequently.  So I just put up with it! 

 

SHOW ME YOURS (and explain why you like it!)

 

Had some fun adventures coding this evening.  Worst (best) part was getting confused for like an hour because my debug/testing 'move ball to mouse pointer' thing was working so weirdly, like the ball seemed to be getting detached from its own centre.  Spent ages stepping through code, examining the inspector and googling. 

 

Eventually it hit me... I'd put the physics component on the sprite, not the game object/prefab!! :lol:

 

But getting there, at stage where I've got a ball I can manually plop into a hole, which in turn triggers the next course.  Using prefabs and variants is super useful, I love that I can just add a new item (e.g. the tee) to the main prefab, set it all up with scripts and links in inspector, and then it automagically does the same for all existing prefabs.  AMAZING :D

 

 

 

Link to comment
Share on other sites

1 hour ago, robdood said:

Ha, is that a dig at mine? It's just the default, I gave up on changing it as it seems to corrupt/lose my settings frequently.  So I just put up with it! 

 

SHOW ME YOURS (and explain why you like it!)

 

 

Totally not a dig at your layout, probably says more about my mentality :lol:

I use the 2 x 3 layout. The icon slider all the way down. And Maximise on Play Turned off. I have the build settings and Console output on the other monitors, but if its a one monitor setup I hover it where I have space on the right. The reason I like this is it gives a good view of the heirachy and project views as they have the full height of the screen and you get as much as possible on without big icons.

The two panels show the scene and the game running at the same time which I can't live without.

Unity_Layout.jpg.8d4d5d67a95ffb908308f139ea5814f0.jpg

Link to comment
Share on other sites

Yeah that was how I liked setting it too!  TBH I've not done much time in the actual editor since restarting the project :) All VS.  Where I have a side-by-side, two code windows open, with tabs listed down the righthand side :D

 

Link to comment
Share on other sites

Haha, interesting.  When I do see other peoples editors I forget you can change it as I've become so used to my own layout.

 

940661380_Screenshot2021-01-29at22_50_39.thumb.jpg.8153282392c348fe3b701da327b915bf.jpg

I can't remember even if this was one of the set layouts, or I customized it to my own liking.  I tend to like to see what's going on in the middle with peripheral stuff around the edges.  So scene hierarchy top left, assets bottom left and I set my list of "stuff" to files rather than icons so I can see more on the screen.  Game window bottom middle with editor window top middle (The use of both is absolutely critical for me as I can move around the scene independant of my "player" as I need to.  Finally, I have the inspector window on the right.  If a single thing changed in this layout, I'd be lost :D

 

Link to comment
Share on other sites

Update! I love how amateur things look this time around. But I can make it pretty later, innit! Hehe. 

 

 

So far we can:

  • Set up hole & background prefabs, link them up to courses in the inspector and with no extra coding can successfully load our way through any number of them, returning to title screen after 
  • Objects within prefabs for tees, water hazards, offscreen detection and hole/Cup itself set up with scripts etc so I don't have to code or manually set anything separately (like ball start position) for each hole 
  • Main menu, in game menu and score hud all set up. Score resets per hole/course as needed
  • Just starting to get the aiming implemented, got the floating text and aim line at early stage - gonna make sure it's working tidily and hiding itself properly, not interfering with menus etc before I get onto doing the actual ball movement and camera stuff. 
Link to comment
Share on other sites

Progress! Ah, we're almost back where we were before.. Except a lot more robust this time! :D

 

Got a bit tired of trying to solve coding things (currently trying to figure out a decent way of transitioning / fading to black between holes) so spent some time tonight making a draft tutorial, and making it look a bit prettier! 

 

 

Not sure what to work on next, there's loads I still want to do! 

 

Might fiddle with transitions a bit more, then add some music and sounds, then get the options screen hooked up to actually turn things on and off! And then saving data! 

Link to comment
Share on other sites

Amazing progress. The fade in/out issue I solved a few years ago with a script I found online, but it's not worth recommending (it's a pain in the arse, tbh). It looks like an easily-Google-able issue though to find a decent solution. 

 

However - can I recommend you get some sound in next - it will help enormously. Get loads of sounds in. Go fucking OTT with sounds. Honestly, everything should be feeding back by sound, as well as vision. And then you just want to go nuts for the sake of it. Add sound to things that need it first. Then add sounds to things that don't need it. Then just add more sounds. Audio is the bit I'm least good at creating, but I know enough to chuck the kitchen sink at it with borrowed sounds/whatever I can scrabble together. I'm watching this and as the ball goes in the hole I'm thinking of Peggle and what it does. I'm not saying to copy its "Ode To Joy" mentality (your game is much more cynical obvs), but the feedback Peggle gives is incredible, and that's what's worth looking at.

Link to comment
Share on other sites

7 hours ago, MarkN said:

I'm watching this and as the ball goes in the hole I'm thinking of Peggle and what it does.

 I wonder if that's because I planted that seed? :D

On 16/01/2021 at 01:46, robdood said:

To do!

  • Sound
  • Add water splashes when ball enters water
  • Make the raindrops change texture once they hit the ground
  • See if I can do a dramatic zoom-in when nearly getting ball in hole (think Peggle and the last peg)
  • Main menu
  • Rescale things to get bigger courses
  • Set up chain of courses
  • Persistent overall stroke count for all courses
  • Save game / record handicap
  • Muck about with lightning & related lighting effects
  • Look at touch/mobile build 

 

Link to comment
Share on other sites

Hehe - possibly. My memory is terrible, and I am very suggestible. But I do hold Popcap's output in very high regard with respect to feedback - rewarding everything with sounds and effects and other bonuses. (I always remember one particular incident. I'm hazy on the exact details, but I think I'd hit the last pin, tried to bounce it into the bucket, but missed by a whisker, the ball bounced back up, off the wall, and then back into the bucket, and it rewarded me for pretty much THAT explicitly - hit last pin, only made it into the bucket at the second attempt.)

 

As a result, I try to add as much sound as I can as early as possible. When I start a new project I automatically copy my menuMove and menuSelect sounds across from a past project, because those are 2 sounds I know I'll want early on, and everything - even the front end - just feels nicer with that feedback. (I don't even like those sounds particularly - I've been meaning to find better default ones for ages, but having something is much better than nothing (and the more these grate, the more likely I am to swap them for something that fits the new game better).

Link to comment
Share on other sites

@MarkN omg you're right!  Sound has really made the thing come alive :D  Use headphones to hear the details.  Am dead pleased with how I alter volume and pitch of sounds dynamically based on things like speed etc :) An extended WFH lunchbreak well spent! ;)

 

 

 

 

 

Link to comment
Share on other sites

Haha - that's great. And again super-fast progress. The stretchy aiming sound is particularly effective (the kind of thing you could just sit and play with without even taking a shot).

 

Edit: Have you thought about doing sarcastic clapping for bogeys? That would be funny - just one guy doing a short slow hand clap.

Link to comment
Share on other sites

17 minutes ago, MarkN said:

Edit: Have you thought about doing sarcastic clapping for bogeys? That would be funny - just one guy doing a short slow hand clap.

Yep! And groans etc.  In fact to keep with the miserable tone I might just make it all one-man clapping, with various levels of enthusiasm. 

Link to comment
Share on other sites

5 minutes ago, robdood said:

Yep! And groans etc.  In fact to keep with the miserable tone I might just make it all one-man clapping, with various levels of enthusiasm. 

Sounds like my kind of game! You could go to town with that - it's such a fun angle. Being watched by one bored spectator (and possibly his dog).  Really pathetic insincere cheers and woops. Sniggering when you miss a sitter. "You muppet!" for a particularly poor shot.

Link to comment
Share on other sites

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) 

Link to comment
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
 Share

  • 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.