Blog 8: Widgets & Animations

4/18/2023

Welcome back to the Integration Hell development blog.

There is a lot to discuss this week. First up is the rest of the widgets I mentioned last week. All of the widgets I planned to create last week have been made (Radio Buttons, Sliders, Input Boxes, and Checkboxes). After making the buttons work, getting the other widgets was very simple. The most complex part was rendering them.

Pictured above are the Radio Buttons, Checkbox, Slider, and Text Input. I have designed these to be as configurable as possible.

Radio Buttons can have as many options as wanted. Checkboxes are only in sets of one but are small enough to be tiled. The slider can have arbitrary start and endpoints. The input box can accept most standard keyboard characters. The input box still has some graphical work to be done to it. The text is not centered yet. Also, the box size does not expand with the text to the text will just leave the box.

All of the widgets are fully interactable with the mouse and the slider is draggable. To input text into the input box, the user must click on it to get its focus. This can be seen with the black rectangle around the box. The exit button featured on menus is now functional (it's a widget).

Moving on from widgets, you might have noticed that the textures in the window are different from the above screenshots. This is because I have created a new system for the tile textures in the game. Rather than hardcode in the available textures into the game, there is a file system for them. All tile textures are located in the Integration Hell directory in the subdirectory "assets/base". To add a new tile, first create a directory in this directory. Name the tile asset image the same as the directory name. Then create a file called "parameters.txt", this file will contain all of the information about the tile such as its id and behaviors. Then in the "assets/base" directory update the file "directory.dir" to include the name of the new directory created. When the game runs, it uses directory.dir to load all of the textures and behaviors into the game. For testing I have created new tiles. Tile 0 is grass and Tile 1 is tile. Pictured below are those tiles.


Grass Tile

While these tiles are simplistic in design, they suffice for testing the functionality of the system.

Along with improved file management, I have also worked on animations for the player and tiles. I have a system for how images will be animated. I am going to put the image used for the player and explan using that.

The player displayed in game is a 50x50 image. Above is eight tiled versions of the player. The image tiles are divided into an x-y system. Tiles going along the x-axis are the frame number. The above image has four frames of animation. Tiles going along the y-axis refer to the state of the player. The state tile can be used for different states of a tile or player. The renderer will cycle through the frames of a state indefinitely until the state changes. There is an associated parameter that goes along with the speed of the animation. For now, the game assumes it is running at 60 FPS. Every frame the player is drawn to the screen. If there was no speed parameter, every animation in the game would run at 60 FPS which may make some animations play too fast. There is a parameter called divider, which is used to make the animation counter increment slower. If divider is 60, then every 60 frames, the animation counter will increment by one. This can be used to change animation speed from 60 FPS to any arbitrary speed.

That is all of the newly created content for Integration Hell. However, there is still some things I am going to write about as I will forget about some of them if I don't write them down.

Memory - In the game's current state, it will use up more of the computer's RAM the larger the world is. While this is not a problem for small scale worlds, it may not be viable to have the game require 4+ gigs of RAM to function correctly. I'm not sure how big of an issue this is yet, but it's on my mind since the game behaves like a memory leak at the moment (I also found a memory leak that I had to fix).

Gameplay - Most of the development of Integration Hell has been spent on making the most basic parts of the game work. This includes things like having worlds and player movement. I don't consider these things gameplay as there is nothing to do in the game right now. Because of that I have not put together a cohesive idea of what I want the gameplay to be. While it is about factory/logistics management, I need a way for it to be interesting and fun. The least thought out thing I need to figure out is opposition. I think the game will be less fun if the player is allowed to make the factory unrestricted. I could just throw enemies at the player, but I want something more challenging than just enemies. A feature I think has potential is pollution. Machines the player uses will pollute the environment around them. If the amount of pollution in an area is too high, then the player takes damage and can be potentially fatal. The reason I think this would be a good challenge to the game is that it forces the player to think about more than just making production as high as possible. The layout will have to be carefully crafted to have as much production as possible without creating a toxic wasteland that is inhospitable to the player.

That is all I have for this week. Thanks for reading and I hope to see you next week!

The Checklist:

Tasks:

✔️ Create more assets to use

✔️ Create better file organization for the game

✔️ Create widgets for the menus

✔️ Create animations

𐄂 Give the game an icon

𐄂 Create gameplay concepts

𐄂 Add item system

𐄂 define tile behaviors