Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upCreature rework (checkpoint) #4982
Conversation
swwu
and others
added some commits
Nov 28, 2013
This comment has been minimized.
This comment has been minimized.
|
@kevingranade Less a concern about exposure, more a concern about getting this in before I leave for the holidays (the 20th) after which I won't have consistent access to internet for a few weeks. Exposure is a nice side effect though. The |
This comment has been minimized.
This comment has been minimized.
|
Uh, does this gender-specificity need to here? It's the same text. |
This comment has been minimized.
This comment has been minimized.
|
I dunno, I just reverted this to the way it is in the current master. It probably doesn't. |
This comment has been minimized.
This comment has been minimized.
|
Grab and disarm are [del]fairly[/del] very low priority, so that's fine. Burst-fire retargeting is fairly high priority, bounce and underwater penalties are solid nice-to-haves. It looks like you'll have it sorted out enough to merge within a few days, which would be nice, since I'm heading for a long workholidaycation... thing next Monday and will have spotty ability to merge things until the new year as well. |
This comment has been minimized.
This comment has been minimized.
|
@kevingranade burst-fire retargeting, bounce, and underwater are all accounted for. I'll see what I can do about the style but it might be easier for someone who can actually run astyle to just run the indicated files through it. Anything else needs doing? |
This comment has been minimized.
This comment has been minimized.
|
By the way, this is why I said to make a do-nothing creature class (then merge), then extract pieces of code from monster and player a bit at a time (merging as you go). Please keep this in mind in the future instead of trying to tackle the whole thing as a single branch. Not only is this more painful, but it's getting less review and testing than it would if we were proceeding incrementally, and it's not as bisectable if you do have some weird bug hiding somewhere. |
kevingranade
reviewed
Dec 11, 2013
| target.c_str()); | ||
| } | ||
|
|
||
| /* TODO: implement this effect yo, also figure out why weapon.conductive |
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 11, 2013
Member
This is a pretty strong nice-to-have, it's a major defense of a fairly common monster (shocker zombies).
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
This is in. Go check monster::deal_damage_handle_type. This is just a rogue comment.
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
Oh wait never mind, I misread the part of the file. Yeah, I can add this real quick.
This comment has been minimized.
This comment has been minimized.
|
@kevingranade That's more or less what was done, minus merging back into master. I've also been merging master into this branch the whole way so there's no reason it shouldn't be bisectable. |
swwu
added some commits
Dec 11, 2013
kevingranade
reviewed
Dec 11, 2013
| if (type->melee_cut > 0) | ||
| damage.add_damage(DT_CUT, type->melee_cut); | ||
|
|
||
| /* TODO: height-related bodypart selection |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
This also currently breaks the encapsulation pretty badly, since monsters now use the same combat system as humans (which prioritizes the eyes/head/torso with higher attack rolls). Would need a fair bit of extra scaffolding to get in place.
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 12, 2013
Member
I suspect that was the case, that's an acceptable temporary regression IMO.
kevingranade
reviewed
Dec 11, 2013
| // Shoot a random nearby space? | ||
| targetx += rng(0 - int(sqrt(double(missed_by))), int(sqrt(double(missed_by)))); | ||
| targety += rng(0 - int(sqrt(double(missed_by))), int(sqrt(double(missed_by)))); | ||
| /* TODO: as above, figure out what the tart parameter does |
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 11, 2013
Member
This definitely needs to be fixed, otherwise it will turn misses into hits fairly frequently.
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
How? The targeted square is still offset the way it's supposed to be.
kevingranade
reviewed
Dec 11, 2013
| p.has_charges("adv_UPS_on", adv_ups_drain*num_shots))) { | ||
| num_shots--; | ||
| } | ||
| //bool is_bolt = (curammo->type == "bolt" || curammo->type == "arrow"); |
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Dec 11, 2013
| // OR it's not the monster we were aiming at and we were lucky enough to hit it | ||
| int mondex = g->mon_at(tx, ty); | ||
| // If we shot us a monster... | ||
| /* TODO: implement underground etc flags in Creature |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Dec 11, 2013
| monster &z = g->zombie(mondex); | ||
|
|
||
| dealt_damage_instance dealt_dam; | ||
| // TODO: add bounce effect application |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Dec 11, 2013
| tarx = new_targets[target_picked].x; | ||
| tary = new_targets[target_picked].y; | ||
| zid = g->mon_at(tarx, tary); | ||
| /* TODO: get t back in? No idea what it does though, |
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 11, 2013
Member
Again this is critical, pretty sure burst fire is broken if you don't have this. You'll just keep shooting the same spot even though you're trying to shoot a new target.
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
No, it definitely works. I've tested it. I can attach a screenshot if you like.
kevingranade
reviewed
Dec 11, 2013
|
|
||
| dispersion += 2*encumb(bp_arms) + 4*encumb(bp_eyes); | ||
|
|
||
| // this is what the total bonus USED to look like |
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 11, 2013
Member
Woah! you can't just change the whole accuracy system with no discussion.
Revert this and PR separately.
This comment has been minimized.
This comment has been minimized.
swwu
Dec 11, 2013
Author
Contributor
The numbers work out to be the same, I just changed where they were added. The 80 is selected, for instance, because that's what all the constants in the old numbers added up to be. The only difference is that the standard deviation will be slightly smaller in this because it uses a fixed number of rolls instead of rng-ing each separately. Unfortunately I can't PR this separately because the old system violates encapsulation pretty badly. All of the "mechanical" changes are as close as possible to the old system as I could manage, in the sense that their expected values always match up and their standard deviations are usually fairly close to matching up.
This comment has been minimized.
This comment has been minimized.
kevingranade
Dec 12, 2013
Member
The results might be similar, but they aren't the same, and this version of the system is much less legible than the previous version, where it was extremely straightforward that each source of dispersion contributed a random amount between 0 and its max value. If you feel you need to pull all the constants and logic into this method, that's fine, but keep the logic the same.
This comment has been minimized.
This comment has been minimized.
|
Looks like that's all the pending issues, sort those out and it looks good to go, modulo testing. Development methodology discussion below, has nothing to do with this PR any more: The bigger your PR is, the more likely it is that I simply won't have time to deal with it. This one didn't reach the threshold, but that threshold isn't fixed, it changes based on how much time I have available, which is a steadily shrinking supply. I'm sorry if I'm coming across as harsh, but the way you developed this imposes a lot of extra work and uncertainty on me, and this is the only way I have of protecting myself from that. |
This comment has been minimized.
This comment has been minimized.
|
@kevingranade Cata's codebase is a big pile of functionality without any central guiding principle, where every class member variable is public and you have to explicitly check That kind of refactoring isn't possible with smaller chunks. I can't just change the melee attack functions to use creatures instead of monsters+players without dropping half the features attached to melee attacks, because so many of those features depend on very specific player/monster peculiarities. I can't just change the gunfire function to use creatures without dropping half the features attached to gunfire, because so many of those features depend on very specific player/monster peculiarities. If i were to commit code in small chunks that I hacked into working, we would end up barely better than where we started - we would have a "unified base class" in name only. I appreciate that it takes you time to merge these, and I appreciate that you've done so. But I can't do a rewrite that has one-for-one all the features of the original and is done in small chunks and is comprised of code that isn't a steaming cesspit of spaghetti. I'm only human; the best I can do is "pick two". Edit: Since I didn't actually make this clear, what I'm saying is, I can do small merge commits if you'd like, but they almost certainly either won't have immediate 100% feature parity, or will contain monstrous hacks. |
This comment has been minimized.
This comment has been minimized.
dwarfkoala
commented
Dec 11, 2013
|
Has this been taken to the forum for exposure yet? |
This comment has been minimized.
This comment has been minimized.
moist-zombie
commented
Dec 12, 2013
|
I don't comprehend 98% of this, but it looks quite a bit like HARD WORK :D Effort noted, to all involved parties :) |
swwu
added some commits
Dec 13, 2013
This comment has been minimized.
This comment has been minimized.
|
Ok, I THINK that addresses everything, so this will move to the top of the pile for merging for me. Thanks a lot for all this hard work. I hope I don't give the impression that it's not appreciated, this is a major undertaking that really needed to happen. Semi-unrelated policy side discussion: *More raw code, less time spent merging for all parties, honestly don't know where it would come out as far as total time spent. |
swwu commentedDec 10, 2013
Just to save a bit on merging pains down the road, and to get wider playtesting on the current state of the rework. Most things should be up to feature parity with pre-rework, with some small exceptions:
What's been done so far:
Creaturebase class for all things (that move) ever.Characterbase class for the player, human NPCs, and other such dialogue-enabled folk.Creature::reset_stats(instead of on-the-fly everywhere), andCreature::get_<stat>will automatically include the bonus in the total value. Can also get base inget_<stat>_baseor just the bonus inget_<stat>_bonus. Not fully implemented as a lot of bonuses still occur in e.g.player::suffer, but these shouldn't affect anything except the accuracy of theget_<stat>_basefunctions. "Stats" include, but are not limited to, str/int/per/dex, speed, bonus armor, bonus damage, damage multipliers, stealthiness, resistance to throwing techniques, etc.monattackfor monsters). To copy what I said in #4970: