Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 27

Author Topic: LCS 4.07.0 Download (Sneak Attacks, April 2013)  (Read 256646 times)

Little

  • Bay Watcher
  • IN SOVIET RUSSIA, LITTLE IS YOU!
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #15 on: April 25, 2013, 12:28:20 am »

Bug: the 'A'ctivate Liberals and reorganize squads screens gets sleepers and the imprisoned visible, and allows the imprisoned to waltz right out of their cells.
Logged
Blizzard is managed by dark sorcerers, and probably have enough money to bail-out the federal government.

EuchreJack

  • Bay Watcher
  • Lord of Norderland - Lv 20 SKOOKUM ROC
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #16 on: April 25, 2013, 01:42:58 am »

Bug: the 'A'ctivate Liberals and reorganize squads screens gets sleepers and the imprisoned visible, and allows the imprisoned to waltz right out of their cells.
Sounds more like an awesome feature to me.  Early release for everybody!

seth--

  • Bay Watcher
  • We need a slogan!
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #17 on: April 25, 2013, 02:07:33 am »

Bug: the 'A'ctivate Liberals and reorganize squads screens gets sleepers and the imprisoned visible, and allows the imprisoned to waltz right out of their cells.
I can't reproduce this with a sleeper. Haven't tried with prisioners yet.

Can you upload the save file?

Edit: ok, reproduced it, I had to create a new squad instead of changing a existing one.

edit2: looks like the bug was introduced in r644:
Code: [Select]
@@ -930,17 +887,10 @@
    vector<Creature *> temppool;
    for(p=0;p<pool.size();p++)
    {
-      if(pool[p]->alive==1&&
-         pool[p]->align==1&&
-         pool[p]->clinic==0&&
-         pool[p]->dating==0&&
-         pool[p]->hiding==0&&
-         !(pool[p]->flag & CREATUREFLAG_SLEEPER))
+      if(pool[p]->is_active_liberal() &&
+         pool[p]->location==culloc || culloc==-1)
       {
-         if(location[pool[p]->location]->type!=SITE_GOVERNMENT_POLICESTATION&&
-            location[pool[p]->location]->type!=SITE_GOVERNMENT_COURTHOUSE&&
-            location[pool[p]->location]->type!=SITE_GOVERNMENT_PRISON&&
-            (pool[p]->location==culloc||culloc==-1))temppool.push_back(pool[p]);
+         temppool.push_back(pool[p]);
       }
    }

This is the commit message:
Code: [Select]
r644 | jonathansfox | 2013-04-20 23:39:54 -0300 (Sat, 20 Apr 2013) | 1 line

Substantial under-the-hood work refactoring location data. Most notable change is in newgame.cpp, where the code for initializing the game world is now vastly shorter and easier to read.

Reverting that part seems to fix the problem to me, at least the part of creating a new squad with a sleeper member.
Here is the patch:
Code: [Select]
--- src/basemode/reviewmode.cpp (revision 652)
+++ src/basemode/reviewmode.cpp (working copy)
@@ -884,15 +884,24 @@
       newsquad=1;
    }
 
-   vector<Creature *> temppool;
-   for(p=0;p<pool.size();p++)
-   {
-      if(pool[p]->is_active_liberal() &&
-         pool[p]->location==culloc || culloc==-1)
-      {
-         temppool.push_back(pool[p]);
-      }
-   }
+
+    vector<Creature *> temppool;
+    for(p=0;p<pool.size();p++)
+    {
+      if(pool[p]->alive==1&&
+         pool[p]->align==1&&
+         pool[p]->clinic==0&&
+         pool[p]->dating==0&&
+         pool[p]->hiding==0&&
+         !(pool[p]->flag & CREATUREFLAG_SLEEPER))
+       {
+         if(location[pool[p]->location]->type!=SITE_GOVERNMENT_POLICESTATION&&
+            location[pool[p]->location]->type!=SITE_GOVERNMENT_COURTHOUSE&&
+            location[pool[p]->location]->type!=SITE_GOVERNMENT_PRISON&&
+            (pool[p]->location==culloc||culloc==-1))temppool.push_back(pool[p]);
+       }
+    }
+
   
    sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ASSEMBLESQUAD]);

Can you try it, Little?
Sleepers don't show in my 'A'ctivate menu
« Last Edit: April 25, 2013, 02:37:09 am by seth-- »
Logged
I am confused are you saying you changed the kidnapping so it is less... Saw?
Did Saw consist of you beating them then yelling Ronald Reagan in their face?

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #18 on: April 25, 2013, 05:22:03 pm »

Reverting the change overcomplicates and duplicates code, which is why I simplified it in the first place. The problem is that I incorrectly removed the parentheses around the (pool[p]->location==culloc || culloc==-1) check. That's the part that checks if the particular Liberal is in the same location as the squad you're forming. The && operator is higher priority than the || operator in C++, so it's now making the whole is_active_liberal() check optional when your squad is empty, which is what should be culling out sleepers and people in prison. It was a logical error and an inevitable bug for me to drop the parentheses in that case.

This doesn't explain why you'd be able to see sleepers from the Activation screen or from the re-basing squadless screens -- it should only allow you to form new squads with Sleepers and Jailbirds.
Logged

KA101

  • Bay Watcher
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #19 on: April 25, 2013, 05:27:32 pm »

Re: maps
Uh...I was hoping for a bit more discussion first.  The Courthouse map turned out to increase difficulty (at least if you mind a B&E charge) and I'm not sure changing the DEB&G bouncers was necessary.  Any reports on the two-Jury effects?

(The Nuke Plant work was pretty minor, and the CCS facilities were basically random rooms with a security checkpoint.)
Logged

seth--

  • Bay Watcher
  • We need a slogan!
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #20 on: April 25, 2013, 05:28:34 pm »

Reverting the change overcomplicates and duplicates code, which is why I simplified it in the first place. The problem is that I incorrectly removed the parentheses around the (pool[p]->location==culloc || culloc==-1) check. That's the part that checks if the particular Liberal is in the same location as the squad you're forming. The && operator is higher priority than the || operator in C++, so it's now making the whole is_active_liberal() check optional when your squad is empty, which is what should be culling out sleepers and people in prison. It was a logical error and an inevitable bug for me to drop the parentheses in that case.

This doesn't explain why you'd be able to see sleepers from the Activation screen or from the re-basing squadless screens -- it should only allow you to form new squads with Sleepers and Jailbirds.
I agree the short version is clearly better, I was trying to find what caused the bug but couldn't really see it as I assumed both operators had the same priority
Logged
I am confused are you saying you changed the kidnapping so it is less... Saw?
Did Saw consist of you beating them then yelling Ronald Reagan in their face?

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #21 on: April 25, 2013, 06:16:14 pm »

Uh...I was hoping for a bit more discussion first.  The Courthouse map turned out to increase difficulty (at least if you mind a B&E charge) and I'm not sure changing the DEB&G bouncers was necessary.  Any reports on the two-Jury effects?

Let me assure you that I went over the maps with a fine toothed comb and used my own best judgment; any quality complaints that might arise aren't your fault, they're mine. The CCS maps are mostly unrecognizable compared to the ones you uploaded (I wanted to make the maps a little less samey rather than all being loosely in the template of the nuclear plant); the Bar & Grill map is the exception, and I heavily revised that one too. I didn't touch your courthouse map, because I agree with jboy that it's fantastic. I made the bouncer change myself because I wanted to let you slip into that location's public area without getting stopped at the door. It wasn't necessary by any means, but it seemed very fitting with the new map.

I take a "be bold and sort out the mess afterward" approach to the game, and I think that's the best way to go about it; like Wikipedia, you can always revert if things go sideways, so it's better to go crazy and just try stuff. As usr_share has observed in the "prisons and guns patch" thread (which I also threw into this release after some internal revision and testing), the game has several features that have been tried and later discarded. But for the most part, it's full of features that were tried and kept because they were good -- so I tend to err on the side of courage rather than trepidation. :)

Edit: Plus, nothing stimulates discussion of a feature like it showing up in the next release. If we need to change the maps, let's do it!

I agree the short version is clearly better, I was trying to find what caused the bug but couldn't really see it as I assumed both operators had the same priority

I had to look up the && vs || priority myself before posting -- I remembered back from my early programming courses (which were taught in C++, lucky me?) that they have different priority, but I can never keep them straight. That sort of logic should always have explicit grouping, since many programmers won't intuit the priority between them; it really was a mistake on my part to leave off the parentheses, not just because it caused the code to break.

Edit: Also, it is by no means wrong to revert a change to see that a commit is what created the bug. You didn't do anything wrong, I just wanted to make sure my clean code baby wasn't thrown out with the bathwater.
« Last Edit: April 25, 2013, 06:20:45 pm by Jonathan S. Fox »
Logged

ShoesandHats

  • Bay Watcher
  • Shoes cancels Drink: Intensified by Penguin Man.
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #22 on: April 25, 2013, 06:29:07 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.
Logged

seth--

  • Bay Watcher
  • We need a slogan!
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #23 on: April 25, 2013, 06:36:40 pm »

I agree the short version is clearly better, I was trying to find what caused the bug but couldn't really see it as I assumed both operators had the same priority

I had to look up the && vs || priority myself before posting -- I remembered back from my early programming courses (which were taught in C++, lucky me?) that they have different priority, but I can never keep them straight. That sort of logic should always have explicit grouping, since many programmers won't intuit the priority between them; it really was a mistake on my part to leave off the parentheses, not just because it caused the code to break.

Edit: Also, it is by no means wrong to revert a change to see that a commit is what created the bug. You didn't do anything wrong, I just wanted to make sure my clean code baby wasn't thrown out with the bathwater.
fix is in the repo
Logged
I am confused are you saying you changed the kidnapping so it is less... Saw?
Did Saw consist of you beating them then yelling Ronald Reagan in their face?

BoxOfAids

  • Bay Watcher
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #24 on: April 25, 2013, 06:38:43 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.

Was it on a single target? Because if you sneak attack 1 person in a group, the rest will notice. If there's more than 1 conservative present, you need an equal or larger amount of liberals able to sneak attack to take them all down without alarm.
Logged

ShoesandHats

  • Bay Watcher
  • Shoes cancels Drink: Intensified by Penguin Man.
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #25 on: April 25, 2013, 06:40:07 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.

Was it on a single target? Because if you sneak attack 1 person in a group, the rest will notice. If there's more than 1 conservative present, you need an equal or larger amount of liberals able to sneak attack to take them all down without alarm.

There was just one guy, and he got his heart stab'd. And then died.
Logged

KA101

  • Bay Watcher
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #26 on: April 25, 2013, 06:52:53 pm »

Related question: do "successful", in that no alarm is raised at the end of the combat round, sneak-attack kills attach Murder/Armed Assault charges?

If they do, we/I should probably update the wiki to reflect that.
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #27 on: April 25, 2013, 07:57:10 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.

It's possible it's a bug -- I had this happen once in testing, but wasn't able to reproduce it. What sort of enemy are you attacking? I'm wondering if your opponent had body armor, you got him down to near death, and he bled out and died immediately.

Related question: do "successful", in that no alarm is raised at the end of the combat round, sneak-attack kills attach Murder/Armed Assault charges?

If they do, we/I should probably update the wiki to reflect that.

They should still attach charges.
Logged

ShoesandHats

  • Bay Watcher
  • Shoes cancels Drink: Intensified by Penguin Man.
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #28 on: April 25, 2013, 08:00:42 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.

It's possible it's a bug -- I had this happen once in testing, but wasn't able to reproduce it. What sort of enemy are you attacking? I'm wondering if your opponent had body armor, you got him down to near death, and he bled out and died immediately.

It's anyone I shank. I've managed to one-hit soldiers with a sneak attack to the body, so I imagine one of those to a lawyer would be immediately fatal. I'm using a combat knife and wearing leather armor, if that might help.
Logged

a1s

  • Bay Watcher
  • Torchlight Venturer
    • View Profile
Re: LCS 4.07.0 Download (Sneak Attacks, April 2013)
« Reply #29 on: April 25, 2013, 10:11:59 pm »

Well, not sure if it's a bug or I'm not understanding the mechanic, but whenever I perform a successful sneak attack, it still immediately trips the alarm.

It's possible it's a bug -- I had this happen once in testing, but wasn't able to reproduce it. What sort of enemy are you attacking? I'm wondering if your opponent had body armor, you got him down to near death, and he bled out and died immediately.
happens every time for me, I tried to use a dagger, and a combat knife, tried withitout knife skill, and with. it seems to occur every time I only have 1 operative. to clarify: when I have more people sneaking, it's fine (no alarm).
« Last Edit: April 25, 2013, 10:16:52 pm by a1s »
Logged
I tried to play chess but two of my opponents were playing competitive checkers as a third person walked in with Game of Thrones in hand confused cause they thought this was the book club.
Come play Ventures by Torchlight with us!
Pages: 1 [2] 3 4 ... 27