Sign in to follow this  
  • entries
    109
  • comments
    378
  • views
    127844

God hates me again

Sign in to follow this  
Raduprv

143 views

Today I finished the 'baby ojects' which can be used for growing plants, and possibly to show the stages of a structure that is being built.
I finished that in about 30 minutes of work.
However, there were a few problems. First, the map got corrupted whenever a plant became a baby plant (for testing purposes I changed the order in which the plants grow, from adult to baby plants).
Then, the baby plants became adult plants whenever a seed of the same species germinated.
Finally, when plants associated with a resource changed to some other resource, the other resource was not being used, but the previous one was.
So I had to spend about 5 hours debugging, and solving all those problems, which were not related.
The plants not becoming another resource was relatively easy, I was using the ID of an object after that ID changed.
The plants becoming adult when a seed of their type germinated was relatively easy as well, but tricky. It turned out that I set the "size" value in a definition of a 3d object, rather than in the instantiated version of the object (we are talking C here, not C++, so it was about structures, not objects as in OOP).
The map corruption problem, on the other hand, was very nasty, and took most of the time, about 2 hours. The problem was that while replacing a 3d object with another, some old values were not copied properly, due to using a pointer to an object that was erased.
There was also a small modification I made with the vegetation becoming a resource by default, based on the object type, rather by using the flags sent by the server. While this is SLIGTLY less flexible than the previous way, it is far better from the bandwidth point of view, and makes my life easier.
This change also took a little more than expected, due to some other bugs that had to do with the CVS acting up, and using a previous version of a file which I fixed a while ago.
Sign in to follow this  


11 Comments


Recommended Comments

Your work is absolutely incredible. I'm sure you're going all the way in the world of game development. Hope you have fun with what you do.

Share this comment


Link to comment
Thanks ;)
Tomorrow maybe I will post some simple screenshots showing the plants growing. However, the growing is not smooth, the obejcts have only 8 sizes, so the plants 'jump' each time they grow, until they reach maturity.

Share this comment


Link to comment
Shame that there isn't any easy way to 'scale' the plant objects as they grow. Or to have an adult plant model as well as a baby model and have the client interpolate between the two.

Share this comment


Link to comment
Just a thought: Couldn't you have the plants 'jump' to certain sizes (like the 8 different sizes, or maybe even less), and have them grow per-frame on the client-side? The server-side's plant size (which would for however many frames it takes to grow from one size to another) would thus be smaller than the client's depiction of it.

The problem you would run into is having the players be able to partially walk 'into' to plant as it's growing. That problem could easily be fixed by making the collision box the size of the current plant-size on the server + 1. You wouldn't be able to walk 'right up' to the plant most of the time, but you would get smooth animation on the client's side, at little performance cost on bandwidth.

I'm a newbie, so maybe I shouldn't be giving advice, as there is probably something I stated that is terribly wrong and blasphemous, heh.

Share this comment


Link to comment
The client COULD interpolate between the plant positions, that's not a problem. However, the plants are updated on the server only once/hour, and the client doesn't know when/which plant will be updated next. Some plants grow faster than others, and some plants grow only if there are enough nutrients in the soil. The client doesn't know that either.
The server COULD send information to the client like: thisplant will grow this much in one hour, but then this would require a lot of bandwidth, since the client would need to know that information for all the plants, so this can be very taxing on the bandwidth.

Share this comment


Link to comment
Hmm. I can see where that would be a problem then. *thinks* Given the constraints of your situation, I can't really think of a way around it without increasing the bandwidth consumption either.

Share this comment


Link to comment
I am sure that if this were the outmost important thing in the Universe, I could find some solution around it, but does anyone REALLY care about seeing a plant growing smoothly, or do they care more about having more freedom in the game? Our team is very small, so we have to focus on the important stuff first.

Share this comment


Link to comment
I wouldnt care if it was smooth or otherwise, though you might consider, if theres spare time and a bored programmer, when the client recieves a grow update to have it grow in size smoothly via interpolation. I just have a tendency to obsess over fine little details, which is probably why i rarely finish personal projects...

Share this comment


Link to comment
Before starting working at Eternal Lands, I also had this tendency, but I had to abandon it in favor of adding more important stuff (gameplay related) rather than focusing too much on the the eye candy things.

Share this comment


Link to comment
You could send a message saying that, in a fixed amount of time, the plant will reach the next stage. It wouldn't really need much data, just the message ID and the plant ID, so I doubt it'd take much bandwidth.

Share this comment


Link to comment
Consider the plant ID is 16b and the time ID (how many seconds till it grows big) is another 16b
Combined with the message headers, we have 7 bytes for every plant, for every player in the screen.
To make things worse, you will ned yet another value which says: this plant is of this size (where size is a 16b value, indicating a delta growth). It's hard to explain, but, like I said, this is NOT easy and can't be done without extensive bandwidth.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now