Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Ihlosi

Pages: 1 2 3 [4] 5 6 7
46
Curses / Re: Code question time!
« on: May 22, 2013, 12:17:51 pm »
Okay, I think I managed to commit some changes using the new selectRandomString function. Let me know what you think and then I can work on all the other occurrences.

Basically, a search for "case 0:addstr(" gives possible places where the new function might be used.

47
Curses / Re: Code question time!
« on: May 21, 2013, 12:32:33 pm »
Cool! Well, the easiest for me is that you could PM me with your Sourceforge username and I can add you as a developer on the project. Then you can SVN commit your changes.

Done. I still have to get used to SVN, though. I'm using a different (proprietary) revision control system at work.


Toady left everything in one file tens of thousands of lines of code long,

*faints*

Well, we all learn (usually the hard way) from beginners mistakes. Some of mine are over ten years old and still occasionally come back to haunt me in the form of nasty assembly blobs. I've grown wiser.

48
Curses / Re: Code question time!
« on: May 20, 2013, 02:19:54 am »
Hm, is there a source file that holds small "utility" functions that are used frequently by all parts of the code?

My approach uses a generic "pick random string function":

Code: [Select]
const char *SelectRandomString(const char **string_table, int table_size)
{
int roll;

roll = LCSrandom(table_size);

return(string_table[roll]);
}

that picks one random string from a given array, e.g.

Code: [Select]
static const char *male_first_names[] =
{
"Aaron", "Abraham", "Adam", "Adolph", ...
        };

I placed it in creaturenames.cpp, but logically it should go in a more general place.

49
Curses / Has anyone else noticed that priests ...
« on: May 19, 2013, 04:03:22 pm »
... seem to be fairly frequent in the Fireman HQ/Fire Station? In the latter, it does make a bit of sense (firefighters needing spiritual support), while in the former, it makes perverted conservative sense.  ;D

Btw, some kind of church would be nice as another building. I'm sure there's all kinds of mischief that creative Liberals can get into there, with preaching their own sermon (similar to AM radio station/Cable news station) being just one of them.

50
Curses / Re: Code question time!
« on: May 19, 2013, 02:03:35 pm »
So, if someone wanted to rewrite the name generator to clean it up, that'd be cool. It's low priority for me personally, simply because it has no immediate impact on the game.

I have a changed creaturenames.cpp ready to submit. ;) Now what do I do?

Then we just need to hunt down all the other places where strings are randomly picked from a list.

51
Curses / Re: Compiling on Code Blocks
« on: May 19, 2013, 05:50:26 am »
>Open up game.cbp in code blocks
>right-click 'liberal crime squad' in the left window
>select 'add files recursively'
>select src/title

Thanks. I found out that locations.cpp was missing in src/title. After adding it, the project compiles.

52
Curses / Re: Thug horde early game strategy.
« on: May 19, 2013, 04:44:54 am »
Does having a squadwipe hurt the public's perception of the LCS/ the issues, or could using disposable thugs to constantly perform attacks be a viable strategy?

There are few issues with using this strategy later on:

1. Juice only "trickles up" the chain of command if the superior has less juice than the subordinate. A leader with 500 juice already will gain no juice from a freshly recruited thug horde.
2. Liberals other than the LCS leader need to get up to 50 juice before they can recruit at all (normal recruits, not love slaves), and to 100 juice so they can have three recruits. I.e. the thug horde works best for the LCS leader, but not so well for any other Liberals.
3. Later on, as the population becomes more liberal, it becomes increasingly hard to avoid accidentially hitting moderates/liberals when attacking conservatives.

Later on, having "non-expendable" attack squads is probably a better idea. They gain more juice themselves and are able to constantly supply their superiors with "trickle-up" juice.

The strategy is almost an exploit. There should be repercussions for a Liberal if his subordinates/love slaves are killed (loss of juice), and police should try to capture the wounded Liberals if a squad gets completely disabled (members are alive, but unable to fight). This would lead to possible racketeering charges for the superior.

53
Curses / Re: Code question time!
« on: May 18, 2013, 04:01:11 pm »
Correct me if I'm wrong, but I don't see why that would be. sizeof(names) should be the number of bytes in a pointer times the number of names; you defined it as an array of pointers, not an array of arrays.

You're right. I got some things confused. That makes this approach even more elegant than I had thought.

54
Curses / Re: Compiling on Code Blocks
« on: May 18, 2013, 03:02:22 pm »
Yep, though in the last couple versions I've had to add a couple files in src/title to get it to compile.

Could you give some details on that? I'm trying to work with Code::Blocks, too.

55
Curses / Re: Hospital bills
« on: May 18, 2013, 02:57:43 pm »
The main issue really is that, with the sole exception of Gun Control, every issue turning more L either makes the game easier for you or doesn't make much of a difference.

Hm, with Flag Burning at C+, flying flags gives 10% extra secrecy.

56
Curses / Re: Code question time!
« on: May 18, 2013, 01:53:45 pm »
num_names = sizeof(names) / sizeof(names[0]);

This only works if the array uses fixed-length strings (which may actually be advisable due to being able to use the line above, even though it leaves some memory unused), e.g.

Code: [Select]
char male_first_names[MFN_COUNT][MAX_MFN_LENGTH] = {"Aaron", "Abraham", ...}
On the other hand,

Code: [Select]
char *male_first_names[] = {"Aaron", "Abraham", ...}
does not leave any memory unused, since it is technically an array of pointers into one long string, "Aaron\0Abraham\0...".

57
Curses / Thug horde early game strategy.
« on: May 18, 2013, 11:44:38 am »
I found a strategy that allows to get several hundred points of juice for the Founder in no time.

At the start of the game, go to the projects and recruit six gang members/highschool dropouts/etc (no crack heads, as they have bad stats, and no hippies). Put them in a squad, arm them with knives, put them in a base away from the founder. Then visit various locations in the industrial and university district and stab conservatives to death.

Due to the trickle-up economics of juice, this will give your founder completely safe juice. Change hideouts with the thug squad and buy business fronts with the profits from sold loot. Eventually, just get the knife squad killed. This will prevent any racketeering charges. Then recruit your actual followers.

58
Curses / Re: Extremely Liberal Crime Squad
« on: May 18, 2013, 08:47:06 am »
*Note: most of the time blue states give more federal tax money than they receive, and vice versa for the red states.

Heh. We must have better conservatives where I live, since the conservative "states" are actually funding the "liberal" (we call 'em "social democratic") "states" around here. Then again, the conservative party/-ies around here is more along the lines of m...L instead of C+...C.

59
Curses / Re: Code question time!
« on: May 18, 2013, 08:41:32 am »
So, if someone wanted to rewrite the name generator to clean it up, that'd be cool. It's low priority for me personally, simply because it has no immediate impact on the game.

I just installed Code::Blocks. I'll try to get the game to compile. Unfortunately, the largest part of my programming practice and experience is writing C (plus some assembly) for microcontrollers (mostly ARM, some 8051, some DSP) and dealing with the appropriate development tools. Writing for an actual computer might have the benefit of not having to deal with emulators, "hardware in development", and debugging with an oscilloscope. ;)

I found quite a few things that would make the code more maintainable/expandable without any impact on the game. Improvements here would be investments for the future, but have not immediate benefit.

Now if I could only tear myself away from playing the game. ;)

60
Curses / Re: Extremely Liberal Crime Squad
« on: May 18, 2013, 01:53:03 am »
Y'know, I was thinking that the LCS ought to have to get an ELITE LIBERAL AMENDMENT of this nature in order to win.  As it stands, Nightmare Mode is pretty much the LCS-wins scenario, but for the CCS (and I think the Congress isn't Arch-Conservative).

Well, the Congress can't be arch-conservative, since that would mean that the ARCH CONSERVATIVE AMENDMENT(*) to fully reaganize the country would be passed a few months into the game, leading to a game over for the LCS.

(*) see endgame.cpp. Yes, it's one way to lose the game.


Pages: 1 2 3 [4] 5 6 7