Chat and Debug Console

Chat and Debug Console

So I will need to do some testing and tuning on the tick, this means I need to be able to fire it at will. I could have an input on the server itself where I can press a button and have it fire the tick for me... but what if I don't have immediate access to the server and I need to do something like mute a player or teleport someone who got stuck?

This is why I am building the debug console now. I can create commands that admins can run to help debug things or run tests among other things like running in-game events.

Yesterday I made the chat box, today I need to make it function. I will need to set state of the player to chatting if the chat box is focused so they don't fire inputs into the game and walk around interacting with everything when they are trying to talk.

Then I need to send the text from the message entry window to the server, do any processing on it like filtering, checking for commands, etc. Then if it is a normal chat message, send it out to the other players... otherwise handle a command or warn the player not to be a jackass, then add an infraction to the player in the DB so we can keep track of people who hit the filter often and see if they might be some kind of asshole that's bad for the community or if they are like me and have a hard time filtering their swearing in real-time. I will need a filter since there might be some kids playing this at some point and I don't want to be responsible for them spewing gamer words at their parents.

For now I will ignore the chat filter, it wont be necessary for a while. Instead I will focus on the functionality of the debug console and simply sending messages to other clients.

First up is state change, the player character input should halt when the textbox is focused. Then when the textbox is out of focus return inputs to normal.

Chat works.

I can freeze input when the chat window is focused, however it will unfreeze and immediately refreeze when the player sends a chat message. I assume this is because the just_pressed() is reset and can be repolled when you unfocus a UI element... but I am not sure.

That's all I can think it might be, having traced my code. It looks like maybe I want to have a cooldown or something to prevent it from immediately refocusing chat when enter is pressed.

I did notice an interesting problem with the offline ticks not being processed correctly, thought that might be a problem. I will fix that once this is working and I have the tick command in.

Staff commands test.

Fixed the chat re-entry issue. Also the UI confirmation issue at the same time. Now to promote my character here to staff...

Forgot I saved character data on logout, overwriting any changes.

Debug commands handled.

Now I can write some commands to do things like rehash the config so I can change the rates on the API and update them without rebooting the server and of course fire the tick.

First, the Tick firing command, should be the easiest of those two.


Now a command to rehash the config.

Also an unknown command handler.

Alright, now we can update the config and fire the ticks at will. The gameplay loop can now be tuned.

First, I need to add documentation on my admin commands...


All this before lunch, even. Huh. Well, I guess I can spend the rest of my time before lunch fixing that bug I found.

Also handled MOTD, Might need it, who knows?

The bug was simply because I was in a rush to finish before dinner yesterday and forgot to call the get_ticks_since_last_processed() in the slime on load. Easy fix.

There's another bug with the apartment map where the player can get stuck in the corner, gonna fix that too.

All slimes were saved in a way where they believe it was 16 ticks since they last loaded.

16 ticks worth of change.

Gave Frodda a bath and then fired 2 ticks.

Fired some more ticks.

Colorful bars

I suppose the next part would be the slime detail UI window...

It's just about lunch time so no point starting that just now. I will start it after lunch.

It needs to be a tabbed window, the first tab should have care stats and the slime's detail sprite... though I may hold off on that detail sprite for a bit I think. I have had... interesting history with showing layered sprites in the UI in Godot. Might be fixed now, will find out today probably.

Welp, time to build the detail view UI I guess. Ho boy.

Got the care text showing fine, now it's time to basically build a second compositor for the detail sprite. Doesn't help that I am getting sleepy after lunch again. Seems seasonal.

It's a start.

Some annoyances with positioning the BBCode of the name. Then there's the fact I never set up the compositor to handle the detail sprites and slime detail sprite fields in the model. Ohhhh boy.

I need to basically build the detail composition pipeline now. Whoopee. My favorite. Yay.

Oh well, nothing ever is simple. So I need to start at the compositor API and work my way up through the API to the client. I can probably get this done in the next couple hours.

Well, I have the pipeline working and the sprites are saving to the client side folders, it is having problems loading the actual sprites from files for some reason. It seems to think they do not exist. I have checked the path exactly and the files are all there so I don't know what is going on and it's 5pm and there might be another gas leak so I am going to be clocking out. I'll figure it out tomorrow.