Friday 29 August 2014

Crucible XXVIII 29/08/2014

This post will probably end up being shorter than usual. I spent the start of the week rewriting and fixing the code related to the hero invasion screens and how the various actions heroes can perform actually work. The middle of the week was spent re-writing and optimising both the map generation code, and the code I use to detect and change any connections that are not suitable for the map (eg. if connections between systems overlap). The end of the week was spent fixing bugs and optimising other parts of the code (a lot of this involved converting class to static classes- tedious!). The result of this is that the game can now support many more systems at one time, and the collision detection algorithm can be run in real-time with minimal performance impact. At the moment I'm getting between 70 and 100 FPS when I run the game in a standalone window with the largest map size (90 systems). I will need some serious play testing to test the performance of the improvement algorithms that calculate the resource modifiers, but I'm confident that everything is running nicely. I guess being at a stage where I am spending serious time optimising code means that the game is getting steadily closer to release.

Aside from that I also put in a picture of the milky way to get an idea of how the map should look on release. Unfortunately I don't know if it is a stock image, but would love to credit whoever created it. Also in the screenshot below you should be able to see the map generator working better than it ever has before! Map shapes are interesting and varied and there are enough connections between the right systems to prevent the maps from being too plain or too complex.

Beginning to look really nice!

On running the game in fullscreen I have discovered that the UI is faaaarrr too small. These things are all being noted and I'll fix them closer to release. Next week I will probably work on finishing up the features that are currently in the game, and then get to work on the empire research. Hopefully if I can get the research finished soon, I'll be able to get the other races in the game and work on the AI for some kind of free beta release. Until then, have a good week and thanks for reading!

Friday 22 August 2014

Crucible XXVII 22/08/2014

This week had a number of surprises in store. I updated the version of NGUI I was using, which resulted in the project being broken for 2 days whilst I fixed it (I did have other things to do so the time wasn't completely wasted), and Unity 4.6 Beta has been released which has all the new UI features in it! Although I will be sticking with NGUI to save time, I am quite excited about the new UI things in 4.6. I'm also prepping for uni in 5 weeks, so when I leave there will probably be a lack of updates for a while whilst I'm settling in and doing my coursework, but I will still be working on this!

This week I spent some time working on and fleshing out the hero skills and how they fit with the gameplay style of the hero classes. I mentioned a while ago that I have slimmed it down to 3 basic heroes, each fitting a different method of playing. These are Infiltrator (Being sneaky and Spike Damage), Soldier (Not being sneaky, territory control, being a tank), and Diplomat (being a little bit sneaky, changing the diplomatic relations between players, condition damage). All the classes have their own traits and technologies (as well as some generic technologies), and they all have 3 unique abilities to be used in game. The abilities are available to be used as soon as the hero is purchased, and can be augmented by using various technology. The abilities and their corresponding in-game symbols are listed here.

  • Infiltrators can:
    • Spy on enemy systems. The owner of the system is unaware that the enemy hero is in the system. The hero can have a look at the improvements and output of a system, and can plant bombs on planets. They can only spend a limited amount of time in the system before the owner is alerted to their presence. (Symbol 7)
    • Teleport to escape enemies. This allows the hero to teleport to the nearest friendly system if it is in trouble. This can be augmented to allow the hero to teleport anywhere! (No Symbol yet!)
    • Attack an enemy hero. The infiltrator will chase the enemy hero, do a significant amount of damage to it, and (hopefully) run away before the enemy hero can retaliate. This does affect your relations with the enemy player, and is on a cool-down timer. (Symbol 8)
  • Soldiers can:
    • Invade enemy systems. This is pretty clear- the hero can enter a system and start to attack planets. There are some nuances to it but this is the simple explanation. Soldiers are tanky so they are the only really suitable class for this task (especially against powerful systems). (Symbol 5)
    • Guard systems. They can bolster the defences of systems if they are located within them. The soldier will take a minimal amount of damage from this, but is not directly involved in the battle (passive ability). (Symbol 4)
    • Claim unowned systems. If a system is unowned the hero can claim it, preventing all other players from colonising the system before you. The hero must be present in the system for this to occur. It can have negative diplomatic effects, and the hero is very vulnerable during this time. (Symbol 1)
  • Diplomats can:
    • Enter enemy systems. This has no diplomatic effects and will not automatically trigger war with the system. Diplomats are the only heroes that can passively look at the improvements and output of systems. However diplomats are unable to enter systems that are set to auto attack intruders. (Symbol 3)
    • Promote systems. This increases the resource output of the system, and when performed on enemy systems, will improve the diplomatic relations with that player. (Symbol 6)
    • Embargo systems. This prevents the system from producing resources. It will impact poorly on diplomatic relations with that player. (Symbol 2)
 In game symbols for hero ablities

In addition to all that I improved the workings of the hero pathfinding algorithm, and some associated scripts. If you have a hero selected, and you mouse over another system, the path that the hero would take to get there is now highlighted. This is not only nice to look at, but will also help to identify systems the hero cannot pass through for whatever reason. In the gif below you can see the algorithm in action (and you can also see that my map generation algorithm isn't working again!).

Pathfinding with style

That's it for this week. Hopefully I can get some of these problems fixed by next week and have some nicer hero stuff to show. My plan is to complete the heroes, then get the empire technology finished, and finally get working making the AI nice and polished. After that I'll be free to polish it up, add some new races, add the win conditions and generally make it a bit more fun to play. See you next time!

Friday 15 August 2014

Crucible XXVI 15/08/2014

Oh yeah, I can totally keep doing roman numerals in my post titles (those of you not reading on my blog won't see this). So I am back from my THIRD holiday this year. It was great, thanks. I have indeed done some work on the game this week. After working for so long on the headache that is the voronoi generator, I decided to work on something a bit different- improvements. My goal was really just to re-write the code that is responsible for calculating the modifiers that are created by the improvements. This was in order to both make the code faster, and also to give me greater control over how the improvements work. Systems now have their own modifiers (with names such as systemPowerModifier or systemGrowthModifier), whilst the planets in the system also have a modifier (with equally imaginative names like planetPowerModifer, and planetGrowthModifer). I made a couple of little diagrams to help explain what the modifiers are and how the are calculated.

This diagram explains the difference between improvements with system wide effects and those with planet-wide effects.

This diagram explains how the modifiers are calculated for each planet.

The modifiers are nothing arcane, they are simply a value that is multiplied to the base resource production value. For example the Power modifier is multiplied with the base Power output of a planet (say 4 Power with a modifier of 2) to produce a final Power output of 8. There are modifiers for almost every kind of resource in the game- Power, Knowledge, Wealth, Maximum Population, Population Growth, Improvement Slots, Amber production etc.

I had a major issue with github which resulted in started a new repository for my code. The result of this is that the current code version number is now 1.4. For some strange reason I did return to the voronoi code, and with fresh eyes, I think I have made some improvements. It does occasionally break still, but the frequency of this appears to have decreased.

That's it for this week, see you next time!