mrfrustrationman:
Loom (by Polynoid)
cherry valley forever
he wasn't even looking at me and he found me

Andulka
let's talk about Bridgerton tea, my ask is open

JVL
Lint Roller? I Barely Know Her
todays bird
will byers stan first human second
Game of Thrones Daily

if i look back, i am lost
almost home
I'd rather be in outer space 🛸

No title available
TVSTRANGERTHINGS
official daine visual archive
tumblr dot com
YOU ARE THE REASON

Discoholic 🪩

★
untitled

seen from United States

seen from United States
seen from United States
seen from United States

seen from United States

seen from Malaysia

seen from Malaysia

seen from Jamaica

seen from Bosnia & Herzegovina

seen from Türkiye

seen from United States

seen from Türkiye
seen from Dominican Republic

seen from United States
seen from Russia
seen from Canada
seen from United Kingdom
seen from Spain
seen from United Kingdom

seen from Malaysia
@koenvr-blog
mrfrustrationman:
Loom (by Polynoid)
I'm still alive, project still alive, quest are boring ...
Quest 6 - Items
Like all games we need items, this term is very broad so we will have to try to narrow it down and divide the remainders in to even smaller groups. First group of items we can ignore here are those that don’t require interaction, those sit in the background or just need a collision box and that’s simple to in unity. So items left are those that require some sort of interaction …Â
When will we be able to interact with a object ? How do we achieve this interaction in unity ? First of we want our player to interact with certain objects if he is in range of them. This can be done by adding a trigger to the object (a collision shape marked as trigger), the size of this shape will determine how close the player has to be before he can interact with it. Sounds simple not ? Â With that in mind we can now split up the items in to smaller groups, the goal is to create some sort of tree structure that we can use to abstract parts of the code behind them. My tree looked like this:
Projectiles
Items
Inventory
Static
Cannons
Destructible Walls
...
Usable
Armor
Weapons
Upgrades
...
Consumable
Potions
Boosters
…
Environmental
Ice
Fire
Gravity
…
Interactable
Doors
Leavers
…
The player will respond differently to the first level in the tree, this means we only have to put in 5 different behaviors (triggers) on the player. The rest can be fine tuned inside those depending on some variables in side the second level of the tree ... There is one odd duck in that list, it’s the projectiles. I left those out because we will probably be creating and destroying hundred's or maybe even thousand's of those per level, This means we will have to optimize them allot and keep there footprint as small as possible, good thing there only supposed to do one thing, hit and damage a target. That’s all there is to it. Make base classes of the first tree, refine and implement them in the second tree and make sure the triggers and messages between the item and player are setup correctly. If that's done we have something that starts to feel like a game.
(big image: http://pis.revision-base.net/photos/Items.01.png)
This blow me away so had to share ... unique, funny and entertaining. Clicky
Quest 5 - Fall Damage
So with our health stat in place the first thing I want to do is kill the player by making him jump off a platform high up in the sky … no funny eye’s, it’s what game development does to people. This sounds simple but there are some pitfalls and options to look at. So lets dive in and have a look at those … Down below you can see the platform and some different options as to how a fall could go and/or could be calculated. Just read over them and then I’l go over some of the different solutions.
Red Line (rl): Strait down from platform shortest route.
Yellow Line (yl): Bit to side, landing on other platform a bit higher.
Green Line (gl): Allot to the side, landing allot further.
Blue Line (bl): A indicator to show the height from start to land on side platform.
Before we can start we need to pick a event to start and stop checking the height/length of the fall, for me this event will always be at the start and end of falling state in the character fsm. (see quest 2) We will also need some attributes; Fall Max Height and Fall Damage per Unit; respectively from how height can we fall without damaging ourself and how match damage is obtained per unit. RayCasting: To me this seems redundant but people like to raycast and use the ray’s length, so lets look. 3 Way’s to cast the ray:
Cast a ray at start strait down, it will always get you the red line, it can work if your character is always falling strait down.
Cast a ray from end to start, it results in rl, yl or gl depending on where you end. You will have to save the starting point while falling. Again this can work if that is the result you want..
Casting strait up: There is no collision strait up so way would I do this ? If we did we would get the bl, but we would have to reset the start point to be above us .. that math can be used to manually calculate the bl without casting a ray.
Distance Between Points: You save the start point and calculate the distance from it to end point. You will end up with rl, yl or gl depending on your end point and all without the need to cast a ray. Again this can work if that is the result you want. To get bl you will have to reposition the start point, the math for that is redundant as you can see it the next option. Hint: Most vector libs provide a method to get the distance between 2 points so there usually is no need to know the math behind them. In unity we use Vector2.Distance(startPoint, endPoint) or Vector3.Distance(startPoint, endPoint). Difference in Height: Depending on your engine you safe the float representing the start height (in unity this normally is the y axis), when the fall ends you get the difference between the start height and the end height. The result is rl or bl and it is the cheapest way to get a result. No casting, no vector math and all we had to save was one float. Last note on this topic, you can also get a combination of ‘Distance’ and ‘Difrence’. Just add them up and divide them by 2 to get a average that depends on both height and length of the fall. In some cases it might be the desired effect.
Once you have that number to work with you just have to check and apply the attributes as you please. For our current project we just used the ‘Difference in Height’ fast easy and it gives the result we want. Next up is combat … wait we need weapons to fight with before we start combat don’t we ?
Quest 4 - Game Stats
First off it’s been a while but we are moving along nicely. I moved houses over the past week so didn't feel like typing out what I was working on.I hope I can cache up on that during the weekend.Â
Starts are at the hart of every game, things like: score, lives, health, … You can make them as complex or as simple as you want them to be. For our current project we needed a bit of complexity sins it has some rpg elements. So lets try to figure out what we need ...
Lets look at the obvious rpg needs:
Vitals: Health, Energy, Damage, Speed
Base Attributes to modify the vitals. (Strength, Dexterity, Accuracy, …)
Stats don’t end there, they extend it to allot of numbers that are better described as attributes. We already seen some of them in the previous list but if you think a bit more about it there are many more of these modifiers you can come up with.
Some examples:
Minimum Health, Maximum Health, Health Regen rate, Health Lock/Unlock values
Minimum Energy, Maximum Energy, Energy Regen rate, Energy Lock/Unlock values
Base Speed, Run Speed, Gravity, …
Energy Consumption (for different items/usage …)
….
All these are numbers and most of these interact with one and other in some way. The most obvious interaction is between player and items, a good gun will give the player a higher damage output then a bad gun. We could just use the gun to store damage but in that case our players ‘Accuracy’ will modify the guns damage ...
So how to organize them ? You could just slap variables around in different objects and write the interaction code for every object separately. For small simple games this can work, but as a game grows it can become a daunting task to change things around. For more complex games (any type of fps, rpg, ...) you probably want a common interface to deal with the attributes.
After some testing and playing around I ended up with something that looked allot like the ‘User Actions’ in the previous quest. A couple of classes with a manager, some key differences do and those are not just the provided functionality. Â
IAttribute is a interface, it describes the base functions and property’s every attribute should have. Unlike ‘User Actions’ there we have a base class that actually implements some of that functionality. Again we are using enums to identify the type and a specific attribute, they are fast and make your code clean and readable. (In the user action quest you can find some more info on way I like these)
We also have a manager again, to add, remove and access attributes or modifiers; it is the common interface to use when interacting with a objects attributes. The modifier class is a simple data structure to hold the ratio a specific attribute has when manipulating a other attribute. For example the value of Dexterity is added to speed with a ratio of 0.001, for every 100 points in dexterity our speed goes up by 0.1.
For now we have 3 attribute types:
AttribStatic: a float value that can be increased/decreased. (low memory footprint)
AttribDynamic: a value that can be manipulated and modified; has Max/Min value and has 3 other values to use next to the default. (Buff-, Debuff, Base-Value)
AttribCollection: the strange duck in the pond, it holds no real values but allows you to group other attributes and enumerate true them.
We could have added allot more attribute types here, think off: custom values, serialized classes, … int, double … For now I wanted to keep it simple and we don’t rely need them in our current project.
That's it so far I have been very happy using this to add stats and attributes to items and our character controller. More to come ...
Plamaker and universe work on eliminating the programmer ... lets eliminate the artist for a change. Procedural (coded) textures ftw, yarr. (j/k ofc, these tools empower both party's, not eliminate ether one of them)
A demo a day keeps the pain away ...
Indie game developer meme
Had to reblog this one, my favorite ?
and many more ofc ...
dragonmaw:
oh hello two-tone background meme. (not made by me, btw, these are just the funny ones)
Quest 3 - User Actions
The default unity input manager is firmly closed up and tucked away behind several brick walls. We want to have more control over the input and give the user the option to remap the key’s while playing. A new sub quest was born: The Input Manager.
In the first prototype this quest was completed, we had a flexible key-binding system called Input Manager. The Input Manager was a simple wrapper around the UnityEngine.Input class. It worked and life was sweet in the realm of Pis. But then some people started to ask questions, ‘can we have double tab on one key’, ‘can we have combo key’s’, ‘I need unity’s build in axis system’, ‘How about input from other devices ?’ … No, our wrapper could not do that, it was just a small and simple class.
We needed a more flexible system to deal with all the different way’s a user can interact with the game (user actions). Beside flexible it had to be fast and expendable to other input methods.
At first glance this looks like a simple task and to be honest it is. But there are several different ways to go about this and they all have there pros and cons. So lets look over them and way I made certain choices.
First option would be to simply extend our wrapper and put every thing in there; not a option really, it would make it very hard to add other devices later on and the file would just be a cluster fuck (as I like to call a huge amount of if/else statements nested in to one function/file). So we have to start splitting it up in to different classes and preferably create some degree of polymorphism to prevent the same ‘cluster fuck’ of showing up again.
The second decision to make is ‘how to store and identify these actions’, we could use array index, numbers, strings, enumeration, … as id’s.
=> First off lets strike the array index, it isn’t reliable (same as some other options I left out) as a result we would need extra checks and we don’t want that. Way is that ? Well what happens to a array of 6 elements if you delete the 4the element ? (indexes change)
=> Numbers, endless amount of id’s and fast but annoying, a number doesn’t really say what it does or stands for, you would need to check inside every time. Deleting and adding actions would become a drag as well, grab the next number in line, create a hole in the number list … numbers are a sequence right, It’s not fun and in this case very impractical.
=> Strings these are fun, they would create a endless amount of id’s and can tell us what it does before we even look inside. On the other hand they are very slow and open up the door to typo’s, two reasons way I avoid using strings as id’s when ever I can. (I know there are some tricks to speed up string compare and look-ups but still … it’s the slowest of them all)
=> Enumeration, it’s not as flexible as any of the above methods but is fast, descriptive and typo safe (errors show up before you can even compile the game). The biggest disadvantage is that they have to be hard coded so we lose some flexibility. (yes I know there are tricks to make em flexible)
My choice here is the enum, this is probably one of the few spots where I will trade in flexibility for usability.And lets be honest 128-256 user actions with the option to remap on the fly (depending on game state) should make it it as flexible as we need it to be.
As last, we look for a way to store it, array or one of the many containers in System.Collections, keep in mind we want to store a key and a value. Lets quickly go over some of the main tools that come to mind.
Array’s would waist allot of memory sins we would have to reserve it for all possible user actions even those we don’t actively use.(again yes I know, you could redo the array on change, but I don’t like garbage and I definitely don’t like the collector). A Hash-table could do the trick but it isn’t type safe and you end up casting allot. Fast forward, Dictionary is the collection we want, it’s optimised for key/value pairs with fixed types.
So lets recap, we need different action types to bind to different action key’s and we will be storing these in a dictionary managed by a manager.
So after some playing around this is what I came up with:
‘Action Base’ or ‘Act as base’ is used as base class for all other actions, this creates the polymorphism to simplify our manager. Our enumeration for all action key’s, we know what thy are for and a enumeration for the action types. Using a enum for the action types provides us with some fast check, at least faster then using typeoff(), to differentiate action types. Last but not least the manager and all the different actions.
Action Overview:
Single Key: just a single key press, vb. a, b, up arrow
Combo Key: a combination of key's, ctrl+a, ctrl+shift+a
Single Axes: negative and positive key, holding them down will increase decrease a float value representing rotation around a axis.
Combo Axes: same as above but with a key combination.
Key Sequence: A timed key sequence, double dash a key or even a longer series to create special combo (attacks).
Key Macro: For now this allows us to bind multiple ActionKeys (if there set as one of the above) to a single key on the keyboard, triggering all those actions with one key as result.
More to come ...
With that done we wrap all the public functions in to playMaker actions and we are done. Byby 'Input Manager', Hello 'User Actions'.
Clean, fast, easy to use and easy to extend. Send it off for review …
For most programmers all this will be very basic but I hope some people new to the craft or a hobby coder got some new insights. Next up will be character attributes and/or maybe a gui to test the key binding a bit more.
How do they actually make those amazing effects ? that's one way ...
Quest 2 - Moving around
Sins we will have a character in our game we needed a way to move it around. The default character controllers in the unity engine are setup for a full 3D worlds and our world will be a 2.5 realm. As a result we have to build our own character controller, a flexible controller that we can add to both enemies and players.
Before I started on this I had to take a few step backs, in our game the player would control more then one character and all these characters would have there own way of doing thing. Then there is the character controller concept, controlling the character does not just mean moving around, there are allot more aspects of a character that you can control …
So after looking at all that and some testing I found a nice little structure that would allowed us to do exactly what we wanted.
Images can say more then word:
In this structure the interfaces look unneeded but believe me they will come in handy later on. What if our player decides to drive around in a vehicle or to take control of the death star to … euh yha you get the idea.
After making sure the code for these elements worked as intended it was time to involve our state engine. This was surprisingly easy, our character controller formed a nice interface so all we had to do was plug that in to playmaker actions and set it up.
The end result looked like this:
You can see the base of our Movement Fsm, it’s getting even more complex as I type this up. At the right bottom you can see our character controller, wrapping playmaker actions around those was a breeze.
We could have ended there but we took it one step further. I decided to optimize the states in to a single actions, this should minimize duplicated references and variables;Â it also minimizes function calls; last but not least, to clean up the clutter in the ui and make room for the special effects people to add there shiny.
That's done, lets send it off and wait for feedback. Next quest will be to improve our key binding system.
Quest 1 - Pick your poison and setup !
We picked our poison long before we all teamed up in to the Pis realm, Unity 3D is our tool of choice to make some fun games for you to play. Personally I picked unity because it’s complete, stable, has a clean flexible ui and many use full extensions to make it even better. The programming interface is easy to read and has full mono support in 3 different languages, besides that you can extend it using c, c++ and objective-c based Plugins.
That said, we also decided to grab a extension (called playMaker) that will serve as a finite state machine, almost every games need some sort of state engine any way. We decided to pick up playMaker because it is flexible, easy to use and adds a visual aspect to the fsm, this allows our artists and level designers to have a better insight on the game logic and even have some control without looking at or writing a single line of code.
With the basic game design document and the perfect tools in our hands we setup and made our first prototypes ...
Links: Unity 3D, PlayMaker
Quest 0 - Intro quest.
Besides the randoms I will also be posting some info and progression updates on my latest adventure in to the realm called Phase Inertia Studios. The final quest in this adventure is to deliver a small portable game to the realm of gamers. Off course there will be many side quest to complete before we reach this final goal and I will try to keep you entertained (or bored) by posting about them. So lets start spamming to catch up on some events in the last 2 weeks.
One more just for fun, comes with a nice step-by-step guide, clicky.
A sunny Sunday so lets go euh err .. Some how a video made it in to my mail box (again), as a result I had to sit down and have some fun with unity. Final conclusion of the day, I want unity pro even more now. (and yes, I know the video doesn't use unity)
Lets fill the emptiness. By the end of this fast-paced video, you'll practically be a scrum master.