Pre-Order the Game!

Desura Digital Distribution

Friday, September 21, 2012

Less is More

For the past couple of months, I've been gnawing on the planet window UI.  I want to display all the important information, but wasn't sure on how to do it in a clean way.  If you look at an earlier post, I had an idea that I started on.  But it wasn't good enough for me.

I've spent hours thinking about this problem.  As Mark Twain said "I don't have the time to write you a short letter, so I'm writing you a long letter" (or something like that), it is hard to come up with a good UI design that is both functional and informative, without overwhelming the player.  I don't want my game to look like this.

I needed to be able to display planet information, production/consumption, population, regions, etc.  Then last night as I laid on my bed, a brilliant idea struck me.  "Less is more!"  The extra information that isn't absolutely critical can be put into a tooltip that shows up when hovering over something.

For example, I can just display "50 Population" without needing to display the amount for each race, that can be put in a tooltip.  Using this approach, I was able to actually reduce the window size!  The UI is mostly done now, I need to add some display text (I added them in MS Paint for the screenshot to illustrate what the final version will look like).  After this UI is done, I will then upload both the code changes and the new version on Desura.  At this point, both Desura and source code will be in sync.

Here's what it looks like, I welcome your feedback!

Sunday, September 16, 2012

Source Code Uploaded!

I've just uploaded the source code for Beyond Beyaan to!

Now, before I explain the structure for the game's code, I would like to take a moment and share the reasons for lack of development progress the past couple of months.

On July 3rd, our baby Marie was born 10 weeks early.  Ever since then, our life has been hectic.  Sometimes I have some free time to work on the game, but that was rare.  I needed to support my wife both physically and emotionally.  And so my motivation for working on the game declined.  After all, it's just a computer game, it's not as important as our newborn.  I can go back to the game later when things gets better.  There were some scary situations when our baby required antibiotics to fight a deadly infection, and requiring a blood transfer.  Then there's the period when she wouldn't keep the milk down.  But the good news is that she has recovered, and has just arrived home with us today!  So hopefully in a month or so, our lives will be stabilized enough for me to resume work on Beyond Beyaan.

I know that you all are waiting for the next Master of Orion game.  It sure seem like the MoO 2 curse is working hard against me, but I won't let it succeed!  There will be a complete version, the game will be playable!  :)

Now, about the source code.  I've tried to keep it clean and easily refactorable.  So I'll explain how all of it is organized.

First up is the "GameMain.cs".  This is the core of everything, it stores the galaxy, the empires, etc, and is located in the same directory as the project.  All of the UI refer to it.  GameMain.cs stores the different parts of the game, and each of those parts (such as "EmpireManager") handles the logic internally.  The UI is responsible only for updating the values and displaying them.  So it's critical that major components are stored in GameMain.cs, and that the UI does not have game logic in them.

Then there's four directories:
Utility - static classes that assists in different calculations (such as line/circle intersection and so forth), all static classes/functions goes here.

Data Modules - Data classes that both stores and processes data.  For example, "planet" class stores data about a planet, and has functions for processing data such as population growth, production, etc.

Data Managers - This is a collection of classes that helps in managing the data classes.  An example is the EmpireManager class.  It stores which Empire is doing its turn, all of the empires in the game, assists in the end-turn processing by going through each empire and calling their "ProcessTurn" function.

Screens - This is the UI for the game.  Each screen is an independent class, with each screen being able to contain and display other classes.  An example is the GalaxyScreen class.  It displays the galaxy screen where you see the stars, fleets, starlanes, etc.  It also stores "SystemWindow", in that if a system is selected, it calls the "SystemWindow.LoadSystem()" then draws SystemWindow as a part of GalaxyScreen's drawing code.  The GameMain class also manages which of the main screen is currently displaying.  If the name is "Screen", it's a main screen.  If the name is "Window", it's a sub-window that can be stored and displayed by another window or screen.

There's still a lot of work to be done.  The assets on Desura is not yet updated to work with this version.  My plan is to finish the planet screen UI, then update both demo and full versions on Desura so you can drop them into the project and run it.

Yes, the Demo version will be runnable by compiling this project.  So what will be the difference between the full and demo versions?  As of now, the demo has all the races (4 of them), while the full will have more added in the future.  Also, there will be less technologies and artwork for space combat, so basically a limited version, sufficient to let people try it and taste the possibilities of the full game's version.  However, it's possible that people not buy the game, and just download the source code and provide their own content.  But if you want to support this project, please don't hesitate to buy it!  The funds will go directly into adding new assets (new races, new technologies, etc).

Since the game's engine is now open source, and the only thing I profit from are assets, I'm considering merging my "ReMoO" project into this game's source code (For more details, go to this post:  What that means is that when I'm done with Beyond Beyaan's features, as in that it's a fully playable game, I'll look into adding the ability to load MoO 1's files directly, and you'll be able to play it without requiring DosBox.  Maybe in the future, if multiplayer is added, people can finally play MoO 1 multiplayer and see how their strategies work against other people :)

If you're interested in using some or all of my game's source code in your commercial project, let me know and we can work out the licensing agreement.  There's already one person who've expressed interest in using parts of my game's code for their project to help speed their development along.  The truth is, I won't be able to inspect all of the available 4X development projects to make sure they're not ripping my code off.  So I'm trusting you all to be honest :)

Have fun digging in my 23k plus lines of code! :)

Friday, September 7, 2012

Status Update

I've finished the economy framework!  Now I just need to create UI for it...

Here's what I have done so far:

Population now consumes resources, and their growth/decline is based on the available resources.  If there's a shortage, then all population that consumes that resource suffers from the shortage.

The growth formula is as following:
Growth/Decline = population count * 0.05 * (shortage - (Space Usage / Total Space))

The value for shortage is calculated as follows:  Total available resource / Total resource consumption.  So if you have 100 food, but 200 population, the shortage is 0.5.

The value for Space Usage is total population space usage on the planet's climate type, while Total Space is number of regions multiplied by 10.  If a race's space usage is 1, then that race can have 10 units of population per region.  It accounts for multiple races (it tallies them all up)

So if you have 0.5 shortage, and the planet is half-full, then there's no growth or decline.  Nifty, isn't it?  It's possible to have two races, one starving and one prospering if both consumes different resources (Ores for one, food for other)

I've also decided that instead of having the game automatically scrap items and potentially causing frustration for players (Dude, where's my scout? syndrome), the game will simply prevent the player from ending his turn if maintenance costs exceeds the available resources.  Then the user can click on financial information and have a list of ships and buildings that consumes that resource so he can scrap any of them from this screen.  This will make things a lot more simple both in front-end and under the hood!

The empire also now stores resources, or if they are not storable, converts them into a storable resource.  Regions now produce and consume resources.  Everything's there, just need the UI...