Unnamed object/person inflation game (Dead)

EDIT (10/18/2021, 9:09 PM):
Recently, my system drive died, causing me to lose two updates I had ready to go. I’m not willing to re-do that work, so this project, in current form, is officially dead. I plan to revisit the idea eventually, most likely going to stick to one mechanic or the other with maybe a few changes here and there for the next time I make a game. I’m leaving the download link up.
A QUICK NOTE.
It’s hard to find, but you DO NOT have to pay to get the game! I don’t like how Itch does it because it probably put a few people off from playing the game, but there’s a small text hyperlink above the payment field that doesn’t really look like a hyperlink. Simply click on that if you don’t wanna pay anything for it, especially as unfinished as it was at release.
If I can find the most recent version somewhere, I think I had sent it to someone for testing, I’ll post that too.

Thank you all for your interest, it really upped my spirits while I was working on the game. Here’s hoping I can look back on this and have it give me the energy to start on a brand new project, probably with more of a goal laid out in mind.
~End Update~

Thread for a game I’m making based around the concept of having several different types of inflation that a character/object can have. Here are the inflation types planned, from lightest to heaviest:

Helium (self explanatory) the Character/object floats a certain distance above the ground. This distance is determined by their “level” of inflation, to keep things easy for coding.

O2: the Character/object is far lighter, making them jump higher, fall slower, and stop faster, as well as making objects far easier to push.

Normal: No inflation.

Water: The Character/object is far heavier, but also larger, making it easier to jump on said objects, and making the character sink in water, when in water, a character will slowly increase in level until they are maxed out. Jump height is lowered, as is speed, and it takes longer to stop, but due to the increased mass, some objects may be pushable in this state.

Fat: This only works for Characters. It’s far heavier, like water, but you can float on water, speed and jump height will decrease as time goes on, and the character will only lose weight by transitioning to the next/previous level.

Edit 1/31/2021: First Playable (V0-U0)

Well, finally time to release A version of this. This is not a very complex version, and is little more than a very early alpha build and a proof of concept at this stage. Untitled Inflation Metroidvania (V0-U0) by ImaginaryMechanisms

Changes (or, well, devlog, at this point):
-Added a placeholder character for testing purposes.
-Added water and air inflation, both of which are tied to the R and T keys.
-Added a simple gamedown/reset script.
-Added two test levels that loop on each other.

Planned:
Reworking inflation mechanics to use raycasting.
Creating a better player model.

Edit 2/26/2021: Second Playable (V0-U1)

First off, made a mistake last time I edited this post. It’s in V0 right now, not V1 yet. That has now been corrected.
Anyway, it’s still not THAT complex, but it’s a little better now. Here’s the download. Untitled Inflation Metroidvania (V0U1) by ImaginaryMechanisms

Changes:

  • Added in an “inflation gun” to use instead of R & T. (placeholder asset for now)
  • Added a system for selecting a type of inflation, and to go along with it, objects are now color codes with whatever they’re filled with.
  • Removed the old, funky button, replaced it with a much simpler example.
  • Adjusted jump height.
  • Changed shaders.
  • Modified the background objects to be less painful to view.
  • Updated UI to reflect the changes in how inflation works.
8 Likes

Update 1/7/2021
Just added in placeholder physics for “water inflation” on the “light” cube. (light blue)
Will now figure out how to fetch the mass of an object, so I can base increments off of that. May also make a script who’s sole purpose is to allow the other codes to draw values from it.

looks interesting!
If you need (wg related) assets you can contact me on discord or look for bucculentus on the forum.

Ye caught me attention laddie. I’ll watch yer progect grow.

Alright, cool, I’ll keep that in mind, thank you! I’ll probably need some later on, after I’m done using the placeholders from Yttreia’s model pack.

2 Likes

Currently, I’m having a pretty big issue; I’m trying to find the mass of an object to set as a “default” mass, so I don’t have to make new code every time I add in an object that’s bigger than what I currently have. Apparently nobody in the history of mankind has EVER done this specific function before, because I cannot for the life of me find any information on how to pull the mass data out of the game engine.

In reality water weighs more than fat. In fact fat floats in water because it is less dense.

I may change this order in game, my only thought process is since I plan to have this be the “heavy that can float”, I wanted to give it something that helps set it apart further, I.E. being more dense means the player would be able to push blocks more easily.

I’m not 100% sure what you mean by this, but wouldn’t the default mass just be a single unit of the measurement of mass used by the engine? Or do you mean a default density that will automatically apply mass to objects of any size? In which case it probably isn’t possible, as most games with a physics engine just do it the hard way and assign a mass to each and every object, and the main way they streamline this is by using the same object multiple times.

It’s hard to explain, but I’ll try to describe it.
I’m setting the mass of each object on the engine side of things, right? So for example, I have a cube that’s the size of the player at let’s say 20 mass, and I have a cube twice that size at 50. I want to multiply these masses by a modifier in code when I inflate them, but I want to use the same script for each, which currently I can’t do. (let’s say since I don’t have it open in front of me the script is something like “ObjHeavyInf” since these are objects meant to be inflated before they can be moved)

Currently I specifically have to set mass in code through rb.mass before I can change it, and can only do that by straight up changing the value manually as well, but what I WANT to do is have the code find the value set in the engine (which always exists at start up, even when I’m not setting the value IN the code) at startup, I then want it to assign THAT to an empty float/integer value (set as defaultMass so I know what it is when I go through code, this is a LOCAL value that is drawn only by the script on the object)
This number becomes the “default” that the code references when an object is returned to it’s normal state, and is the number that is multiplied and assigned as the new mass value whenever I inflate it.

In other words, I need some way to tell the code that the mass is “x” without making a new script with new code or a lookup table to manually put the number in, to streamline asset/prefab creation.

So it would eventually look like this (keep in mind this isn’t C#, or really ACTUAL code, this is just an example of what I WANT the code to do):

Engine: Mass is “x” (rigidbody tab)

Code: Finds Rigidbody Mass on the object is is assigned to, which is “x”
defaultMass = “x”

If base size is needed, rb.mass = “defaultMass(x)”
If size 1 is need, rb.mass = “defaultMass(x)X.75f”
If size 2 is needed, rb.mass = “defaultMass(x)X.5f”
If size 3 is needed, rb.mass = “defaultMass(x)X.25f”
If size 4 is needed, rb.mass = “defaultMass(x)X.1f”
(X = times cause I don’t wanna make it all italics)

Meaning I could apply the code to an object with a mass of 20(x=20), and one with a mass of 50(x=50), set them both to stage 2, and they would return with 10 or 25 respectively without duplicating the script.

Figured I should post an update, just made a background asset for the game:

It has four animations that will continuously play in a loop.

So, maybe I’m still not understanding, but you want all objects to have their own default mass, and to then manipulate that mass value, while still being able to reference that default mass for further manipulation later in the level? If so, then I would assume that all you would need to add to each object is the defaultMass value you mentioned, that then gets called (or referenced, or whatever the term is, I don’t remember C++ as well as I do Java) by the mass code you outlined, so that rb.mass can be set when the objects are loaded.
First, though, I have realized I have made an assumption that I need to clear up: is each level being treated as its own separate thing, with each object saved in its place, or does the code ‘build’ each level by creating and placing copies of objects you’ve defined? Because there is a major difference in how to go about things based on which of those methods you are using.
If you want the engine to assign that defaultMass value for whenever you make a new object (and not a copy of an existing object), that might be a bit more challenging, if not impossible. As I said in my previous post, most engines require you to manually define a new object’s values (which is why copying an object already defined and manipulating it is easier than making a new object). The best you might be able to do is to copy-and-paste a large portion of the code from an existing object.
Overall, I would advise that, to cut down on the number of objects you need to make, just make the code that ‘builds’ the level call a very small number of objects and then manipulate their size, weight, color, etc. in the code, rather than have a hundred different objects with their own stats. it means more code, and possibly longer level load times, but it makes your job a bit easier. Try to only make a new object if its characteristics are too different from all existing objects to be able to transform one of them into it (like if you need a cylinder or a triangular prism instead of a rectangle.

Well, what I want to do is set maybe 3-6 different prefab inflatable objects (3 of each “density” class of heavy or light), but I want to use the same code for all of them so that I don’t end up with 6 different codes, PLUS unique objects like spheres or staircases, or triangular prisms, etc. etc., so I want to be able to make the object, define it’s weight in the Rigidbodies tab, and have the code directly reference THAT value for Rigidbody, so I can then have six different prefab assets with different masses, with those six assets sharing four separate codes. (including the new collision code I made to ensure that the player is actually touching an inflatable object before allowing it to be inflated)

So I want to manually assign the mass values, but I want to do it without changing the script for each new object.

…I don’t know if that makes it more or less confusing.

Possibly make a function that calculates the newly given mass with the mass of x and a multiplier as parameters?

I’m not great at C++ so this may be useless.

Then you just init the masses you want and call on the function to calculate their new mass?

Hmmm, sounds like it’d work. How exactly would I write that in code, though?

well im not sure how to do it in C++

but its like

function name (parameter 1, parameter 2)
value = parameter 1 * parameter 2 (or whatever the formula you are working with is)
return value

then when you go to set the mass of the various things

say Person1 mass = function (parameter1 (im assuming default value for this), parameter2 (the multiplier)

and then when you call on person1mass as a variable, it’ll give you the edited value.

hopefully that makes some sense.

Very first version released!

Second version is ready. It will be released on the 26th of this month. I’m currently working on making a devlog, so look forward to that~

Devlog’s live! Unnamed Game- Devlog 2/19/2021 - YouTube

Second version has been released!