I have learned a lot about unity over the years. I also have made quite a quite a few mistakes in design and how to work the most efficently with it. My old inventory systems used a lot of internal code swapping data / windows / array checks / LOTS OF CODE THAT CAN FAIL. So this time through it has gone at least 10x faster by using unitys design. What I am doing is all objects ARE game objects. Thus only 1. If the item is in your hand it IS in your hand. If the item is in the inventory it IS in the inventory heirchy in the scene. If it is in your right or left quick action rings then it IS. Thus no dups, losses, data corruption / extra checking code. The items simply have methods to destroy the 3D representation or rebuild it. ALL the data comes from an excel spread sheet. Items,combat,story,cut scenes, etc comes from spread sheets (Data driven as it all should be) and external for QUICK and easy testing / updates. Seen below is the starts of the inventory window with the left and right hand quick rings. drag and drop an item from the central inventory wheel and they change places.
For speed I expect to add in only 8 or so items are displayed on the wheel at a time in front of you. There will be a set of labels at the bottom and a wheel side by side for each that comes into focus when that tab is selected. The inventories auto sort on loot pickup. Each inventory wheel has 32 slots. There are 7 wheels. The wheels are from left to right as you start in the middle for speed. The seperate wheels (inventories) are Materials, Schematics, Abilities, Weapons, Medication, Armor, Ammo. Each wheel stores 32 slots. So 224 total items. However, they are limited to the type of item weapons cannot go in materials. This will be to fast of a game for that. You also have 16 quick ring slots so a grand total of 240 slots. People like their loot =). The way they are currently designed to be used is a hud pop up in camera space (locked to your scree) as the quick rings left and right will be around your hands if possible. I am worried about collision with models and do not want to set up to many extra depth clears with transparent items… but I may (I may get it to one extra). Remember Vr has to draw the scene twice already. After the inventory is up then the right control stick spins the wheel by how hard it is pressed and in the up and down direction. The center item is then selected with a press and then a direction and it will move to that spot in your ring and that item returned to your inventory. The left stick controls what section you are in and slides the wheels. All in all it only took a day so far. That is EONS faster the the old design and MUCH more easy. I think I may have 20 pages of code total for all the menus so far (probably less). That is always good when not in native code. Anywho. I will be working as much as I can now on this and seeing where I get. After I get the menus working I plan on moving them to VR. Then getting simple combat protos up. Gameplay is king and that will be the inital focus before any eyecandy is made. After I feel it is a heck of a good time playing on a simple plane with some AI. I will move to playing in levels etc.. After that its mission editor time. Which I had a pretty fancy one I need to adapt to the new databased systems. (It was native to unity and their node based systems in my own editor code.)
Off to the races!
I am doing as much as I can with quick debug code so I am not wearing a VR helmet all the time. But I made a quick key that just adds a random pistol to the menu and removes the old to oblivion for now. This test the same functionality of choosing to add a object to a slot as it will use the same function.
The way this will work will be REALLY fast.. to make the much liked VR quick action games. The user will press in the joystick on either or both hands. Then choose a weapon, or ability, or tossable item, etc… Then release and if it is a weapon it will teleport into the hand with a cool lightning effect. If it is an ability it will charge if it charges until released. If it is throwable item like a grenade it will toss the item depending on how long it is held. Thus you can do things with both hands at lighting speed. Hard to picture so one could have a pistol in the right hand but incoming enemies are getting close and the high tech sword you have deals huge damage close. So a quick flick and wham the sword teleports to your hand. Start swining with the right hand. At the same time you are charging a stun ability in the left hand. Instantly the sword comes in the stun goes off and the player goes to town. Kills the enemy and since it is dead if the last swing hit an arm, leg, hand, or whatever it lops off with a spray of blood. Then more enemies are at range so a flick with the right hand and now a rifle is in the right hand. A flick with the left hand pulls a rifle. Then a flick charges shields. Pops a shield while firing both guns down range.
Thats the plan so far and I really like it.
The cool hing is it is toltally modular. It also can be extended to any shape or size. Build it in unity and the code figures the rest out. pretty cool stuff. On to the next task yet to be decided.
So the idea is you press in the joystick and then flick in one of the directions and it will auto switch to that weapon with an effect as if it teleported into your hand for quick action. This is the future after all and we have teleporters….. plus extra quick gameplay. There will be 2 one on each hand. Abilities work the same way. Flick and use it. hopefully it will be acurate enough. I will work on that and may have to have a button press again to activate it. Moved REALLY well today… should have the menu system there workin in a few hours more work in VR. Prolly pick it up tomorrow though after a little bit more tonight after the Alabama game.
To equip the slots there will be an inventory window. There the items will scroll top to bottom. There will be a set number of slots there. These slide up or down with the joystick right button while in this menu. Then a lazer selection to slect the item then a click on one of the slots in the wheels lined up left and right. The items will then switch. A LOT easier then the previous design. And everything is moduler so the items build them selfs when they hit the world and deconstruct when they leave. It would take a long time to explain the whole setup… back to work.
Been a lot of boring code work with nothing to say is new. I have refactored the testing code to deployment code… will be working the next 4 days…gave up drinking sadly it was eating into dev time…. we all like our pubs but they do not have laptops there and I am not bringing mine! (Plus I feel a lot better!)
More as it comes.
Sheesh… crazy last 3 weeks.. 80 hour weeks are not fun… Anywho back at it!