Jump to content

An Overly Long Tangent Talking About Programming and How to Use It In Roleplay (TM)


McSpazz

Recommended Posts

Oh boy! Here we go again! Another tangent! As I promised in my post on hacking, I'm going to talk some about programming. What it is, what it isn't, and how you can best represent it in your roleplay. As a reminder, while I have a degree in computer science, this is all fiction and intended as a fun thing to do. If you don't want to take my opinions here to heart, you certainly don't have to!

 

1. What is Programming?

At the core of programming is logic. A series of statements that yield a result. Not only do you need a logical step by step means of reaching your goal, but you also need to phrase it in a way that makes sense to the language you are writing in. While general principles of logic and an understanding of how a computer works on the back end is always important, every programming language has its own quirks and syntax that can complicate implementation.

 

It is very important to remember, however, that not all programming languages are created equal. Some are only good for very specific tasks (like SQL) while others are better for web development (like CSS or .NET) and others still are useful for a ton of different applications but simply knowing how to program in that language isn't going to make you able to understand all of those different applications (like Python, Java, or every variant of C)

 

The hardest part of programming isn't necessarily making the code itself. The two big things that end up taking up most of a coder's time is going to be debugging (fixing problems in the code) and keeping up maintainability. That second one is really important because even if code you write now works, if it isn't flexible or you have to spend 15 minutes every time you open it to even understand what's going on, the future time you'll be spending trying to make future stuff work with your old stuff will make your head spin.

 

Just as an example, it's widely known that the code of City of Heroes is really messy. This is, in large part, because not much time was put into touching up old code to make use of new tools or keeping track of what is dependent on what. Part of the reason that it took so long to expand bases to what they are now is because even the guy that originally developed it couldn't remember how it worked when the original dev team tracked him down for advice. Even poking the original base code could make the entire thing fall apart. I've heard numerous stories of the wild and crazy things that have been found under the hood of the game which is, in part, why I am always so impressed with how far they've come in making sense of it all and cleaning it up.

 

2. What You Should Focus On

Somewhat amusingly, the actual process of coding is kind of the opposite of hacking. The process itself, from an outsider's perspective, is kind of boring unless it's intentionally being presented for the purpose of entertainment. Trying to write out your character actively programming something would basically be them staring at a computer screen for hours on end as they try to figure out why an array index works properly when a variable is saved within a function but not when it's passed in as an argument and...yeah, you get my point. Not only can it get very technical, but most of the actual coding can be fairly dull to get out.

 

That being said, outside of the end result, I'd say there's three things you should focus on when presenting your character when they're in the process of coding something.

 

First, research! While it's a bit of a meme that, after college, most of the programming you'll do will be in the form of copying code you find online...it's not entirely far off from the truth. Back in the day, before the internet, the only easy resource you had were peers where you studied/worked and books. My dad used to have a small library of textbooks that he'd refer to for technical information when he got stuck on something. These days, collaboration is a huge aspect. While nobody is about to share the entirety of their code, it's not at all uncommon for programmers to post snippets of what they're stuck on and ask for advice. There are people who spend their free time doing nothing but helping people on stuff like this in places like Stack Overflow or GitHub. If you ever needed a hook for your dork of a character to be recognized like some kind of celebrity without being too hamfisted, being a well known contributor on websites like these could be a legitimate outlet.


Second, FAILURE! Don't just make your character's code work. Have moments where bugs show up or where some unexpected result occurs. Not only does it add a layer of fallibility and realism to your character, but it can lead to fun moments in roleplay where things don't go right in fun and interesting ways. What's more, having your character have to take the time to understand how the software in that weird alien technology works can add time between events to allow for things to happen between acquisition and utilization.


Third and, most importantly, however, you should always...


3. Evolve, Modify, and Adapt!
Yes, this last point gets its very own section. There are few industries where the need to adapt and evolve is as important as software development. As time goes on, programming standards change, operating systems get updated, and services are dropped from support. 
For one thing, nothing just works "out of the box". It might appear that way to the person using it, but literally any hardware you use to interface with a computer has some kind of software telling the computer what it is and how to use it. Yes, even your mouse probably has some drivers. Not only can drivers that either do not or cannot properly be read by a system lead to things not functioning as intended, but maliciously designed drivers can fool a computer into fooling a computer into thinking something is working as advertised when it isn't actually doing that at all. One of the best, most relatable examples of this are fake SSDs you can buy off of Amazon.


Going even beyond that, as the programming languages and operating systems hardware runs on change, so too does the list of no longer functional hardware or even other software that used to be able to run on them. While an obvious example that might come to mind are old programs that were intended to run on Windows 95 being thrown at Windows 11, even the code within a programming language can stop working with other bits of code from the same programming language that was written more recently. A lot of this has to do not just with the addition of new features but also the deprecation of old features. Because of this, if a driver never gets an update as time goes on, it can stop working as well if at all.


More importantly, just because your character knows one programming language doesn't necessarily mean they know them all. Sure, knowing how to program in C will help you a lot when programming in C++, but C# is far closer to Java and will only help with Python after you learn Python's syntax. That doesn't just mean your character needs to spend time learning other languages when trying to allow systems to communicate with one another, that also means that they'll need to study up when dealing with some kind of exotic system they don't frequently work with. You might have made a fleet of robots, but that doesn't mean your character is fluent in whatever insane programming language the Rikti use. Plus, much like a spoken language, that also means your character will likely have at best a few languages they're good with, plenty they're familiar with, and numerous languages they know nothing about. If you don't think it would make sense for your character to be fluent in every single Romantic language, it probably wouldn't make sense for them to have every language remotely similar to C++ down to a science.


So what does this mean for your character? Put simply, never consider a project "finished" in the same sense you'd consider a puzzle finished. Just because your character's robot is complete doesn't mean you can't still have them commenting on code they're working on or some new development that's thrown them for a loop. Even an entirely custom system requires software to allow it to communicate with other systems. The more custom your computer is, be it in a case or in a robot, the more coding you'll be doing.

 

4. Why Make This at All?
Well, for a similar reason I made that entire post talking about hacking. A lot of people that make programmers often don't really explore the concept. Either their character knows how to code as a pretense to allow them to have robots or they stop interacting with that aspect of their character after all of their current projects are "complete" and there's nothing new in the works. My main goal here is to try and encourage everyone who plays a nerdy character that uses programming to fight (or cause) crime to go out of their comfort zone and play around with that side of their character more.
 

This is tangentially part of a series of tutorials regarding roleplay! You can find the full list of tutorials here!

Edited by McSpazz
  • Thanks 1
Link to comment
Share on other sites

What I get from this, an RP story where my character says "oh I can quickly make a program for that" but instead in a fit of rage throws the PC out the window because it wasnt as quickly done as the character belived is completely justified

  • Haha 3

back to the Zukunft

 

@Jkwak

Link to comment
Share on other sites

6 hours ago, jkwak said:

What I get from this, an RP story where my character says "oh I can quickly make a program for that" but instead in a fit of rage throws the PC out the window because it wasnt as quickly done as the character belived is completely justified


0.0
>.>
<.<
.... well, if you were going to write my biography, just say so.

  • Haha 1
Link to comment
Share on other sites

On 1/24/2024 at 1:50 AM, jkwak said:

What I get from this, an RP story where my character says "oh I can quickly make a program for that" but instead in a fit of rage throws the PC out the window because it wasnt as quickly done as the character belived is completely justified

And then half way through they discover that a different programming language actually has a library of functions that do everything that they need and, using that, they can have the program done in a day. They then set their computer on fire.

  • Haha 1
Link to comment
Share on other sites

On 1/23/2024 at 4:29 PM, McSpazz said:

hacking

 

I remember when hacking was figuring out how to manipulate code without having a manual or formal training.

Hackers - all along - find flaws that can be manipulated and learning things that the "formally trained" didn't know, didn't understand, or thought couldn't be done.

 

Keep your mask on, heroes!

If someone posts a reply quoting me and I don't reply, they may be on ignore.

(It seems I'm involved with so much at this point that I may not be able to easily retrieve access to all the notifications)

Some players know that I have them on ignore and are likely to make posts knowing that is the case.

But the fact that I have them on ignore won't stop some of them from bullying and harassing people, because some of them love to do it. There is a group that have banded together to target forum posters they don't like. They think that this behavior is acceptable.

Ignore (in the forums) and /ignore (in-game) are tools to improve your gaming experience. Don't feel bad about using them.

Link to comment
Share on other sites

5 hours ago, UltraAlt said:

 

I remember when hacking was figuring out how to manipulate code without having a manual or formal training.

Hackers - all along - find flaws that can be manipulated and learning things that the "formally trained" didn't know, didn't understand, or thought couldn't be done.

 

Keep your mask on, heroes!

Well said! Sometimes hacking can be as simple as "they didn't change the default password from 1111". It's not always hackerman.

Link to comment
Share on other sites

7 hours ago, McSpazz said:

Well said! Sometimes hacking can be as simple as "they didn't change the default password from 1111". It's not always hackerman.

 

... if you program something that looks like a login screen and leave it  up on a computer ... have it mail the username and password to you, put up a message that the username or password is incorrect, and then have it set to actually log out of the computer so the real login screen comes up ...

  • Thumbs Up 2

If someone posts a reply quoting me and I don't reply, they may be on ignore.

(It seems I'm involved with so much at this point that I may not be able to easily retrieve access to all the notifications)

Some players know that I have them on ignore and are likely to make posts knowing that is the case.

But the fact that I have them on ignore won't stop some of them from bullying and harassing people, because some of them love to do it. There is a group that have banded together to target forum posters they don't like. They think that this behavior is acceptable.

Ignore (in the forums) and /ignore (in-game) are tools to improve your gaming experience. Don't feel bad about using them.

Link to comment
Share on other sites

On 1/26/2024 at 8:33 PM, McSpazz said:

Well said! Sometimes hacking can be as simple as "they didn't change the default password from 1111". It's not always hackerman.


I'd say "oftentimes."   It can also be used in RP to tie in a physical aspect to a "hack."  Getting other players to "get inside, find these three devices, and .. [something simple, like-hold down the button for 15 seconds while it's plugged in, so it resets to factory defaults] can be a strangely viable way to gain a toehold into a system in today's smart-device era.


I'll also share an investigation that's old enough the NDA no longer applies: 

Incident: A Major US school district- tens of thousands of students.  records leaked, website defaced, mail archives dumped, more.
Root Cause:
When new software was installed, the software was to "inherit" all the login rules of the central system, including its restrictions on what the password may be if they were set correctly.  The head of IT tested that by making an account "admin" and password of.. you guessed it, "password."  When it went through, he knew things weren't  working right and made corrections, but he NEVER deleted that account... which had been granted full admin rights (to EVERYTHING).

The most incredible part- that account sat dormant- never a login- for FOUR YEARS.   Students logged in to a form at least 4x a day that, if they'd have tried those credentials, would have let them in.   It was even accessible OFFSITE, so anyone could have discovered it from home too, but it took FOUR YEARS from the time of creation to the first actual login attempt.  FOUR YEARS.   This launched a whole side-investigation just to be sure that account ACCESS was logging correctly and couldn't be overwritten to hide tracks.

FOUR YEARS!  Tens of thousands of users... multiple times a day...
... What's wrong with kids noowadays?  

(to be fair, this was over a decade ago, so... maybe kids nowadays are better 😄 )



 

  • Haha 2
Link to comment
Share on other sites

  • 1 month later

I made a script to do "/copychat [tab]" every 0.1 seconds, then parse the text inside the clipboard. Using that parsed text, my toons would react whenever someone hit them with sleep, fear, knockback, etc. They would also react when their health falls too low.

 

I wanted my toons to become more talkative and let me do "a one-man RP". Let's say, I would become their mission control. 

 

I wrote a dozen monologues to be randomly blurted when certain events happen. One problem is they become repetitive fast. Each level has dozens of mobs, so either I have to write a hundred monologues or make my toons less likely to yell something when an event happens (p<=10%). 

 

Also, I suppose a Praetorian surviving the horror of war would react differently to a fresh graduate of Steel Canyon University when both of them get hurt. That means another set of monologues for each toon and each event. So, I quickly abandoned the idea.

 

Anyway, since the thread is about programming, is there any way to read the memory while playing CoH? Not writing, just reading. For example, it would be great to know the location of all critters on a map. No more playing hide and seek in the Orangebagel or those mine caves. I am an amateur coder (emphasis on amateur), but I know a bit of C/C++, Python, and BASIC.

 

edit

 

Oh, you were talking about our character's ability to program, not real-life examples. Whoops, sorry.

 

edit again because I've already commented, I guess I should write these:


I think writing a program is dull. Admiring paintings or statues is one thing. Watching the artist paint or sculpt the art from beginning to completion is another thing. So, the RP may need some artistic liberties.


People can make it relatively fast and easy. A superhero (robot?) can write and compile on the fly. Re-compiling and restarting the OS (during a hostile base takeover) happens fast enough that it can still fight off the intruders. Even better, they may be able to upload the program into foreign hardware and force it to run the program (similar to the Independence Day movie).


IMO, the hardest part is figuring out the audience. How many artistic liberties before the act of programming turns into magic and ruins the RP?

Edited by huang3721
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...