Jump to content

  • Log In with Google      Sign In   
  • Create Account

Several 3D environments. How to ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Karnot   Members   -  Reputation: 179

Like
0Likes
Like

Posted 10 June 2014 - 07:11 AM

For example, i might have an environment that is a game level, and my character walks around it. But when i open his inventory it shows another, small environment where i can rotate a character's model, change his equipment and so on. What is the "time-tested" way to do that ? Do i just put all environments i might call on in every game level ? That seems excessive, but i cant think of anything else.

For instance, in Unity i could create a game level in one file, and inventory screen in another, and switch between the two, but it is somewhat problematic to keep track of the data, not to mention there will be a loading time, however small it might be. In most modern games inventory screens and such just come right up, as soon as i press the button. Do people really just put everything in one level ? Please explain this to me.



Sponsor:

#2 Burnt_Fyr   Members   -  Reputation: 1241

Like
0Likes
Like

Posted 10 June 2014 - 08:12 AM

your inventory is not part of the level at all. Your level is just data, as is your inventory, but they are not the same. That being said, how you display it is up to you.

 

A screen that operates on a characters inventory simply needs to have access to that inventory, how ever you store that data. When the user accesses the inventory, the screen pops up, allows the user to interact with their equipment, and when closed, the game resumes as normal. I'm not familiar with unity, so i'm not sure how i would accomplish that with said tool, but surely there is a GUI system in place.



#3 SeanMiddleditch   Members   -  Reputation: 5795

Like
4Likes
Like

Posted 10 June 2014 - 11:21 AM

In Unity, yes, they're still usually separate levels. Preload the inventory/menu levels and never unload them. When they're inactive, simply disable/hide their rendering. You'll usually need some kind of game-specific system in place to manage GUI objects, visibility, input modes, etc.

Note that in Unity (at least back in 3.5) you also have to deal with the annoying part where there's only a single Cartesian space, so you have to place all the UI assets at some world position never seen from within the game (or use some similar kind of trick, maybe with object tags/filters). Multiple distinct spaces are ridiculously useful and any engine lacking them should be kicked in the metaphorical shin. smile.png

#4 Karnot   Members   -  Reputation: 179

Like
0Likes
Like

Posted 10 June 2014 - 01:49 PM

>you have to place all the UI assets at some world position never seen from within the game

 

Is it done in a different way in other popular engines ? I.e. UE, CryE, etc ?



#5 Tutorial Doctor   Members   -  Reputation: 1622

Like
0Likes
Like

Posted 10 June 2014 - 04:06 PM

The engine I use has two ways to do this. One way is to render what a particular camera sees to a texture.

The other way is to project what a camera sees over another camera view (the seeing camera can be in another screen.

So we do our 3D GUI in that other scene, and just project it over the main camera.

The objects in that other scene can be manipulated by code, or animation still.

They call me the Tutorial Doctor.


#6 Scouting Ninja   Members   -  Reputation: 666

Like
0Likes
Like

Posted 11 June 2014 - 02:41 PM

SeanMiddleditch  is correct I will just elaborate:

 

In most game engines like Unity,UDK and many others, you will create a separate scene or level for your inventory.

In your level with the character you will have a camera that renders that scene, in your inventory you will have a other camera to render it's own scene.

When you press the inventory key the inventory scene will be drawn over your current scene, with it's background transparent.

Interaction with the inventory checks to see if it is visible and usually uses a screen ray for interaction, a buffer or list is used to store information for quick access.

 

The Hud is usually made the same way.

There are many other methods, some better others worse.



#7 Karnot   Members   -  Reputation: 179

Like
0Likes
Like

Posted 12 June 2014 - 10:21 AM

Thanks.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS