XNA was abandoned by Microsoft many years ago. But even now I have still been using it, that is untill MonoGames has become a viable alternative.
I have therefore spent my time on holiday converting Craft Empire over to MonoGames. The main advantage is cross-platform. Been able to target Andriod, IOS, Windows and Mac with 99% of the same code is awesome indeed. The MonoGames team really deserve a lot of gratitude for make such an awesome framework.
MonoGames also uses the same functions as XNA meaning that most of your XNA code will work out the box. I say most as there is still a lot of work porting your code over.
Anyhow gone is my dependence on needed the XNA framework installed on the users pc. Now the user will have the option of using DirectX or OpenGL.
I have finally managed to be able to store both block rotate and block data with in the same byte.
This means that the game will use a lot less memory meaning we can have bigger worlds and there is more chance it running on phones and tablets.
However the downside is that since I need 3 bits for the rotation I only have 5 bits for the data meaning I can only have a total of 32 different states for the block data on any block that can rotate.
Buildings can now be rotated before been placed in the game.
This small ability will allow you to tightly pack your buildings in your city, as well as making things look more natural and less repetitive.
Last week I did work on the building UI. It was a complete nightmare!
I wanted the UI to show you a preview of the building that you are going to build. Therefore if the user creates there own building the UI will automatically create a preview for that building for you to see. It was a pain.
Now for the technical bit for you who are interested.
- The end result is the building is render to a back-buffer.
- Then take this image and find the nearest pixels to each edge of the texture.
- Remove the rest of the image just leaving the rendered building
- Scale that texture to the correct size.
The result is something I am happy with. Its not to bad on performance either.
Block Empire now has a new name Craft Empire. We decided to change name to avoid confusion with Minecraft severs and clones.
Yesterday was all about the user interface. Iv still got a long way to go in this regarded but a lot of progress has been made. For starters 99% of the UI has been made resolution Independent. This mean that the UI will automatically adjust if the screen resolution is changed. This is all handled through an event that get fired at startup and every time the resolution changes.
I also added a UI to show what resources are required to build each building and added a check so that you can not start building anything that you don’t have enough resources for. This is only a basic representation of what I want to achieve in the future when it comes to buildings been built but it will do for now. In the future I want the builders to actually walk to the warehouse collect the resources and then bring them back and start building. I have not worked out all the details yet but either way its some time in the future that I will be tacking that issue.
today I managed to add a new job woodcutter. Selecting a worker then selecting a tree will send the worker off to chop it down. I thought it would be easy to then get the worker to find the nearest tree and go chop it down. It turned out to be a lot more complex than I thought. :/
in the end I got it to work though and now we have tree slayers in the game
This week I have been working on jobs in Block Empire. Jobs are basically what you would assign to villagers. For example you can have a Walking to a location, Building something, Mining or Tree Cutter jobs.
Surprisingly though there are little jobs that I never thought about. I was working on a way to garrison villagers like when they go in to a mine. I never imaging that to do so I would have to make a job for garrison.
Anyway the main job class is built and so are some sub classes like walking and garrisoning. Hopefully I will be able to add more jobs in the next few days.
Now that all the other things have been done. I have turned my attention back to block empire.
Over the next 2 weeks I will be working heavily on the project. We will have a new name for it and someone else has joined the project. More on that later.
On another note we are going to have a fundraiser on Kick Starter to get the game funded for production.
I am still in the process of trying to get some funds for Block Empire. In the mean time i have released both OSR 2 and Fly Johnny Fly on Amazon Underground.
Fly Johnny Fly Amazon Underground
Old School Racer 2 Amazon Underground