Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
[flagged] Explore the Dragon Realm: Build a C++ adventure game with a little help from AI (about.gitlab.com)
30 points by mikece on Aug 25, 2023 | hide | past | favorite | 19 comments


I guess the image above the article is also AI-generated - at first glance it looks like a compass lying in a grassy field, but if you take a closer look, it becomes deeply unsettling: you realize that's not grass, it looks more like coarse, monstrous hair, and it's not a compass either, it's the misshapen child of a pocket watch that had sex with a compass, useless because of a complete lack of hands or a compass needle, begging you to put it out of its misery, and the lid, if you tried to close it, wouldn't even fit over the lower part, this is wrong in so many many ways, aaaaargh...


Looks like a regular compass to me.




Hmmm, looks like somebody has been reading along... now the only fault I can find with the new https://about.gitlab.com/images/blogimages/compassinfield.jp... is that it's not actually in a field anymore :)


Hiiiiii :) GitLab team member and the author of the blog post here.

After reading your comment, we swapped out the photo so that no one else would have such an unsettling experience! I liked the compass photo, so I feel a bit silly that I didn't notice what you did! I'll remember your comment and zoom the next time we pick a stock photo, haha. Thank you!


This is sort of a funny piece - when I saw "C++ adventure game" I was expecting maybe an ASCII crawler or maybe a simple Box2D rogue-like.

The resulting game from the article is a very, very simple text adventure, with what looks like 3 different leaf nodes. A great way for someone to learn control flow and variable management, but it does beg the question, why C++? And further, why AI?

If someone approached and said "Joe - I want to learn more about programming, and eventually make my own game", I don't think I'd tell them to start with a C++ text adventure. Whatever spark they were feeling in the moment would be sufficiently stomped when they notice the first step in the tutorial is to create a Makefile. Keep in mind they also introduce the concept of variables and if statements. This tutorial's aimed at total beginners!

"Joe, what's a Makefile?" "Well..."


Hiiiiiiii,

GitLab team member and author of the blog post here. Both excited and terrified to be on HN, honestly - what a honor!

* Totally agree that the Makefile was a high bar of entry right at the beginning. Since we're working with a single source file, I just opened an MR to update the blog post to compile it directly in the terminal [1]. Do you think this approach would make it more beginner-friendly?

* My fondness for C++ might've steered the direction of the project a bit! I considered a 2D platformer at first, but felt that I/o centric approach would be easier for a beginner. I could always rebuild the text adventure into a 2D platformer - would make for an interesting follow-up post. I hadn't thought of an ASCII crawler at all, so thank you for that idea!

* Lately, everyone's been using AI assisted code as a helping hand, especially in simpler projects like this one where it's likely to provide helpful suggestions. The integration was an attempt to, of course, promote our Code Suggestions feature ;), and also showcase how AI can function something like copy pasting code from a tutorial by providing you with code you can use.

* As for the complexity, I was debating between writing this for beginners vs an intermediate audience and asked myself things like "Can I assume that this person who knows what conditionals like while or for loops are?". After some peer reviews, it became a very introductory C++ lesson. Striking the right balance can be tricky. I'm hoping to get into more complex code in future parts, but first I really need to introduce functions because the code needs it haha.

Thanks for your valuable feedback and things to think on, super appreciated! :)

[1]https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request...


> Whatever spark they were feeling in the moment would be sufficiently stomped when they notice the first step in the tutorial is to create a Makefile. Keep in mind they also introduce the concept of variables and if statements. This tutorial's aimed at total beginners!

Thanks for your great feedback. I suggested using a Makefile during blog post review [0], to avoid explaining gcc compiler flags, and have a single command with `make build` available for future, repeated compilation steps. I did not expect this to be an entry barrier, and will reconsider suggesting makefiles in the future. Thanks again.

[0] https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request...

(GitLab team member here)


> "Joe, what's a Makefile?" "Well..."

"It's this thing you might need for a different C++ project. For this project, one source file is enough"

IOW, for someone who wants to write a tiny program, and wants to do it in C++, a Makefile is pointless.


Yeah, I totally agree. I think for learners, whatever can tighten the feedback loop of code->build->error->fix is usually what will keep someone interested.


Since I got downvoted, I'll reply that this is a useless piece of article. I already flagged it and please do the same.


I think AI code assistants in-editor would be a really bad experience for beginners since discovering and dealing with hallucinations is going to be so much more painful. If someone is starting out, the best way to use AI to learn is probably still just through a web chat interface where you have continuity and can ask questions about any response that isn't working out. In-editor code completion is more useful if you already know exactly what you're looking for, but just want something else to type it out for you.


Apparently they write rather poor C++ in the Dragon Realm.


I thought this was about DALnet until the colon.


Examples like these do little to help the idea that AI is just a tool for beginners - especially in a language like C++, where the code it generates it clearly junior-level code.


AI is at least as helpful to me as StackOverflow, and significantly less hostile.

Neither provides a 100% working solution out of the box, but I'd rather argue with ChatGPT about a library it hallucinated than dal with the egomaniacs that exist solely to lock threads on StackOverflow.


or, you know, read the documentation? why is this so hard? you shouldn't need stack overflow unless you run into something the docs don't answer


Agreed. Not very useful IMHO.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: