Monday, January 6, 2014

Build All The Techs

Last caturday I managed to complete two pieces so that I can move onto my next features (stuff listed last post such as the constitutionally appropriate family class). These two things were the tech tree UI and getting the build menu to be data driven.

Tech Tree

Cultura will include technology and for the first iteration of the game it'll cover the paleolithic and neolithic age (needless to say I have a lot of work ahead of me). The general idea of technology is that each one has an id and a level. Complex technologies have prerequisites not just of particular technologies but their level as well. This allows me to make the tool technology more interesting and have it lead off to other industries slowly. For instance, you might start with the "hammer stone" and you upgrade up to level 5 before you can move onto the "biface stone", the improved stone tool. The "biface stone", upon reaching level 1, will open up several industries. This gives a way for a smoothish transition between tools.

What I'd like is for a hammerstone to provide 20% production bonus (just an example) and then 100% bonus at level 5. Then the first level of biface stone immediately gives 100% bonus and each point gives 40% bonus instead of 20%. Given that situation, I'm leaning toward putting "maximum" levels for some technologies.

There are a few caveats I encountered while making the simplistic developer friendly UI. The CEGUI VerticalLayoutContainer and similarly the HorizontalLayoutContainer have two methods that are of interest when sizing them out. There is setMinSize and then setMaxSize. It turns out that if you don't setMaxSize on a container it has a default max size and will cut off items within it! So I had to do something silly like


container->setMaxSize(CEGUI::UVector2(CEGUI::UDim(10.0f,0), CEGUI::UDim(10.0f,0)))

Build Menu

The build menu was reduced to a single menu. Bringing up the context menu will show the buttons Build/Demolish/Management. I'm still working on whether that's a good idea but UI improvements are put on hold until all game features are done. I'll start doing the UI in beta development. Anyway, when clicking on build it brings up all the buildings that I've put into the xml file. It then checks whether the player has the proper technology. Then you can build away!

Other Stuff

One interesting thing I ran into on Sunday, the day after Caturday, was trying to get my work environment set up on another laptop. It turns out that if you do not have the DirectX SDK installed on your machine (if you encounter s1023 error upon installation it means you have a VC++ dist installed and must uninstall it to allow the SDK to install it again) you get the curious error of "RenderSystem_Direct3D9_d.dll not found". The error is a bit misleading. It's right there. The problem is that it can't find something else upon loading it and one possible cause is that you don't have the DirectX SDK. Only really relevant in the debug case.

Despair at the developer friendly graphics

No comments:

Post a Comment