Skip to content

Instantly share code, notes, and snippets.

View kevingranade's full-sized avatar
💭
Optimizing all the things

Kevin Granade kevingranade

💭
Optimizing all the things
View GitHub Profile
@kevingranade
kevingranade / critical weak points.md
Created April 27, 2024 20:03
Brief outline of ccritical hits vs weakpoints with benefits

Goals of "Critical Hits"

  • A mechanism to greatly increase damage output of highly skilled characters.
  • A mechanism for differentiating between weapon types.
  • Introduces some variation to combat so it's not just a steady burn down.

Current Critical Hits, the good parts

  • Meets above goals.
  • Only lives in the attack code, so it doesn't require more per-monster data.

Current Critical hits, the bad parts

@kevingranade
kevingranade / gist:c1a0bc32778223eb17629b4d18c43c28
Created August 16, 2019 02:50
DDA weapon values according to an 8-stat 0-skill NPC
2h_flail_wood has value 10.102587
jumper_cable has value 10.135000
cheek_pad has value 10.135000
kettle has value 10.151667
knife_steak has value 10.167421
oil_lamp has value 10.179534
oil_lamp_on has value 10.179534
pot_copper has value 10.196538
tongs has value 10.196539
fishing_hook_basic has value 10.212500
I'm fine with what you're doing in general, but there are a few places that overreach a bit.
If I don't comment on something, feel free to assume that I think it's ok.
The biggest thing is open season on mutations, whether adding it to scenarios or adding professions to scenarios that have it.
Ambush, Next Summer: Passage of time does not justify enabling starting mutations.
Sheltered: Likewise, the shelter is supposed to be a HUGE bonus, allowing that to pair with arbitrary professions is a really big deal.
Lab: If you're throwing open the list of professions allowed, the mutations need to go, it's precisely to avoid this mixing and matching of professions and mutations that was the reason for creating the lab start in the first place.
[2:11 PM] The Cat: All these toddler men that need their own crew of back patters and yes men to function and here I am pushing commits through a plasma storm of hate.
[2:11 PM] The Cat: Thin skinned man babies.
[2:11 PM] pawnis: guys
[2:11 PM] pawnis: is it viable to 100
[2:11 PM] pawnis: 100% abandon dodge
[2:11 PM] pawnis: and just put on a ton of armor
[2:11 PM] ThatGuyWhoLikesSpace: Completely
[2:11 PM] The Cat: Yes.
[2:11 PM] pawnis: and only use ranged
@kevingranade
kevingranade / gist:36f879d4e8f1500724afd4b92465b32f
Created June 12, 2017 03:48
Failing gcc7 fallthrough warning supression
switch( adjusted_intensity ) {
case 3:
parts_burned.push_back( bp_hand_l );
parts_burned.push_back( bp_hand_r );
parts_burned.push_back( bp_arm_l );
parts_burned.push_back( bp_arm_r );
// fallthrough intentional.
case 2:
parts_burned.push_back( bp_torso );
// fallthrough intentional.
@kevingranade
kevingranade / FOV_TEST_RESULTS
Created August 7, 2015 04:43
Unit test results comparing different FoV methods
# # # # # # ## # # # # # #
# # # S # # # # # # ## # #
# S # # # # # # # # ##
# # # # # # #S # # # # # #
# # # S # # #
# # ## # S # # # # # # # # # #
# # # S# S # # ## #
# # # # # # # # SS ## #
@kevingranade
kevingranade / gist:960855c2f3eff775255a
Created July 12, 2015 19:43
magic incantation to create an overmap from scratch
PATH_INFO::init_base_path("");
PATH_INFO::init_user_dir("./");
PATH_INFO::set_standard_filenames();
initOptions();
load_options();
init_colors();
g = new game;
existing hordes live in overmap::zg;
hordes move with calls to overmap::move_hordes()
These should both be removed, specific monster instances should be created instead of hordes, probably.
monsters outside the reality bubble live in overmap::monster_map
methods for spawning and despawning monsters live in overmapbuffer::{spawn,despawn}_monster()
need an act method, overmapbuffer::move_hordes()
In overmapbuffer since they will need to cross overmap borders.
Store references to monsters on a queue keyed by turns, after acting monsters insert themselves in the queue a number of turns in the future based on their speed.
Treat each submap of monsters as a group that gets processed at once, that would be slightly less turn-accurate, but have MUCH better memory coherence.
g++ -DLOCALIZE -Wall -Wextra -g -D_GLIBCXX_DEBUG --std=c++11 -MMD -c src/mission_companion.cpp -o obj/mission_companion.o
src/mission_companion.cpp: In function 'void talk_function::companion_mission(npc*)':
src/mission_companion.cpp:31:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (p->name.find("Scavenger Boss") != -1){
^
src/mission_companion.cpp:35:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (p->name.find("Crop Overseer") != -1){
^
src/mission_companion.cpp:39:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (p->name.find("Foreman") != -1){
@kevingranade
kevingranade / gist:635c39eb94c0be82d7e8
Created November 17, 2014 03:13
release notes 0.B
The Brin release is named in honor of significant improvements to PC/NPC relations. This release, containing
[size=20pt]over 9,000 commits[/size] (I counted)
brings an unheard-of amount of new features and content, most of which wants you dead.
Start your adventure in a wide variety of different locations, with a selection of different starting scenarios, now with unique character traits.
Explore new locations, some of which are ridiculously big (did somebody say 'mall'?), and some of which have inhabitants that don't want to eat you for a change. Vehicles have gotten some love, and now form a basis for an electrical network should you desire to build one. If you've ever wanted to strap a C4 pack onto an RC car and drive it under a Zombie Hulk, you got your chance.
A few more highlights:
You want speed? We brought the speed. You want more buildings? We have more buildings.
More configurable difficulty? got it. Better menus? Way better menus.
Mutation chains to explore? Tons of em. More guns? yep.
More t