Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to Make an RPG (howtomakeanrpg.com)
331 points by catwell on June 24, 2016 | hide | past | favorite | 96 comments


This looks really cool, I just wish there were a sample chapter... I'd want to look at some sample code to see what kind of stuff I'd be getting into before I made such a time commitment.


Yeah, this would benefit from a sample chapter.


Agreed. The contents look very helpful but a sample would give more confidence about the quality of writing and information provided.


> Over $2500 worth of pixel art (free to use however you like)

I think this sounds kinda fishy. Why isn't it sold for 2500 USD if it's supposed to be worth so much? I guess there are way too many scam sites trying to sell me something at a great discount that I can't help but feel this way.

I'd change this line to something like "over 1000 pixel art graphics free to use however you like".


Because If someone contracted them to make these assets they would have charged that person $2500. But here they sell it to you much cheaper in hopes That enough people will buy the book thus making more that the 2500 they could have made.


It's only worth that much to create, not to use.


If you just want to make a RPG and don't care about the programming part, you could just use RPG Maker instead...


Shameless plug: or http://rpgplayground.com :)! Remark that this is far from finished, but people are already making some fun stuff with it.

Any feedback is welcome.


Honestly the screenshots and assets all look like they're ripped from RPGMaker..


There's only so much you can do with 16-bit-ish styled RPG graphics.


You just say that because you never played a single Super NES RPG.


I "learned" to code with RPG Maker when I was 12. So much nostalgy in here right now.


Risky Click.

I figured I was either about to learn something about gaming, or I was about to end up on a terrorism watch list...


There should be nothing wrong with learning how to make a rocket propelled grenade. Knowledge is knowledge, it's only bad when used nefariously.


Well, I know how to make a grenade, and I know how to make a rocket. I guess it's not that bad to know how to combine those things.


You're definitely on the list now.


Chances are you learned something about gaming AND ended up on a terrorism watch list.


I wonder how it compares with Handmade Hero https://handmadehero.org/


I've really enjoyed watching the handmade hero videos - but it's not for everyone. Since you see every keystroke, and as the engine progresses every refactoring, you really need to enjoy the "craft of coding". You're not getting a tutorial!


handmade hero is like learning the process of cooking (what ingredients are good for what sort of flavour etc), vs a tutorial, which is simply a list of steps which you follow, and will get some decent result.

By learning from a tutorial over time, you'll attain some level of mastery (i mean, after seeing how every recipe tells you similar things, you have to learn it). But i think learning from a master like an apprentice is the much easier, and sure fire way to attain mastery.


Well, just watch the sheer amount of videos of handmadehero and I don't think he's finished. I'd consider the book if I were you. It's ridiculous https://www.youtube.com/user/handmadeheroarchive/videos


Certainly following all those videos is an inefficient way to learn. As smoyer said, it's more about the craft of coding, so maybe I made an apples/oranges comparison.

Does anyone know about the depth and structure of the code in "How to Make an RPG"? From the post, it looks like it is focusing specifically on gameplay issues. Handmade Hero is covering quite a range of topics from basic gamepad input and audio output (done early in the series) on up. It is structured so that it's relatively easy to port to non-Windows OS's, and I like the live-coding feature which really shortens the code-compile-test cycle.

I guess it would be nice to see the table of contents and maybe a sample chapter or excerpts.


There is a table of contents at the bottom of this page: https://howtomakeanrpg.com/

I bought the book. Haven't read it yet but the PDF is 978 pages and the downloads of source/assets was approx. 2GB.

Roughly glancing through the book, there seems to be code examples on most pages. Looks like he's using LUA.


Yea... Handmade Hero is a very awesome idea, but I can't imagine the amount of dedication it would take for someone to sit down one day and decide to watch all 300+ videos. It's like an order of magnitude more content than a college course already and it's clearly far from finished.


>I don't think he's finished.

Not even close. I think he spent the last three or four episodes working out how to efficiently sort sprites or something.


I enjoyed watching a few of his videos but because they are all live streams they are obviously not edited so sometimes there are mistakes or sections where not much happens.

My biggest complaint is that he spends a lot of time setting up his dev environment that I found to be super confusing for a newcomer. I am an experienced dev and couldn't understand why he spent so much time mucking around with writing batch files and setting up emacs instead of just encouraging new users to just use Visual Studio where you can click compile and run and the setup takes 5 minutes instead of 2 screencasts.


Because he is doing it like an experienced dev who prefers to use the right tools for the job, not a quick "click to compile" IDE.


I love that you wrote your own engine (and your rationale for doing so) and that you used Lua!

This looks like a very fun resource and something I'll be pointing aspiring RPG makers to all the time (perhaps in leiu of my standard "you have no idea what you're getting into, drop the idea and start something much much smaller" spiel).


There are a couple of articles I really enjoy on the blog section of the site.

http://howtomakeanrpg.com/a/sine-of-the-times.html

http://howtomakeanrpg.com/a/the-power-of-one.html


How different is the C++ engine to love2d? Does it just do enough to let you draw in the screen with lua or does it implement anything more specific for an RPG?


I doubt that his engine has a third of Love2D's capability. gamepad, audio, etc.


I don't know anything about this engine, but I've tinkered with stuff myself and gamepads, audio etc are all pretty easy to implement. Eg SDL2 has a very easy to use gamepad interface that's similar to XInput (pretends your gamepad is an Xbox controller). I've used SDL_mixer and FMOD in the past for audio and both are really really simple to get going.

My point is that, yes Love2D has been in development for longer and does likely have more capability, but that doesn't mean that this is lagging behind thaaaaat much, certainly not in the areas you mentioned. It might do, but not necessarily. Also, I assume this has more RPG-specific functionality baked in that you'd have to do by yourself in Love2D.


tl;dr This is a book about how to make a 2D JRPG in Lua (with a C++ engine). The source code of the engine and the art assets ship with the book.


What's the licensing on those?

The project site itself mentions the underlying graphics engine is an Open Source one, but doesn't seem to have info on the licensing for the art/sound assets.


There is a bullet point for the pixel art:

* Over $2500 worth of pixel art (free to use however you like)

But I don't see any concrete licensing statements for the art assets besides that.


I was an early supporter (bought the book in pre-release), but the lack of explicit licensing info on the engine and assets has cooled my interest. Hope this gets addressed.



The site says that there's over $2500 in assets that come bundled with a permissive license


It says on the page that the assets are custom for the project and have a liberal license, but it doesn't say what the license is in the spot I was reading--I assume MIT.


Hmmmm, assuming anything about licensing kind of makes me nervous. :)

Just emailed the author, to ask directly. Will post the response back here (when received) for reference.


Yep MIT. Email response from the author:

> Hi Justin,

>

> I want people to be able to use the art however they deem best so the MIT license is the one I've chosen. Though I don't think I've written this anywhere - which I should address!

>

> -Dan


Why not just clone Pixel Dungeon repo?


It would be cool if there were resources for just doing the systems and encounter design. Most of graphics and engine programming seems easy enough (just time consuming) and there are plenty of existing engines.

Always wonder how RPGs or or games like civ get balanced and designed. I assume some of it is iterative but that requires at least starting out with something reasonable right? Might pick this book up if it touches on that :)


Interesting, I've always wanted to make a game but never found the time, now I'm torn between learning Lua or just sticking to the web and try to do something there instead.

Nitpick, there's a little typo: "Hello World exmaple for Mac"


I highly recommend giving Lua a try, it's a simple yet powerful little language(metatables, coroutines!) that embeds incredibly easily and has great performance.

Way back on the PSP we use to run our whole game logic with Lua in a 400kb pre-allocated block. You only had 8mb of system ram since 24mb went to texture/audio and it really worked great. Coroutines are also a perfect fit for try-wait-try logic you get in a lot of AI routines.


What are some good current RPG's, in the style of the original Zelda, for PC or mobile today? All I can find is free-to-play.


Solarus (http://www.solarus-games.org/) is both a very polished fan sequel to A Link to the Past, and also an engine for building your own action-RPG games in Lua.


Wow, this looks great. How are they able to use "The Legend of Zelda" title in their released games?

edit: Getting "Bandwidth or Storage Limit Exceeded" when attempting to download from the Solarus packagecloud.io. Sadface.


It's back. I also wonder how they are able to do that. The graphics, sounds and music is all from the SNES Zelda title. How can this survive if you aren't even allowed by Nintendo to upload movies to YouTube?


The website owner and lead of the project is not based in the US. If he's received any notice from Nintendo, he's probably just ignored it with no consequence.


Youtube is different because there's a monetization angle with the ads. The artwork in Solarus is certainly not legal to distribute in most countries, but it's so low-profile that no one has bothered to go after them.


Hyper Light Drifter

http://www.heart-machine.com/

Some of the most beautiful 2D graphics I've ever seen in a setting absolutely soaked with atmosphere and detail, really nice responsive controls, and hard, rewarding gameplay.


Not sure if this is what you're looking for exactly, but Trails in the Sky is pretty good. It's on GOG for PC. It has one of the most detailed worlds I've ever seen in an RPG -- almost every NPC has a name and updates dialogue after every event.

Can personally confirm that it works pretty well with WINE on Linux (even got my xbox360 controller to work using xboxdrv in xpad mode, shockingly) -- just the intro movies won't play, but other than that it works great.


Yes, Trails is very good (and Second Chapter is even better) but it is nothing like any Zelda game I have ever played. More like a Final Fantasy game with turn-based, tactical battles which are separated from the overworld.

(On your specific video problem: Trails uses DirectShow to play the videos so make sure your Wine setup can play them)

To the GP: Recettear has combat like the older Zelda games (with a simplistic shop management sim tacked on. I think the Ys series also has combat somewhat like Zelda. Perhaps Diablo clones might interest you. Which bit of Zelda are you looking for?


try http://www.heart-machine.com/ - i heard good things about it (not played it yet, but the trailer/screenshots looks good!).


I think it's the best game of 2016 so far.


I've backed Moonlighter[1] and Cosmic Star Heroine[2] on Kickstarter. They might be worth a look, although neither are out yet...

[1] http://moonlighterthegame.com/ [2] https://www.youtube.com/watch?v=ytQNG5t8wCs


Oceanhorn is very Zelda-like, originally made for iOS but later ported to many other platforms. It got great reviews and is not free-to-play.


Crashlands is much like Zelda in that it focuses on fun, adventure, and action over things like stats and skills and party building. Available on Steam and also iOS/Android. I also found this game extemely funny and addictive (though it has a definitive end, so you don't end up stuck playing forever).


If you have ~$150, buy a PS Vita. Through the PlayStation store you can purchase dozens of JRPGs like Persona 1 through 4, Final Fantasy I through X, Chrono Trigger/Cross, Legend of Mana, Vagrant Story, Breath of Fire IV, Legend of Heroes series, Harvest Moon series, etc


Anodyne (http://www.anodynegame.com/) is a great indie game heavily inspired by the early Zeldas.


Salt and Sanctuary is basically Zelda II + Dark Souls (and a great game!)


About the dinodeck_mac hello world: You have to fix your linker settings.

> dyld: Library not loaded: @rpath/libopenal.1.dylib

> Referenced from: /Users/kyb/Downloads/hello_world_mac/./dinodeck_mac

> Reason: image not found


I'm wondering if that was part of the test. To make sure people who start could get this working.

Tip: Copy the dylib to /usr/local/lib/libopenal.1.dylib


Bought it, went through 1/2 of it in a day, think it is really good. Informative watching the author's design choices and refactoring of the code base as he added new features and builds up the game from "hello world" to pretty full featured. I am a professional programmer and in my opinion this would be tough to understand for someone who wasn't already an experienced programmer, but I've never used Lua or coded games before.


This person is waaaayyyyy undercharging. Should be $100 or maybe even more.


Agreed. It is worth a couple hundred bucks IMO. I bought it and it is very good.


Anyone can suggest similar books/tutorials with Javascript?


Phaser.io has a bunch of javascript resources and books.


While I really enjoyed Phaser, which in turn made me love TypeScript.

I had some serious issues with performance and trying to maintain 60 frames per second in any 16:9 resolution.

I've been looking into C++ and Java solutions and this book might be the perfect fit.


I had the same issues myself until I ended up dropping Phaser and using Pixijs (the rendering code used by Phaser) on its own and then writing a bit of code to only render the game in chunks. It seems like by default Pixijs (and this may have changed since I wrote my code) renders the whole scene no matter how large it is. Since I'm working on dwarf fortress type game, the game world has a lot going on and it crushed my game's performance and brought it to a halt. Since writing that chunking code I haven't had any performance problems that weren't my own doing.

tl;dr I would recommend checking out Pixijs on its own if you still want to use TypeScript (I recently converted my code from es6 to TypeScript a month or two ago and am in love love love).


I recommend looking at Love2d. It's fantastic.


is there anything inherent in the Lua Language that makes it a good match for an in-game-engine programming language?


I would say several things:

- Its small size (the PUC Lua codebase is about 15000 lines of C and compiles to about 250 kB). PUC Lua is the reference implementation of Lua, as opposed to e.g. LuaJIT.

- Its portability: PUC Lua is written in Clean C, the intersection of ANSI C and C++ 98. That makes it trivially portable to any architecture that matters in games.

- Its performance. PUC Lua is already faster than most popular scripting languages and uses less memory. If you need extra performance you can switch to LuaJIT and come close to C on a lot of codebases.

- The syntax is designed for data description, which makes it a very good language to implement DSLs for lots of things. Also the parser is very efficient so you can store data in Lua files.

- Coroutines. They let you propose an API to users (scripters) that appears synchronous but actually runs in an asynchronous fashion.

- The language is made to be embedded. Its C API is a central point of the design. The interpreter is reentrant so you can run several instances in threads without any problem.

All of this made Lua very popular in the game industry, along with its use in pretty famous games (initially Grim Fandango, then lots of others including World of Warcraft).


Lua is a very simple yet very powerful language. I like to say it is the best of JavaScript without the warts of JavaScript.

Lua is one of the best performing interpreted languages around. If you use LuaJIT, it competes well with the best JS jits. It also has a small memory footprint and reasonably controllable GC pauses.

Lua is very easy to integrate into C/C++ projects. It is easy to write a debugger for Lua. Like everything else in Lua, debugging capabilities are libraries that can just as easily be invoked in Lua itself or in C.

IMHO, very overlooked is that Lua is a batteries-optional language. It comes with a small standard library that keeps it's footprint and capabilities reasonable. If you want more, there are lots of open source libraries you can add. But, more importantly, almost all of the standard libs can be stripped out and Lua will still function just fine. Don't want your scripts to do file IO? Don't load the IO library.


Not so much in the language itself (I'm not a fan), but the process of embedding Lua and pushing data into a Lua context and pulling data out of a Lua context is so simple the first time I got it working I thought, "Surely I'm missing something, it can't be this easy." The ease of integration with C or C++ makes it worth strongly considering when you need an embedded scripting language. But, as I alluded to, Lua as a language is pretty awful. Lua's tables are an abomination in my eyes.

A few years ago I started a simple RPG game engine that uses Lua[0] as its scripting language. I never got very far with it but considering I had zero clue how to even begin approaching the problem when I started I'm pretty happy with how far I got before I lost interest.

[0]: https://github.com/seaneshbaugh/SDL03


What do you think is so bad about Lua tables? They have some unintuitive aspects (such as not being able to store `nil`) but in the end being able to use tables for everything considerably simplifies the language. I'd hardly consider that an abomination.


Personally, I think Lua's widespread use in game programming stems from it's performant design, paradigm flexibility, and the fact that it's not hard to embed into an existing project. There are other languages that have this mindset too, but I think Lua's been able to capture enough mindshare to be quite sticky in the industry.

I've met quite a few game programmers that don't like parts of Lua, and wish there was something that was closer to C++ rather than JavaScript.


Have you seen Squirrel? [0] It does have a lot in common with Lua, but does have a bit more of a C++ feel to it.

[0] http://www.squirrel-lang.org/


In addition to the other points, it's a very vanilla and unopinionated language. You can use it to match the style of your engine without much friction.


This is interesting for 2d rpgs, Does anyone know of something similar for a 3d/VR compatible version ?


I want to buy this book because it seems perfect for a Love2d project I've been working on.

BTW clicking the "Buy Now" button is sort of jarring in that you first see some text that starts with "Warning" which gets replaced by a credit card dialog after a second or so.


My first memory as a kid playing a "Japanese" style RPG was Final Fantasy. Is this what the author was referring to, or was there a game like this that preceded that?


I mean, Dragon Quest is basically 1 year older, but I bet they were both in development at the same time. I don't know of anything older than that with the top-down turn-based approach with overworlds, battle screens, inventory, etc.


Nothing Japanese, but there were western games before that had major influence on DQ and FF, most notably Ultima and Wizardry.


Ah, so many happy memories of playing Shining Force...


I have bought Shining Force on so many platforms. It seems like there is a great port out for every phone or gaming system you can think of.


Same. I have the complete collection now from 8bit to PS3. Such a great game. I hope to create a 2d engine in that style next (in javascript because I'm a crazy mofo)


dammit... came for RPG ( Rocket Propelled Grenade ) got RPG ( Role Playing Game )

left disappointed


wow I have not had my coffee yet. I was thinking you mean rocket propelled grenade


I havent seen much about games recently and click bait about contreversial issues often gets on the front page. You are definitely not alone


I was thinking tabletop RPGs, not video games.


> RPG

Yes, yes of course they mean game.


There are spelling mistakes on that page. That does not bode well for the book.


Then don't read it. In several years you've made only a couple negative, snarky comments on HN.

If a guy writes an entire book and you don't want to read it because he made a spelling mistake, then don't.


I disagree. The presence of several typos on the main page is a big red flag for a technical book.

Having said that, I'm still interested, but the lack of proofreading on the author's release announcement for his book is definitely counterproductive.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: