Feb 14th 2015, 13:58:21
How hard would it be to add another field into the db, maybe a String, which would hold a simple description of the breakdown of research points?
On the other hand, judging by the way you mention it, the engine directly accesses the ally's country tech when it adds the research, but it apparently only saves an int of total research to deliver as a message to the ally's screen. Why not, for example, constantly keep track of the player's tech points and so whenever an ally does research and that research is added to the user's balance, print that data in the user's news messages directly, which would then store it as strings used for the news items, right? This could turn out to be messy so, additionally, you could attach a token to the string containing research data points and whenever that token is detected parse the specific part of the string for an int, extract the int, and add into an array; display the contents when the user logs on. All of this could be run in memory without the need for a database edit. At least it would in a way that I think of it - I only program in Java, so I don't know how it looks like in this game and on the server side, but may give you an idea... The downside is that there would be more processing. At any rate, I'm just poking in the dark here, but seems like there are 2 choices: 1 - edit the database (this could be easy if you have a nice database update method) and 2 - don't edit the database and use the string field to keep track of research point types.
As a third possibility - how come when something is sold on the market we know exactly what and in what quantity? Can this same mechanism be exploited to keep track of gained research? Perhaps "disguise" the gained tech info as, for example, purchased tech, but without touching the money balance, and save that information in the same field where "sold tech" is kept?
Just some ideas..