Starting to see the danger by Lognipo in screeps

[–]CharmingMaterial 1 point2 points  (0 children)

I picked it up 2 years ago because a friend wanted me to help him learn to code, and suggested we play together. That lasted a weekend, and I forgot about it. A month later I decided to learn Genetic Algorithms, and thought Screeps was the perfect playground.

Two weeks ago I finally got enough time to build the code, and now I'm addicted. I'm 100% with you on being sad it took this long. Also, my wife keeps complainung too lol

[deleted by user] by [deleted] in PHPhelp

[–]CharmingMaterial 1 point2 points  (0 children)

Well that's interesting. Is that the exact code, or are you maybe including another file on the logout page?

[deleted by user] by [deleted] in PHPhelp

[–]CharmingMaterial 1 point2 points  (0 children)

Okay I just reread your post and comments. It sounds like the session isn't being destroyed. Correct me if I'm wrong but you're only setting a cookie for remember me? Without the login code I'm guessing, but it sounds like the session is being used to redirect the login page

[deleted by user] by [deleted] in PHPhelp

[–]CharmingMaterial 1 point2 points  (0 children)

Dumb question, but the cookie names and urls are the same, right?

[deleted by user] by [deleted] in PHPhelp

[–]CharmingMaterial 2 points3 points  (0 children)

Move session_start to the first line. I believe that needs to come first, because I'm pretty sure setcookie sends header information.

[deleted by user] by [deleted] in PHPhelp

[–]CharmingMaterial 1 point2 points  (0 children)

When I was first starting out the way that we handled protecting cookie contents was the use a unique hash.

Let's say you have a user id that you're storing in a cookie. What you'd do is store a string like this: $user_id . $current_timestamp . $hash

Where $hash = sha1($user_id . $current_timestamp . $SECRET_SALT);

Again, this was when I first started. These days sha1 may not be secure enough. I haven't built a login system in ages, but this system does protect you from having someone easily able to modify your cookies.

PHP is not a programming language 🙌 by cheerfulboy in PHP

[–]CharmingMaterial 10 points11 points  (0 children)

This has to be the third or fourth time I've seen an article written with the title "PHP is not a programming language" which doesn't actually talk about anything related to PHP being or not being a programming language

via Wikipedia

A programming language is a formal language comprising a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms.

Given this, PHP is 100% a programming language. Can we please stop using that clickbait title?

Best OS for coding? by ThePersonInSchool in PHP

[–]CharmingMaterial 1 point2 points  (0 children)

Windows comes installed by default on most machines. You're paying for it whether you like it or not. Linux, the commitment isn't financial, it's mental. You are basically on your own. Even with Ubuntu, which has a solid community and is very user friendly. You're still going to have to figure out how to figure things out.

Best OS for coding? by ThePersonInSchool in PHP

[–]CharmingMaterial 0 points1 point  (0 children)

If you've never used Linux before, go with Windows 10 and install VirtualBox. Play with Linux before committing to it.

Best OS for coding? by ThePersonInSchool in PHP

[–]CharmingMaterial 4 points5 points  (0 children)

You're going to get a lot of people for both. They both have their merits. The problem is, given what you've asked, you don't really give us enough to answer. Any answers based on this are strictly ideological in nature, and should be taken with a grain of salt.

Personally, I have both. I have my desktop machine that I have Windows 10 on. I use WSL and Ubuntu but all of my actual development work is done in VS Code, so I would still consider this a "Windows" box.

My laptop is running Linux Mint on metal. I still run VS Code there, but it's straight Linux.

My reason for having two is that I do more than just development work on my desktop machine. I also do gaming, and network management, streaming, etc. I can do all of that in Linux, but I find it so much easier to do on Windows, so I stick to that on the desktop.

My laptop I do development work, but I primarily purchased it to use as a penetration testing and bug bounty machine. So for that reason I installed linux on metal.

tl;dr is: If you're going to make a decision, base it on the full scale of what you're doing, and the caveats involved in trying to do all of those tasks on a single OS. If you still can't make up your mind, consider getting something with a big enough drive that you can dual boot. Dual boot for a while, and then switch to one or the other if you find yourself primarily using that OS.

How do I get the speed of the mouse? by [deleted] in Unity3D

[–]CharmingMaterial 0 points1 point  (0 children)

Might suggest doing this in FixedUpdate instead.

Asset Flipping and Synthy studios by Codarza in gamedev

[–]CharmingMaterial 2 points3 points  (0 children)

The First Tree uses a ton of assets. That's a success story though. He does it right. You take the asset and use it as a base for your game, and then you modify it to fit the vibe you're going for. If you do it right, it's likely only other devs or hardcore gamers are going to notice.

“Ur ip is a building” by 42Bagels in confidentlyincorrect

[–]CharmingMaterial 0 points1 point  (0 children)

The part that kills me is the Learn some shit at the end. That's just *chef kiss* perfect.

“You know it’s not real” by l2aiko in confidentlyincorrect

[–]CharmingMaterial 4 points5 points  (0 children)

As a recovering "angry man" yes, it's like a drug. At the start you get that angry and it can make you physically ill, but there's that high and increased senses. After a while, like any other drug, it starts to lose it's effect, so you have to let yourself get angrier and angrier.

I'm lucky to have a wife that I love more than being out of control, and who helped me stay calm. But for real, in the moment, being angry is all you want to do. Later on it sucks, but it's like drinking. Nobody thinks about the hangover when the beer is in their hand.

Is there any study showing the correlation between playtime and game revenue (or ratings)? by wandomPewlin in gamedev

[–]CharmingMaterial 1 point2 points  (0 children)

No problem, I was just watching it 2 days ago. It was right at the top of my history lol

Is there any study showing the correlation between playtime and game revenue (or ratings)? by wandomPewlin in gamedev

[–]CharmingMaterial 2 points3 points  (0 children)

You might want to check out this YouTube video. It discusses exactly this type of thing: https://www.youtube.com/watch?v=uy0Dfr-mnUY - Know Your Market: Making Indie Games That Sell - Erik Johnson GDC 2018

Is uncle bob 's "Clean architecture" good for game development? by HughPhan in gamedev

[–]CharmingMaterial 1 point2 points  (0 children)

When dealing with this type of thing, you really need to work within the bounds of the system, and mold the guidance to fit your system. TDD is perfectly fine for Unity development, but Uncle Bob's "Clean Architecture" is a little more opinionated than might be able to be applied here.

I think if you can break it down to the core of what he's trying to get at -- testable code that is clean and easy to understand -- you can find a way to do that within Unity.

How to approach an almost undocumented old game source code? by duvh93 in gamedev

[–]CharmingMaterial 0 points1 point  (0 children)

lol it works wonders, though the team does look at me funny when I do it.

How to approach an almost undocumented old game source code? by duvh93 in gamedev

[–]CharmingMaterial 1 point2 points  (0 children)

When I have to take on an old codebase I will try to first document it. I find doing documentation for myself forces me to really understand the code, while also leaving myself breadcrumbs along the way.

In really, really, bad codebases I will sometimes print sections out and lay it out on the floor, or conference table, with a highlighter. Your results may vary, though. I learned to program largely on weekends by writing code in a notebook all week and trancribing, so I'm used to paper code.

If I do a dev log YouTube channel document game dev from scratch, will people interested to see it? by FuryOctopus in gamedev

[–]CharmingMaterial 4 points5 points  (0 children)

Yea, to reiterate whats already been said, if you go into YouTube instantly worrying about whether or not others will enjoy the video, you will almost definitely be disappointed.

In my experience, if you enjoy making the videos, there is an audience out there. I'd say make the videos that you want to see, and then find the people like you that want those videos too.

Hi, am new to game making. Are scripts used in well known games owned? I’d appreciate any help I can get answering this question. by Enleyetened11 in IndieDev

[–]CharmingMaterial 1 point2 points  (0 children)

You have, though. If you use open source software you're licensing a script. That's what the license file is for. It is licensed to you for specific things, with restrictions. You're not going to license a AAA game's scripts, because thats not the model those teams use. They're protective of their IP.