Suggestion for extending this section

Is this section now fully complete?

If not I would like to make a suggestion for an extension, that is to implement a simple inventory system. This would allow the player to collect items along the route. Then at a later stage possession or otherwise of these items could determine their ability to make certain choices within the game.

If you really want to elaborate on this you could have the outcome of the choices vary according to the possession of the item. Another possibility would be to have multiple outcomes of a choice vary randomly, making for more interesting and varied routes through the game.

Just a thought. :grinning:

3 Likes

Hey Keith,

I’m fairly certain this section has been wrapped up, as the remastered content is now all the way up the Laser Defender. The learning tends to be progressive also, so implementing an inventory system early on in the course may be a little bit too much for first time Unity users or those new to coding in general.

We can tag @Rick_Davidson though and see if he has any thoughts on the matter… :slight_smile:

Incidentally, there is absolutely nothing stopping you having a go at implementing a system like this into this game, or extending any other features and sharing the approach you used with the community. Chances are there could be a lot of students thinking, “ooh, wouldn’t it be good if I could…” and then your topic would help them out or give them a little guidance to get started.

Hi Rob,

I suspected that the section was finished but just thought I would ask. Do you know if Rick actually monitors these posts? I am a little reluctant to tag him directly as it was a fairly minor query.

As you suggest I could have a go at implementing the suggestions myself and posting the results. It might have to wait a while as I am using the course to (among other things) get back into the ‘swing’ of Unity/C# for some work I have been asked to undertake. I have been working on the Godot course for a little while so my Unity skills (such as they are) are quite rusty.

I am also unsure as to how an inventory system will fit with the scriptable object set up, as by its nature possession of items will affect the course of the game and require flexibility in terms of what the next game state should be. Consequently you can’t just have precoded destinations, but need some form of branching in the object. I can think of ways of doing this, using two alternate destinations, but as I understand it scriptable objects are really intended for holding static information and are limited in terms of their mutability. So I am a little worried that my solution would ‘break’ the scriptable object paradigm. That’s why I was hoping for a bit of guidance from the experts as to how it might be implemented.

Hey Keith,

Do you know if Rick actually monitors these posts? I am a little reluctant to tag him directly as it was a fairly minor query.

None of the instructors really spend a lot of time reviewing posts on the forum, so if there are course specific questions you are better posting those within the Q&A on Udemy where one of the student instructors can either resolve or escalate. That said, often if you tag Rick and often Sam you will have them reply, hence the tag :slight_smile:

As you suggest I could have a go at implementing the suggestions myself and posting the results.

It would be very satisfying to achieve an enhancement on your project like that.

Regarding the more specific queries… there are ways you could still incorporate the scriptable objects for the state and also have a non-scriptable object based inventory…

You would probably need to dial the idea down to its basics initially, i.e pause the randomness, and get a model working first, then introduce extra ideas/concepts. I’d go as far as just including collecting items initially also, e.g. I wouldn’t worry about dropping them. You could then enable options within your states based on whether the player has an item or not. That could be phase one.

You could use the scriptable objects to store where objects in the game spawn initially. The kitchen has a knife. The study has a book. Nice and basic, but initial spawning points.

You would want some form of collection/list/array associated with the player to hold the items they have collected and remove them from the scriptable objects when taken.

Once you have some functionality it will be much easier to build upon it. So after this I’d probably look at then dropping items. Have the states store what has been dropped, so maybe I take the book from the study, walk into the kitchen and drop it, now there’s a knife and a book. That suggests that the states need to be able to store a collection of items, not just one, and so the design gets tweaked a little to support that.

Maybe next you introduce Take All and Drop All, just as a player convenience, but you’d already have the main functionality required to implement that, so its a nice win.

You could increase the complexity for the options on each state, so for example, perhaps an option has a reliance on an item. You could make some design decisions with regards to what happens under these circumstances, for example, do you not even show the option that relies on an item if they don’t have it, or do you show the option but then handle what happens when they try to use the option without the item. A door is a nice example of this. “2 - Unlock the door and walk through”, this could just tell the player that they need a key.

You could later consider the number of items a player can carry, which may make them have to think about what they take, and/or when they drop items to take others instead.

In the block of text above there are a lot of features, but remember, it all started small and got built up bit by bit. This approach would give you the opportunity to build something to suit your game and the direction you want to take it in.

Hope the above is of use :slight_smile:

1 Like

Hey Keith, feel free to tag me if its something for my eyes. As Rob says, I don’t see all the questions in the forum (there are lots of them) and tend just to dive in when I’m poked.

Thank for the good suggestion. Its always a wrestle for me as to when we’ve finished a section and its time to move on. My game designer brain wants to keep adding features, but my instructor brain insists that we keep things moving along and fresh.

2 Likes

Privacy & Terms