Combat Log

Hambil

Emperor
Joined
Oct 16, 2006
Messages
1,100
I've seen several requests for this, but I'm not sure what they want? Perhaps they don't know that a fairly detailed log, including how much damage each unit took from what unit, is already available (isn't it?) I've looked at the log tons of times and off the top of my head I can't be 100% sure but I'm pretty sure it includes damage taken and deaths and such.
 
Hambil, are you talking about in game log, or a log file somewhere? If it's an InGame log, i would be happy to know how to access it.
 
Perhaps RED, as Gedemon has a CombatResult event which has all that info in it
 
We just need to find that code in the game,

pretty much every call to AddMessage() in CvUnitCombat.cpp - or just use Gedemon's CombatResult event as a template for writing the log entries from the DLL
 
Yep, in fact I'm really using that event for a (Lua) combat log in R.E.D. WWII, but I had to put a limit on the table, saveutils is taking a few minutes to save it when there are more than 1000 entries (could reach more than 10,000 combat/game in that mod)
 
Well, as i took part on some of the discussions in the strategy forum, i can tell you that even a 1 turn log would make lots of people happy. Something going like 5 turns back would be more than enough for most, and not having the log saved wouldn't be such an issue either.
It's just that many people, especially players going for Domination victory play with Quick Combat, and the floating text goes away too fast, so you can't even know what units the ennemy has until you actually stumble into said units with your own.
That's also the reason i'm trying to mod animation speed if anyone has clues ;) (well, i gues i would have an answer by now if anyone knew how to do this, shame i can change movement speed but not the more important combat speed)

EDIT : can't test the F7 log right now, i'm under Linux. Will test when i reboot to win.
 
I was also thinking hotseat when I made it :)
 
Yep, in fact I'm really using that event for a (Lua) combat log in R.E.D. WWII, but I had to put a limit on the table, saveutils is taking a few minutes to save it when there are more than 1000 entries (could reach more than 10,000 combat/game in that mod)
saveutils has to re-serialize everything. Why not just save these as one-liners in a single SaveGameDB table? Then read as needed. I've loaded these up to well over 50000 rows with no problem (keep the data as compact as possible, of course).
 
saveutils has to re-serialize everything. Why not just save these as one-liners in a single SaveGameDB table? Then read as needed. I've loaded these up to well over 50000 rows with no problem (keep the data as compact as possible, of course).
Does anyone know if the version of SQLite they are using is compiled with FTS, and what version? While not 'fast' I can see many possible uses for a fulltext search on a table like the one proposed above.

Now I'm imagining Recount for Civ V :)

Edit: Come to think of it, I wouldn't store the text at all (you probably don't), just the data needed to rebuild the text. Which means something with graphics and cumulative results and such would be even easier.
 
Is it possible to actually write to an SQLite table from in-game. I though even reading them wasn't possible after a game was started (and only Lua tables were available then).
 
No idea what version, or what FTS is. I haven't found any limitations yet that I could blame on version, though SQLite has limitations compared to SQL.

Doing a SELECT on a 50000 line table is quite fast. I'm guessing faster than the Lua/C++/SQLite context changes you need to push the command through to SQLite and get the result back.

No, don't store text. 50000 lines is not a big deal if each one is only 100 bytes, which should be possible using integers. And keep in mind that DB tables don't "grow" when you add columns, only when you add non-default values. (Actually, I'm not sure if there is some minimum size per row so I don't know if my 100 byte per row is realistic. But I have done this and haven't noticed an obvious effect on gamesave/load speed.)

Is it possible to actually write to an SQLite table from in-game. I though even reading them wasn't possible after a game was started (and only Lua tables were available then).
You can create tables, add columns, deleate columns, insert, update, anything you want. That's how my TableSaverLoader works. [Edit: but don't use my TableSaverLoader for this. Bad idea. Just set up your own Query commands to create a specific table for this in SaveGameDB and insert/read as needed.]



Edit: If you tell me what columns you need and how you would likely want to get info from it, I'd be happy to write and post the Lua/SQL part for you.
 
Back
Top Bottom