The Apartment.

The Apartment.

After I get done with a little UI for a character panel I will make the first apartment and figure out how it will be represented on the server. I need to limit the amount of furniture items to some degree depending on the apartment size. I don't even have an inventory for the player yet for holding new furniture. There's a lot to do.

But first, of course, the character UI panel.

Designed, now to wire it up.

I really need to get in the habit of declaring implicitly or explicitly the type in GDScript. This could get me in trouble later. Got too used to python, need to return to C mindset. Probably thinking this way because the syntax is so similar.

Edited the character in the DB to test.

Looks fine, I think.

Good enough for now.

Oh boy, looks like that means I am on to apartment design. Gonna need more caffeine.

The apartment model in the DB is subject to change, but it looks like:


With the Base Scene being the name of the scene to load and then populate with the furniture. For now the rest of this data is not relevant and if I think about it I will only cloud my mind.

I'm going to break this down in my project management board so I don't go all haywire.

So to start out:

  • Make an apartments folder to hold all the various types of apartments (all of one for now) where I can load them from.
  • Create base apartment scene (With an area polygon to detect the floor for item placement later)
  • Create the first furniture scene and store it in apartments/furniture.
  • Write the Apartment Generator function on the apartment server which will Create an entry for the basic apartment, assign it to the current user, create a furniture placement entry for the basic furniture item (table probably), then load the data from the DB as a child node of the player
  • Write the function to SEND the data to the client
  • Write the Client's RECEIVE function, which will then load the correct scene and populate it with the furniture
  • Add a few more bits of furniture to make sure everything is loading right
  • Create a Furniture Inventory for the Apartment to store unused furniture
  • Create basic furniture placement functions in client
  • Create functions to recieve, sanitize and update furniture placement in DB on Server
  • Move on to Tanks(Which are similar to apartments but for pets) with a better understanding of how they will work.
  • Finally get on to the meat of the game, the Geru. (This is where the majority of the work will be done early on. All this work up til now is scaffolding.)

After I have the Geru and care systems in I can come back and add Apartment Visitors, Energy Management, Etc. For now I just want to focus on the basic functionality of saving, loading and decoration.

Alright, with that... time to make the basic apartment scene.

It's a roof over my head.

My focus since lunch is shot. My cat might have a cavity and doesn't seem to want to eat much lately and man I am broke. I also just had to call and make an optometrist appointment because things have been getting blurry lately and my eyes start stinging. Bit stressed.

Anyway, I need to redouble my focus and get this apartment built server-side.

Been about 20 minutes and redoubling my focus is proving quite hard. I am unable to hold anything in my head right now. I need to make a table scene I guess.

Wow, can't even draw a table. This is worse than I thought. I am having a really off day. Alright, I will just make an ugly table then. Whatever.

Yeah, that's one ugly table. I just can't seem to think clearly about anything.

Ugly table, enjoy.

It occurred to me I should be able to flip the horizontal for furniture. This should be something I add to the furniture placement db. Also thought maybe the current way the furniture placement is handled in the DB might lag the server later on. I should probably come up with a better solution but right now is not the best time for that.

Maybe I am just entering a depression phase or something, starting to become lethargic as well. Hm. Gotta power through.

So I need to create a table scene.

You know. Tables have four legs usually. Wow. Whatever, anyway...

Ugly Table with Collision
Ugly table is FUCKING HUGE

That's one tall table. I'm not sure exactly what I was thinking when I set about making this thing. This day just gets better and better, eh? Well, I will fix it's height before I continue at least.

There, now it's an ugly coffee table.

At least now you don't know there's a missing leg.

Now I have a piece of furniture and an apartment scene. Next I have to load the dang thing. But to do that I must first have it in the DB, then the Apartment Server, then I can send it over to the client here to handle placing and displaying it.

The Scene lookup in the client is functioning as intended.

I am using the basic apartment as a default value if nothing comes from the server, this is mostly for testing purposes.

So, once we log in and have our character loaded the scene manager will switch us over to the apartment scene, depending on which apartment we have. Then it will fade in the scene.


But now we need to work on the server side of the thing for a while.

I need the DB functions first, one to Read, one to Create. Later on I need one to Update. Deletion will be handled in the back-end admin.

Before we can read we need to create, so that's where I'll start.

Almost forgot I needed to create a background scene as well. (So you can have the background under the apartment look like whatever... space, grass, cemetery, etc.) so I did that...

The Void.

It's just a scene with a simple dithered dark purple to black sprite.

Holy crap, man, for a moment there I wasn't sure if I set up the furniture placement in the DB correctly. Thankfully I can indeed use negative values.

Nice. A table for my bumbo. 
More queries that probably have something wrong.


Well, I test my query for the generator and it runs fine. I run it in the server's generator function and I get some weirdness.

E 0:00:10.692   call: [PostgreSQLClient:1261] invalid input syntax for type bigint: "0930320b-c065-4bd0-a2cf-36768b0687c1"
  <C++ Source>  modules/gdscript/gdscript_functions.cpp:775 @ call()
  <Stack Trace> @ reponce_parser()
       @ execute()
       @ generate_apartment()
       @ get_apartment()
       @ load_data()
       @ add_player()
       @ get_client_token()
       @ _process()

It seems to be reading my UUID as a bigint for... some reason? I ran the exact query in the terminal client and it's fine.

Seems fine.

I use the same technique for my character creation query so I am not sure what's going on here. Gonna double-check.

Maybe I should escape my ' in the apartment name... let's see.

Nope. Not that.

Welp, time to go make some dinner. Hopefully my brain will be better at handling this tomorrow.

Clocking out.