Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 11 12 [13] 14 15 16

Author Topic: Bugs, UI issues and Minor Suggestions  (Read 27503 times)

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #180 on: December 21, 2011, 08:19:58 pm »

For the first time today, I had the chance to get someone's skill above 20. Imagine my suprise to find out that skills do not go above 20 even though stats do.
Or at least stealth doesn't. I assume the same is true for the rest.
----
Edit: Here's the culprit, from creature.cpp
void Creature::train(int trainedskill, int experience)
{
   return this->train (trainedskill, experience, 20);
}

Should be 30 36. I think that's as high as a stat can go.
« Last Edit: December 24, 2011, 08:11:03 pm by Pesi »
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #181 on: December 24, 2011, 07:20:25 pm »

From mapspecials.cpp...

448    addstr("The nuclear waste gets released into the state's water supply!");
449    change_public_opinion(VIEW_NUCLEARPOWER,15,0,95);
450    change_public_opinion(VIEW_LIBERALCRIMESQUAD,-100,0,0);


Was the idea here that people would hate the LCS for doing this? Because if so, the last line should be affecting VIEW_LIBERALCRIMESQUADPOS.

Also, the change_public_opinion() function has a cap on how far it can fall at once and for VIEW_LIBERALCRIMESQUAD, that's -5. (So it might as well say -5; for VIEW_LIBERALCRIMESQUADPOS it's -50)

As it is, it's just lowering the amount of people that have heard of the LCS, and nothing that 5 days of causing trouble won't fix.

If bringing the issue, whichever it's supposed to be, to 0 is the idea; you might want to go for attitude[VIEW_LIBERALCRIMESQUAD]=0;.
----
Edit:
Words fail me.

Witness the relevant part of void change_public_opinion:

544    if(v==VIEW_LIBERALCRIMESQUAD)
545    {
546    //Only half the country will ever hear about the LCS at one time,
547    //and people will only grudgingly lose fear of it
548    if(effpower<-5)effpower=5;
549    if(effpower>50)effpower=50;
550    }


Note the absence of a -
« Last Edit: December 24, 2011, 08:16:36 pm by Pesi »
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #182 on: December 25, 2011, 12:52:30 pm »

shopsnstuff.cpp:

armsdealer(), pawnshop(), deptstore() and halloweenstore() could be made into a single function taking a string with a filename.
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: Bugs, UI issues and Minor Suggestions
« Reply #183 on: December 26, 2011, 05:35:30 am »

Pesi, I don't know if someone else is following up on these reports and implementing your fixes, but normally that would be my job, since I'm kind of the de facto maintainer for LCS. Lately, I haven't been doing that, because I have another project I'm devoting all my attention to. This is troubling for me, because you're producing great suggestions and bug reports, and I don't want your efforts to go to waste.

Do you know how to use SVN? And are you willing to commit changes directly? If you give me a Sourceforge username (in thread or in PM) I can add you to the dev team -- which implies no obligation, it just grants privileges -- and then you can commit bug fixes and anything else you spot directly to the main LCS trunk build. You already have my approval; I think you've demonstrated you know what you're doing several times over with your reports and insightful questions.
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #184 on: December 26, 2011, 10:16:46 am »

@Fox:

Unfortunately, I have NO idea how to use SVN.
----
Two more things I want to bring up.

1) It seems it is quite possible to end up with a female president during C+ gender equality laws (and also, funnily enough, for someone with a WHITEMALEPATRIARCH name to have the title "mrs.").

Suggestion:politics.cpp
216    else if(candidate[0][0]==-1 || law[LAW_WOMEN]==-2)
290    else if(LCSrandom(2) || law[LAW_WOMEN]==-2)


2) The way nonunion workers are given their alignment means that when the public mood is C+ (let's call that 0% liberal) they are all conservative; when it's 50% liberal, rougly 62,5% of them will be moderate; and when the mood is 100% liberal this will have gone down to 50% moderates. Is this intentional?
----
Edit:

Perhaps this alone would be better:
290    else if(LCSrandom(2) || candidate[c][0]=<-1)
At least that way there won't be a "mrs. guaranteed-malename", not a perfect fix, but better than nothing.
« Last Edit: December 26, 2011, 11:46:26 am by Pesi »
Logged

Yannanth

  • Guest
.
« Reply #185 on: December 26, 2011, 10:54:08 am »

.
« Last Edit: November 22, 2016, 05:18:50 am by Yannanth »
Logged

Servant Corps

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #186 on: December 26, 2011, 01:05:18 pm »

450    change_public_opinion(VIEW_LIBERALCRIMESQUAD,-100,0,0);
...what? There's not really much point to put nuclear waste in the state's water supply then.

Then again, there's not much point to put nuclear waste in the state's water supply anyway other than for the lulz, but it could be seen as a way to build an easy reputation of fear that could aid the LCS.
Logged
I have left Bay12Games to pursue a life of non-Bay12Games. If you need to talk to me, please email at me at igorhorst at gmail dot com.

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #187 on: December 26, 2011, 02:53:36 pm »

@Servant Corps:

The point of my post there was that this line doesn't actually work. It looks bad, but doesn't do anything; not even the little bit that I thought it did before the edit.
----
Optimization-suggestion:politics.cpp

2402    for(int v=0;v<VIEWNUM;v++)
2403    {
2404    if(v==VIEW_LIBERALCRIMESQUAD)continue;
2405    if(v==VIEW_LIBERALCRIMESQUADPOS)continue;
2406    if(v==VIEW_CONSERVATIVECRIMESQUAD)continue;
2407    sum+=attitude[v];
2408    }


This could be:

for(int v=0;v<VIEWNUM-3;v++)
{
  sum+=attitude[v];
}
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #188 on: December 26, 2011, 04:16:24 pm »

Something I just noticed in politics.cpp:

First:
162    char candidate[2][80];

So let's call the two candidates candidate[0] and candidate[1].

Second: determining alignment
Code: [Select]
195 // determine conservative winner
196 if(consvotes[0] > consvotes[1])
197 if(consvotes[0] > consvotes[2])
198 candidate[1][0]=-2;
199 else candidate[1][0]=0;
200 else if(consvotes[1] > consvotes[2])
201 candidate[1][0]=-1;
202 else candidate[1][0]=0;
203
204 // determine liberal winner
205 if(libvotes[0] > libvotes[1])
206 if(libvotes[0] > libvotes[2])
207 candidate[0][0]=0;
208 else candidate[0][0]=2;
209 else if(libvotes[1] > libvotes[2])
210 candidate[0][0]=1;
211 else candidate[0][0]=2;

From this we can see that candidate[0] is the liberal one, and candidate[1] is the conservative one, this is supported further during printing:
258    for(c=0;c<2;c++)
267    move(6-c*2,0);

meaning the liberal one is below the conservative one.

The hilarity happens during naming:
Code: [Select]
213 // name the candidates
214 if(candidate[0][0]==-2)
215 generate_name(candidate[0]+1,GENDER_WHITEMALEPATRIARCH);
216 else if(candidate[0][0]==-1)
217 generate_name(candidate[0]+1,GENDER_MALE);
218 else
219 generate_name(candidate[0]+1);
220 generate_name(candidate[1]+1);
It checks to see if the liberal candidate is conservative (never) before deciding to just toss a coin for both of them.

In the naming part, all instances of candidate[0] should be swapped with candidate[1] and vice versa.

My previous suggestion depends on this being so, and makes no sense otherwise.
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #189 on: December 27, 2011, 01:46:05 pm »

blomkvist has made another revision (584). He was pretty quick to adopt the suggestions in my first thread, but doesn't seem to read this one.

At any rate, I've been reading talk.cpp and it looks like you can intimidate tanks as easily as you can anyone else who's not a professional combat-machine.
I invite you to try it and see if you can get the message "M1 Abrams Tank has a family!".
----
Edit:
Yeah, it seems you can also get rid of a tank by threatening a hostage at it.
----
More edit:
Code: [Select]
417 if(law[LAW_FREESPEECH]>ALIGN_ARCHCONSERVATIVE)
418 addstr("\"Fuck! \"");
419 else
420 addstr("\"[No!] \"");
421 switch(LCSrandom(5))
422 {
423 case 0:addstr("Okay, okay, you win!\"");break;
424 case 1:addstr("Don't shoot!\"");break;
425 case 2:addstr("Do you even care?!\"");break;
426 case 3:addstr("Heartless!\"");break;
427 case 4:addstr("It's not worth it!\"");break;
428 }
The first two lines have an inexplicable space between the end of the word and the closing quote, the other five are missing the opening quote.
« Last Edit: December 27, 2011, 02:42:20 pm by Pesi »
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #190 on: December 27, 2011, 07:17:56 pm »

Digging around in the codebasement (specifically, commondisplay.cpp), I noticed this old gem of a function:
Code: [Select]
35 void set_alignment_color(signed char alignment, bool extended_range)
36 {
37    switch(alignment)
38    {
39    case ALIGN_ARCHCONSERVATIVE:
40       set_color(COLOR_RED,COLOR_BLACK,1);
41       break;
42    case ALIGN_CONSERVATIVE:
43       if(extended_range)
44          set_color(COLOR_MAGENTA,COLOR_BLACK,1);
45       else
46          set_color(COLOR_RED,COLOR_BLACK,1);
47       break;
48    case ALIGN_MODERATE:
49       set_color(COLOR_YELLOW,COLOR_BLACK,1);
50       break;
51    case ALIGN_LIBERAL:
52       if(extended_range)
53          set_color(COLOR_BLUE,COLOR_BLACK,1);
54       else
55          set_color(COLOR_GREEN,COLOR_BLACK,1);
56       break;
57    case ALIGN_ELITELIBERAL:
58       set_color(COLOR_GREEN,COLOR_BLACK,1);
59       break;
60    }
61 }
...whose extended_range mode is not used by anything except things that are, themselves, not used by anything.

If we were to change COLOR_BLUE to COLOR_CYAN it could be given a purpose once more.

Such as in this part of politics.cpp:

260    // Pick color by political orientation
261    if(candidate[c][0]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
262    else if(candidate[c][0]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
263    else if(candidate[c][0]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
264    else if(candidate[c][0]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
265    else set_color(COLOR_GREEN,COLOR_BLACK,1);


...which could become simply:

set_alignment_color(candidate[c][0],true);// Pick color by political orientation
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #191 on: December 28, 2011, 10:26:44 pm »

commonactions.cpp:A way for juice-adding to not go above the cap without affecting trickle-up:

// Apply juice gain
if(juice>0){cr.juice+=min(juice,(cap-cr.juice));}
else{cr.juice+=juice;}


*Knows that this is a sloppy solution*
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #192 on: January 04, 2012, 09:46:06 am »

Another line of code needing review, from fight.cpp

1102    addjuice(a,-(5+t.juice/20),1000);

The limit on negative juice is how far it can fall. As one can't go above 1000 juice, this line does nothing.
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #193 on: January 09, 2012, 12:01:31 pm »

I may have found the reason for spraypainters not finding spraycans in the base.

activities.cpp:
Code: [Select]
1486 for(int i=0; i<location[graffiti[s]->base]->loot.size(); --i)
1487 {
1488   if(location[graffiti[s]->base]->loot[i]->is_weapon())
1489   {

The counter goes down instead of up. I'm pretty sure it's supposed to go up. It looks like the for-loop underflows through every possible value of int, stopping just as it gets to the ones that would actually be useful.
Logged

Pesi

  • Bay Watcher
    • View Profile
Re: Bugs, UI issues and Minor Suggestions
« Reply #194 on: January 19, 2012, 11:44:19 am »

I have found no more bugs that haven't been found already, and it doesn't look like I will, so here are some suggestions.

activities.cpp:
2022    else if(trouble[t]->get_skill(SKILL_HANDTOHAND)<4)

This decides if the rednecks attack. They can somehow tell if you can fight, but they still rush in when you have an AK47 at your side when a knife is enough to scare them away. They didn't use to.
I suggest changing it to this:

else if(trouble[t]->get_skill(SKILL_HANDTOHAND)<4 && trouble[t]->weapon_is_concealed())

I am assuming here that empty fists are always concealed.

Muraling could use a nerf.
Code: [Select]
1599 graffiti[s]->activity.arg=-1;
1600 addjuice(*graffiti[s],power,power*20);
1601 change_public_opinion(issue,power);
1602 graffiti[s]->train(SKILL_ART,MAX(10-graffiti[s]->get_skill(SKILL_ART)/2,1));

Here's an idea: Change line 1601 to...

change_public_opinion(issue,power,1,min(power*25,100));

that way it won't affect everyone unless it's "beautiful".

While on the subject of graffiti, here's how it ends:
Code: [Select]
1637 if(issue==VIEW_LIBERALCRIMESQUAD)
1638 {
1639    change_public_opinion(VIEW_LIBERALCRIMESQUAD,LCSrandom(2),0,65);
1640    change_public_opinion(VIEW_LIBERALCRIMESQUADPOS,!LCSrandom(8),0,65);
1641    public_interest[issue]+=power;
1642 }
1643 else
1644 {
1645    change_public_opinion(VIEW_LIBERALCRIMESQUAD,LCSrandom(2)+1,0,85);
1646    change_public_opinion(VIEW_LIBERALCRIMESQUADPOS,!LCSrandom(4),0,65);
1647    public_interest[issue]+=power;
1648    background_liberal_influence[issue]+=power;
1649 }
The only times where issue is something other than VIEW_LIBERALCRIMESQUAD is when they either start a mural, or finish one. When they start one, power is 0; so the only times lines 1647-1648 do something is when they finish a mural, which already changes the public opinion via change_public_opinion(), something that also affects public_interest and background_liberal_influence. This makes muraling better than other otherwise equally-powerful mood-changing activities.

Edit:

This comment from daily.cpp:
Code: [Select]
616 case ACTIVITY_MAKE_ARMOR:
617    makearmor(*pool[p],clearformess);
618    // Uncomment this to have people stop making armor after the first day
619    //pool[p]->activity.type=ACTIVITY_NONE;
gave me an idea.

There could be some sort of 'management'-screen where one could decide these things, like with the checkboxes during setup.

a) [ ] - stop making armor after the first day
Code: [Select]
case ACTIVITY_MAKE_ARMOR:
   makearmor(*pool[p],clearformess);
   if(a)pool[p]->activity.type=ACTIVITY_NONE;

This could have several other options such as:

b) [ ] - don't do major hacks
Code: [Select]
if(!b && DIFFICULTY_HEROIC<=hack_skill+static_cast<int>(truehack.size())-1)
c) [ ] - don't make murals
Code: [Select]
else if(!c && !LCSrandom(MAX(30-graffiti[s]->get_skill(SKILL_ART)*2,5)))
d) [ ] - don't cause trouble on L+ issues
Would need work, but is basically an extra thing in the existing if-clauses.
« Last Edit: January 19, 2012, 01:49:45 pm by Pesi »
Logged
Pages: 1 ... 11 12 [13] 14 15 16