Refactor and Polish

posted in KrisWolfe
Published August 29, 2019
Advertisement

This week has been has just been refactoring and cleaning up the code, finding more efficient ways to do things. All the bugs I've found I've crushed except one. For some reason if you try to build a building without the necessary resources, the text is not displaying that there's not enough resources. I've tried to trace it but can't see from a surface level detection. My first hard bug. I'll have to do some deep diving, but for now the behavior is correct...the building isn't being created. Just something with not displaying the text.

I've ripped out my entire research system. The display and the data model. I've come up with a new idea. We're going to hunt and find collectible items, and slot them into slots on a research screen. The first research I have is the Storage building, researching a way to store resources. It's not game breaking or anything, but I was messing with some of the polish for the images and came up with this (Mind the placeholder art. It will likely be some sort of cube with shaders in the future):

ResearchPolish.gif.1bb304f22f9e5f737a676e9b48b4f558.gif

As the Macguffin gets closer to it's storage slot, it starts to shake, and then we will have a slow hum start to build up as the object gets closer and closer, with some effects and shaders when we've slotted the item in the research slot.

This act of putting the storage macguffin into the slot unlocks the storage building, and that works fine.

As for the refactor, I've decided that my most likely best course of action now is to have a different class for every dialogue and research in the game. I've tried to come up with ways to have a generic research or dialogue class that somehow knows what it's supposed to unlock. But I need custom behavior for pretty much every dialogue unlock and research unlock, that I've just gone with a separate class for each one. Will that mean I'll have 100 files? Yeah probably, but I can't think of any other way to deal with it right now. Plus, this allows me to unload all the strings of dialogue from memory once they're been read, which is nice I guess.

Either way, we are moving on. I now have the entire beginning of the game scripted out, with each building being unlocked by actions and dialogue, and the storage building being unlocked through research. Next step is to code up humans and begin to work on that system. I will also work more on my research screen. I really like this idea of having slots and putting items we find for research, instead of just clicking a button. There's a lot to polish there.

1 likes 0 comments

Comments

Rutin

? Cool!

August 29, 2019 03:56 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement