Okay work time is time for work.
Gonna make the background into a bunch of 16×16 squares instead of 32×32, and give them simple colours…
Huh, interesting, I had thought that shrinking them wouldn’t make a big difference since the graphics are simpler and it’s just re-using two bitmap stamps over and over, but the FPS with nothing in the scene has dropped by five. Well, that’s partly ’cause my laptop isn’t very good, but I also realized that the grid is also being used for collision tests, so there is more overhead than I had thought at first.
I’ll leave it like this for now, though there shouldn’t be many collisions with the tilemap outside of the border, so maybe I’ll switch it with something else later.
Now, I’m going to add in arrow key control for the viewpoint, since I can only see part of the scene right now.
*work work work* Okay, now I can move my viewpoint about the scene as I please.
Now for the logic of life, I think.
The plants will spawn at a very small size and slowly be scaled up as their food value increases, simulating photosynthesis. At this stage, they’ll be static things. I’ll sprinkle them in randomly, and they’ll grow slowly over time.
The animals will just be herbivores for now. I’m not sure if I should code in senses at this stage; should they be omnicient and automatically head towards the best plant, or use senses to try to find a plant that is big enough to eat while wandering around pseudo-randomly?
Now that I think about it, I don’t really know much about how microbes do their stuff. Do they have senses? Do they just squiggle around pseudo-randomly untill they blunder into success or failure? Let’s look it up…
*looks it up*
Huh, well it looks like microbes are like bears; they can smell you from SO FAR AWAY!!!! Or at least, relative to scale. They have incredibly powerful senses and can detect something like a sugar molecule from pretty far away, if I’m understanding this article right. http://biosingularity.com/2006/06/04/how-bacteria-sense-their-environments/
So for my simulation it might actually make sense to have the little animals be omnicient at this stage. Of course, I’m not coding this to simulate microbes, so maybe I should just knuckle down and do the senses now.
For now I’m thinking that they’ll drop an invisible ‘area of effect’ entity that will pass its collisions back to the parent. If it detects a food source, it’ll head towards it and chow down. Otherwise it’ll wiggle around pseudo-randomly. Eventually I’d like to use different AoEs for sight, sound, and smell. Hopefully it won’t bog down the simulation too much, but figuring out stuff like that is part of why I’m doing this.
It’s noon now, so I think I’m done for the day. Next time I’ll have to try and code the plants.