Ages of Man: the GENERAL DISCUSSION thread

Are you using GameEvents:UnitSetXY() in your combat workarounds? I was thinking about using this to grab info on melee units before they die, or even to figure out whether it was a melee attack at all. But I'm somewhat worried about this GameEvent sucking up too much overhead, and I'm not even sure it's safe to assume that this will run before RunCombatSim().

Believe me, I thought of that. But I ran into a few problems:
> The overhead is huge. UnitSetXY not only runs every time a unit moves, it runs once for EACH HEX traveled through. So figuring out whether that particular movement was linked to a combat (for melee units) would add a lot of headaches. It can be done, and it might even be low enough in processor time to be acceptable for some people, but it's not really a good solution since it wouldn't help with ranged attacks.
> The easier way to tell it was a melee attack is that the attacker took damage in the progress; ranged attacks never damage the attacker. (And those damage values are arguments to RCS, not dependent on the Unit structure, so they're still working.) But even for melees, that movement command won't help me figure out what unit was involved in the combat very easily, and for ranged warfare it'd be useless.
The problem is that since the Unit structure is now cleared before RCS triggers, fixing this would require you to scan through the list of active units for the two participants and see which entry is now missing; that's a LOT of overhead, since it'd require you to update a persistent table of active units after every combat, every event that could kill a unit (like my Lua-based Poison and Disease logics, my Critical Strike ability, and so on), whenever someone disbands a unit, etc. just to make sure you're identifying the RIGHT unit as the victim.

(Specifically, I need to know how much experience is dealt out in combat, which I did by figuring out who the combatants were.

Well, that won't work any more if one of the two units involved died. Or if one of the two participants was a city. Or if a nuke was involved. And your Great General workaround might work for your own mod, but it wouldn't for mine, since quite a few of my units (like all of my Heroes, and many Myth units) generate no Great General points, while others generate more GG points than normal.

-----------

I've spent the past month going through all of the possible methods I could think of to fix this issue. So far, the best solution has been to redesign the math to not hinge so much on the individual units' stats in any RCS events. A lot of this does work; the Favor generation equation, for instance, primarily depends on the amount of damage dealt and whether or not the opponent was killed in the process, and all of that can be determined without needing the Unit structure. But there are some other bits that can't be worked around smoothly; I currently have a multiplier in there, to where 50% more Favor will be given to both parties if the attacker is either a Hero or a Myth unit, and another 50% if the defender is Hero or Myth. (That is, Hero-on-Myth, Hero-on-Hero, or Myth-on-Myth fights give twice the normal Favor to BOTH sides. Hero-on-Normal gives 150% to both sides.) That's a lot harder to work with, since determining whether a participant was a Hero or Myth unit will depend on the Unit structure. So, I could get around this by increasing the bonus to both sides if one of the two participants was killed in the process; it might be a bit unfair, but it'd result in the same average Favor rates over time. (That is, if a Hero kills any unit, whether mundane or mythological, both sides would get 175% Favor, since I'd have no way to know whether the defender would have been mundane, giving 150%, or mythological, giving 200%.)
If it were possible to have different Max HP values for individual unit types then it'd be easy; give all Myth units 12 HP, all Heroes 15 HP, and so on, and it'd be easy to use RCS's arguments to see what the unit was before it was killed. I'm trying to see if it's practical to do this sort of thing as a solution, but so far no luck.

Similar workarounds exist for a lot of stuff. Take Psi units; instead of adjusting their base strength pre-combat by +/-25% to account for enemy strength, I could just make it a simple "deal +1 to +3 damage if the opponent is stronger than you and survives, deal -1 to -3 damage if the opponent is weaker than you and survives, or heal fully if you kill the opponent". It'd have roughly the same effect, and wouldn't suffer from any of RunCombatSim's current problems. Most of the problems can be "fixed" like this. The problem is that there are just still a few that can't, like nuke interception. I've found nothing that could be used to mimic the old nuke interception; at best, I could give hidden anti-nuke promotions/abilities to units and buildings, to help them survive nuke attacks, but those wouldn't protect improvements. And until I find some acceptable fix for this, the Ascension mod just won't be balanced at all, as nukes are just too important a part of that mod's balance and being unable to intercept them would just ruin everything. And then there's the promotion cap; many of my stopgap fixes require giving hidden promotions, but from what people have said, the expansion adds so many promotions that my mods wouldn't have worked even WITHOUT the RCS bug.

Like I said, I'm still looking into solutions for this, and I've found some things that might be useful. But it's unlikely that the solution will be anything elegant like a single Lua workaround that'll fix all of these; it's more likely I'll have to patch each broken bit individually.
 
Are you using GameEvents:UnitSetXY() in your combat workarounds?

I may be wrong, but from what I've seen in my test games since .674, this one seems to be called after all units have attacked during the AI turn.
 
Yes, I saw that. Unfortunately, some RL issues are going to prevent me from doing much C++ coding in the near future, so I'm probably going to have to wait and see what new hooks other folks can create. It might be a while before I make a working version of these mods again... but it WILL happen eventually.
 
Yes, I saw that. Unfortunately, some RL issues are going to prevent me from doing much C++ coding in the near future, so I'm probably going to have to wait and see what new hooks other folks can create. It might be a while before I make a working version of these mods again... but it WILL happen eventually.

I'm working on a new simple combat event, test are promising, it should fire before the combat is done, it works with quick combat and strategic view, and it will return the attacked plot :D

edit: http://forums.civfanatics.com/downloads.php?do=file&id=20340
 
Yes, I saw that. Unfortunately, some RL issues are going to prevent me from doing much C++ coding in the near future, so I'm probably going to have to wait and see what new hooks other folks can create. It might be a while before I make a working version of these mods again... but it WILL happen eventually.

Awesome! I look forward to seeing a revived version. This mod looks awesome!

However, did the fall patch fixes change anything for you? (Other than the DLL)
 
However, did the fall patch fixes change anything for you? (Other than the DLL)

I haven't had a chance to really look through it in detail yet. (Some RL issues have cropped up.) There were two really welcome changes that I want to look at more closely:

1> AI workboats now connect Oil correctly. The question is whether they hard-coded it for oil, or whether the AI will now handle my custom water resources as well. I've got a few workarounds in my mods for things like this, which I'd really like to get rid of.

2> "Modding: Fix the hard-coded length of the promotions boolean array." If this means no more 200-promotion limit, then my job just got a LOT easier since the promotion limit was a big problem for my mods' compatibilities.

But again, the only way this mod'll ever work again is if we get a good combat-related Event, so while I'm willing to fix things for the new patch, it won't be playable until progress is made by other modders.
 
You don't like the one I posted above ? ;)

It work perfectly with the WWII mod, but if you can test it in your mod and give me feedback, I'd like to know if it allows ICBM interception.

edit: and I think that removing the limit on promotions was in the patch notes, but I didn't test it.
 
You don't like the one I posted above ?

Just haven't tested it yet. Transitioning my old combat-related routines just takes a little time; you kept the argument lists the same as the old events, but you're only triggering BEFORE the combat, and for some of my things I'd prefer to be able to do them AFTER the combat. I can shift those bits to other functions, but it just takes a little work. The best example of this is the Psi units; they're supposed to adjust their strength before combat is resolved, and then shift back afterwards. If the only available event triggers before combat, then I'll have to shift the "reset" to the start of the next player's turn. Easy to do, but I'll have to actually do it.

(Now, if you could ALSO figure out where to place an end-of-combat hook...)

Anyway, I'll spend most of this upcoming weekend fixing my mods, and I hope to have something internally functional by next week. But making it something other people can use will require me to buy the G&K expansion and update for THAT, which might take a bit longer.
 
But making it something other people can use will require me to buy the G&K expansion and update for THAT, which might take a bit longer.

you could put up a link to paypal and ask for donations, it shouldn't take long... hell I've seen people gift games by steam on forums before :D
 
I didn't hold off on G&K because I couldn't afford it. I held off because I had little interest in playing Civ5 without my own mods, and they've been broken since before the expansion. But if Gedemon's new events give me the functionality I need, then I'll be back to playing Civ again, so I'll need to get the expansion.
 
...which might mean that I'd have to get it, too. So if you want to give $$$ to Firaxis just update that mod. ;)
Looking forward to its probable resurrection!
 
I didn't hold off on G&K because I couldn't afford it. I held off because I had little interest in playing Civ5 without my own mods, and they've been broken since before the expansion. But if Gedemon's new events give me the functionality I need, then I'll be back to playing Civ again, so I'll need to get the expansion.

Don't forget those who haven't gotten the expansion ;)
 
Don't forget those who haven't gotten the expansion

There's no choice. Mods made pre-G&K just aren't compatible with post-G&K. If I don't buy the expansion then the majority of players wouldn't be able to use my mod. Besides, I want some of the things the expansion adds...
 
There's no choice. Mods made pre-G&K just aren't compatible with post-G&K. If I don't buy the expansion then the majority of players wouldn't be able to use my mod. Besides, I want some of the things the expansion adds...

My WWII mod is still for vanilla, G&K users could use it by disabling the expansion in the DLC menu, and now it's automatically disabled by the mod itself using an override of ModsMenu.Lua.

But if you need features from the expansion, yes, there is no choice.
 
What a sad story... a modder cant continue his work just because he cant afford the game ...
 
What a sad story... a modder cant continue his work just because he cant afford the game ...

I didn't hold off on G&K because I couldn't afford it. I held off because I had little interest in playing Civ5 without my own mods, and they've been broken since before the expansion. But if Gedemon's new events give me the functionality I need, then I'll be back to playing Civ again, so I'll need to get the expansion.

Hopefully there will be a point in the future where these issues have been sorted, this project is awesome
 
Top Bottom