1. I added small rocks to the scene. Even with just one texture, they add a huge amount of visual interest.
2. I've implemented additional fragments of the unified movement engine. Notably, movement and AI are now separate processes, and movement has been tested a little bit. Lots to go, but progress is being made.
I think I'm going slowly at this point partly because I'm afraid of failure - that the engine won't be fast enough, and that it will thereby bring the entire project to a flaming halt. It's a deeply-ingrained fear, born of three generations of coding "dead points."
3. Normal mapping is now fixed for terrain (before now, it was far too dark at sunrise/sunset)
Finally, I have a writeup of one of my "long term goals" for the game - that of ecology. This is basically guidance for implementation, based on projected things I want the system to achieve. It may not be complete, and not everything here may make it in.
Long-term goal 1: Implement ecology.
Subgoal 1: Silent running. Ecology should have less than 5fps effect on game speed.
Subgoal 2: Animal movement. Animals should move when appropriate, and enough to give an approximation of life.
Subgoal 3: Animal numbers. There should be about 50 predator groups and 100 prey groups on the map. Predator groups should consist of 1-5 animals; prey groups of 1-10. Average total animals on the map should be ~500-1000.
Subgoal 4: The hunt. Predator animals should attack nearby prey animals (when they approach through wandering). They should start running after a given closest animal (as communicated to them by random localized AI checks), and if they catch it, should kill it. Its neighbors should keep running for a while after.
Facilitation 1: Each animal in a group knows all other animals in the group.
Sub-subgoal 1: Predatory groups should regard workers in the same manner as they do other animals, and have the possibility of electing to hunt nearby citizens.
Subgoal 5: Herds. Herd animals should move with brownian motion normally, but if they have elected to move and are outside the herd's target point, they should move there. This will allow natural migration to watering holes/grazing areas.
Facilitation 1: Target points are set for groups every so often. They are determined for a group when the group spawns (loading time)
Subgoal 6: Hunting. As animals are designed to be hunted, they must be designed to be replenished. Groups should add new animals to replace ones that are lost - if they are below a certain threshold, and if there are at least two animals remaining in a group.
Facilitation 1: Each group has an optimal population count, set at load time and typically 50-75% of the group's starting population.
Side benefit 1: Predators and large animals (like mammoths!), which have smaller groupings, will be more likely to die out - erasing "rare" species from the map over time and reducing the danger involved in hunting.
Side benefit 2: A growing city will likely be forced to change its food source from hunting to something else, as all the local animals disappear.
Sunday, December 26, 2010
Tuesday, December 14, 2010
Bushes, specular, etc.
1. I was able to add specular elements to the terrain shader with no speed repercussions. This means that various "shiny" elements of the terrain now properly show up - highlights on grass, snow, shiny rocks, and wet sand are all possible.
2. I created a third paged geometry manager to handle bushes in the local regions (around the camera). This has the effect of increasing ground cover in regions otherwise devoid of anything but grass - adding a good bit of visual interest to the scene. They are set up to have density dependent on fertility and temperature.
3. I implemented several optimizations for the unit manager. Units will now do no per-frame code execution unless they are both visible and moving. They update their positions every N frames, where N is the number of frames it takes to move ~8 feet in any direction - and between these updates, they use a combination of original position, original timestamp (when they were at said position), and velocity to maintain their curent location. This has the added benefit of being highly useful for multiplayer.
Hypothetically, I should be able to handle upwards of 4000 units in an active game, or 200 for each of the 16 players plus 800 animals. I have high hopes for this system.
4. I have additionally created a graphics settings program- it contains all the useful graphical settings in one easy-to-use and easy-on-the-eyes location.
5. And finally, I have been experimenting with normal mapping on the foliage in the game, with mixed results. Generally speaking, it looks nice in close-ups of the trunks, but is invisible at standard playing distances. Overall, it probably ain't worth the extra cost in shaders.
On the other hand, I did manage to get the deciduous trees to render with lit trunks and unlit foliage, which does wonders for their cohesiveness. This is an optimization that may well be worth the effort... and it's possible I could add self-shadowing to complete the shading effect. I'll have to investigate this particular concept farther.
2. I created a third paged geometry manager to handle bushes in the local regions (around the camera). This has the effect of increasing ground cover in regions otherwise devoid of anything but grass - adding a good bit of visual interest to the scene. They are set up to have density dependent on fertility and temperature.
3. I implemented several optimizations for the unit manager. Units will now do no per-frame code execution unless they are both visible and moving. They update their positions every N frames, where N is the number of frames it takes to move ~8 feet in any direction - and between these updates, they use a combination of original position, original timestamp (when they were at said position), and velocity to maintain their curent location. This has the added benefit of being highly useful for multiplayer.
Hypothetically, I should be able to handle upwards of 4000 units in an active game, or 200 for each of the 16 players plus 800 animals. I have high hopes for this system.
4. I have additionally created a graphics settings program- it contains all the useful graphical settings in one easy-to-use and easy-on-the-eyes location.
5. And finally, I have been experimenting with normal mapping on the foliage in the game, with mixed results. Generally speaking, it looks nice in close-ups of the trunks, but is invisible at standard playing distances. Overall, it probably ain't worth the extra cost in shaders.
On the other hand, I did manage to get the deciduous trees to render with lit trunks and unlit foliage, which does wonders for their cohesiveness. This is an optimization that may well be worth the effort... and it's possible I could add self-shadowing to complete the shading effect. I'll have to investigate this particular concept farther.
Friday, December 3, 2010
Shadows added!
Since I started modifying the terrain shader, I have had no luck getting shadows to work in the engine. Through a combination of wholesale stealing and careful modification, however, I have been able to add shadows to the terrain shader, making it slightly slower and a whole lot prettier. Forests, especially, epitomize both the speed issues and the prettiness bonus.
In other optimizations, I cleaned up a lot of the nonsense code in the terrain shader, removed a couple of if statements, and got rid of a lot of division. It's still not as fast as I'd like, but it's probably about as fast as it can reasonably be. (Translation: Without diving into the assembly code!) Other code needs my optimizing attention more!
In other optimizations, I cleaned up a lot of the nonsense code in the terrain shader, removed a couple of if statements, and got rid of a lot of division. It's still not as fast as I'd like, but it's probably about as fast as it can reasonably be. (Translation: Without diving into the assembly code!) Other code needs my optimizing attention more!
Subscribe to:
Posts (Atom)